Don't download nuget.exe on every build again TINKERPOP-1836
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2d1e9424 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2d1e9424 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2d1e9424 Branch: refs/heads/TINKERPOP-1878 Commit: 2d1e9424eaabef082660d363453bad9e567a33c0 Parents: 62a8837 Author: Florian Hockmann <f...@florian-hockmann.de> Authored: Mon May 21 18:34:06 2018 +0200 Committer: Florian Hockmann <f...@florian-hockmann.de> Committed: Tue Jun 19 16:41:20 2018 +0200 ---------------------------------------------------------------------- .gitignore | 2 +- gremlin-dotnet/src/pom.xml | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d1e9424/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 0109f82..a27eb44 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,4 @@ tools/ .vs/ *nupkg NuGet.Config -nuget.exe +nuget*.exe http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2d1e9424/gremlin-dotnet/src/pom.xml ---------------------------------------------------------------------- diff --git a/gremlin-dotnet/src/pom.xml b/gremlin-dotnet/src/pom.xml index b8991a0..a018c89 100644 --- a/gremlin-dotnet/src/pom.xml +++ b/gremlin-dotnet/src/pom.xml @@ -26,6 +26,10 @@ limitations under the License. <artifactId>gremlin-dotnet-source</artifactId> <name>Apache TinkerPop :: Gremlin.Net - Source</name> <packaging>${packaging.type}</packaging> + <properties> + <nugetVersion>4.4.1</nugetVersion> + <nugetExe>nuget-${nugetVersion}.exe</nugetExe> + </properties> <build> <plugins> @@ -106,19 +110,19 @@ limitations under the License. <available file="mono" filepath="${env.PATH}"/> <then> <if> - <available file="Gremlin.Net/bin/nuget.exe"/> + <available file="${nugetExe}"/> <then> - <echo>nuget.exe already downloaded and at Gremlin.Net/bin/nuget.exe.</echo> + <echo>nuget.exe already downloaded.</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 executable="wget" failonerror="true"> + <arg line="https://dist.nuget.org/win-x86-commandline/v${nugetVersion}/nuget.exe -O ${nugetExe}"/> </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 executable="mono" failonerror="true"> + <arg line="${nugetExe} pack Gremlin.Net.Template/Gremlin.Net.Template.nuspec"/> </exec> </then> <else> @@ -178,14 +182,14 @@ limitations under the License. <tasks> <taskdef resource="net/sf/antcontrib/antcontrib.properties" /> <if> - <available file="Gremlin.Net/bin/nuget.exe"/> + <available file="${nugetExe}"/> <then> - <echo>nuget.exe already downloaded and at Gremlin.Net/bin/nuget.exe.</echo> + <echo>nuget.exe already downloaded.</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 executable="wget" failonerror="true"> + <arg line="https://dist.nuget.org/win-x86-commandline/v${nugetVersion}/nuget.exe -O ${nugetExe}"/> </exec> </else> </if> @@ -194,8 +198,8 @@ limitations under the License. until https://github.com/NuGet/Home/issues/4095 we have to have to specify the "ConfigFile" option to nuget. --> - <exec dir="Gremlin.Net/bin" executable="mono" failonerror="true"> - <arg line="nuget.exe push Gremlin.Net.*.nupkg -Source https://www.nuget.org/api/v2/package -ConfigFile ${user.home}/.config/NuGet/NuGet.Config"/> + <exec executable="mono" failonerror="true"> + <arg line="${nugetExe} push Gremlin.Net/bin/Gremlin.Net.*.nupkg -Source https://www.nuget.org/api/v2/package -ConfigFile ${user.home}/.config/NuGet/NuGet.Config"/> </exec> </tasks> </configuration>