Skip to content

Commit

Permalink
Build using .net core 3.0 (#5)
Browse files Browse the repository at this point in the history
* Build using .net core 3.0
* Only build master branch
* Make sure to build .net core 2 and 3 tools
* Fix the tests for new APIs
  • Loading branch information
mattleibow authored Sep 30, 2019
1 parent 8f6c1c3 commit f6ba76b
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 280 deletions.
10 changes: 0 additions & 10 deletions .appveyor.yml

This file was deleted.

4 changes: 4 additions & 0 deletions Mono.ApiTools.NuGetDiff.Tests/PackageComparerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,10 @@ public async Task TestMatchPortableUpgradeToNetStandard()
Assert.Equal("lib/portable-net45+win8+wpa81+wp8/SkiaSharp.dll", xStdAss.Attribute("old_path").Value);
var netStdFile = File.ReadAllText(Path.Combine(diffDir, "netstandard1.3", "SkiaSharp.dll.diff.md"));
var netFile = File.ReadAllText(Path.Combine(diffDir, "net45", "SkiaSharp.dll.diff.md"));

// replace the new .NET Standard type
netFile = netFile.Replace("System.IAsyncDisposable, System.IDisposable", "System.IDisposable");

Assert.Equal(netStdFile, netFile);
}

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ point to diff a NuGet package:
## Building

This project is very simple and can be built, packed and tested using
`msbuild` and `dotnet`. But, to do everything in a single step, there is
a cake script:
`msbuild` and `dotnet`. But, to do everything in a single step, there
is the .NET Core Cake tool ([`Cake.Tool`](https://www.nuget.org/packages/Cake.Tool)):

```
.\build.ps1
dotnet cake
```

## Using
Expand Down
2 changes: 1 addition & 1 deletion api-tools/api-tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;netcoreapp3.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<RootNamespace>Mono.ApiTools</RootNamespace>
<AssemblyName>api-tools</AssemblyName>
Expand Down
22 changes: 17 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
trigger:
- master

pool:
vmImage: 'windows-latest'
name: 'Hosted Windows 2019 with VS2019'

variables:
BUILD_NUMBER: $[counter('$(Build.SourceBranchName)_counter', 1)]
BASE_VERSION: 1.1.0
BUILD_NUMBER: $[counter(format('{0}_{1}', variables['BASE_VERSION'], variables['Build.SourceBranch']), 1)]
PACKAGE_VERSION: $(BASE_VERSION).$(BUILD_NUMBER)
CONFIGURATION: 'Release'
PACKAGE_VERSION: '1.0.2.$(BUILD_NUMBER)'
# BUILD_PRERELEASE: [true|false]
BUILD_PRERELEASE: true
CAKE_VERSION: 0.35.0
DOTNET_CORE_VERSION: 3.0.x

steps:
- powershell: .\build.ps1 --configuration="$(CONFIGURATION)" --packageVersion="$(PACKAGE_VERSION)"
- task: UseDotNet@2
inputs:
version: $(DOTNET_CORE_VERSION)
performMultiLevelLookup: true
- powershell: |
dotnet tool install -g cake.tool --version $(CAKE_VERSION)
- powershell: dotnet cake --configuration="$(CONFIGURATION)" --packageVersion="$(PACKAGE_VERSION)" --prerelease="$(BUILD_PRERELEASE)"
- task: PublishBuildArtifacts@1
inputs:
PathToPublish: output
Expand Down
10 changes: 5 additions & 5 deletions build.cake
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var prerelease = bool.Parse (Argument("prerelease", EnvironmentVariable ("BUILD_PRERELEASE") ?? "true"));
var prerelease = Argument("prerelease", true);

// a bit of logic to create the version number:
// - input = 1.2.3.4
// - package version = 1.2.3
// - preview package version = 1.2.3-preview-4
var version = Version.Parse(Argument("packageversion", EnvironmentVariable("BUILD_BUILDNUMBER") ?? EnvironmentVariable("APPVEYOR_BUILD_VERSION") ?? "1.0.0.0"));
// - preview package version = 1.2.3-preview.4
var version = Version.Parse(Argument("packageversion", "1.0.0.0"));
var previewNumber = version.Revision;
var assemblyVersion = $"{version.Major}.0.0.0";
var fileVersion = $"{version.Major}.{version.Minor}.{version.Build}.0";
var infoVersion = $"{version.Major}.{version.Minor}.{version.Build}.{version.Revision}";
var packageVersion = $"{version.Major}.{version.Minor}.{version.Build}";
var previewVersion = packageVersion + "-preview." + previewNumber;
var previewVersion = packageVersion + "-preview." + previewNumber;

Task("Build")
.Does(() =>
Expand Down Expand Up @@ -65,7 +65,7 @@ Task("Test")
});

Information("Running app tests...");
var app = $"api-tools/bin/{configuration}/netcoreapp2.2/api-tools.dll";
var app = $"api-tools/bin/{configuration}/netcoreapp3.0/api-tools.dll";
var id = "Mono.ApiTools.NuGetDiff";
var version = prerelease ? previewVersion : packageVersion;
DotNetCoreExecute(app, $"nuget-diff ./output/{id}.{version}.nupkg --latest --cache=externals --output=test-output");
Expand Down
256 changes: 0 additions & 256 deletions build.ps1

This file was deleted.

0 comments on commit f6ba76b

Please sign in to comment.