Skip to content

Commit

Permalink
SNOW-1663771 Enable Doc Generation (#165)
Browse files Browse the repository at this point in the history
* generate scala doc

* update java doc

* update java doc

* add test
  • Loading branch information
sfc-gh-bli authored Sep 26, 2024
1 parent 26c0f03 commit 030b86a
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/precommit-java-doc-validation.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
115 changes: 115 additions & 0 deletions java_doc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.snowflake</groupId>
<artifactId>snowpark-java</artifactId>
<version>1.15.0-SNAPSHOT</version>
<name>${project.artifactId}</name>
<description>Snowflake's DataFrame API</description>
<url>https://www.snowflake.com/</url>
<inceptionYear>2018</inceptionYear>
<licenses>
<license>
<name>Snowflake License</name>
<url>https://www.snowflake.com/legal/</url>
</license>
</licenses>

<developers>
<developer>
<name>Snowflake Support Team</name>
<email>[email protected]</email>
<organization>Snowflake Computing</organization>
<organizationUrl>https://www.snowflake.com</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:git://github.com/snowflakedb/snowpark</connection>
<url>http://github.com/snowflakedb/snowpark/tree/master</url>
</scm>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding>
<doctitle>Snowpark API ${project.version}</doctitle>
</properties>

<repositories>
<repository>
<id>osgeo</id>
<name>OSGeo Release Repository</name>
<url>https://repo.osgeo.org/repository/release/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.snowflake</groupId>
<artifactId>snowpark_2.12</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<additionalOptions>--allow-script-in-comments</additionalOptions>
<bottom>&#169; {currentYear} Snowflake Inc. All Rights Reserved
<![CDATA[
<!-- Google Analytics Code -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-48785629-1', 'auto');
ga('send', 'pageview');
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-00K70YK8HQ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-00K70YK8HQ');
</script>
<script>
if (typeof useModuleDirectories !== 'undefined') {
useModuleDirectories = false;
}
</script>
]]>
</bottom>
<doctitle>Snowpark Java API Reference ${project.version}</doctitle>
<header>
<![CDATA[
<div style="margin-top: 14px"><strong>
Snowpark Java API Reference ${project.version} <br/>
<a style="text-transform: none" href="https://docs.snowflake.com/en/developer-guide/snowpark/java/index.html" target="_top">[Snowpark Developer Guide for Java]</a>
</strong></div>
]]>
</header>
<excludePackageNames>com.snowflake.*.internal</excludePackageNames>
<windowtitle>Snowpark Java API Reference ${project.version}</windowtitle>
</configuration>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion scripts/generateJavaDoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 030b86a

Please sign in to comment.