From 030b86a14ec88eab556dd7c0d88e86e02f3014d1 Mon Sep 17 00:00:00 2001 From: Bing Li <63471091+sfc-gh-bli@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:16:29 -0700 Subject: [PATCH] SNOW-1663771 Enable Doc Generation (#165) * generate scala doc * update java doc * update java doc * add test --- .../precommit-java-doc-validation.yml | 23 ++++ build.sbt | 2 + java_doc.xml | 115 ++++++++++++++++++ scripts/generateJavaDoc.sh | 2 +- 4 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/precommit-java-doc-validation.yml create mode 100644 java_doc.xml diff --git a/.github/workflows/precommit-java-doc-validation.yml b/.github/workflows/precommit-java-doc-validation.yml new file mode 100644 index 00000000..05709a7e --- /dev/null +++ b/.github/workflows/precommit-java-doc-validation.yml @@ -0,0 +1,23 @@ +name: precommit test - Java Doc Validation +on: + push: + branches: [ main ] + pull_request: + branches: '**' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Install Java + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Decrypt profile.properties + run: .github/scripts/decrypt_profile.sh + env: + PROFILE_PASSWORD: ${{ secrets.PROFILE_PASSWORD }} + - name: Run test + run: scripts/generateJavaDoc.sh \ No newline at end of file diff --git a/build.sbt b/build.sbt index f3b74d79..5054ceab 100644 --- a/build.sbt +++ b/build.sbt @@ -86,6 +86,8 @@ lazy val root = (project in file(".")) // Build Info buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion), buildInfoPackage := "com.snowflake.snowpark.internal", + // doc settings + Compile / doc / scalacOptions ++= Seq("-skip-packages", "com.snowflake.snowpark_java::com.snowflake.snowpark.internal"), // Release settings // usePgpKeyHex(Properties.envOrElse("GPG_SIGNATURE", "12345")), Global / pgpPassphrase := Properties.envOrNone("GPG_KEY_PASSPHRASE").map(_.toCharArray), diff --git a/java_doc.xml b/java_doc.xml new file mode 100644 index 00000000..b77ab195 --- /dev/null +++ b/java_doc.xml @@ -0,0 +1,115 @@ + + 4.0.0 + com.snowflake + snowpark-java + 1.15.0-SNAPSHOT + ${project.artifactId} + Snowflake's DataFrame API + https://www.snowflake.com/ + 2018 + + + Snowflake License + https://www.snowflake.com/legal/ + + + + + + Snowflake Support Team + snowflake-java@snowflake.net + Snowflake Computing + https://www.snowflake.com + + + + + scm:git:git://github.com/snowflakedb/snowpark + http://github.com/snowflakedb/snowpark/tree/master + + + + 1.8 + 1.8 + UTF-8 + Snowpark API ${project.version} + + + + + osgeo + OSGeo Release Repository + https://repo.osgeo.org/repository/release/ + false + true + + + + + com.snowflake + snowpark_2.12 + ${project.version} + + + + src/main/java + + + src/main/resources + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.1 + + --allow-script-in-comments + © {currentYear} Snowflake Inc. All Rights Reserved + + + + + + + + + ]]> + + Snowpark Java API Reference ${project.version} +
+ + Snowpark Java API Reference ${project.version}
+ [Snowpark Developer Guide for Java] +
+ ]]> +
+ com.snowflake.*.internal + Snowpark Java API Reference ${project.version} +
+
+
+
+
\ No newline at end of file diff --git a/scripts/generateJavaDoc.sh b/scripts/generateJavaDoc.sh index 533fd5c5..c43d47f2 100755 --- a/scripts/generateJavaDoc.sh +++ b/scripts/generateJavaDoc.sh @@ -9,7 +9,7 @@ export JAVA_DIR="javaDoc" # release scala code to local .m2 repo -mvn -Dgpg.skip -DskipTests clean install +sbt publishM2 # clean sub dir rm -rf $JAVA_DIR