Skip to content

Commit

Permalink
update test apps and cake.frosting build to netcoreapp2.0 but keep li…
Browse files Browse the repository at this point in the history
…braries targeting netstandard1.1
  • Loading branch information
ryangribble committed Mar 17, 2018
1 parent 4e804f6 commit e9f5d99
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 179 deletions.
9 changes: 4 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ matrix:
- os: linux
dist: trusty
sudo: required
dotnet: 1.0.4
dotnet: 2.0.3
- os: osx
osx_image: xcode8
dotnet: 1.0.4
osx_image: xcode8.3
dotnet: 2.0.3

before_script:
- if test "$TRAVIS_OS_NAME" == "osx"; then export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5/; else export FrameworkPathOverride=/usr/lib/mono/4.5/; fi

script:
- git fetch --unshallow --tags
- dotnet --info
- ./build.sh --linksources=true
- ./build.sh --linksources=true --verbosity=verbose
9 changes: 3 additions & 6 deletions Octokit.Reactive/Octokit.Reactive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,14 @@

<ItemGroup>
<PackageReference Include="System.Reactive" Version="3.1.0" />
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.0" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.0" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.0" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.0" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.1.0" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.1.0" />
</ItemGroup>

</Project>
4 changes: 1 addition & 3 deletions Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
<Description>Convention-based tests for Octokit</Description>
<AssemblyTitle>Octokit.Tests.Conventions</AssemblyTitle>
<Authors>GitHub</Authors>
<TargetFrameworks>netcoreapp1.0;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
<NoWarn>$(NoWarn);CS4014;CS1998</NoWarn>
<AssemblyName>Octokit.Tests.Conventions</AssemblyName>
<PackageId>Octokit.Tests.Conventions</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
Expand Down
4 changes: 1 addition & 3 deletions Octokit.Tests.Integration/Octokit.Tests.Integration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
<Description>Integration tests for Octokit</Description>
<AssemblyTitle>Octokit.Tests.Integration</AssemblyTitle>
<Authors>GitHub</Authors>
<TargetFrameworks>netcoreapp1.0;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
<NoWarn>$(NoWarn);CS4014;CS1998</NoWarn>
<AssemblyName>Octokit.Tests.Integration</AssemblyName>
<PackageId>Octokit.Tests.Integration</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
Expand Down
8 changes: 3 additions & 5 deletions Octokit.Tests/Octokit.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
<Description>Tests for Octokit</Description>
<AssemblyTitle>Octokit.Tests</AssemblyTitle>
<Authors>GitHub</Authors>
<TargetFrameworks>netcoreapp1.0;net452</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net452</TargetFrameworks>
<NoWarn>$(NoWarn);CS4014;CS1998</NoWarn>
<AssemblyName>Octokit.Tests</AssemblyName>
<PackageId>Octokit.Tests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
Expand All @@ -31,10 +29,10 @@
<ItemGroup>
<ProjectReference Include="..\Octokit\Octokit.csproj" />
<ProjectReference Include="..\Octokit.Reactive\Octokit.Reactive.csproj" />
<PackageReference Include="NSubstitute" Version="2.0.2" />
<PackageReference Include="NSubstitute" Version="3.1.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<DefineConstants>$(DefineConstants);NO_SERIALIZABLE;HAS_TYPEINFO</DefineConstants>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions Octokit/Octokit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="SourceLink.Create.GitHub" Version="2.1.0" PrivateAssets="All" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.1.0" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.1.0" />
<PackageReference Include="SourceLink.Create.GitHub" Version="2.8.0" />
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.0" />
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.0" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ init:

build_script:
- dotnet --info
- ps: .\build.ps1 -LinkSources
- ps: .\build.ps1 -LinkSources -Verbosity Verbose

test: off

Expand Down
16 changes: 8 additions & 8 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ Param(
[string]$Configuration = "Release",
[switch]$LinkSources,
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose",
[string]$Verbosity = "Normal",
[switch]$WhatIf,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)

$DotNetChannel = "preview";
$DotNetVersion = "1.0.1";
$DotNetInstallerUri = "https://raw.githubusercontent.com/dotnet/cli/rel/1.0.1/scripts/obtain/dotnet-install.ps1";
$DotNetChannel = "2.0";
$DotNetVersion = "2.0.3";
$DotNetInstallerUri = "https://dot.net/v1/dotnet-install.ps1";
$NugetUrl = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"

# Make sure tools folder exists
Expand Down Expand Up @@ -65,7 +65,7 @@ if (Get-Command dotnet -ErrorAction SilentlyContinue) {
$FoundDotNetCliVersion = dotnet --version;
}

if($FoundDotNetCliVersion -ne $DotNetVersion) {
if($FoundDotNetCliVersion -lt $DotNetVersion) {
$InstallPath = Join-Path $PSScriptRoot ".dotnet"
if (!(Test-Path $InstallPath)) {
mkdir -Force $InstallPath | Out-Null;
Expand Down Expand Up @@ -106,14 +106,14 @@ $Arguments = @{
# Start Cake
Push-Location
Set-Location build
Write-Host "Restoring packages..."
Write-Host "Preparing Cake.Frosting build runner..."
Invoke-Expression "dotnet restore"
if($LASTEXITCODE -ne 0) {
Pop-Location;
exit $LASTEXITCODE;
}
Write-Host "Running build..."
Invoke-Expression "dotnet run -- $Arguments"
Write-Host "Running Cake.Frosting build runner..."
Invoke-Expression "dotnet run $Arguments"
if($LASTEXITCODE -ne 0) {
Pop-Location;
exit $LASTEXITCODE;
Expand Down
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
fi

cd build
echo "Preparing Cake.Frosting build runner..."
dotnet restore
dotnet run -- "$@"

echo "Executing Cake.Frosting build runner..."
dotnet run "$@"
19 changes: 12 additions & 7 deletions build/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
{
"version": "0.2.0",
"configurations": [
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}\\bin\\Debug\\netcoreapp1.0\\build.dll",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/Build.dll",
"args": [],
"cwd": "${workspaceRoot}",
"externalConsole": false,
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command.pickProcess}"
"processId": "${command:pickProcess}"
}
]
,]
}
13 changes: 6 additions & 7 deletions build/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"version": "0.1.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"${workspaceRoot}\\project.json"
"build",
"${workspaceFolder}/Build.csproj"
],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}
]
Expand Down
2 changes: 1 addition & 1 deletion build/Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion build/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public DotNetCoreTestSettings GetTestSettings()

if (!this.IsRunningOnWindows())
{
var testFramework = "netcoreapp1.0";
var testFramework = "netcoreapp2.0";

this.Information($"Running tests against {testFramework} only as we're not on Windows.");
settings.Framework = testFramework;
Expand Down
2 changes: 1 addition & 1 deletion build/Tasks/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public override void Run(Context context)
Configuration = context.Configuration,
ArgumentCustomization = args => args
.Append("/p:Version={0}", context.Version.GetSemanticVersion())
.AppendIfTrue(context.LinkSources, "/p:SourceLinkCreate=true")
.Append("/p:SourceLinkCreate={0}", context.LinkSources.ToString().ToLower())
});
}
}
127 changes: 0 additions & 127 deletions script/cibuild.ps1

This file was deleted.

0 comments on commit e9f5d99

Please sign in to comment.