diff --git a/.travis.yml b/.travis.yml index d76efdb6..1232fedb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,4 +19,5 @@ before_script: script: - git fetch --unshallow --tags - - ./build.sh --linksources=true --verbosity=verbose + # disengage core only switch because mono ships .NETFramework targets + - ./build.sh --coreonly=false --linksources=true --verbosity=verbose diff --git a/Octokit.Reactive/Octokit.Reactive.csproj b/Octokit.Reactive/Octokit.Reactive.csproj index 33b4f859..3833185d 100644 --- a/Octokit.Reactive/Octokit.Reactive.csproj +++ b/Octokit.Reactive/Octokit.Reactive.csproj @@ -6,7 +6,9 @@ GitHub 0.0.0-dev true - netstandard1.1;net45 + False + netstandard1.1 + $(TargetFrameworks);net45 1.6.0 Octokit.Reactive Octokit.Reactive diff --git a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj index 9ec5bb01..2984b59b 100644 --- a/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj +++ b/Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj @@ -4,7 +4,9 @@ Convention-based tests for Octokit Octokit.Tests.Conventions GitHub - netcoreapp2.0;net452 + False + netcoreapp2.0 + $(TargetFrameworks);net452 $(NoWarn);CS4014;CS1998 Octokit.Tests.Conventions Octokit.Tests.Conventions diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj index c38f3269..1c08cbaf 100644 --- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj +++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj @@ -4,7 +4,9 @@ Integration tests for Octokit Octokit.Tests.Integration GitHub - netcoreapp2.0;net452 + False + netcoreapp2.0 + $(TargetFrameworks);net452 $(NoWarn);CS4014;CS1998 Octokit.Tests.Integration Octokit.Tests.Integration diff --git a/Octokit.Tests/Octokit.Tests.csproj b/Octokit.Tests/Octokit.Tests.csproj index d53e8bef..73afcd31 100644 --- a/Octokit.Tests/Octokit.Tests.csproj +++ b/Octokit.Tests/Octokit.Tests.csproj @@ -4,7 +4,9 @@ Tests for Octokit Octokit.Tests GitHub - netcoreapp2.0;net452 + False + netcoreapp2.0 + $(TargetFrameworks);net452 $(NoWarn);CS4014;CS1998 Octokit.Tests Octokit.Tests diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj index a8e824d5..8d8e5df1 100644 --- a/Octokit/Octokit.csproj +++ b/Octokit/Octokit.csproj @@ -6,7 +6,9 @@ GitHub 0.0.0-dev true - netstandard1.1;net45 + False + netstandard1.1 + $(TargetFrameworks);net45 1.6.0 Octokit Octokit diff --git a/build/Context.cs b/build/Context.cs index 12f6cb43..0b224f31 100644 --- a/build/Context.cs +++ b/build/Context.cs @@ -24,6 +24,8 @@ public class Context : FrostingContext public bool AppVeyor { get; set; } public bool TravisCI { get; set; } + public bool CoreOnly { get; set; } + public Project[] Projects { get; set; } public DotNetCoreTestSettings GetTestSettings() diff --git a/build/Lifetime.cs b/build/Lifetime.cs index b899a09d..acf2af1b 100644 --- a/build/Lifetime.cs +++ b/build/Lifetime.cs @@ -12,6 +12,7 @@ public class Lifetime : FrostingLifetime context.Target = context.Argument("target", "Default"); context.Configuration = context.Argument("configuration", "Release"); context.LinkSources = context.Argument("linkSources", false); + context.CoreOnly = context.Argument("CoreOnly", !context.IsRunningOnWindows()); context.Artifacts = "./packaging/"; @@ -19,6 +20,11 @@ public class Lifetime : FrostingLifetime var buildSystem = context.BuildSystem(); context.IsLocalBuild = buildSystem.IsLocalBuild; + if (context.CoreOnly && !context.IsLocalBuild) + { + context.Warning("CoreOnly was specified on a non-local build. Artifacts may be versioned incorrectly!"); + } + context.AppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor; context.TravisCI = buildSystem.TravisCI.IsRunningOnTravisCI; context.IsTagged = IsBuildTagged(buildSystem); @@ -50,9 +56,16 @@ public class Lifetime : FrostingLifetime }; // Install tools - context.Information("Installing tools..."); - ToolInstaller.Install(context, "GitVersion.CommandLine", "3.6.2"); - ToolInstaller.Install(context, "Octokit.CodeFormatter", "1.0.0-preview"); + if (context.CoreOnly) + { + context.Information("Skipping tool installation for core-only build"); + } + else + { + context.Information("Installing tools..."); + ToolInstaller.Install(context, "GitVersion.CommandLine", "3.6.2"); + ToolInstaller.Install(context, "Octokit.CodeFormatter", "1.0.0-preview"); + } // Calculate semantic version. context.Version = BuildVersion.Calculate(context); @@ -63,6 +76,7 @@ public class Lifetime : FrostingLifetime context.Information("Version suffix: {0}", context.Version.Suffix); context.Information("Configuration: {0}", context.Configuration); context.Information("LinkSources: {0}", context.LinkSources); + context.Information("CoreOnly: {0}", context.CoreOnly); context.Information("Target: {0}", context.Target); context.Information("AppVeyor: {0}", context.AppVeyor); context.Information("TravisCI: {0}", context.TravisCI); diff --git a/build/Tasks/Build.cs b/build/Tasks/Build.cs index 68035fc0..99f4d8b7 100644 --- a/build/Tasks/Build.cs +++ b/build/Tasks/Build.cs @@ -14,6 +14,7 @@ public class Build : FrostingTask ArgumentCustomization = args => args .Append("/p:Version={0}", context.Version.GetSemanticVersion()) .Append("/p:SourceLinkCreate={0}", context.LinkSources.ToString().ToLower()) + .Append("/p:CoreOnly={0}", context.CoreOnly), }); } } \ No newline at end of file diff --git a/build/Tasks/FormatCode.cs b/build/Tasks/FormatCode.cs index 57f44b94..84f7528e 100644 --- a/build/Tasks/FormatCode.cs +++ b/build/Tasks/FormatCode.cs @@ -40,7 +40,9 @@ public sealed class FormatCode : FrostingTask public override bool ShouldRun(Context context) { - return context.IsRunningOnWindows(); + // Core only builds do not download the formatter exe + // Only windows is guaranteed to be able to run exe files in the first place + return context.IsRunningOnWindows() && !context.CoreOnly; } private static string CreateTempCsproj(Context context, string projectName) diff --git a/build/Tasks/Package.cs b/build/Tasks/Package.cs index 34f42352..f3b362cf 100644 --- a/build/Tasks/Package.cs +++ b/build/Tasks/Package.cs @@ -21,7 +21,9 @@ public sealed class Package : FrostingTask Configuration = context.Configuration, NoBuild = true, OutputDirectory = context.Artifacts, - ArgumentCustomization = args => args.Append("/p:Version={0}", context.Version.GetSemanticVersion()) + ArgumentCustomization = args => args + .Append("/p:Version={0}", context.Version.GetSemanticVersion()) + .Append("/p:CoreOnly={0}", context.CoreOnly), }); } } diff --git a/build/Utilities/BuildVersion.cs b/build/Utilities/BuildVersion.cs index e945b1a8..07e9ba94 100644 --- a/build/Utilities/BuildVersion.cs +++ b/build/Utilities/BuildVersion.cs @@ -29,10 +29,13 @@ public class BuildVersion public static BuildVersion Calculate(Context context) { - string version = null; - string semVersion = null; - context.Information("Calculating semantic version..."); + if (context.CoreOnly) + { + context.Information("Skipping GitVersion query for local build"); + return new BuildVersion("0.0.0", "dev"); + } + if (!context.IsLocalBuild) { // Run to set the version properties inside the CI server @@ -42,8 +45,8 @@ public class BuildVersion // Run in interactive mode to get the properties for the rest of the script var assertedversions = GitVersionRunner.Run(context, GitVersionOutput.Json); - version = assertedversions.MajorMinorPatch; - semVersion = assertedversions.LegacySemVerPadded; + var version = assertedversions.MajorMinorPatch; + var semVersion = assertedversions.LegacySemVerPadded; if (string.IsNullOrWhiteSpace(version)) {