-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: add additional iOS archive method (#658)
Added ICanArchiveiOS Added IHaveEnableRestore Added IsNotRunningOnAzurePipelines Removed dependency on IHaveTestTarget from ICanPackXamariniOS
- Loading branch information
1 parent
e3d0f7b
commit eaaeb7c
Showing
4 changed files
with
120 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace Rocket.Surgery.Nuke; | ||
|
||
/// <summary> | ||
/// Defines a value whether to enable restore. | ||
/// </summary> | ||
public interface IHaveEnableRestore : IHave | ||
{ | ||
/// <summary> | ||
/// A value indicating whether to enable restoring for a given target | ||
/// </summary> | ||
[Parameter("A value indicating whether to enable restoring for a given target", Name = "EnableRestore")] | ||
public bool EnableRestore => EnvironmentInfo.GetVariable<bool?>("EnableRestore") | ||
?? TryGetValue<bool?>(() => EnableRestore) | ||
?? false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Nuke.Common.Tools.MSBuild; | ||
using static Nuke.Common.Tools.MSBuild.MSBuildTasks; | ||
|
||
#pragma warning disable CA1304 | ||
// ReSharper disable InconsistentNaming | ||
// ReSharper disable once CheckNamespace | ||
namespace Rocket.Surgery.Nuke.Xamarin | ||
{ | ||
/// <summary> | ||
/// archives a binary. | ||
/// </summary> | ||
public interface ICanArchiveiOS : IHavePackTarget, | ||
IHaveConfiguration, | ||
IHaveOutputLogs, | ||
IHaveGitVersion, | ||
IHaveSolution, | ||
IHaveiOSTargetPlatform, | ||
IHaveEnableRestore, | ||
ICan | ||
{ | ||
/// <summary> | ||
/// packages a binary for distribution. | ||
/// </summary> | ||
public Target ArchiveIpa => _ => _.OnlyWhenStatic(() => EnvironmentInfo.Platform == PlatformFamily.OSX) | ||
.Executes( | ||
() => | ||
MSBuild( | ||
settings => | ||
settings.SetSolutionFile(Solution) | ||
.SetRestore(EnableRestore) | ||
.SetProperty("Platform", iOSTargetPlatform) | ||
.SetProperty("BuildIpa", "true") | ||
.SetProperty("ArchiveOnBuild", "true") | ||
.SetConfiguration(Configuration) | ||
.SetDefaultLoggers(LogsDirectory / "package.log") | ||
.SetGitVersionEnvironment(GitVersion) | ||
.SetAssemblyVersion(GitVersion?.AssemblySemVer) | ||
.SetPackageVersion(GitVersion?.NuGetVersionV2) | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters