Skip to content
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

[build] Only build the latest API level #7786

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,9 @@
<_StandardLibraryPath Condition=" '$(TargetFrameworkVersion)' == '' ">$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries('.NETFramework', 'v4.7.2', ''))</_StandardLibraryPath>
<TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' And '$(UsingMicrosoftNETSdk)' != 'true' And '$(_StandardLibraryPath)' != '' ">v4.7.2</TargetFrameworkVersion>
<TargetFrameworkVersion Condition=" '$(TargetFrameworkVersion)' == '' And '$(UsingMicrosoftNETSdk)' != 'true' ">v4.7.1</TargetFrameworkVersion>
<!-- Used by the `build-tools/create-vsix` build so that `Mono.Android.Export.dll`/etc. are only included *once* -->
<!-- Should correspond to the first value from `$(API_LEVELS)` in `build-tools/api-xml-adjuster/Makefile` -->
<AndroidFirstFrameworkVersion Condition="'$(AndroidFirstFrameworkVersion)' == ''">v4.4</AndroidFirstFrameworkVersion>
<AndroidFirstApiLevel Condition="'$(AndroidFirstApiLevel)' == ''">19</AndroidFirstApiLevel>
<AndroidJavaRuntimeApiLevel Condition="'$(AndroidJavaRuntimeApiLevel)' == ''">26</AndroidJavaRuntimeApiLevel>
<!-- The min API level supported by Microsoft.Android.Sdk, should refactor/remove when this value is the same as $(AndroidFirstApiLevel) -->
<AndroidMinimumDotNetApiLevel Condition="'$(AndroidMinimumDotNetApiLevel)' == ''">21</AndroidMinimumDotNetApiLevel>
<AndroidFirstPlatformId Condition="'$(AndroidFirstPlatformId)' == ''">$(AndroidFirstApiLevel)</AndroidFirstPlatformId>
<!-- *Latest* *stable* API level binding that we support; used when building src/Xamarin.Android.Build.Tasks -->
<AndroidLatestStableApiLevel Condition="'$(AndroidLatestStableApiLevel)' == ''">33</AndroidLatestStableApiLevel>
<AndroidLatestStablePlatformId Condition="'$(AndroidLatestStablePlatformId)' == ''">$(AndroidLatestStableApiLevel)</AndroidLatestStablePlatformId>
Expand Down
5 changes: 0 additions & 5 deletions Documentation/building/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ Overridable MSBuild properties include:
This is an integer value, e.g. `15` for
[API-15 (Android 4.0.3)](http://developer.android.com/about/versions/android-4.0.3.html).

* `$(AndroidFirstFrameworkVersion)`: The first `$(TargetFrameworkVersion)`
which will be built by `make jenkins` and included in the installer.
Currently `v4.4`.
This controls what is included in `build-tools/create-vsix` packages.

* `$(AndroidFrameworkVersion)`: The Xamarin.Android `$(TargetFrameworkVersion)`
version which corresponds to `$(AndroidApiLevel)`. This is *usually* the
Android version number with a leading `v`, e.g. `v4.0.3` for API-15.
Expand Down
2 changes: 1 addition & 1 deletion build-tools/api-xml-adjuster/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ API_XML_TOOL = $(BUILDBIN)/api-xml-adjuster.exe
RUNTIME = mono --debug
RUN_CLASS_PARSE = $(RUNTIME) $(CLASS_PARSE)
RUN_API_XML_TOOL = $(RUNTIME) $(API_XML_TOOL)
API_LEVELS = 10 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
API_LEVELS = 33

XML_OUTPUT_DIR = .

Expand Down
176 changes: 0 additions & 176 deletions build-tools/automation/azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ resources:
name: xamarin/release-scripts
ref: refs/heads/sign-and-notarized
endpoint: xamarin
- repository: uitools
type: github
name: xamarin/UITools
ref: refs/heads/main
endpoint: xamarin

parameters:
- name: provisionatorChannel
Expand Down Expand Up @@ -697,11 +692,6 @@ stages:
target_framework: $(DotNetStableTargetFramework)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- stage: wear_tests
displayName: WearOS Tests
dependsOn: mac_build
condition: and(succeeded(), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'MSBuildDevice')))
jobs:
- job: wear_tests
displayName: macOS > Tests > WearOS
timeoutInMinutes: 180
Expand Down Expand Up @@ -771,172 +761,6 @@ stages:
- template: yaml-templates/fail-on-issue.yaml



- stage: designer_tests
displayName: Designer Tests
dependsOn: mac_build
condition: and(succeeded(), or(eq(variables['RunAllTests'], true), contains(dependencies.mac_build.outputs['mac_build_create_installers.TestConditions.TestAreas'], 'Designer')))
jobs:
# Check - "Xamarin.Android (macOS > Tests > Designer Integration)"
- job: designer_integration_mac
condition: false #TODO: Enable once test issues are fixed.
displayName: macOS > Tests > Designer Integration
pool:
vmImage: $(HostedMacImage)
timeoutInMinutes: 120
cancelTimeoutInMinutes: 5
workspace:
clean: all
variables:
EnableRegressionTest: true
steps:
- checkout: uitools
clean: true
submodules: recursive
path: s/UITools
persistCredentials: true

- powershell: |
# Use the branch name of the source being built or the PR target branch name. Fall back to 'main' if the branch is unknown.
$branchPrefix = "/refs/heads/"
$branchName = "$(Build.SourceBranch)" -replace $branchPrefix, ""
if ("$(Build.Reason)" -eq "PullRequest") {
$branchName = "$(System.PullRequest.TargetBranch)" -replace $branchPrefix, ""
}
if (("$branchName" -ne "main") -and ("$branchName" -notlike "d1*")) {
$branchName = "main"
}
Set-Location -Path $(System.DefaultWorkingDirectory)/UITools
git checkout $branchName
git submodule update -q --init --recursive
displayName: Clone and update UITools
- task: NuGetAuthenticate@0
displayName: authenticate with azure artifacts
inputs:
forceReinstallCredentialProvider: true

- task: provisionator@2
displayName: provision designer dependencies
inputs:
github_token: $(GitHub.Token)
provisioning_script: $(System.DefaultWorkingDirectory)/UITools/src/bot-provisioning/dependencies.csx
provisioning_extra_args: -remove Xamarin.Android -vv DEVDIV_PKGS_NUGET_TOKEN=$(DevDiv.NuGet.Token) SECTOOLS_PKGS_NUGET_TOKEN=$(SecTools.NuGet.Token)
env:
PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }}

- template: yaml-templates/setup-test-environment.yaml
parameters:
xaSourcePath: $(System.DefaultWorkingDirectory)/xamarin-android
jdkTestFolder: $(JAVA_HOME_8_X64)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- template: designer/android-designer-build-mac.yaml@yaml-templates
parameters:
designerSourcePath: $(System.DefaultWorkingDirectory)/UITools/src

- template: designer/android-designer-tests.yaml@yaml-templates
parameters:
designerSourcePath: $(System.DefaultWorkingDirectory)/UITools/src
runAddinTests: false

- task: CopyFiles@2
displayName: 'Copy binlogs'
inputs:
sourceFolder: $(System.DefaultWorkingDirectory)/UITools/src/Xamarin.Designer.Android
contents: '**/*.binlog'
targetFolder: $(Build.ArtifactStagingDirectory)/designer-binlogs
overWrite: true
flattenFolders: true
condition: ne(variables['Agent.JobStatus'], 'Succeeded')

- template: yaml-templates/publish-artifact.yaml
parameters:
displayName: upload designer binlogs
artifactName: Test Results - Designer - macOS
targetPath: $(Build.ArtifactStagingDirectory)/designer-binlogs
condition: ne(variables['Agent.JobStatus'], 'Succeeded')

# Check - "Xamarin.Android (Windows > Tests > Designer Integration)"
- job: designer_integration_win
displayName: Windows > Tests > Designer Integration
pool:
vmImage: $(HostedWinImage)
timeoutInMinutes: 120
cancelTimeoutInMinutes: 5
workspace:
clean: all
variables:
EnableRegressionTest: true
RegressionTestSuiteOutputDir: C:\Git\ADesRegTestSuite
VisualStudioInstallationPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise
steps:
- checkout: uitools
clean: true
submodules: recursive
path: s\UITools
persistCredentials: true

- powershell: |
# Use the branch name of the source being built or the PR target branch name. Fall back to 'main' if the branch is unknown.
$branchPrefix = "/refs/heads/"
$branchName = "$(Build.SourceBranch)" -replace $branchPrefix, ""
if ("$(Build.Reason)" -eq "PullRequest") {
$branchName = "$(System.PullRequest.TargetBranch)" -replace $branchPrefix, ""
}
if (("$branchName" -ne "main") -and ("$branchName" -notlike "d1*")) {
$branchName = "main"
}
Set-Location -Path $(System.DefaultWorkingDirectory)\UITools
git checkout $branchName
git submodule update -q --init --recursive
displayName: Clone and update UITools
- task: NuGetAuthenticate@0
displayName: authenticate with azure artifacts
inputs:
forceReinstallCredentialProvider: true

- task: provisionator@2
displayName: provision designer dependencies
inputs:
github_token: $(GitHub.Token)
provisioning_script: $(System.DefaultWorkingDirectory)\UITools\src\bot-provisioning\dependencies.csx
provisioning_extra_args: -vv DEVDIV_PKGS_NUGET_TOKEN=$(DevDiv.NuGet.Token) SECTOOLS_PKGS_NUGET_TOKEN=$(SecTools.NuGet.Token)
env:
PROVISIONATOR_CHANNEL: ${{ parameters.provisionatorChannel }}

- template: yaml-templates\setup-test-environment.yaml
parameters:
xaSourcePath: $(System.DefaultWorkingDirectory)\xamarin-android
jdkTestFolder: $(JAVA_HOME_8_X64)
provisionatorChannel: ${{ parameters.provisionatorChannel }}

- task: VSBuild@1
displayName: Restore Xamarin.AndroidDesigner
inputs:
solution: $(System.DefaultWorkingDirectory)\UITools\src\Xamarin.Designer.Android\Xamarin.AndroidDesigner.sln
vsVersion: 17.0
msbuildArgs: >-
/t:Restore /p:RestoreDisableParallel=true
/p:RestoreConfigFile="$(System.DefaultWorkingDirectory)\UITools\NuGet.Config"
/p:JavaSdkDirectory="$(JAVA_HOME_8_X64)"
platform: Any CPU
configuration: DebugWin32

- task: VSBuild@1
displayName: Build Xamarin.AndroidDesigner
inputs:
solution: $(System.DefaultWorkingDirectory)\UITools\src\Xamarin.Designer.Android\Xamarin.AndroidDesigner.sln
vsVersion: 17.0
msbuildArgs: /t:Build /p:GitHubToken=$(GitHub.Token)
platform: Any CPU
configuration: DebugWin32

- template: yaml-templates/run-designer-tests.yml
parameters:
designerSourcePath: $(System.DefaultWorkingDirectory)\UITools\src

- stage: bcl_tests
displayName: BCL Emulator Tests
dependsOn: mac_build
Expand Down
1 change: 0 additions & 1 deletion build-tools/installers/create-installers.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<LegacyMSBuildSrcDir>$(XAInstallPrefix)xbuild\Xamarin\Android\</LegacyMSBuildSrcDir>
<MSBuildTargetsSrcDir>$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\MSBuild\Xamarin\Android</MSBuildTargetsSrcDir>
<DefaultRuntimeEntitlementsPath>$(MSBuildThisFileDirectory)\..\create-pkg\runtime-entitlements.plist</DefaultRuntimeEntitlementsPath>
<FirstInstallerFrameworkVersion Condition="Exists('$(FrameworkSrcDir)\$(AndroidFirstFrameworkVersion)')">$(AndroidFirstFrameworkVersion)</FirstInstallerFrameworkVersion>
<FirstInstallerFrameworkVersion Condition="'$(FirstInstallerFrameworkVersion)' == ''">$(AndroidLatestStableFrameworkVersion)</FirstInstallerFrameworkVersion>
<BclFrameworkVersion>v1.0</BclFrameworkVersion>
<LibExtension Condition=" '$(HostOS)' == 'Darwin' ">dylib</LibExtension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ class BuildAndroidPlatforms
new AndroidPlatform (apiName: "Jelly Bean", apiLevel: 16, platformID: "16", include: "v4.1"),
new AndroidPlatform (apiName: "Jelly Bean", apiLevel: 17, platformID: "17", include: "v4.2"),
new AndroidPlatform (apiName: "Jelly Bean", apiLevel: 18, platformID: "18", include: "v4.3"),
new AndroidPlatform (apiName: "Kit Kat", apiLevel: 19, platformID: "19", include: "v4.4", framework: "v4.4"),
new AndroidPlatform (apiName: "Kit Kat + Wear support", apiLevel: 20, platformID: "20", include: "v4.4.87", framework: "v4.4.87"),
new AndroidPlatform (apiName: "Lollipop", apiLevel: 21, platformID: "21", include: "v5.0", framework: "v5.0"),
new AndroidPlatform (apiName: "Lollipop", apiLevel: 22, platformID: "22", include: "v5.1", framework: "v5.1"),
new AndroidPlatform (apiName: "Marshmallow", apiLevel: 23, platformID: "23", include: "v6.0", framework: "v6.0"),
new AndroidPlatform (apiName: "Nougat", apiLevel: 24, platformID: "24", include: "v7.0", framework: "v7.0"),
new AndroidPlatform (apiName: "Nougat", apiLevel: 25, platformID: "25", include: "v7.1", framework: "v7.1"),
new AndroidPlatform (apiName: "Oreo", apiLevel: 26, platformID: "26", include: "v8.0", framework: "v8.0"),
new AndroidPlatform (apiName: "Oreo", apiLevel: 27, platformID: "27", include: "v8.1", framework: "v8.1"),
new AndroidPlatform (apiName: "Pie", apiLevel: 28, platformID: "28", include: "v9.0", framework: "v9.0"),
new AndroidPlatform (apiName: "Q", apiLevel: 29, platformID: "29", include: "v10.0", framework: "v10.0"),
new AndroidPlatform (apiName: "R", apiLevel: 30, platformID: "30", include: "v11.0", framework: "v11.0"),
new AndroidPlatform (apiName: "S", apiLevel: 31, platformID: "31", include: "v12.0", framework: "v12.0"),
new AndroidPlatform (apiName: "Sv2", apiLevel: 32, platformID: "32", include: "v12.1", framework: "v12.1"),
new AndroidPlatform (apiName: "Kit Kat", apiLevel: 19, platformID: "19", include: "v4.4"),
new AndroidPlatform (apiName: "Kit Kat + Wear support", apiLevel: 20, platformID: "20", include: "v4.4.87"),
new AndroidPlatform (apiName: "Lollipop", apiLevel: 21, platformID: "21", include: "v5.0"),
new AndroidPlatform (apiName: "Lollipop", apiLevel: 22, platformID: "22", include: "v5.1"),
new AndroidPlatform (apiName: "Marshmallow", apiLevel: 23, platformID: "23", include: "v6.0"),
new AndroidPlatform (apiName: "Nougat", apiLevel: 24, platformID: "24", include: "v7.0"),
new AndroidPlatform (apiName: "Nougat", apiLevel: 25, platformID: "25", include: "v7.1"),
new AndroidPlatform (apiName: "Oreo", apiLevel: 26, platformID: "26", include: "v8.0"),
new AndroidPlatform (apiName: "Oreo", apiLevel: 27, platformID: "27", include: "v8.1"),
new AndroidPlatform (apiName: "Pie", apiLevel: 28, platformID: "28", include: "v9.0"),
new AndroidPlatform (apiName: "Q", apiLevel: 29, platformID: "29", include: "v10.0"),
new AndroidPlatform (apiName: "R", apiLevel: 30, platformID: "30", include: "v11.0"),
new AndroidPlatform (apiName: "S", apiLevel: 31, platformID: "31", include: "v12.0"),
new AndroidPlatform (apiName: "Sv2", apiLevel: 32, platformID: "32", include: "v12.1"),
new AndroidPlatform (apiName: "Tiramisu", apiLevel: 33, platformID: "33", include: "v13.0", framework: "v13.0"),
};

Expand Down