Skip to content

Commit

Permalink
Merge branch 'hotfix/0.21.1' into main
Browse files Browse the repository at this point in the history
* hotfix/0.21.1:
  (build) Updated version and release notes
  Made root path absolute for the AssemblyLoadContext.
  (GH-1685) Add DotNetCoreTool settings overload
  (build) Use DotNetCoreTool alias for tests
  (build) Updated Cake tool to version 0.21.0
  • Loading branch information
gep13 committed Jul 15, 2017
2 parents 57e16a7 + dd87e09 commit 9ff85bb
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 43 deletions.
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### New on 0.21.1 (Released 2017/07/15)

* 1685 Add DotNetCoreTool alias overload that takes DotNetCoreToolSettings parameter
* 1686 AssemblyLoadContext root path is relative

### New on 0.21.0 (Released 2017/07/14)

* 1533 Update DotNetCore Aliases to match tooling 1.0
Expand Down
45 changes: 14 additions & 31 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

BuildParameters parameters = BuildParameters.GetParameters(Context);
bool publishingError = false;
DotNetCoreMSBuildSettings msBuildSettings = null;

///////////////////////////////////////////////////////////////////////////////
// SETUP / TEARDOWN
Expand All @@ -41,6 +42,11 @@ Setup(context =>
parameters.Target,
parameters.Version.CakeVersion,
parameters.IsTagged);
msBuildSettings = new DotNetCoreMSBuildSettings()
.WithProperty("Version", parameters.Version.SemVersion)
.WithProperty("AssemblyVersion", parameters.Version.Version)
.WithProperty("FileVersion", parameters.Version.Version);
});

Teardown(context =>
Expand Down Expand Up @@ -98,17 +104,14 @@ Task("Restore-NuGet-Packages")
{
DotNetCoreRestore("./src/Cake.sln", new DotNetCoreRestoreSettings
{
Verbose = false,
Verbosity = DotNetCoreVerbosity.Minimal,
Sources = new [] {
"https://www.myget.org/F/xunit/api/v3/index.json",
"https://dotnet.myget.org/F/dotnet-core/api/v3/index.json",
"https://dotnet.myget.org/F/cli-deps/api/v3/index.json",
"https://api.nuget.org/v3/index.json",
},
ArgumentCustomization = args => args
.Append("/p:Version={0}", parameters.Version.SemVersion)
.Append("/p:AssemblyVersion={0}", parameters.Version.Version)
.Append("/p:FileVersion={0}", parameters.Version.Version)
MSBuildSettings = msBuildSettings
});
});

Expand All @@ -121,36 +124,19 @@ Task("Build")
DotNetCoreBuild(path.FullPath, new DotNetCoreBuildSettings()
{
Configuration = parameters.Configuration,
ArgumentCustomization = args => args
.Append("/p:Version={0}", parameters.Version.SemVersion)
.Append("/p:AssemblyVersion={0}", parameters.Version.Version)
.Append("/p:FileVersion={0}", parameters.Version.Version)
MSBuildSettings = msBuildSettings
});
});

Task("Run-Unit-Tests")
.IsDependentOn("Build")
.Does(() =>
{
// context.DotNetCoreTest($"{project.Path.FullPath}/{project.Name}.csproj", new DotNetCoreTestSettings()
// {
// Configuration = context.Configuration,
// NoBuild = true,
// Verbose = false
// });
var projects = GetFiles("./src/**/*.Tests.csproj");
foreach(var project in projects)
{
var exitCode = StartProcess("dotnet", new ProcessSettings {
Arguments = "xunit --no-build -noshadow -configuration " + parameters.Configuration,
WorkingDirectory = project.GetDirectory()
});
if (exitCode != 0)
{
throw new Exception(string.Format("dotnet xunit exited with code: {0}", exitCode));
}
DotNetCoreTool(project,
"xunit", "--no-build -noshadow -configuration " + parameters.Configuration);
}
});

Expand All @@ -165,7 +151,7 @@ Task("Copy-Files")
VersionSuffix = parameters.Version.DotNetAsterix,
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.ArtifactsBinNet45,
Verbose = false
Verbosity = DotNetCoreVerbosity.Minimal
});
// .NET Core
Expand All @@ -174,7 +160,7 @@ Task("Copy-Files")
Framework = "netcoreapp1.0",
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.ArtifactsBinNetCoreApp10,
Verbose = false
Verbosity = DotNetCoreVerbosity.Minimal
});
// Copy license
Expand Down Expand Up @@ -235,10 +221,7 @@ Task("Create-NuGet-Packages")
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.NugetRoot,
NoBuild = true,
ArgumentCustomization = args => args
.Append("/p:Version={0}", parameters.Version.SemVersion)
.Append("/p:AssemblyVersion={0}", parameters.Version.Version)
.Append("/p:FileVersion={0}", parameters.Version.Version)
MSBuildSettings = msBuildSettings
});
}
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Param(
[string[]]$ScriptArgs
)

$CakeVersion = "0.20.0"
$CakeVersion = "0.21.0"
$DotNetChannel = "preview";
$DotNetVersion = "1.0.4";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
TOOLS_DIR=$SCRIPT_DIR/tools
NUGET_EXE=$TOOLS_DIR/nuget.exe
NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
CAKE_VERSION=0.20.0
CAKE_VERSION=0.21.0
CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe

# Define default arguments.
Expand Down
37 changes: 31 additions & 6 deletions src/Cake.Common/Tools/DotNetCore/DotNetCoreAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ public static void DotNetCoreVSTest(this ICakeContext context, IEnumerable<FileP
/// /// Execute an .NET Core Extensibility Tool.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="project">The projects path.</param>
/// <param name="projectPath">The project path.</param>
/// <param name="command">The command to execute.</param>
/// <example>
/// <code>
Expand All @@ -1069,7 +1069,7 @@ public static void DotNetCoreVSTest(this ICakeContext context, IEnumerable<FileP
[CakeMethodAlias]
[CakeAliasCategory("Tool")]
[CakeNamespaceImport("Cake.Common.Tools.DotNetCore.Tool")]
public static void DotNetCoreTool(this ICakeContext context, string project, string command)
public static void DotNetCoreTool(this ICakeContext context, FilePath projectPath, string command)
{
if (context == null)
{
Expand All @@ -1078,17 +1078,15 @@ public static void DotNetCoreTool(this ICakeContext context, string project, str

var arguments = new ProcessArgumentBuilder();
var settings = new DotNetCoreToolSettings();
var projectPath = FilePath.FromString(project);

var runner = new DotNetCoreToolRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);
runner.Execute(projectPath, command, arguments, settings);
context.DotNetCoreTool(projectPath, command, arguments, settings);
}

/// <summary>
/// Execute an .NET Core Extensibility Tool.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="projectPath">The projects path.</param>
/// <param name="projectPath">The project path.</param>
/// <param name="command">The command to execute.</param>
/// <param name="arguments">The arguments.</param>
/// <example>
Expand All @@ -1107,6 +1105,33 @@ public static void DotNetCoreTool(this ICakeContext context, FilePath projectPat
}

var settings = new DotNetCoreToolSettings();

context.DotNetCoreTool(projectPath, command, arguments, settings);
}

/// <summary>
/// Execute an .NET Core Extensibility Tool.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="projectPath">The project path.</param>
/// <param name="command">The command to execute.</param>
/// <param name="arguments">The arguments.</param>
/// <param name="settings">The settings.</param>
/// <example>
/// <code>
/// DotNetCoreTool("./src/project", "xunit", "-xml report.xml");
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory("Tool")]
[CakeNamespaceImport("Cake.Common.Tools.DotNetCore.Tool")]
public static void DotNetCoreTool(this ICakeContext context, FilePath projectPath, string command, ProcessArgumentBuilder arguments, DotNetCoreToolSettings settings)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}

var runner = new DotNetCoreToolRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);

runner.Execute(projectPath, command, arguments, settings);
Expand Down
5 changes: 4 additions & 1 deletion src/Cake.Core/Polyfill/AssemblyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ public static Assembly LoadAssembly(ICakeEnvironment environment, IFileSystem fi
return Assembly.Load(new AssemblyName(path.FullPath));
}

// Make the path absolute.
path = path.MakeAbsolute(environment);

var loader = new CakeAssemblyLoadContext(fileSystem, path.GetDirectory());
return loader.LoadFromAssemblyPath(path.MakeAbsolute(environment).FullPath);
return loader.LoadFromAssemblyPath(path.FullPath);
#else
return Assembly.LoadFrom(path.FullPath);
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Reflection;

[assembly: AssemblyProduct("Cake")]
[assembly: AssemblyVersion("0.21.0.0")]
[assembly: AssemblyFileVersion("0.21.0.0")]
[assembly: AssemblyInformationalVersion("0.21.0-beta.1+0.Branch.release/0.21.0.Sha.edd75e172fccd18de5801b82446c103e040d4ff8")]
[assembly: AssemblyVersion("0.21.1.0")]
[assembly: AssemblyFileVersion("0.21.1.0")]
[assembly: AssemblyInformationalVersion("0.21.1-beta.1+6.Branch.hotfix/0.21.1.Sha.45cafa5cf6a410e04fff551683d4323cd97221c5")]
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]

0 comments on commit 9ff85bb

Please sign in to comment.