-
Notifications
You must be signed in to change notification settings - Fork 560
[installers] Share installer payload generation logic #2733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Initial testing of a .pkg produced by this new |
It occurs to me that As such, instead of |
Xamarin.Android provides a variety of targets for use by the [Xamarin.Android Designer][0], which are used to help prepare a project for consumption by the Xamarin.Android Designer. Historically these targets were kept within the commercial repo. Move the `GetExtraLibraryLocationsForDesigner` and related MSBuild targets and unit tests from xamarin/monodroid@40a23fbf into the xamarin-android repo. Moving the targets will hopefully permit the Xamarin.Android Designer integration tests to use the xamarin-android OSS build artifacts and installers (e.g. PR #2733), allowing breakage caused by changes within the `xamarin-android` repo to be more quickly identified and fixed. (Currently, commercial installer creation can be significantly delayed, which increases the time it takes for the Designer integration tests to get a chance to run, and any breakage found and reported, before breakage can be fixed.) [0]: https://docs.microsoft.com/en-us/xamarin/android/user-interface/android-designer/
This should also update diff --git a/build-tools/automation/build.groovy b/build-tools/automation/build.groovy
index dd58d6cc..fe57e8ab 100644
--- a/build-tools/automation/build.groovy
+++ b/build-tools/automation/build.groovy
@@ -97,6 +97,10 @@ timestamps {
sh "make create-vsix CONFIGURATION=${env.BuildFlavor}"
}
+ stageWithTimeout('create pkg', 30, 'MINUTES', XADir, true) { // Typically takes less than 5 minutes
+ sh "msbuild /p:Configuration=${env.BuildFlavor} /t:CreatePkg build-tools/create-pkg/create-pkg.csproj"
+ }
+
stageWithTimeout('build tests', 30, 'MINUTES', XADir, true) { // Typically takes less than 10 minutes
sh "make all-tests CONFIGURATION=${env.BuildFlavor}"
}
@@ -111,7 +115,7 @@ timestamps {
}
stageWithTimeout('publish packages to Azure', 10, 'MINUTES', XADir, true) { // Typically takes less than a minute
- def publishBuildFilePaths = "xamarin.android-oss*.zip,bin/${env.BuildFlavor}/bundle-*.zip,bin/Build*/Xamarin.Android.Sdk*.vsix,prepare-image-dependencies.sh,build-status*,xa-build-status*";
+ def publishBuildFilePaths = "xamarin.android-oss*.zip,bin/${env.BuildFlavor}/bundle-*.zip,bin/Build*/Xamarin.Android.Sdk*.vsix,bin/Build*/*.pkg,prepare-image-dependencies.sh,build-status*,xa-build-status*";
echo "publishBuildFilePaths: ${publishBuildFilePaths}"
def stageStatus = publishPackages(publishBuildFilePaths)
if (stageStatus != 0) { |
8fa9d8b
to
85f052d
Compare
ce0e2a8
to
5cea7c8
Compare
cbce7aa
to
3158c70
Compare
3158c70
to
a3d67f4
Compare
a3d67f4
to
7e49940
Compare
There are merge conflicts. :-( Additionally, commit f74cd44 added some additional files which should be installed:
|
@jonpryor I'm also working on another required make change, we'll need to override |
b040ed5
to
1a7c188
Compare
88d9ba2
to
0c39012
Compare
Introduces a new `create-pkg` project next to `create-vsix` to be used in a similar way to create a macOS installer for xamarin-android. The `build-tools/installers/create-installers.targets` file has also been added to keep track of all of the content we require in both our macOS and Windows installers. These shared items, properties, and targets are used by both installer projects to ensure uniformity between the two installers we produce. The `ConstructInstallerItems` target determines the majority of the files which should end up in the installer. Behavior will vary depending on the existance of certain files or the values of certain msbuild properties. This was done intentionally to be able to support creating installers for PR builds, open source packages, and commercial packages. The `AndroidFirstFrameworkVersion`, `AndroidLatestStableFrameworkVersion`, and `AndroidLatestFrameworkVersion` MSBuild properties (along with some hardcoded values) are used to determine which API levels the installer will support. The `AndroidSupportedTargetJitAbi` MSBuild property is used to determine which Android ABIs the installer will support. The `IncludeMonoBundleComponents` MSBuild property is used to determine whether or not the components which come from a full mono integration build should be included in the installers. The new `create-installers` make target will attempt to package all of the relevant files for every ABI specified in the `ALL_JIT_ABIS` variable in `build-tools/scripts/BuildEverything.mk`. This behavior can be overridden by specifying an empty value for `_MSBUILD_ARGS` when calling the `create-installers` make rule (as build.groovy does), or by providing an alternate value for `/p:AndroidSupportedTargetJitAbis` when building either installer directly from MSBuild. The build.groovy script has been updated to handle creating different installer types for PR builds and full builds. Our macOS PR builds will now build a mxe-win flavored version of `libmono-android`, so that it can be included in a vsix installer and used to extend test coverage for our PR builds in the future. PR builds will also package a limited set of Android ABI support as briefly mentioned above. A new pkg preinstall script has also been added to fix an issue that would result in old installations being left on disk. Now, the macOS installer will attempt to remove the version currently symlinked to `/Library/Frameworks/Xamarin.Android.framework/Versions/Current` before running. Fixes dotnet#2686.
0c39012
to
acec8c0
Compare
// Override _MSBUILD_ARGS to ensure we only package the `AndroidSupportedTargetJitAbis` which are built. | ||
// Also ensure that we don't require mono bundle components in the installer if this is not a full mono integration build. | ||
def msbuildInstallerArgs = hasPrLabelFullMonoIntegrationBuild ? '' : '/p:IncludeMonoBundleComponents=False' | ||
sh "make create-installers CONFIGURATION=${env.BuildFlavor} _MSBUILD_ARGS='${msbuildInstallerArgs}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this overriding _MSBUILD_ARGS
and not MSBUILD_ARGS
?
Introduces a new
create-pkg
project next tocreate-vsix
to be usedin a similar way to create a macOS installer for xamarin-android. The
build-tools/installers/create-installers.targets
file has also beenadded to keep track of all of the content we require in both our macOS
and Windows installers. These shared items, properties, and targets are
used by both installer projects to ensure uniformity between the two
installers we produce.
The
ConstructInstallerItems
target determines the majority of the fileswhich should end up in the installer. Behavior will vary depending on the
existance of certain files or the values of certain msbuild properties.
This was done intentionally to be able to support creating installers for
PR builds, open source packages, and commercial packages.
The
AndroidFirstFrameworkVersion
,AndroidLatestStableFrameworkVersion
,and
AndroidLatestFrameworkVersion
MSBuild properties (along with somehardcoded values) are used to determine which API levels the installer
will support.
The
AndroidSupportedTargetJitAbi
MSBuild property is used to determinewhich Android ABIs the installer will support.
The
IncludeMonoBundleComponents
MSBuild property is used to determinewhether or not the components which come from a full mono integration
build should be included in the installers.
The new
create-installers
make target will attempt to package all ofthe relevant files for every ABI specified in the
ALL_JIT_ABIS
variablein
build-tools/scripts/BuildEverything.mk
. This behavior can beoverridden by specifying an empty value for
_MSBUILD_ARGS
when callingthe
create-installers
make rule (as build.groovy does), or by providingan alternate value for
/p:AndroidSupportedTargetJitAbis
when buildingeither installer directly from MSBuild.
The build.groovy script has been updated to handle creating different
installer types for PR builds and full builds. Our macOS PR builds will
now build a mxe-win flavored version of
libmono-android
, so that it canbe included in a vsix installer and used to extend test coverage for our
PR builds in the future. PR builds will also package a limited set of
Android ABI support as briefly mentioned above.
A new pkg preinstall script has also been added to fix an issue that
would result in old installations being left on disk. Now, the macOS
installer will attempt to remove the version currently symlinked to
/Library/Frameworks/Xamarin.Android.framework/Versions/Current
before running.
Fixes #2686.