From 0b7c9cdd9c7c5604b6ec197c795b3201f0c8466d Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Thu, 27 Apr 2017 16:54:30 -0400 Subject: [PATCH] [create-vsix] Allow overriding the created .vsix filename We want to use the `make create-vsix` target to create the commercial `Xamarin.Android.Sdk.vsix` file, but we want it to have a different filename, matching commit + commit count information from the internal `monodroid` repo, not the xamarin-android repo. Uppdate `create-vsix.csproj` to accept a new `$(VsixPath)` property, which is the path of the .vsix file to create. Update the default `$(VsixPath)` filename to be `Xamarin.Android.Sdk-OSS*`, so that if a customer downloads both a Jenkins OSS build and a commercial .vsix build, it will be easier to differentiate between them. (The `.vsix` package name information is *not* changed, thus it is not possible to concurrently have both the commercial and OSS builds installed in the same VS 2017 SKU.) Update the `make create-vsix` target so that the output path and other MSBuild properties can more easily be overridden: make create-vsix CONFIGURATIONS=Debug VSIX=`pwd`/MyNewPackage.vsix The `$(VSIX)` **make**(1) variable sets the `$(VsixPath)` MSBuild property. *Note*: the current-working-directory for `make create-vsix` is `build-tools/create-vsix`; consequently, this command: make create-vsix CONFIGURATIONS=Debug VSIX=MyNewPackage.vsix will create `./build-tools/create-vsix/MyNewPackage.vsix`, *not* `./MyNewPackage.vsix`. --- build-tools/create-vsix/create-vsix.csproj | 2 +- build-tools/create-vsix/create-vsix.targets | 58 ++++++--------------- build-tools/scripts/BuildEverything.mk | 9 +++- 3 files changed, 25 insertions(+), 44 deletions(-) diff --git a/build-tools/create-vsix/create-vsix.csproj b/build-tools/create-vsix/create-vsix.csproj index 57869f2496a..dfbcd97eec2 100644 --- a/build-tools/create-vsix/create-vsix.csproj +++ b/build-tools/create-vsix/create-vsix.csproj @@ -7,7 +7,7 @@ {94756FEB-1F64-411D-A18E-81B5158F776A} Library Xamarin.Android.Sdk - Xamarin.Android.Sdk + Xamarin.Android.Sdk-OSS v4.6 False False diff --git a/build-tools/create-vsix/create-vsix.targets b/build-tools/create-vsix/create-vsix.targets index 97c476fda3c..e7159c0bac1 100644 --- a/build-tools/create-vsix/create-vsix.targets +++ b/build-tools/create-vsix/create-vsix.targets @@ -1,9 +1,6 @@ - - - - + @@ -81,7 +78,7 @@ $(ProductVersion).$(_XACommitCount) @@ -94,57 +91,34 @@ false - - - - - - - - - - - - - - + Replacements="@PACKAGE_VERSION@=$(ProductVersion);@PACKAGE_VERSION_BUILD@=$(XAVersionCommitCount);@PACKAGE_HEAD_REV@=$(XAVersionHash);@PACKAGE_HEAD_BRANCH@=$(XAVersionBranch)"> - + - <_Branch>$(_XABranch.Replace ('/', '-')) + <_Branch>$(XAVersionBranch.Replace ('/', '-')) <_Branch>$(_Branch.Replace ('\', '-')) + + ..\..\bin\Build$(Configuration)\$(AssemblyName)-$(ProductVersion).$(XAVersionCommitCount)_$(XAVersionBranch)_$(XAVersionHash).vsix + + + diff --git a/build-tools/scripts/BuildEverything.mk b/build-tools/scripts/BuildEverything.mk index ad2e642955c..a7bfc61b598 100644 --- a/build-tools/scripts/BuildEverything.mk +++ b/build-tools/scripts/BuildEverything.mk @@ -130,7 +130,14 @@ _BUNDLE_ZIPS_EXCLUDE = \ create-vsix: $(foreach conf, $(CONFIGURATIONS), \ - MONO_IOMAP=all MONO_OPTIONS=--arch=64 msbuild $(MSBUILD_FLAGS) build-tools/create-vsix/create-vsix.csproj /p:Configuration=$(conf) /p:CreateVsixContainer=True ; ) + MONO_IOMAP=all MONO_OPTIONS=--arch=64 msbuild $(MSBUILD_FLAGS) /p:Configuration=$(conf) /p:CreateVsixContainer=True \ + build-tools/create-vsix/create-vsix.csproj \ + $(if $(VSIX),"/p:VsixPath=$(VSIX)") \ + $(if $(PRODUCT_COMPONENT),/p:IsProductComponent="$(PRODUCT_COMPONENT)") \ + $(if $(PACKAGE_VERSION),/p:ProductVersion="$(PACKAGE_VERSION)") \ + $(if $(PACKAGE_HEAD_BRANCH),/p:XAVersionBranch="$(PACKAGE_HEAD_BRANCH)") \ + $(if $(PACKAGE_VERSION_REV),/p:XAVersionCommitCount="$(PACKAGE_VERSION_REV)") \ + $(if $(COMMIT),/p:XAVersionHash="$(COMMIT)") ; ) package-oss-name: @echo ZIP_OUTPUT=$(ZIP_OUTPUT)