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 2017/07/13 17:48:29 UTC

[41/52] [abbrv] tinkerpop git commit: TINKERPOP-1552 Nuget publishing of SNAPSHOTs working now.

TINKERPOP-1552 Nuget publishing of SNAPSHOTs working now.

It's a bit hokey, but it works. There are some problems in the toolchain that makes this less nice that the gremlin-python setup. I almost wonder if we shouldn't copy the whole gremlin-dot-net source to target and operate on it in isolation so that we dont' have to muck with the source controlled csproj file. I suppose what I have here will work for now. As long as the documentation I wrote is followed I don't see any problems popping up, but we'll see.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/47973fb6
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/47973fb6
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/47973fb6

Branch: refs/heads/TINKERPOP-1552-master
Commit: 47973fb62f44f8f0eddb3b0ab7f062e051a245c2
Parents: 83e7496
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Jun 28 13:22:08 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Jul 13 13:46:49 2017 -0400

----------------------------------------------------------------------
 docs/src/dev/developer/release.asciidoc        | 17 +++++-
 gremlin-dotnet/glv/Gremlin.Net.csproj.template | 64 +++++++++++++++++++++
 gremlin-dotnet/pom.xml                         | 14 +++++
 gremlin-dotnet/src/pom.xml                     | 48 +++++++++++++++-
 4 files changed, 140 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47973fb6/docs/src/dev/developer/release.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/release.asciidoc b/docs/src/dev/developer/release.asciidoc
index 4e5db99..f83ab16 100644
--- a/docs/src/dev/developer/release.asciidoc
+++ b/docs/src/dev/developer/release.asciidoc
@@ -60,7 +60,7 @@ development artifacts must be generated and deployed separately with additional
 mvn clean install -Pglv-python
 mvn deploy -pl gremlin-python -Dpypi
 
-Python does not use the snapshot model that the JVM does, however, the build is smart in that it will dynamically
+Python does not use the snapshot model the JVM does, however, the build is smart in that it will dynamically
 generate a development version number for the Python artifacts when "-SNAPSHOT" is in the `pom.xml`. The previous
 command will push the development version to link:https://pypi.python.org/pypi/gremlinpython/[pypi] for distribution.
 Use the `testpypi` test environment by updating the `gremlin-python/pom.xml` to verify the `mvn deploy` command works.
@@ -69,6 +69,19 @@ IMPORTANT: The `clean` in the above commands is more important to the pypi deplo
 anything found in the `target/python-packaged/dist` directory. Since the names of the artifacts are based on
 timestamps, they will not overwrite one another and multiple artifacts will get uploaded.
 
+For .NET and NuGet, development artifacts can be created as follows:
+
+[source,text]
+mvn clean install -pl :gremlin-dotnet,:gremlin-dotnet-source -Dnuget
+mvn deploy -pl :gremlin-dotnet-source -Dnuget
+
+As with PyPi, NuGet does not support a snapshot model as Java does. The commands above will dynamically generate a
+version number when "-SNAPSHOT" is in the `pom.xml`. Use the `staging.nuget.org` environment by updating the
+`gremlin-dot-source/pom.xml` to ensure the `mvn deploy` command works.
+
+IMPORTANT: These commands will dynamically edit the `gremlin-dotnet-source/Gremlin.Net.csproj`. Take care to commit
+or not commit changes related to that as necessary.
+
 Release Manager Requirements
 ----------------------------
 
@@ -225,7 +238,7 @@ Release & Promote
 . Login to link:https://repository.apache.org/[Apache Nexus] and release the previously closed repository.
 . Deploy to link:https://pypi.python.org/pypi[pypi]
 .. This build will likely occur from the tag for the release, so be sure to checkout the tag first before executing this step.
-.. `mvn clean install -DskipTests`
+.. `mvn clean install -DskipTests -Dnuget`
 .. `mvn deploy -pl gremlin-python -DskipTests -Dpypi`
 .. `mvn deploy -pl :gremlin-dotnet-source -DskipTests -Dnuget`
 . `svn co --depth empty https://dist.apache.org/repos/dist/dev/tinkerpop dev; svn up dev/xx.yy.zz`

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47973fb6/gremlin-dotnet/glv/Gremlin.Net.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
new file mode 100644
index 0000000..b55eecb
--- /dev/null
+++ b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
@@ -0,0 +1,64 @@
+<!--
+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.
+-->
+
+<!--  THIS IS A GENERATED FILE - DO NOT MODIFY THIS FILE DIRECTLY - see pom.xml -->
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup Label="Build">
+    <TargetFramework>netstandard1.3</TargetFramework>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <GenerateDocumentationFile>true</GenerateDocumentationFile>
+  </PropertyGroup>
+
+  <PropertyGroup Label="Package">
+    <Version>${projectVersion}</Version>
+    <Title>Gremlin.Net</Title>
+    <Authors>Apache TinkerPop</Authors>
+    <Description>
+      Gremlin.Net for Apache TinkerPop™ is a language variant and driver for .NET.
+    </Description>
+    <Summary>
+      Apache TinkerPop™ is a graph computing framework for both graph databases (OLTP) and graph analytic systems (OLAP).
+      Gremlin is the graph traversal language of TinkerPop. It can be described as a functional, data-flow language
+      that enables users to succinctly express complex traversals on (or queries of) their application’s property graph.
+
+      Gremlin.Net implements Gremlin within .NET. C# syntax has the same constructs as Java including “dot notation”
+      for function chaining (a.b.c), round bracket function arguments (a(b,c))`, and support for global namespaces
+      (a(b()) vs a(__.b()))`. As such, anyone familiar with Gremlin-Java will immediately be able to work with
+      Gremlin.Net. Moreover, there are a few added constructs to Gremlin.Net that make traversals a bit more succinct.
+
+      Please see the reference documentation at Apache TinkerPop for more information on usage.
+
+      NOTE: Gremlin.Net is an extension of the Gremlin.Net driver by Florian Hockmann (versions &lt;= 0.X) and is now
+      included as part of the Apache TinkerPop project. The 'old' Gremlin.Net driver is however still supported.
+      Head to https://github.com/FlorianHockmann/Gremlin.Net for more information.
+    </Summary>
+    <PackageId>Gremlin.Net</PackageId>
+    <PackageTags>gremlin;tinkerpop;apache</PackageTags>
+    <PackageProjectUrl>http://tinkerpop.apache.org</PackageProjectUrl>
+    <PackageLicenseUrl>https://github.com/apache/tinkerpop/blob/master/LICENSE</PackageLicenseUrl>
+    <RepositoryUrl>https://github.com/apache/tinkerpop</RepositoryUrl>
+  </PropertyGroup>
+
+  <ItemGroup Label="Package References">
+    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+    <PackageReference Include="System.Net.WebSockets" Version="4.3.0" />
+    <PackageReference Include="System.Net.WebSockets.Client" Version="4.3.0" />
+    <PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
+  </ItemGroup>
+
+</Project>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47973fb6/gremlin-dotnet/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/pom.xml b/gremlin-dotnet/pom.xml
index 58ac2d6..20db3d8 100644
--- a/gremlin-dotnet/pom.xml
+++ b/gremlin-dotnet/pom.xml
@@ -260,6 +260,20 @@ def namingConversionsTemplate = engine.createTemplate(new File('${project.basedi
 def namingConversionsFile = new File('${project.basedir}/src/Gremlin.Net/Process/Traversal/NamingConversions.cs')
 namingConversionsFile.newWriter().withWriter{ it << namingConversionsTemplate }
 
+def determineVersion = {
+    def env = System.getenv()
+    def mavenVersion = env.containsKey("TP_RELEASE_VERSION") ? env.get("DOTNET_RELEASE_VERSION") : '${project.version}'
+
+    // only want to generate a timestamp for the version if this is a nuget deploy
+    if (!mavenVersion.endsWith("-SNAPSHOT") || null == System.getProperty("nuget")) return mavenVersion
+
+    return mavenVersion.replace("-SNAPSHOT", "-dev-" + System.currentTimeMillis())
+}
+
+def versionToUse = determineVersion()
+def csprojTemplate = engine.createTemplate(new File('${project.basedir}/glv/Gremlin.Net.csproj.template')).make(["projectVersion":versionToUse])
+def csprojFile = new File('${project.basedir}/src/Gremlin.Net/Gremlin.Net.csproj')
+csprojFile.newWriter().withWriter{ it << csprojTemplate }
 ]]>
                                 </script>
                             </scripts>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/47973fb6/gremlin-dotnet/src/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/pom.xml b/gremlin-dotnet/src/pom.xml
index 86a56af..d19170d 100644
--- a/gremlin-dotnet/src/pom.xml
+++ b/gremlin-dotnet/src/pom.xml
@@ -152,7 +152,7 @@ limitations under the License.
                                         the "ConfigFile" option to nuget.
                                         -->
                                         <exec dir="Gremlin.Net/bin" executable="mono" failonerror="true">
-                                            <arg line="nuget.exe push Gremlin.Net.3.2.6-beta1.nupkg -Source https://staging.nuget.org/api/v2/package -ConfigFile ${user.home}/.config/NuGet/NuGet.Config"/>
+                                            <arg line="nuget.exe push Gremlin.Net.*.nupkg -Source https://staging.nuget.org/api/v2/package -ConfigFile ${user.home}/.config/NuGet/NuGet.Config"/>
                                         </exec>
                                     </tasks>
                                 </configuration>
@@ -166,6 +166,52 @@ limitations under the License.
                             </dependency>
                         </dependencies>
                     </plugin>
+                    <plugin>
+                        <groupId>org.codehaus.gmavenplus</groupId>
+                        <artifactId>gmavenplus-plugin</artifactId>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.apache.tinkerpop</groupId>
+                                <artifactId>gremlin-core</artifactId>
+                                <version>${project.version}</version>
+                                <scope>runtime</scope>
+                            </dependency>
+                            <dependency>
+                                <groupId>org.codehaus.groovy</groupId>
+                                <artifactId>groovy-all</artifactId>
+                                <version>${groovy.version}</version>
+                                <scope>runtime</scope>
+                            </dependency>
+                            <dependency>
+                                <groupId>log4j</groupId>
+                                <artifactId>log4j</artifactId>
+                                <version>1.2.17</version>
+                                <scope>runtime</scope>
+                            </dependency>
+                        </dependencies>
+                        <executions>
+                            <execution>
+                                <id>generate-dsl</id>
+                                <phase>deploy</phase>
+                                <goals>
+                                    <goal>execute</goal>
+                                </goals>
+                                <configuration>
+                                    <scripts>
+                                        <script><![CDATA[
+// revert back the version after a SNAPSHOT deployment
+def versionToUse = '${project.version}'
+def engine = new groovy.text.GStringTemplateEngine()
+def csprojTemplate = engine.createTemplate(new File('${project.parent.basedir}/glv/Gremlin.Net.csproj.template')).make(["projectVersion":versionToUse])
+def csprojFile = new File('${project.basedir}/Gremlin.Net/Gremlin.Net.csproj')
+csprojFile.newWriter().withWriter{ it << csprojTemplate }
+]]>
+                                        </script>
+                                    </scripts>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
                 </plugins>
             </build>
         </profile>