From dcb568ec87c0639190f8e3230a662f6d37d7bd4d Mon Sep 17 00:00:00 2001 From: Jonathan Pryor Date: Wed, 24 May 2017 20:48:49 -0400 Subject: [PATCH] [create-vsix] Improve compatibility with commercial .vsix Reduce the number of differences between the `.vsix` file we build and the `Xamarin.Android.Sdk*.vsix` file which is provided commercially: * The `$(VsixVersion)` wasn't a valid version value; it was e.g. `7.3.99.` (note trailing `.`). This was caused by 611bb66e, which removed `$(_XACommitCount)`, replacing it with `$(XAVersionCommitCount). * Default to `$(IsProductComponent)`=True, and separate its logic from `$(IsExperimental)`. `$(IsProductComponent)` alters the value of the `packages[0].id` value within `catalog.json`: when `$(IsProductComponent)` is False, `packages[0].id *starts with* `Component`, e.g. `Component.Xamarin.Android.Sdk`, which is wrong. I'm still not sure why `$(IsProductComponent)` and `$(IsExperimental)` were previously tied together as they were. * Set `$(ExtensionInstallationFolder)` so that the `packages[0].extensionDir` value within `catalog.json` doesn't contain a random filename. Previously, it would be e.g.: "extensionDir":"[installdir]\\Common7\\IDE\\Extensions/x11jqb13.6u5 Setting `$(ExtensionInstallationFolder)` allows this to instead be: "extensionDir":"[installdir]\\Common7\\IDE\\Extensions/Xamarin.Android.Sdk TODO/Note: I suspect that the `Microsoft.VSSDK.BuildTools` code which creates `extensionDir` is using `Path.Combine()`, because we're getting a `.../Xamarin.Android.Sdk` value (`/` is used). The existing commercial package uses `\\` consistently. I don't know if this will be a problem. * Set `%(Content.IncludeInVSIX)`=True for `AndroidSdkPackage.ico`, so that it is included in the `.vsix` file. * Create the files `bin\$(Configuration)\lib\xbuild\Xamarin\Android\Version.txt` and `bin\$(Configuration)\lib\mandroid\MULTIDEX_JAR_LICENSE.txt` to work around Bug #54804 so that we have *some* form of `Version*` and `MULTIDEX_JAR_LICENSE` file within the `.vsix`. * Review the `@(MSBuild)` items. Apparently this construct: doesn't behave as intended: `host-mxe-Win64` is *not* added to the `.vsix`; the preceding `%(MSBuild.Remove)` takes precedence. Instead of removing "all bad" then adding the desired values, just remove the the undesirable values. (This means we might miss some, but at least this way we keep the values we want!) --- build-tools/create-vsix/create-vsix.csproj | 9 +++++++-- build-tools/create-vsix/create-vsix.targets | 12 +++--------- build-tools/scripts/BuildEverything.mk | 1 + build-tools/xa-prep-tasks/xa-prep-tasks.targets | 6 ++++++ .../Xamarin.Android.Build.Tasks.targets | 6 +++++- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/build-tools/create-vsix/create-vsix.csproj b/build-tools/create-vsix/create-vsix.csproj index 38088d85fc7..bdd1e114d49 100644 --- a/build-tools/create-vsix/create-vsix.csproj +++ b/build-tools/create-vsix/create-vsix.csproj @@ -17,14 +17,19 @@ False False False - False + true + True <_BuildVsix Condition=" '$(CreateVsixContainer)' == 'True' And Exists ('$(VsSDKInstall)') ">True <_BuildVsix Condition=" '$(_BuildVsix)' == '' ">False + Xamarin.Android.Sdk bin\$(Configuration) - + + PreserveNewest + true + Always True diff --git a/build-tools/create-vsix/create-vsix.targets b/build-tools/create-vsix/create-vsix.targets index 5cc7f9aae9b..9bacb3ba06c 100644 --- a/build-tools/create-vsix/create-vsix.targets +++ b/build-tools/create-vsix/create-vsix.targets @@ -27,15 +27,14 @@ Returns="@(MSBuild);@(ReferenceAssemblies)"> - + + %(RecursiveDir) - Xamarin/Android - Xamarin/Android/lib/host-win @@ -45,7 +44,6 @@ - Xamarin/Android/%(RecursiveDir) @@ -81,15 +79,11 @@ DependsOnTargets="GetXAVersionInfo" Returns="$(VsixVersion)"> - $(ProductVersion).$(_XACommitCount) + $(ProductVersion).$(XAVersionCommitCount) - - true - false - ..\..\bin\$(Configuration)\Version.commit <_VersionRevFile>..\..\bin\$(Configuration)\Version.rev <_XAVersionFile>$(_XAPrefix)\Version + <_XAVersionTxtFile>$(_XAPrefix)\Version.txt <_XAVersionCommitFile>$(_XAPrefix)\Version.commit <_XAVersionRevFile>$(_XAPrefix)\Version.rev @@ -32,6 +33,11 @@ Lines="$(ProductVersion)" Overwrite="True" /> + - + +