Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/v0.3.2' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RLittlesII committed Feb 16, 2019
2 parents 8986dba + b2e12e3 commit fd13366
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Xamarin.Recipe is a set of convention based scripts for building and deploying X

|dev|main|
|:--:|:--:|
[![Build status](https://ci.appveyor.com/api/projects/status/mbn32rx9rc874dqm/branch/dev?svg=true)](https://ci.appveyor.com/project/RocketSurgeonsGuild/xamarin-recipe/branch/dev)|[![Build status](https://ci.appveyor.com/api/projects/status/mbn32rx9rc874dqm/branch/main?svg=true)](https://ci.appveyor.com/project/RocketSurgeonsGuild/xamarin-recipe/branch/main)|
[![Build status](https://ci.appveyor.com/api/projects/status/mbn32rx9rc874dqm/branch/dev?svg=true)](https://ci.appveyor.com/project/RocketSurgeonsGuild/xamarin-recipe/branch/dev)|[![Build status](https://ci.appveyor.com/api/projects/status/mbn32rx9rc874dqm/branch/main?svg=true)](https://ci.appveyor.com/project/RocketSurgeonsGuild/xamarin-recipe/branch/main)|
[![Build Status](https://dev.azure.com/rocketsurgeonsguild/Libraries/_apis/build/status/RSG.Xamarin.Recipe?branchName=dev)](https://dev.azure.com/rocketsurgeonsguild/Libraries/_build/latest?definitionId=25&branchName=dev)|[![Build Status](https://dev.azure.com/rocketsurgeonsguild/Libraries/_apis/build/status/RSG.Xamarin.Recipe?branchName=main)](https://dev.azure.com/rocketsurgeonsguild/Libraries/_build/latest?definitionId=25&branchName=main)
4 changes: 2 additions & 2 deletions Xamarin.Recipe/Content/android.cake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Task("Android-Manifest")
var manifest = DeserializeAppManifest(BuildParameters.AndroidManifest);

manifest.VersionName = BuildParameters.Version.Version;
manifest.VersionCode = Convert.ToInt32(BuildParameters.Version.BuildMetaData);
manifest.VersionCode = BuildParameters.BuildNumber == 0 ? manifest.VersionCode ++ : BuildParameters.BuildNumber;

Verbose("Version Name: {0}", BuildParameters.Version.Version);
Verbose("Version Code: {0}", BuildParameters.Version.PreReleaseNumber);
Expand Down Expand Up @@ -125,4 +125,4 @@ Task("Upload-AzureDevOps-Apk")
Verbose("Apk Path: {0}", apk.FullPath);

BuildSystem.TFBuild.Commands.UploadArtifact(artifactPath.ToString(), apk, apk.GetFilename().ToString());
});
});
2 changes: 1 addition & 1 deletion Xamarin.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public class Builder

private static void Setup()
{
if(!BuildParameters.IsDotNetCoreBuild)
if(BuildParameters.ShouldRunxUnit)
{
BuildParameters.Tasks.TestTask.IsDependentOn("xUnit-Tests");
}
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Recipe/Content/ios.cake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Task("iPhone-Info-Plist")
Verbose("CFBundleShortVersionString: {0}", BuildParameters.Version.Version);
Verbose("CFBundleVersion: {0}", BuildParameters.Version.PreReleaseNumber);
plist["CFBundleShortVersionString"] = BuildParameters.Version.Version;
plist["CFBundleVersion"] = BuildParameters.Version.BuildMetaData;
plist["CFBundleVersion"] = BuildParameters.BuildNumber == 0 ? BuildParameters.Version.BuildMetaData : BuildParameters.BuildNumber.ToString();

var bundleIdentifier = EnvironmentVariable(Environment.BundleIdentifierVariable);
if(!string.IsNullOrEmpty(bundleIdentifier))
Expand Down
9 changes: 9 additions & 0 deletions Xamarin.Recipe/Content/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ public static class BuildParameters
public static bool IsNuGetBuild { get; set; }
public static bool TransifexEnabled { get; set; }
public static bool PrepareLocalRelease { get; set; }

public static int BuildNumber { get; private set; }

public static bool ShouldRunGitVersion { get; private set; }
public static bool ShouldDeployAppCenter { get; private set; }
public static bool ShouldRunFastlaneDeliver { get; private set; }
public static bool ShouldRunFastlaneMatch { get; private set; }
public static bool ShouldCopyImages { get; private set; }
public static bool ShouldRunxUnit { get; private set; }
public static bool ShouldRunUnitTests { get; private set; }

public static BuildVersion Version { get; private set; }
public static BuildPaths Paths { get; private set; }
Expand Down Expand Up @@ -91,7 +94,9 @@ public static class BuildParameters
bool shouldDeployAppCenter = false,
bool shouldCopyImages = false,
bool? shouldRunxUnit = null,
bool? shouldRunUnitTests = null,
bool shouldRunFastlaneMatch = false,
int buildNumber = 0,
string mainBranch = "main",
string devBranch = "dev",
FilePath androidManifest = null,
Expand Down Expand Up @@ -162,9 +167,13 @@ public static class BuildParameters

ShouldRunxUnit = shouldRunxUnit ?? !IsDotNetCoreBuild;

ShouldRunUnitTests = shouldRunUnitTests ?? context.GetFiles(UnitTestFilePattern).All(x => x != null);

ShouldRunFastlaneDeliver = context.DirectoryExists(BuildParameters.Paths.Directories.Metadata) && (IsReleaseBranch || IsHotFixBranch || (IsMainBranch && IsTagged));

ShouldRunFastlaneMatch = IsiOSBuild && IsRunningOnUnix && shouldRunFastlaneMatch;

BuildNumber = buildNumber;
}

public static void SetBuildVersion(BuildVersion version)
Expand Down
1 change: 1 addition & 0 deletions Xamarin.Recipe/Content/test.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Task("Unit-Test")
.WithCriteria(() => BuildParameters.ShouldRunUnitTests)
.Does(() =>
{
Verbose("Executing Unit Tests");
Expand Down
4 changes: 2 additions & 2 deletions Xamarin.Recipe/Content/version.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

public class BuildMetaData
{
public static string Date { get; } = "2018-12-12 02:36:45";
public static string Version { get; } = "0.3.0-cake-recipe0038";
public static string Date { get; } = "2019-02-15 04:45:40";
public static string Version { get; } = "0.4.0-pipelines0004";
}
26 changes: 26 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
trigger:
branches:
include:
- dev
- main
- feature/*
- release/*
- hotfix/*
pr:
autoCancel: true
branches:
include:
- dev

pool:
vmImage: 'vs2017-win2016'

steps:
- task: DotNetCoreInstaller@0
displayName: 'dotnet install'
inputs:
packageType: 'sdk' # Options: runtime, sdk
version: '2.2.100'

- powershell: '.\build.ps1 -t AzureDevOps'
displayName: 'cake build'
4 changes: 2 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ Param(
[string[]]$ScriptArgs
)

$CakeVersion = "0.29.0"
$CakeVersion = "0.32.1"
$DotNetChannel = "preview";
$DotNetVersion = "2.1.101";
$DotNetVersion = "2.2.100";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

Expand Down
16 changes: 15 additions & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:https://ci.appveyor.com/nuget/cake-recipe?package=Cake.Recipe&version=0.3.0-unstable0441
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&prerelease

Environment.SetVariableNames();

Expand Down Expand Up @@ -41,4 +41,18 @@ Task("Generate-Version-File")
);
});

Task("UploadAzureDevOpsArtifacts")
.WithCriteria(() => TFBuild.IsRunningOnVSTS)
.Does(() =>
{
BuildSystem
.TFBuild
.Commands
.UploadArtifactDirectory(BuildParameters.Paths.Directories.NuGetPackages.MakeAbsolute(Context.Environment).FullPath, "Packages");
});

Task("AzureDevOps")
.IsDependentOn("Publish-MyGet-Packages")
.IsDependentOn("UploadAzureDevOpsArtifacts");

Build.RunNuGet();

0 comments on commit fd13366

Please sign in to comment.