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.1' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
RLittlesII committed Jan 12, 2019
2 parents 71e4eb6 + d8a0ce6 commit 8986dba
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 17 deletions.
9 changes: 9 additions & 0 deletions Xamarin.Recipe/Content/addins.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
///////////////////////////////////////////////////////////////////////////////
// ADDINS
///////////////////////////////////////////////////////////////////////////////

#addin nuget:?package=Cake.AndroidAppManifest&version=1.1.0
#addin nuget:?package=Cake.AppCenter&version=1.1.0
#addin nuget:?package=Cake.Fastlane&version=0.4.1
#addin nuget:?package=Cake.Figlet&version=1.0.0
#addin nuget:?package=Cake.Plist&version=0.4.0
2 changes: 0 additions & 2 deletions Xamarin.Recipe/Content/android.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#addin nuget:?package=Cake.AndroidAppManifest&version=1.1.0

BuildParameters.Tasks.AndroidArchiveTask = Task("Android-Archive")
.IsDependentOn("Android-Build")
.IsDependentOn("Copy-Apk");
Expand Down
2 changes: 0 additions & 2 deletions Xamarin.Recipe/Content/appcenter.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#addin nuget:?package=Cake.AppCenter&version=1.1.0

BuildParameters.Tasks.AppCenterTask = Task("AppCenter")
.WithCriteria(() => BuildParameters.ShouldDeployAppCenter);

Expand Down
3 changes: 2 additions & 1 deletion Xamarin.Recipe/Content/azuredevops.cake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ BuildParameters.Tasks.PublishAzureDevOpsTestResultsTask = Task("Publish-AzureDev
Configuration = BuildParameters.Configuration,
TestRunTitle = "Unit Tests",
TestRunner = TFTestRunnerType.XUnit,
TestResultsFiles = new string[] { BuildParameters.Paths.Files.TestResultsFilePath.ToString() }
TestResultsFiles = new [] { BuildParameters.Paths.Files.TestResultsFilePath }
};

BuildSystem.TFBuild.Commands.PublishTestResults(testResultsData);
Expand All @@ -83,6 +83,7 @@ BuildParameters.Tasks.PublishAzureDevOpsTestResultsTask = Task("Publish-AzureDev
BuildParameters.Tasks.PublishAzureDevOpsCodeCoverageTask =
Task("Publish-AzureDevOps-Code-Coverage")
.WithCriteria(() => BuildParameters.IsRunningOnAzureDevOps)
.WithCriteria(() => ToolSettings.AzureDevOpsPublishCodeCoverageData != null)
.IsDependentOn("Publish-AzureDevOps-Test-Results")
.Does(() =>
{
Expand Down
4 changes: 3 additions & 1 deletion Xamarin.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
///////////////////////////////////////////////////////////////////////////////

Setup(context =>
{
{
Information(Figlet(BuildParameters.Title));

// Executed BEFORE the first task.
Information("Running tasks...");

Expand Down
2 changes: 0 additions & 2 deletions Xamarin.Recipe/Content/fastlane.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#addin nuget:?package=Cake.Fastlane&version=0.4.1

BuildParameters.Tasks.FastlaneTask = Task("Fastlane");

BuildParameters.Tasks.FastlaneDeliverTask =
Expand Down
2 changes: 0 additions & 2 deletions Xamarin.Recipe/Content/ios.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#addin nuget:?package=Cake.Plist&version=0.4.0

BuildParameters.Tasks.iOSArchiveTask = Task("iOS-Archive")
.WithCriteria(() => BuildParameters.IsRunningOnUnix)
.IsDependentOn("iPhone-Build")
Expand Down
16 changes: 13 additions & 3 deletions Xamarin.Recipe/Content/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@ public static class BuildParameters
public static bool IsTagged { get; private set; }
public static bool IsPublishBuild { get; private set; }
public static bool IsReleaseBuild { get; private set; }
public static bool ShouldRunGitVersion { get; private set; }
public static string AppCenterApiKey { get; private set; }
public static bool IsDotNetCoreBuild { get; set; }
public static bool IsiOSBuild { get; set; }
public static bool IsAndroidBuild { get; set; }
public static bool IsNuGetBuild { get; set; }
public static bool TransifexEnabled { get; set; }
public static bool PrepareLocalRelease { get; 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 BuildVersion Version { get; private set; }
public static BuildPaths Paths { get; private set; }
public static BuildTasks Tasks { get; set; }
Expand All @@ -45,6 +46,7 @@ public static class BuildParameters
public static FilePath AndroidManifest { get; private set; }
public static FilePath IOSProjectPath { get; private set; }
public static FilePath PlistFilePath { get; private set; }
public static string AppCenterApiKey { get; private set; }
public static string Platform { get; private set; }
public static DirectoryPath TestDirectoryPath { get; private set; }
public static FilePath IntegrationTestScriptPath { get; private set; }
Expand Down Expand Up @@ -151,7 +153,12 @@ public static class BuildParameters

SetBuildPaths(BuildPaths.GetPaths(context));

ShouldDeployAppCenter = ((!IsLocalBuild && !IsPullRequest && (IsMainBranch || IsReleaseBranch || IsDevBranch || IsHotFixBranch || IsTagged)) || shouldDeployAppCenter);
ShouldDeployAppCenter = (((!IsLocalBuild && !IsPullRequest && (IsMainBranch || IsReleaseBranch || IsDevBranch || IsHotFixBranch || IsTagged)) &&
((context.EnvironmentVariable(Environment.AppCenterTokenVariable) != null) &&
(context.EnvironmentVariable(Environment.AppCenterAppNameVariable) != null) &&
(context.EnvironmentVariable(Environment.AppCenterGroupVariable) != null) &&
(context.EnvironmentVariable(Environment.AppCenterOwnerVariable) != null))) ||
shouldDeployAppCenter);

ShouldRunxUnit = shouldRunxUnit ?? !IsDotNetCoreBuild;

Expand Down Expand Up @@ -199,6 +206,9 @@ public static class BuildParameters
context.Information("IOSProjectPath: {0}", IOSProjectPath);
context.Information("\n");

context.Information("ShouldDeployAppCenter: {0}", ShouldDeployAppCenter);
context.Information("\n");

context.Information("ShouldRunFastlaneMatch: {0}", ShouldRunFastlaneMatch);
context.Information("ShouldRunFastlaneDeliver: {0}", ShouldRunFastlaneDeliver);
context.Information("\n");
Expand Down
6 changes: 2 additions & 4 deletions Xamarin.Recipe/Content/toolsettings.cake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static class ToolSettings
Func<XUnit2Settings> xUnitSettings = null,
Action<FastlaneDeliverConfiguration> fastlaneDeliverConfigurator = null,
Action<FastlaneMatchConfiguration> fastlaneMatchConfigurator = null,
Action<TFBuildPublishCodeCoverageData> azureDevOpsPublishCodeCoverageData = null
Action<TFBuildPublishCodeCoverageData> azureDevOpsPublishCodeCoverageData = default(Action<TFBuildPublishCodeCoverageData>)
)
{
context.Information("Setting up tools...");
Expand Down Expand Up @@ -76,7 +76,7 @@ public static class ToolSettings
XUnitSettings = xUnitSettings ?? _xUnitSettings;
FastlaneDeliverConfigurator = fastlaneDeliverConfigurator ?? _defaultDeliverConfiguration;
FastlaneMatchConfigurator = fastlaneMatchConfigurator ?? _defaultMatchConfiguration;
AzureDevOpsPublishCodeCoverageData = azureDevOpsPublishCodeCoverageData ?? _defaultPublishCodeCoverageData;
AzureDevOpsPublishCodeCoverageData = azureDevOpsPublishCodeCoverageData;
}

private static Func<DotNetCoreTestSettings> _defaultDotNetTestSettings = () => new DotNetCoreTestSettings
Expand All @@ -97,8 +97,6 @@ public static class ToolSettings
NoAppDomain = true
};

private static Action<TFBuildPublishCodeCoverageData> _defaultPublishCodeCoverageData = data => { data = new TFBuildPublishCodeCoverageData(); };

private static Action<FastlaneDeliverConfiguration> _defaultDeliverConfiguration = cfg => { cfg = new FastlaneDeliverConfiguration(); };

private static Action<FastlaneMatchConfiguration> _defaultMatchConfiguration = cfg => { cfg = new FastlaneMatchConfiguration(); };
Expand Down

0 comments on commit 8986dba

Please sign in to comment.