From 8490627a0dcf583db040f27cdbfb5b02575f003b Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Tue, 30 May 2017 16:51:52 -0300 Subject: [PATCH 1/2] [create-vsix] Ensure registration shows up in Help/About Fixes https://bugzilla.xamarin.com/show_bug.cgi?id=56867 It turns out that having a *package* definition in the pkgdef without a corresponding Package entry in the same file, makes it impossible for VS to find the associated resources with the given IDs (#400 for the icon, #110 and #112 for the name and description). It also turns out that even if were to do without the icon, using plain strings for #110/112 doesn't work either, and the package entry has to be there anyway, alongside the assembly and code base. Therefore, just add it to the VSIX payload so that VS can use it to locate those resources for Help/About and nothing else. Since we still tell the VSSDK targets *not* to create the PKGDEF from the Package-derived class, this should still mean it's a plain IL compilation for xbuild/MacOSX and hopefully it won't break anything. NOTE: the AssemblyName has to match what's in the PKGDEF, so we made it match with the official one too. Since this assembly name isn't used for anything at run-time, it's fine to leave it as-is with no changes. The new gazillion packages/references are needed just so the AndroidSdkPackage class can inherit from Package as expected by VS. --- build-tools/create-vsix/AndroidSdkPackage.cs | 10 ++++ .../create-vsix/Xamarin.Android.Sdk.pkgdef.in | 6 +- build-tools/create-vsix/create-vsix.csproj | 59 ++++++++++++++++++- build-tools/create-vsix/packages.config | 15 ++++- 4 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 build-tools/create-vsix/AndroidSdkPackage.cs diff --git a/build-tools/create-vsix/AndroidSdkPackage.cs b/build-tools/create-vsix/AndroidSdkPackage.cs new file mode 100644 index 00000000000..be9b47d7152 --- /dev/null +++ b/build-tools/create-vsix/AndroidSdkPackage.cs @@ -0,0 +1,10 @@ +using System.Runtime.InteropServices; +using Microsoft.VisualStudio.Shell; + +namespace Xamarin.Android.Sdk +{ + [Guid("d0e8d881-b09d-40bf-923b-b3efddc53c16")] + public class AndroidSdkPackage : Package + { + } +} diff --git a/build-tools/create-vsix/Xamarin.Android.Sdk.pkgdef.in b/build-tools/create-vsix/Xamarin.Android.Sdk.pkgdef.in index 789067c0eb4..e8b893d5568 100644 --- a/build-tools/create-vsix/Xamarin.Android.Sdk.pkgdef.in +++ b/build-tools/create-vsix/Xamarin.Android.Sdk.pkgdef.in @@ -4,4 +4,8 @@ "PID"="@PACKAGE_VERSION@.@PACKAGE_VERSION_BUILD@ (@PACKAGE_HEAD_BRANCH@/@PACKAGE_HEAD_REV@)" "ProductDetails"="#112" "LogoID"="#400" - +[$RootKey$\Packages\{d0e8d881-b09d-40bf-923b-b3efddc53c16}] +@="AndroidSdkPackage" +"InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" +"Class"="Xamarin.Android.Sdk.AndroidSdkPackage" +"CodeBase"="$PackageFolder$\Xamarin.Android.Sdk.dll" diff --git a/build-tools/create-vsix/create-vsix.csproj b/build-tools/create-vsix/create-vsix.csproj index bdd1e114d49..a1cf58d709c 100644 --- a/build-tools/create-vsix/create-vsix.csproj +++ b/build-tools/create-vsix/create-vsix.csproj @@ -7,13 +7,13 @@ {94756FEB-1F64-411D-A18E-81B5158F776A} Library Xamarin.Android.Sdk - Xamarin.Android.Sdk-OSS + Xamarin.Android.Sdk v4.6 False - False + true False False - False + true False False False @@ -26,6 +26,7 @@ + PreserveNewest true @@ -48,6 +49,58 @@ + + + ..\..\packages\Microsoft.VisualStudio.CoreUtility.15.0.26201\lib\net45\Microsoft.VisualStudio.CoreUtility.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Imaging.15.0.26201\lib\net45\Microsoft.VisualStudio.Imaging.dll + True + + + ..\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.15.0.15.0.26201\lib\Microsoft.VisualStudio.Shell.15.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Framework.15.0.26201\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll + True + + + ..\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Threading.15.0.240\lib\net45\Microsoft.VisualStudio.Threading.dll + + + ..\..\packages\Microsoft.VisualStudio.Utilities.15.0.26201\lib\net45\Microsoft.VisualStudio.Utilities.dll + True + + + ..\..\packages\Microsoft.VisualStudio.Validation.15.0.82\lib\net45\Microsoft.VisualStudio.Validation.dll + + diff --git a/build-tools/create-vsix/packages.config b/build-tools/create-vsix/packages.config index 5046ee42b7d..0419ef44efa 100644 --- a/build-tools/create-vsix/packages.config +++ b/build-tools/create-vsix/packages.config @@ -1,4 +1,17 @@  + + + + + + + + + + + + + - \ No newline at end of file + From 847fea0b9df4719e721510ade5d3f1ede49b700e Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Wed, 31 May 2017 11:08:03 -0300 Subject: [PATCH 2/2] [create-vsix] Make sure the OSS VSIX has that suffix in the filename --- build-tools/create-vsix/create-vsix.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/create-vsix/create-vsix.targets b/build-tools/create-vsix/create-vsix.targets index 9bacb3ba06c..08d87a556c4 100644 --- a/build-tools/create-vsix/create-vsix.targets +++ b/build-tools/create-vsix/create-vsix.targets @@ -103,7 +103,7 @@ <_Branch>$(_Branch.Replace ('\', '-')) - ..\..\bin\Build$(Configuration)\$(AssemblyName)-$(ProductVersion).$(XAVersionCommitCount)_$(XAVersionBranch)_$(XAVersionHash).vsix + ..\..\bin\Build$(Configuration)\$(AssemblyName)-OSS-$(ProductVersion).$(XAVersionCommitCount)_$(XAVersionBranch)_$(XAVersionHash).vsix