Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix up build for netcore 3.1 #100

Merged
merged 4 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ log.txt
/docs/api/*.yml
/docs/api/.manifest
coverage.json
dotnet-install.ps1
7 changes: 6 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@
<PackageTags>semver;versioning;git</PackageTags>
<RepositoryUrl>https://github.com/Kieranties/SimpleVersion</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageIconUrl>https://raw.github.com/Kieranties/SimpleVersion/master/docs/img/logo.png</PackageIconUrl>
<PackageIcon>logo.png</PackageIcon>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>

<ItemGroup Label="Package Meta">
<None Include="logo.png" Condition="Exists('logo.png')" Pack="true" PackagePath="\" />
<None Include="$(MSBuildThisFileDirectory)shared\logo.png" Condition="!Exists('logo.png')" Pack="true" PackagePath="\" />
</ItemGroup>

<PropertyGroup Label="Build Attributes">
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
<TreatWarningsAsErrors Condition="'$(BuildingInsideVisualStudio)' != 'true'">true</TreatWarningsAsErrors>
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ variables:
jobs:
- job: Windows
pool:
vmImage: vs2017-win2016
vmImage: windows-2019
steps:

# Install nuget
Expand Down
31 changes: 18 additions & 13 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@
#>
param(
[ValidateSet('Debug', 'Release')]
[String]$Configuration = $env:Configuration,
[String]$Version = $env:Version,
[String]$Configuration = 'Debug',
[String]$Version = '1.0.0-local',
[String]$RootPath = $PSScriptRoot,
[String]$ArtifactsPath = (Join-Path $RootPath 'artifacts'),
[String]$DocsPath = (Join-Path $RootPath 'docs'),
[String]$PackagesPath = (Join-Path $RootPath 'packages'),
[Switch]$NoBuild,
[Switch]$BuildDocs,
[Switch]$ServeDocs,
[String]$DocfxVersion = '2.42.0'
[String]$DocfxVersion = '2.42.0',
[string]$DotnetInstallScript = 'https://dot.net/v1/dotnet-install.ps1',
[string]$DotnetLocalInstallScript = (Join-Path $PSScriptRoot 'dotnet-install.ps1')
)

# Ensure we have the latest LTS installed for the user before processing further
function CheckDotNet {
if(-not(Test-Path $DotnetLocalInstallScript)){
Invoke-WebRequest -Uri $DotnetInstallScript -OutFile $DotnetLocalInstallScript
}
. $DotnetLocalInstallScript
}

function exec([string]$cmd) {
$currentPref = $ErrorActionPreference
$ErrorActionPreference = 'Continue'
Expand All @@ -28,31 +38,26 @@ function exec([string]$cmd) {

$ErrorActionPreference = 'Stop'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
if(!$Configuration) {
$Configuration = 'Debug'
$env:Configuration = $Configuration
}
if(!$Version) {
$Version = '1.0.0-local'
$env:Version = $Version
}
if($ServeDocs) {
$BuildDocs = $true
}

CheckDotNet

# Build/Pack
Remove-Item $ArtifactsPath -Recurse -Force -ErrorAction Ignore
if(!$NoBuild) {
exec dotnet build
exec dotnet build --configuration $Configuration /p:Version=$Version
$distArtifacts = Join-Path $ArtifactsPath 'dist'
exec dotnet pack --no-restore --no-build -o $distArtifacts
exec dotnet pack --no-build --no-restore --configuration $Configuration --output $distArtifacts

# Unit Test
$testArtifacts = Join-Path $ArtifactsPath 'tests'
Get-ChildItem 'test' -Filter '*.csproj' -Recurse |
ForEach-Object {
$testArgs = @(
'--no-restore', '--no-build'
'--configuration', $Configuration
'--logger', 'trx'
'-r', $testArtifacts
'/p:CollectCoverage=true', "/p:MergeWith=$testArtifacts\coverage.json"
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"msbuild-sdks": {
"Microsoft.Build.CentralPackageVersions": "2.0.26"
"Microsoft.Build.CentralPackageVersions": "2.0.52"
}
}
Binary file added shared/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/App.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<PropertyGroup Label="Pack Customizations">
<!-- We pack custom assets after the publish task -->
<IncludeContentInPack>False</IncludeContentInPack>
<IncludeBuildOutput>False</IncludeBuildOutput>

</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/SimpleVersion.Cake/SimpleVersion.Cake.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
<PropertyGroup>
<AssemblyName>Cake.SimpleVersion</AssemblyName>
<PackageTags>$(PackageTags);Cake</PackageTags>
<PackageIconUrl>https://cdn.jsdelivr.net/gh/cake-contrib/graphics/png/cake-contrib-medium.png</PackageIconUrl>
</PropertyGroup>

<PropertyGroup Label="Pack Meta">
Expand Down
Binary file added src/SimpleVersion.Cake/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/SimpleVersion.Command/SimpleVersion.Command.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<AssemblyName>SimpleVersion</AssemblyName>
<!-- No Target Framework dependency group-->
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>

<PropertyGroup Label="Pack Meta">
Expand Down