Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit d8a9412

Browse files
authored
Add a property to allow for preview packages (#173)
1 parent 1e220ec commit d8a9412

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

azure-pipelines.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ variables:
33
MONO_VERSION: 5_16_0
44
XCODE_VERSION: 10.1
55
VERBOSITY: minimal
6+
BUILD_NUMBER: $[counter('$(Build.SourceBranchName)_counter', 1)]
67

78
resources:
89
repositories:
@@ -50,15 +51,12 @@ jobs:
5051
# Run some internal auditing
5152
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }}:
5253
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
53-
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
5454
displayName: Component Detection - Log
5555
inputs:
5656
scanType: LogOnly
5757
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
58-
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
5958
displayName: Component Detection - Report
6059
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1
61-
condition: eq(variables['System.TeamProject'], 'devdiv')
6260
displayName: 'PoliCheck'
6361
inputs:
6462
targetType: F
@@ -72,7 +70,7 @@ jobs:
7270
name: VSEng-XamarinCustom
7371
demands:
7472
- corpnet
75-
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'],'refs/tags/'))
73+
condition: and(succeeded(), or(startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/AndroidX')))
7674
steps:
7775
# don't checkout code and sign the packages
7876
- checkout: none

build.cake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ var MONODROID_PATH = MONODROID_BASE_PATH.Combine(ANDROID_SDK_VERSION);
4848

4949
var ANDROIDX_MAPPER_EXE = MakeAbsolute ((FilePath)$"util/AndroidXMapper/AndroidXMapper/bin/{BUILD_CONFIG}/net47/AndroidXMapper.exe");
5050

51+
var BUILD_NUMBER = EnvironmentVariable("BUILD_NUMBER") ?? "";
52+
if (string.IsNullOrEmpty(BUILD_NUMBER)) {
53+
BUILD_NUMBER = "0";
54+
}
55+
5156
Information ("MONODROID_BASE_PATH: {0}", MONODROID_BASE_PATH);
5257
Information ("MONODROID_PATH: {0}", MONODROID_PATH);
5358
Information ("ANDROIDX_MAPPER_EXE: {0}", ANDROIDX_MAPPER_EXE);
59+
Information ("BUILD_NUMBER: {0}", BUILD_NUMBER);
5460

5561
// You shouldn't have to configure anything below here
5662
// ######################################################
@@ -110,6 +116,19 @@ Task("nuget")
110116
.IsDependentOn("libs")
111117
.Does(() =>
112118
{
119+
// package the stable release
120+
MSBuild ("./generated/AndroidX.sln", c => {
121+
c.Configuration = BUILD_CONFIG;
122+
c.MaxCpuCount = 0;
123+
c.Verbosity = VERBOSITY;
124+
c.Targets.Clear();
125+
c.Targets.Add("Pack");
126+
c.Properties.Add("PackageOutputPath", new [] { MakeAbsolute(new FilePath("./output")).FullPath });
127+
c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
128+
c.Properties.Add("DesignTimeBuild", new [] { "false" });
129+
c.Properties.Add("AndroidSdkBuildToolsVersion", new [] { "28.0.3" });
130+
});
131+
// package the preview release
113132
MSBuild ("./generated/AndroidX.sln", c => {
114133
c.Configuration = BUILD_CONFIG;
115134
c.MaxCpuCount = 0;
@@ -120,6 +139,7 @@ Task("nuget")
120139
c.Properties.Add("PackageRequireLicenseAcceptance", new [] { "true" });
121140
c.Properties.Add("DesignTimeBuild", new [] { "false" });
122141
c.Properties.Add("AndroidSdkBuildToolsVersion", new [] { "28.0.3" });
142+
c.Properties.Add("PackageVersionSuffix", new [] { "-preview-" + BUILD_NUMBER });
123143
});
124144

125145
var xmlns = (XNamespace)"http://schemas.microsoft.com/developer/msbuild/2003";

source/AndroidXProject.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=865352</PackageProjectUrl>
3131
<PackageLicenseUrl>https://go.microsoft.com/fwlink/?linkid=865381</PackageLicenseUrl>
3232
<PackageIconUrl>https://raw.githubusercontent.com/xamarin/AndroidSupportComponents/master/icons/@(Model.Name)_128x128.png</PackageIconUrl>
33-
<PackageVersion>@(Model.NuGetVersion)</PackageVersion>
33+
<PackageVersion>@(Model.NuGetVersion)$(PackageVersionSuffix)</PackageVersion>
3434
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
3535
</PropertyGroup>
3636

0 commit comments

Comments
 (0)