You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by fl...@apache.org on 2018/05/16 18:27:34 UTC
[10/11] tinkerpop git commit: TINKERPOP-1836 Add Gremlin.Net.Template
project
TINKERPOP-1836 Add Gremlin.Net.Template project
This project is a dotnet template that can be installed and then used to
create a simple dotnet console application ready to be used together
with a Gremlin Server.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/72cbb634
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/72cbb634
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/72cbb634
Branch: refs/heads/TINKERPOP-1836
Commit: 72cbb6348f18e4d65f5091a6d53f3bcffdfceecd
Parents: 699a5aa
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Sun May 13 17:52:36 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Wed May 16 20:27:12 2018 +0200
----------------------------------------------------------------------
.travis.yml | 5 +-
CHANGELOG.asciidoc | 2 +-
docker/Dockerfile | 4 +-
.../developer/development-environment.asciidoc | 6 ++-
gremlin-dotnet/Gremlin.Net.sln | 19 ++++++-
.../glv/Gremlin.Net.Template.csproj.template | 33 ++++++++++++
.../glv/Gremlin.Net.Template.nuspec.template | 21 ++++++++
gremlin-dotnet/glv/generate.groovy | 8 ++-
.../.template.config/template.json | 14 +++++
.../Gremlin.Net.Template.csproj | 33 ++++++++++++
.../Gremlin.Net.Template.nuspec | 21 ++++++++
.../src/Gremlin.Net.Template/Program.cs | 50 +++++++++++++++++
.../src/Gremlin.Net.Template/README.md | 46 ++++++++++++++++
.../src/Gremlin.Net.Template/Service.cs | 43 +++++++++++++++
gremlin-dotnet/src/pom.xml | 47 ++++++++++++++++
.../Gremlin.Net.Template.IntegrationTest.csproj | 20 +++++++
.../ServiceTests.cs | 56 ++++++++++++++++++++
pom.xml | 2 +
18 files changed, 423 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 6c98950..3aacee2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,9 +21,12 @@ before_install:
- curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
- sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
- sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
- - sudo apt-get install apt-transport-https
+ - sudo sh -c 'echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list'
+ - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
+ - sudo apt-get install apt-transport-https
- sudo apt-get update
- sudo apt-get install dotnet-sdk-2.1.101
+ - sudo apt install mono-devel
jobs:
include:
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index b407288..5addf4b 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -23,9 +23,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
[[release-3-2-10]]
=== TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET)
+* Added a dotnet template project that should make it easier to get started with Gremlin.Net.
* Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors.
-
[[release-3-2-9]]
=== TinkerPop 3.2.9 (Release Date: May 8, 2018)
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/docker/Dockerfile
----------------------------------------------------------------------
diff --git a/docker/Dockerfile b/docker/Dockerfile
index ef6b06c..dbc06ef 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -25,10 +25,12 @@ RUN apt-get update \
&& add-apt-repository -y ppa:webupd8team/java \
&& sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list' \
&& apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893 \
+ && sh -c 'echo "deb https://download.mono-project.com/repo/ubuntu stable-trusty main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list' \
+ && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& apt-get update \
&& apt-get install -y oracle-java8-installer curl gawk git maven openssh-server subversion zip \
&& sh -c 'curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.gpg' \
- && apt-get install -y --force-yes dotnet-sdk-2.1.101 python python-dev python-pip build-essential \
+ && apt-get install -y --force-yes dotnet-sdk-2.1.101 python python-dev python-pip build-essential mono-devel \
&& pip install virtualenv virtualenvwrapper \
&& pip install --upgrade pip \
&& rm -rf /var/lib/apt/lists/* /var/cache/oracle-jdk8-installer
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/docs/src/dev/developer/development-environment.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/development-environment.asciidoc b/docs/src/dev/developer/development-environment.asciidoc
index 4dfbcaa..afe44ca 100644
--- a/docs/src/dev/developer/development-environment.asciidoc
+++ b/docs/src/dev/developer/development-environment.asciidoc
@@ -105,6 +105,9 @@ See the <<release-environment,Release Environment>> section for more information
The build optionally requires link:https://www.microsoft.com/net/core[.NET Core SDK] (>=2.1.101) to work with the
`gremlin-dotnet` module. If .NET Core SDK is not installed, TinkerPop will still build with Maven, but .NET projects
will be skipped.
+It is also necessary to install link:http://www.mono-project.com/[Mono] for release preparations and to pack the
+Gremlin.Net Template project. The release process is known to work with 5.0.1, so it is best to probably install that
+version.
`gremlin-dotnet` can be build and tested from the command line with:
@@ -162,8 +165,7 @@ The release manager shall use the project's pypi credentials, which are availabl
link:https://svn.apache.org/repos/private/pmc/tinkerpop[PMC SVN repository]. The `password` should be left blank so
the deployment process in Maven will prompt for it at deployment time.
-For .NET releases, install link:http://www.mono-project.com/[Mono]. The release process is known to work with 5.0.1,
-so it is best to probably install that version. Release managers should probably also do an install of
+Release managers should probably also do an install of
link:https://dist.nuget.org/win-x86-commandline/v3.4.4/nuget.exe[nuget 3.4.4] as it will help with environmental setup.
To get an environment ready to deploy to NuGet, it is necessary to have a NuGet API key. First, create an account with
link:https://www.nuget.org[nuget] and request that a PMC member add your account to the Gremlin.Net package in nuget
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/Gremlin.Net.sln
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/Gremlin.Net.sln b/gremlin-dotnet/Gremlin.Net.sln
index b1a5d19..3f2b2b4 100644
--- a/gremlin-dotnet/Gremlin.Net.sln
+++ b/gremlin-dotnet/Gremlin.Net.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26430.12
+VisualStudioVersion = 15.0.27130.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{584F838B-DAE2-44F5-868C-1F532949C827}"
EndProject
@@ -15,6 +15,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gremlin.Net.UnitTest", "tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gremlin.Net.IntegrationTest", "test\Gremlin.Net.IntegrationTest\Gremlin.Net.IntegrationTest.csproj", "{CC54ABE3-13D2-491C-81E2-4D0355ABFA93}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gremlin.Net.Template", "src\Gremlin.Net.Template\Gremlin.Net.Template.csproj", "{A9D2567A-6FD0-452B-A2F9-4256FE513ADD}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Gremlin.Net.Template.IntegrationTest", "test\Gremlin.Net.Template.IntegrationTest\Gremlin.Net.Template.IntegrationTest.csproj", "{3BFC3559-E317-4327-AFB7-CFBB31E1C868}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -33,6 +37,14 @@ Global
{CC54ABE3-13D2-491C-81E2-4D0355ABFA93}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC54ABE3-13D2-491C-81E2-4D0355ABFA93}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC54ABE3-13D2-491C-81E2-4D0355ABFA93}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A9D2567A-6FD0-452B-A2F9-4256FE513ADD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A9D2567A-6FD0-452B-A2F9-4256FE513ADD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A9D2567A-6FD0-452B-A2F9-4256FE513ADD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A9D2567A-6FD0-452B-A2F9-4256FE513ADD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3BFC3559-E317-4327-AFB7-CFBB31E1C868}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3BFC3559-E317-4327-AFB7-CFBB31E1C868}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3BFC3559-E317-4327-AFB7-CFBB31E1C868}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3BFC3559-E317-4327-AFB7-CFBB31E1C868}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -41,5 +53,10 @@ Global
{6C1DD34D-E30F-4E37-AACC-BEB8AD2320D8} = {584F838B-DAE2-44F5-868C-1F532949C827}
{1FAB781B-B857-4AD2-BEC8-E20C214D9E21} = {1B54FAC2-5411-4BB6-B450-FE2FFD8C4782}
{CC54ABE3-13D2-491C-81E2-4D0355ABFA93} = {1B54FAC2-5411-4BB6-B450-FE2FFD8C4782}
+ {A9D2567A-6FD0-452B-A2F9-4256FE513ADD} = {584F838B-DAE2-44F5-868C-1F532949C827}
+ {3BFC3559-E317-4327-AFB7-CFBB31E1C868} = {1B54FAC2-5411-4BB6-B450-FE2FFD8C4782}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {F0AF408C-2147-434A-80FB-73A1626FC30C}
EndGlobalSection
EndGlobal
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/glv/Gremlin.Net.Template.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.Template.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.Template.csproj.template
new file mode 100644
index 0000000..9a6adf0
--- /dev/null
+++ b/gremlin-dotnet/glv/Gremlin.Net.Template.csproj.template
@@ -0,0 +1,33 @@
+<!--
+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>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <IsPackable>false</IsPackable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <!-- We need both reference elements until this is resolved: https://github.com/dotnet/sdk/issues/1151 -->
+ <ProjectReference Include="../Gremlin.Net/Gremlin.Net.csproj" />
+ <PackageReference Include="Gremlin.Net" Version="$projectVersion" />
+ </ItemGroup>
+
+</Project>
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/glv/Gremlin.Net.Template.nuspec.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.Template.nuspec.template b/gremlin-dotnet/glv/Gremlin.Net.Template.nuspec.template
new file mode 100644
index 0000000..72ad382
--- /dev/null
+++ b/gremlin-dotnet/glv/Gremlin.Net.Template.nuspec.template
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>Gremlin.Net.Template</id>
+ <title>Gremlin.Net Template</title>
+ <version>$projectVersion</version>
+ <description>Gremlin.Net template to create a console application with dotnet new.</description>
+ <authors>Apache TinkerPop</authors>
+ <licenseUrl>https://github.com/apache/tinkerpop/blob/master/LICENSE</licenseUrl>
+ <projectUrl>http://tinkerpop.apache.org</projectUrl>
+ <tags>TinkerPop Gremlin Gremlin.Net</tags>
+ <packageTypes>
+ <packageType name="Template" />
+ </packageTypes>
+ </metadata>
+ <files>
+ <file src=".template.config/template.json" target="content/.template.config" />
+ <file src="Gremlin.Net.Template.csproj" target="content" />
+ <file src="*.cs" target="content" />
+</files>
+</package>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/glv/generate.groovy
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/generate.groovy b/gremlin-dotnet/glv/generate.groovy
index 10b1008..8f5fa44 100644
--- a/gremlin-dotnet/glv/generate.groovy
+++ b/gremlin-dotnet/glv/generate.groovy
@@ -378,4 +378,10 @@ def determineVersion = {
def versionToUse = determineVersion()
def csprojTemplate = engine.createTemplate(new File("${projectBaseDir}/glv/Gremlin.Net.csproj.template")).make(["projectVersion":versionToUse])
def csprojFile = new File("${projectBaseDir}/src/Gremlin.Net/Gremlin.Net.csproj")
-csprojFile.newWriter().withWriter{ it << csprojTemplate }
\ No newline at end of file
+csprojFile.newWriter().withWriter{ it << csprojTemplate }
+def templateCsprojTemplate = engine.createTemplate(new File("${projectBaseDir}/glv/Gremlin.Net.Template.csproj.template")).make(["projectVersion":versionToUse])
+def templateCsprojFile = new File("${projectBaseDir}/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj")
+templateCsprojFile.newWriter().withWriter{ it << templateCsprojTemplate }
+def nuspecTemplate = engine.createTemplate(new File("${projectBaseDir}/glv/Gremlin.Net.Template.nuspec.template")).make(["projectVersion":versionToUse])
+def nuspecFile = new File("${projectBaseDir}/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec")
+nuspecFile.newWriter().withWriter{ it << nuspecTemplate }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/src/Gremlin.Net.Template/.template.config/template.json
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/.template.config/template.json b/gremlin-dotnet/src/Gremlin.Net.Template/.template.config/template.json
new file mode 100644
index 0000000..f1ea667
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/.template.config/template.json
@@ -0,0 +1,14 @@
+{
+ "$schema": "http://json.schemastore.org/template",
+ "author": "Apache TinkerPop",
+ "classifications": [ "TinkerPop", "Gremlin", "Gremlin.Net" ],
+ "identity": "Gremlin.Net.Template",
+ "name": "Gremlin.Net Template",
+ "shortName": "gremlin",
+ "tags": {
+ "language": "C#",
+ "type": "project"
+ },
+ "sourceName": "Gremlin.Net.Template",
+ "preferNameDirectory": true
+ }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj
new file mode 100644
index 0000000..bfe36cf
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.csproj
@@ -0,0 +1,33 @@
+<!--
+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>
+ <OutputType>Exe</OutputType>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+ <IsPackable>false</IsPackable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <!-- We need both reference elements until this is resolved: https://github.com/dotnet/sdk/issues/1151 -->
+ <ProjectReference Include="../Gremlin.Net/Gremlin.Net.csproj" />
+ <PackageReference Include="Gremlin.Net" Version="3.2.10-SNAPSHOT" />
+ </ItemGroup>
+
+</Project>
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec
new file mode 100644
index 0000000..3de87df
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/Gremlin.Net.Template.nuspec
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
+ <metadata>
+ <id>Gremlin.Net.Template</id>
+ <title>Gremlin.Net Template</title>
+ <version>3.2.10-SNAPSHOT</version>
+ <description>Gremlin.Net template to create a console application with dotnet new.</description>
+ <authors>Apache TinkerPop</authors>
+ <licenseUrl>https://github.com/apache/tinkerpop/blob/master/LICENSE</licenseUrl>
+ <projectUrl>http://tinkerpop.apache.org</projectUrl>
+ <tags>TinkerPop Gremlin Gremlin.Net</tags>
+ <packageTypes>
+ <packageType name="Template" />
+ </packageTypes>
+ </metadata>
+ <files>
+ <file src=".template.config/template.json" target="content/.template.config" />
+ <file src="Gremlin.Net.Template.csproj" target="content" />
+ <file src="*.cs" target="content" />
+</files>
+</package>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/src/Gremlin.Net.Template/Program.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/Program.cs b/gremlin-dotnet/src/Gremlin.Net.Template/Program.cs
new file mode 100644
index 0000000..00f85e4
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/Program.cs
@@ -0,0 +1,50 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+using System;
+using Gremlin.Net.Driver;
+using Gremlin.Net.Driver.Remote;
+using Gremlin.Net.Structure;
+
+namespace Gremlin.Net.Template
+{
+ internal class Program
+ {
+ private const string GremlinServerHostname = "localhost";
+ private const int GremlinServerPort = 45940;
+
+ private static void Main()
+ {
+ using (var client = new GremlinClient(new GremlinServer(GremlinServerHostname, GremlinServerPort)))
+ {
+ var g = new Graph().Traversal().WithRemote(new DriverRemoteConnection(client));
+ var service = new Service(g);
+ var creators = service.FindCreatorsOfSoftware("lop");
+ foreach (var c in creators)
+ {
+ Console.WriteLine(c);
+ }
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/src/Gremlin.Net.Template/README.md
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/README.md b/gremlin-dotnet/src/Gremlin.Net.Template/README.md
new file mode 100644
index 0000000..c57f51c
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/README.md
@@ -0,0 +1,46 @@
+<!--
+
+ 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.
+
+-->
+
+# Gremlin.Net Template
+
+This dotnet template helps getting started with [Gremlin.Net](http://tinkerpop.apache.org/docs/current/reference/#gremlin-DotNet) - the .NET Gremlin Language Variant (GLV) of Apache TinkerPop™. It creates a new C# console project that shows how to connect to a [Gremlin Server](http://tinkerpop.apache.org/docs/current/reference/#gremlin-server) with Gremlin.Net.
+
+## Installation
+
+You can install the template with the dotnet CLI tool:
+
+```bash
+dotnet new -i Gremlin.Net.Template
+```
+
+## Creating a project using the template
+
+After the template is installed, a new project based on this template can be installed:
+
+```bash
+dotnet new gremlin
+```
+
+You can specify the output directory for the new project which will then also be used as the name of the created project:
+
+```bash
+dotnet new gremlin -o MyFirstGremlinProject
+```
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/src/Gremlin.Net.Template/Service.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net.Template/Service.cs b/gremlin-dotnet/src/Gremlin.Net.Template/Service.cs
new file mode 100644
index 0000000..4ded6d3
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net.Template/Service.cs
@@ -0,0 +1,43 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+using System.Collections.Generic;
+using Gremlin.Net.Process.Traversal;
+
+namespace Gremlin.Net.Template
+{
+ public class Service
+ {
+ private readonly GraphTraversalSource _g;
+
+ public Service(GraphTraversalSource g)
+ {
+ _g = g;
+ }
+
+ public IList<string> FindCreatorsOfSoftware(string softwareName)
+ {
+ return _g.V().HasLabel("software").Has("name", softwareName).In("created").Values<string>("name").ToList();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/src/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/pom.xml b/gremlin-dotnet/src/pom.xml
index f913692..dba3bd2 100644
--- a/gremlin-dotnet/src/pom.xml
+++ b/gremlin-dotnet/src/pom.xml
@@ -89,6 +89,47 @@ limitations under the License.
<nugetAddEnabled>false</nugetAddEnabled>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>pack-dotnet-template</id>
+ <phase>package</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" />
+ <if>
+ <available file="Gremlin.Net/bin/nuget.exe"/>
+ <then>
+ <echo>nuget.exe already downloaded and at Gremlin.Net/bin/nuget.exe.</echo>
+ </then>
+
+ <else>
+ <exec dir="Gremlin.Net/bin" executable="wget" failonerror="true">
+ <arg line="https://dist.nuget.org/win-x86-commandline/v4.4.1/nuget.exe"/>
+ </exec>
+ </else>
+ </if>
+
+ <exec dir="Gremlin.Net/bin" executable="mono" failonerror="true">
+ <arg line="nuget.exe pack ../../Gremlin.Net.Template/Gremlin.Net.Template.nuspec"/>
+ </exec>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ <dependencies>
+ <dependency>
+ <groupId>ant-contrib</groupId>
+ <artifactId>ant-contrib</artifactId>
+ <version>20020829</version>
+ </dependency>
+ </dependencies>
+ </plugin>
</plugins>
</build>
</profile>
@@ -200,6 +241,12 @@ 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 }
+def templateCsprojTemplate = engine.createTemplate(new File('${project.parent.basedir}/glv/Gremlin.Net.Template.csproj.template')).make(["projectVersion":versionToUse])
+def templateCsprojFile = new File('${project.basedir}/Gremlin.Net.Template/Gremlin.Net.Template.csproj')
+templateCsprojFile.newWriter().withWriter{ it << templateCsprojTemplate }
+def nuspecTemplate = engine.createTemplate(new File('${project.parent.basedir}/glv/Gremlin.Net.Template.nuspec.template')).make(["projectVersion":versionToUse])
+def nuspecFile = new File('${project.basedir}/Gremlin.Net.Template/Gremlin.Net.Template.nuspec')
+nuspecFile.newWriter().withWriter{ it << nuspecTemplate }
]]>
</script>
</scripts>
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/Gremlin.Net.Template.IntegrationTest.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/Gremlin.Net.Template.IntegrationTest.csproj b/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/Gremlin.Net.Template.IntegrationTest.csproj
new file mode 100644
index 0000000..3607e68
--- /dev/null
+++ b/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/Gremlin.Net.Template.IntegrationTest.csproj
@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netcoreapp2.0</TargetFramework>
+
+ <IsPackable>false</IsPackable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
+ <PackageReference Include="xunit" Version="2.3.1" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
+ <DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\Gremlin.Net.Template\Gremlin.Net.Template.csproj" />
+ </ItemGroup>
+
+</Project>
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/ServiceTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/ServiceTests.cs b/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/ServiceTests.cs
new file mode 100644
index 0000000..8bf332f
--- /dev/null
+++ b/gremlin-dotnet/test/Gremlin.Net.Template.IntegrationTest/ServiceTests.cs
@@ -0,0 +1,56 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+using System.Collections.Generic;
+using Gremlin.Net.Driver;
+using Gremlin.Net.Driver.Remote;
+using Gremlin.Net.Structure;
+using Xunit;
+
+namespace Gremlin.Net.Template.IntegrationTest
+{
+ public class ServiceTests
+ {
+ private const string TestHost = "localhost";
+ private const int TestPort = 45940;
+
+ [Fact]
+ public void ShouldReturnExpectedCreators()
+ {
+ using (var client = CreateClient())
+ {
+ var g = new Graph().Traversal().WithRemote(new DriverRemoteConnection(client));
+ var service = new Service(g);
+
+ var creators = service.FindCreatorsOfSoftware("lop");
+
+ Assert.Equal(new List<string> {"marko", "josh", "peter"}, creators);
+ }
+ }
+
+ private static IGremlinClient CreateClient()
+ {
+ return new GremlinClient(new GremlinServer(TestHost, TestPort));
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72cbb634/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9c4b507..e78d99c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -329,6 +329,8 @@ limitations under the License.
<exclude>**/*.csproj</exclude>
<exclude>**/.vs/**</exclude>
<exclude>**/NuGet.Config</exclude>
+ <exclude>**/*.nuspec</exclude>
+ <exclude>**/*.nuspec.template</exclude>
<exclude>**/gremlin-javascript/node_modules/**</exclude>
<exclude>**/node/node_modules/**</exclude>
<exclude>**/node/node</exclude>