dotnet: update nuget_archive

This commit is contained in:
Corentin Le Molgat
2018-07-17 17:06:45 +02:00
parent 7f6dcf4b31
commit 328172f395
2 changed files with 21 additions and 14 deletions

View File

@@ -36,7 +36,7 @@ DOTNET_BIN := $(shell $(WHICH) $(DOTNET) 2> NUL)
else # UNIX
DOTNET_BIN := $(shell command -v $(DOTNET) 2> /dev/null)
endif
NUGET_BIN = $(DOTNET_BIN) nuget
NUGET_BIN = "$(DOTNET_BIN)" nuget
HAS_DOTNET = true
ifndef DOTNET_BIN
@@ -431,6 +431,7 @@ clean_dotnet:
-$(DEL) $(BIN_DIR)$S$(CLR_PROTOBUF_DLL_NAME).*
-$(DEL) $(BIN_DIR)$S$(CLR_ORTOOLS_DLL_NAME).*
-$(DEL) $(BIN_DIR)$S$(CLR_ORTOOLS_FSHARP_DLL_NAME).*
-$(DEL) $(SRC_DIR)/ortools/dotnet/$(ORTOOLS_NUSPEC_FILE)
-$(DELREC) $(TEMP_DOTNET_DIR)
-$(DELREC) $(TEMP_DOTNET_TEST_DIR)
@@ -442,20 +443,24 @@ TEMP_DOTNET_DIR=temp_dotnet
$(TEMP_DOTNET_DIR):
$(MKDIR_P) $(TEMP_DOTNET_DIR)
$(SRC_DIR)/ortools/dotnet/$(ORTOOLS_NUSPEC_FILE): $(SRC_DIR)/ortools/dotnet/$(ORTOOLS_NUSPEC_FILE).in
$(SED) -e "s/@PROJECT_DLL_NAME@/$(CLR_ORTOOLS_DLL_NAME)/" \
ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE).in \
>ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE)
$(SED) -i -e "s/@PROJECT_VERSION@/$(OR_TOOLS_VERSION)/" \
ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE)
.PHONY: nuget_archive # Build .Net "Google.OrTools" Nuget Package
nuget_archive: dotnet $(SRC_DIR)/ortools/dotnet/$(ORTOOLS_NUSPEC_FILE).in | $(TEMP_DOTNET_DIR)
nuget_archive: dotnet $(SRC_DIR)/ortools/dotnet/$(ORTOOLS_NUSPEC_FILE) | $(TEMP_DOTNET_DIR)
"$(DOTNET_BIN)" publish -c Release --no-dependencies --no-restore -f netstandard2.0 \
-o "..$S..$S..$S$(TEMP_DOTNET_DIR)" \
ortools$Sdotnet$S$(ORTOOLS_DLL_NAME)$S$(ORTOOLS_DLL_NAME).csproj
"$(DOTNET_BIN)" publish -c Release --no-dependencies --no-restore -f netstandard2.0 \
-o "..$S..$S..$S$(TEMP_DOTNET_DIR)" \
ortools$Sdotnet$S$(ORTOOLS_FSHARP_DLL_NAME)$S$(ORTOOLS_FSHARP_DLL_NAME).fsproj
$(SED) -e "s/MMMM/$(CLR_ORTOOLS_DLL_NAME)/" \
ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE).in \
>ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE)
$(SED) -i -e "s/VVVV/$(OR_TOOLS_VERSION)/" \
ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE)
"$(NUGET_BIN)" pack ortools$Sdotnet$S$(ORTOOLS_NUSPEC_FILE)
"$(DOTNET_BIN)" pack -c Release \
-o "..$S..$S..$S$(BIN_DIR)" \
ortools$Sdotnet
.PHONY: nuget_upload # Upload Nuget Package
nuget_upload: nuget_archive

View File

@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<package >
<metadata>
<id>MMMM</id>
<version>VVVV</version>
<id>@PROJECT_DLL_NAME@</id>
<version>@PROJECT_VERSION@</version>
<authors>Google Inc.</authors>
<licenseUrl>https://github.com/google/or-tools/blob/master/LICENSE-2.0.txt</licenseUrl>
<projectUrl>https://developers.google.com/optimization</projectUrl>
@@ -15,12 +15,14 @@
</references>
</metadata>
<files>
<file src="../../examples/dotnet/**" target="examples" exclude="**/obj/**;**/bin/**"/>
<file src="../../bin/Google.Protobuf.dll" target="lib/netstandard2.0"/> + <file src="../../temp_dotnet/**" target="lib"/>
<file src="../../lib/*.*" target="lib/netstandard2.0"/>
<file src="../../bin/Google.Protobuf.dll" target="lib/netstandard2.0"/>
<file src="../../temp_dotnet/**" target="lib/netstandard2.0"/>
<file src="OrTools/bin/Release/netstandard2.0/*.*" target="lib/netstandard2.0"/>
<file src="OrTools.FSharp/bin/Release/netstandard2.0/Google.OrTools.FSharp.*" target="lib/netstandard2.0"/>
<file src="../../bin/Google.Protobuf.dll" target="lib/netstandard2.0"/>
<file src="../../lib/*.*" target="lib/netstandard2.0" exclude="*.jar"/>
<file src="../../dependencies/install/lib/*.*" target="lib/netstandard2.0" exclude="*.jar;*.la"/>
<file src="../../dependencies/install/lib*/*.*" target="lib/netstandard2.0" exclude="*.jar;*.la"/>
<file src="../../LICENSE-2.0.txt"/>
<file src="../../examples/dotnet/**" target="examples" exclude="**/obj/**;**/bin/**"/>
</files>
</package>