Skip to content

Commit

Permalink
cake-buildGH-2014: Allow multiple NugetFeeds for InProcess-NugetClient
Browse files Browse the repository at this point in the history
  • Loading branch information
Insire committed Mar 3, 2018
1 parent c0f0229 commit 88e07e9
Show file tree
Hide file tree
Showing 70 changed files with 445 additions and 471 deletions.
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Expand Up @@ -5,7 +5,6 @@ stages:
build_job:
stage: build
script:
- ln -s /usr/share/dotnet .dotnet
- mkdir tools
- ln -s /opt/nuget/nuget.exe ./tools
- cake build.cake --target="Run-Unit-Tests"
8 changes: 8 additions & 0 deletions ReleaseNotes.md
@@ -1,3 +1,11 @@
### New in 0.26.1 (Released 2018/03/03)

* 2063 Cake running on Mono can't load netstandard 2.0 assembly

### New in 0.26.0 (Released 2018/02/26)

* 1781 Update to .NET Core 2

### New in 0.25.0 (Released 2018/01/17)

* 1995 Make In-proc NuGet addin/tool installation default
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
@@ -1,4 +1,5 @@
# Build script
image: Visual Studio 2017
init:
- git config --global core.autocrlf true

Expand Down
1 change: 0 additions & 1 deletion bitbucket-pipelines.yml
Expand Up @@ -5,7 +5,6 @@ pipelines:
default:
- step:
script:
- ln -s /opt/dotnet .dotnet
- mkdir tools
- ln -s /opt/nuget/nuget.exe ./tools
- cake --target="Run-Unit-Tests"
39 changes: 32 additions & 7 deletions build.cake
Expand Up @@ -4,7 +4,7 @@
#addin "nuget:https://api.nuget.org/v3/index.json?package=Cake.Gitter&version=0.7.0"

// Install tools.
#tool "nuget:https://api.nuget.org/v3/index.json?package=gitreleasemanager&version=0.5.0"
#tool "nuget:https://api.nuget.org/v3/index.json?package=gitreleasemanager&version=0.7.0"
#tool "nuget:https://api.nuget.org/v3/index.json?package=GitVersion.CommandLine&version=3.6.2"
#tool "nuget:https://api.nuget.org/v3/index.json?package=coveralls.io&version=1.3.4"
#tool "nuget:https://api.nuget.org/v3/index.json?package=OpenCover&version=4.6.519"
Expand Down Expand Up @@ -139,6 +139,7 @@ Task("Build")
DotNetCoreBuild(path.FullPath, new DotNetCoreBuildSettings()
{
Configuration = parameters.Configuration,
NoRestore = true,
MSBuildSettings = msBuildSettings
});
});
Expand All @@ -150,8 +151,29 @@ Task("Run-Unit-Tests")
var projects = GetFiles("./src/**/*.Tests.csproj");
foreach(var project in projects)
{
DotNetCoreTool(project,
"xunit", "--no-build -noshadow -configuration " + parameters.Configuration);
// .NET Core
DotNetCoreTest(project.ToString(), new DotNetCoreTestSettings
{
Framework = "netcoreapp2.0",
NoBuild = true,
NoRestore = true,
Configuration = parameters.Configuration
});
// .NET Framework/Mono
// Total hack, but gets the work done.
var framework = "net46";
if(project.ToString().EndsWith("Cake.Tests.csproj")) {
framework = "net461";
}
DotNetCoreTest(project.ToString(), new DotNetCoreTestSettings
{
Framework = framework,
NoBuild = true,
NoRestore = true,
Configuration = parameters.Configuration
});
}
});

Expand All @@ -163,6 +185,7 @@ Task("Copy-Files")
DotNetCorePublish("./src/Cake", new DotNetCorePublishSettings
{
Framework = "net461",
NoRestore = true,
VersionSuffix = parameters.Version.DotNetAsterix,
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.ArtifactsBinFullFx,
Expand All @@ -172,19 +195,20 @@ Task("Copy-Files")
// .NET Core
DotNetCorePublish("./src/Cake", new DotNetCorePublishSettings
{
Framework = "netcoreapp1.0",
Framework = "netcoreapp2.0",
NoRestore = true,
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.ArtifactsBinNetCore,
MSBuildSettings = msBuildSettings
});
// Copy license
CopyFileToDirectory("./LICENSE", parameters.Paths.Directories.ArtifactsBinFullFx);
CopyFileToDirectory("./LICENSE", parameters.Paths.Directories.ArtifactsBinNetCore);
CopyFileToDirectory("./LICENSE", parameters.Paths.Directories.ArtifactsBinFullFx);
CopyFileToDirectory("./LICENSE", parameters.Paths.Directories.ArtifactsBinNetCore);
// Copy Cake.XML (since publish does not do this anymore)
CopyFileToDirectory("./src/Cake/bin/" + parameters.Configuration + "/net461/Cake.xml", parameters.Paths.Directories.ArtifactsBinFullFx);
CopyFileToDirectory("./src/Cake/bin/" + parameters.Configuration + "/netcoreapp1.0/Cake.xml", parameters.Paths.Directories.ArtifactsBinNetCore);
CopyFileToDirectory("./src/Cake/bin/" + parameters.Configuration + "/netcoreapp2.0/Cake.xml", parameters.Paths.Directories.ArtifactsBinNetCore);
});

Task("Zip-Files")
Expand Down Expand Up @@ -243,6 +267,7 @@ Task("Create-NuGet-Packages")
Configuration = parameters.Configuration,
OutputDirectory = parameters.Paths.Directories.NugetRoot,
NoBuild = true,
NoRestore = true,
IncludeSymbols = true,
MSBuildSettings = msBuildSettings
});
Expand Down
7 changes: 5 additions & 2 deletions build.ps1
Expand Up @@ -31,12 +31,15 @@ Param(
[string[]]$ScriptArgs
)

$CakeVersion = "0.25.0"
$CakeVersion = "0.26.1"
$DotNetChannel = "Current";
$DotNetVersion = "1.1.7";
$DotNetVersion = "2.1.4";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

# Temporarily skip verification of addins.
$ENV:CAKE_SETTINGS_SKIPVERIFICATION='true'

# Make sure tools folder exists
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
$ToolPath = Join-Path $PSScriptRoot "tools"
Expand Down
7 changes: 5 additions & 2 deletions build.sh
Expand Up @@ -10,9 +10,12 @@ 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.25.0
CAKE_VERSION=0.26.1
CAKE_EXE=$TOOLS_DIR/Cake.$CAKE_VERSION/Cake.exe

# Temporarily skip verification of addins.
export CAKE_SETTINGS_SKIPVERIFICATION='true'

# Define default arguments.
TARGET="Travis"
CONFIGURATION="Release"
Expand Down Expand Up @@ -47,7 +50,7 @@ if [ ! -d "$SCRIPT_DIR/.dotnet" ]; then
mkdir "$SCRIPT_DIR/.dotnet"
fi
curl -Lsfo "$SCRIPT_DIR/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 1.1.7 --install-dir .dotnet --no-path
sudo bash "$SCRIPT_DIR/.dotnet/dotnet-install.sh" --version 2.1.4 --install-dir .dotnet --no-path
export PATH="$SCRIPT_DIR/.dotnet":$PATH
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
Expand Down
2 changes: 1 addition & 1 deletion build/paths.cake
Expand Up @@ -25,7 +25,7 @@ public class BuildPaths
var artifactsDir = (DirectoryPath)(context.Directory("./artifacts") + context.Directory("v" + semVersion));
var artifactsBinDir = artifactsDir.Combine("bin");
var artifactsBinFullFx = artifactsBinDir.Combine("net461");
var artifactsBinNetCore = artifactsBinDir.Combine("netcoreapp1.0");
var artifactsBinNetCore = artifactsBinDir.Combine("netcoreapp2.0");
var testResultsDir = artifactsDir.Combine("test-results");
var nugetRoot = artifactsDir.Combine("nuget");

Expand Down
8 changes: 5 additions & 3 deletions global.json
@@ -1,6 +1,8 @@
{
"projects": [ "src" ],
"projects": [
"src"
],
"sdk": {
"version": "1.1.7"
"version": "2.1.4"
}
}
}
10 changes: 5 additions & 5 deletions nuspec/Cake.CoreCLR.symbols.nuspec
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Cake.CoreCLR</id>
<version>0.0.0</version>
<authors>Patrik Svensson, Mattias Karlsson, Gary Ewan Park, Alistair Chapman, Martin Björkström and contributors</authors>
Expand All @@ -14,8 +14,8 @@
<tags>Cake Script Build</tags>
</metadata>
<files>
<file src="Cake.dll" target="lib/netstandard1.6" />
<file src="Cake.pdb" target="lib/netstandard1.6" />
<file src="Cake.xml" target="lib/netstandard1.6" />
<file src="Cake.dll" target="lib/netcoreapp2.0" />
<file src="Cake.pdb" target="lib/netcoreapp2.0" />
<file src="Cake.xml" target="lib/netcoreapp2.0" />
</files>
</package>
27 changes: 7 additions & 20 deletions src/Cake.Common.Tests/Cake.Common.Tests.csproj
@@ -1,57 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Cake.Common.Tests</AssemblyName>
<TargetFrameworks>net46;netcoreapp1.0</TargetFrameworks>
<PlatformTarget>anycpu</PlatformTarget>
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<IsCakeTestProject>true</IsCakeTestProject>
</PropertyGroup>

<!-- Import shared functionality -->
<Import Project="..\Shared.msbuild" />

<!-- Project references -->
<ItemGroup>
<ProjectReference Include="..\Cake.Core\Cake.Core.csproj" />
<ProjectReference Include="..\Cake.Common\Cake.Common.csproj" />
<ProjectReference Include="..\Cake.Testing\Cake.Testing.csproj" />
<ProjectReference Include="..\Cake.Testing.Xunit\Cake.Testing.Xunit.csproj" />
</ItemGroup>

<!-- Global packages -->
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta5-build3769" />
<PackageReference Include="Castle.Core" Version="4.2.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

<!-- .NET Framework packages -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Threading.Tasks" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<None Update=".\Properties\PropertyList-1.0.dtd">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
Expand All @@ -61,5 +49,4 @@
<Generator></Generator>
</EmbeddedResource>
</ItemGroup>

</Project>
</Project>
Expand Up @@ -782,7 +782,7 @@ public void Should_Return_The_Same_Configuration()

public sealed class TheSetTargetFrameworkMethod
{
private const string TargetFramework = "netstandard1.6";
private const string TargetFramework = "netstandard2.0";

[Fact]
public void Should_Set_Target_Framework()
Expand Down
8 changes: 4 additions & 4 deletions src/Cake.Common.Tests/Unit/XML/XmlTransformationTests.cs
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if !NETCORE
using System.IO;
using System.Linq;
using System.Text;
Expand All @@ -11,6 +10,7 @@
using Cake.Common.Xml;
using Cake.Core;
using Cake.Core.IO;
using Cake.Testing.Xunit;
using Xunit;

namespace Cake.Common.Tests.Unit.XML
Expand Down Expand Up @@ -182,7 +182,8 @@ public void Should_Transform_Xml_String_And_Xsl_String_To_Result_String_With_Xml
Assert.Equal(htm, result, ignoreLineEndingDifferences: true);
}

[Fact]
// this feels wrong to be CLR only
[RuntimeFact(TestRuntime.Clr)]
public void Should_Transform_Xml_String_And_Xsl_String_To_Result_String_With_Utf32Xml_Declaration()
{
// Given
Expand Down Expand Up @@ -241,5 +242,4 @@ public void Should_Throw_If_String_Settings_Was_Null()
}
}
}
}
#endif
}
42 changes: 13 additions & 29 deletions src/Cake.Common/Cake.Common.csproj
@@ -1,46 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Cake.Common</AssemblyName>
<TargetFrameworks>net46;netstandard1.6</TargetFrameworks>
<TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
<OutputType>Library</OutputType>
<PlatformTarget>AnyCpu</PlatformTarget>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<!-- Package specific metadata -->
<PropertyGroup>
<Description>Provides aliases (extension methods on Cake context) that support CI, build, unit tests, zip, signing, etc. for Cake.</Description>
</PropertyGroup>

<!-- Import shared functionality -->
<Import Project="..\Shared.msbuild" />

<!-- Project references -->
<ItemGroup>
<ProjectReference Include="..\Cake.Core\Cake.Core.csproj" />
</ItemGroup>

<!-- .NET Core packages -->
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<PackageReference Include="System.Xml.XmlDocument" Version="4.3.0" />
<PackageReference Include="System.Xml.XPath" Version="4.3.0" />
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Json" Version="4.3.0" />
<PackageReference Include="System.Xml.ReaderWriter" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
</ItemGroup>

<!-- .NET Framework packages -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Runtime.Serialization.Json" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

</Project>
<!-- .NET Framework packages -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
<Reference Include="System" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Runtime.Serialization.Json" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
</Project>

0 comments on commit 88e07e9

Please sign in to comment.