You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/11/09 02:01:53 UTC

[tinkerpop] branch TINKERPOP-2010 created (now b469d89)

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a change to branch TINKERPOP-2010
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.


      at b469d89  TINKERPOP-2010 Generate JSDoc for gremlin-javascript

This branch includes the following new commits:

     new b469d89  TINKERPOP-2010 Generate JSDoc for gremlin-javascript

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[tinkerpop] 01/01: TINKERPOP-2010 Generate JSDoc for gremlin-javascript

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch TINKERPOP-2010
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit b469d895c709b3ce8ade3c22410c843550423bbe
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Thu Nov 8 21:00:01 2018 -0500

    TINKERPOP-2010 Generate JSDoc for gremlin-javascript
    
    Updated publish-docs.sh to push jsdoc to jsdocs/x.y.z/ on the website.
---
 bin/publish-docs.sh                                | 15 +++++++++
 .../dev/developer/development-environment.asciidoc |  4 ++-
 docs/src/index.asciidoc                            |  3 +-
 gremlin-javascript/glv/PackageJson.template        |  4 ++-
 gremlin-javascript/pom.xml                         | 13 +++++++-
 .../main/javascript/gremlin-javascript/.gitignore  |  3 +-
 .../javascript/gremlin-javascript/Gruntfile.js     | 36 ++++++++++++++++++++++
 .../javascript/gremlin-javascript/package.json     |  4 ++-
 pom.xml                                            |  1 +
 9 files changed, 77 insertions(+), 6 deletions(-)

diff --git a/bin/publish-docs.sh b/bin/publish-docs.sh
index aec223e..788add8 100755
--- a/bin/publish-docs.sh
+++ b/bin/publish-docs.sh
@@ -36,6 +36,8 @@ VERSION=$(cat pom.xml | grep -A1 '<artifactId>tinkerpop</artifactId>' | grep '<v
 rm -rf target/svn
 
 bin/process-docs.sh || exit 1
+
+# generates javadoc and jsdoc
 mvn process-resources -Djavadoc
 
 mkdir -p target/svn
@@ -45,13 +47,16 @@ pushd target/svn
 
 ${SVN_CMD} update "docs/${VERSION}"
 ${SVN_CMD} update "javadocs/${VERSION}"
+${SVN_CMD} update "jsdocs/${VERSION}"
 
 mkdir -p "docs/${VERSION}"
 mkdir -p "javadocs/${VERSION}/core"
 mkdir -p "javadocs/${VERSION}/full"
+mkdir -p "jsdocs/${VERSION}"
 
 diff -rq -I '^Last updated' docs/${VERSION}/ ../docs/htmlsingle/ | awk -f ../../bin/publish-docs.awk | sed 's/^\(.\) \//\1 /g' > ../publish-docs.docs
 diff -rq -I 'Generated by javadoc' -I '^<meta name="date"' javadocs/${VERSION}/ ../site/apidocs/ | awk -f ../../bin/publish-docs.awk | sed 's/^\(.\) \//\1 /g' > ../publish-docs.javadocs
+diff -rq -I 'Generated by jsdoc' -I '^<meta name="date"' jsdocs/${VERSION}/ ../../gremlin-javascript/src/main/javascript/gremlin-javascript/doc/ | awk -f ../../bin/publish-docs.awk | sed 's/^\(.\) \//\1 /g' > ../publish-docs.jsdocs
 
 # copy new / modified files
 for file in $(cat ../publish-docs.docs | awk '/^[AU]/ {print $2}' | grep -v '.graffle$')
@@ -70,13 +75,23 @@ do
     mkdir -p "javadocs/${VERSION}/`dirname ${file}`" && cp "../site/apidocs/${file}" "$_"
   fi
 done
+for file in $(cat ../publish-docs.jsdocs | awk '/^[AU]/ {print $2}')
+do
+  if [ -d "../../gremlin-javascript/src/main/javascript/gremlin-javascript/doc/${file}" ]; then
+    mkdir -p "javadocs/${VERSION}/${file}" && cp -r "../../gremlin-javascript/src/main/javascript/gremlin-javascript/doc/${file}"/* "$_"
+  else
+    mkdir -p "javadocs/${VERSION}/`dirname ${file}`" && cp "../../gremlin-javascript/src/main/javascript/gremlin-javascript/doc/${file}" "$_"
+  fi
+done
 
 pushd "docs/${VERSION}/"; cat ../../../publish-docs.docs | awk '/^A/ {print $2}' | grep -v '.graffle$' | xargs --no-run-if-empty svn add --parents; popd
 pushd "javadocs/${VERSION}/"; cat ../../../publish-docs.javadocs | awk '/^A/ {print $2}' | xargs --no-run-if-empty svn add --parents; popd
+pushd "jsdocs/${VERSION}/"; cat ../../../publish-docs.jsdocs | awk '/^A/ {print $2}' | xargs --no-run-if-empty svn add --parents; popd
 
 # delete old files
 pushd "docs/${VERSION}/"; cat ../../../publish-docs.docs | awk '/^D/ {print $2}' | xargs --no-run-if-empty svn delete; popd
 pushd "javadocs/${VERSION}/"; cat ../../../publish-docs.javadocs | awk '/^D/ {print $2}' | xargs --no-run-if-empty svn delete; popd
+pushd "jsdocs/${VERSION}/"; cat ../../../publish-docs.jsdocs | awk '/^D/ {print $2}' | xargs --no-run-if-empty svn delete; popd
 
 CHANGES=$(cat ../publish-docs.*docs | grep -v '.graffle$' | wc -l)
 
diff --git a/docs/src/dev/developer/development-environment.asciidoc b/docs/src/dev/developer/development-environment.asciidoc
index 288f2a6..7b29adc 100644
--- a/docs/src/dev/developer/development-environment.asciidoc
+++ b/docs/src/dev/developer/development-environment.asciidoc
@@ -237,7 +237,9 @@ mvn -Dmaven.javadoc.skip=true --projects tinkergraph-gremlin test
 ** Build AsciiDocs (but don't evaluate code blocks in specific files): `bin/process-docs.sh --dryRun docs/src/reference/the-graph.asciidoc,docs/src/tutorial/getting-started,...`
 ** Build AsciiDocs (but evaluate code blocks only in specific files): `bin/process-docs.sh --fullRun docs/src/reference/the-graph.asciidoc,docs/src/tutorial/getting-started,...`
 ** Process a single AsciiDoc file: +pass:[docs/preprocessor/preprocess-file.sh `pwd`/gremlin-console/target/apache-tinkerpop-gremlin-console-*-standalone "" "*" `pwd`/docs/src/xyz.asciidoc]+
-* Build JavaDocs: `mvn process-resources -Djavadoc`
+* Build JavaDocs/JSDoc: `mvn process-resources -Djavadoc`
+** Javadoc to `target/site/apidocs` directory
+** JSDoc to the `gremlin-javascript/src/main/javascript/gremlin-javascript/doc/` directory
 * Check for Apache License headers: `mvn apache-rat:check`
 * Specify the seed used for `Random` in tests `mvn clean install -DtestSeed` - useful when a test fails, the seed will be printed in the build output so that the test can run with the same version of random (look for "TestHelper" logger in output)
 * Check for newer dependencies: `mvn versions:display-dependency-updates` or `mvn versions:display-plugin-updates`
diff --git a/docs/src/index.asciidoc b/docs/src/index.asciidoc
index 588afc0..071589a 100644
--- a/docs/src/index.asciidoc
+++ b/docs/src/index.asciidoc
@@ -37,7 +37,8 @@ TinkerPop's interfaces).
 5. link:http://tinkerpop.apache.org/javadocs/x.y.z/full/[Javadoc] - The full Javadoc for all TinkerPop modules. There
 is also an abridged version of the link:http://tinkerpop.apache.org/javadocs/current/core/[core] interfaces which may
 be more convenient in some cases.
-6. link:http://tinkerpop.apache.org/docs/x.y.z/upgrade/[Upgrade Documentation] - Notes related to upgrading from one
+6. link:http://tinkerpop.apache.org/jsdocs/x.y.z/[JSDoc] - The JSDoc for gremlin-javascript.
+7. link:http://tinkerpop.apache.org/docs/x.y.z/upgrade/[Upgrade Documentation] - Notes related to upgrading from one
 version of TinkerPop to the next. This document describes breaking changes, major new features and other important
 information related to a particular version.
 
diff --git a/gremlin-javascript/glv/PackageJson.template b/gremlin-javascript/glv/PackageJson.template
index b87bdd1..954e8ec 100644
--- a/gremlin-javascript/glv/PackageJson.template
+++ b/gremlin-javascript/glv/PackageJson.template
@@ -33,7 +33,9 @@
   ],
   "license": "Apache-2.0",
   "dependencies": {
-    "ws": "^3.0.0"
+    "ws": "^3.0.0",
+    "grunt": "~1.0.2",
+    "grunt-cli": "~1.2.0"
   },
   "devDependencies": {
     "mocha": "~4.0.1",
diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml
index 6102a7d..d536fb8 100644
--- a/gremlin-javascript/pom.xml
+++ b/gremlin-javascript/pom.xml
@@ -189,12 +189,23 @@ limitations under the License.
                         </configuration>
                     </execution>
                     <execution>
+                        <id>grunt jsdoc</id>
+                        <goals>
+                            <goal>grunt</goal>
+                        </goals>
+                        <phase>generate-resources</phase>
+                        <configuration>
+                            <arguments>jsdoc</arguments>
+                        </configuration>
+                    </execution>
+                    <execution>
                         <id>npm test</id>
                         <phase>integration-test</phase>
                         <goals>
                             <goal>npm</goal>
                         </goals>
                         <configuration>
+                            <skip>${skipTests}</skip>
                             <arguments>test --exit</arguments>
                             <failOnError>true</failOnError>
                         </configuration>
@@ -206,13 +217,13 @@ limitations under the License.
                             <goal>npm</goal>
                         </goals>
                         <configuration>
+                            <skip>${skipTests}</skip>
                             <arguments>run-script features</arguments>
                             <failOnError>true</failOnError>
                         </configuration>
                     </execution>
                 </executions>
                 <configuration>
-                    <skip>${skipTests}</skip>
                     <workingDirectory>src/main/javascript/gremlin-javascript</workingDirectory>
                     <nodeVersion>v6.12.3</nodeVersion>
                 </configuration>
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
index 4c7120c..5e83b29 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/.gitignore
@@ -2,4 +2,5 @@ node_modules/
 .idea/
 npm-debug.log
 # maven plugin com.github.eirslett frontend-maven-plugin installs node.js runtime in "node" folder
-node/
\ No newline at end of file
+node/
+doc/
\ No newline at end of file
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.js
new file mode 100644
index 0000000..c7e1caa
--- /dev/null
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/Gruntfile.js
@@ -0,0 +1,36 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+'use strict';
+
+module.exports = function(grunt) {
+
+    grunt.loadNpmTasks('grunt-jsdoc');
+    grunt.initConfig({
+        jsdoc : {
+            dist : {
+                src: ['lib'],
+                options: {
+                    destination: 'doc',
+                    recurse: true,
+                    readme: 'README.md'
+                }
+            }
+        }
+    });
+}
diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
index e6cbe08..9aa843c 100644
--- a/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
+++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/package.json
@@ -14,7 +14,9 @@
   ],
   "license": "Apache-2.0",
   "dependencies": {
-    "ws": "^3.0.0"
+    "ws": "^3.0.0",
+    "grunt": "~1.0.2",
+    "grunt-cli": "~1.2.0"
   },
   "devDependencies": {
     "mocha": "~4.0.1",
diff --git a/pom.xml b/pom.xml
index 394d6ae..2b4eeac 100644
--- a/pom.xml
+++ b/pom.xml
@@ -386,6 +386,7 @@ limitations under the License.
                         <exclude>**/*.nuspec</exclude>
                         <exclude>**/*.nuspec.template</exclude>
                         <exclude>**/gremlin-javascript/node_modules/**</exclude>
+                        <exclude>**/gremlin-javascript/doc/**</exclude>
                         <exclude>**/node/node_modules/**</exclude>
                         <exclude>**/node/node</exclude>
                         <exclude>**/npm-debug.log</exclude>