Skip to content

Commit fc7fc74

Browse files
committed
Update more package settings and build details
1 parent db77acf commit fc7fc74

File tree

7 files changed

+36
-7
lines changed

7 files changed

+36
-7
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.0.0-alpha-build{build}
1+
version: 2.0.0-alpha.{build}+{branch}
22
init:
33
- git config --global core.autocrlf true
44
clone_depth: 1

Directory.Build.props

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
<Project>
22

33
<PropertyGroup>
4+
<Authors>Microsoft;Nate McMaster</Authors>
45
<Product>CommandLineUtils</Product>
5-
<RepositoryUrl>https://github.com/natemcmaster/CommandLineUtils</RepositoryUrl>
6+
<Copyright>Copyright © Nate McMaster</Copyright>
7+
<NeutralLanguage>en-US</NeutralLanguage>
8+
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
9+
<PackageProjectUrl>https://github.com/natemcmaster/CommandLineUtils</PackageProjectUrl>
10+
<RepositoryUrl>https://github.com/natemcmaster/CommandLineUtils.git</RepositoryUrl>
611
<RepositoryType>git</RepositoryType>
12+
<IsPackable>false</IsPackable>
13+
<MinClientVersion>4.3.0</MinClientVersion>
14+
<NoPackageAnalysis>true</NoPackageAnalysis>
715

816
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)build\StrongName.snk</AssemblyOriginatorKeyFile>
917
<SignAssembly>true</SignAssembly>
@@ -14,8 +22,9 @@
1422
<VersionPrefix>2.0.0</VersionPrefix>
1523
<VersionSuffix>alpha</VersionSuffix>
1624
<BuildNumber Condition=" '$(BuildNumber)' == '' ">$(APPVEYOR_BUILD_NUMBER)</BuildNumber>
25+
<BuildNumber Condition=" '$(BuildNumber)' == '' ">0</BuildNumber>
1726
<BranchName Condition=" '$(BranchName)' == '' ">$(APPVEYOR_REPO_BRANCH)</BranchName>
18-
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BuildNumber)' != '' ">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
27+
<VersionSuffix Condition=" '$(VersionSuffix)' != '' ">$(VersionSuffix).$(BuildNumber)</VersionSuffix>
1928
<VersionSuffix Condition=" '$(VersionSuffix)' != '' AND '$(BranchName)' != '' ">$(VersionSuffix)+$(BranchName)</VersionSuffix>
2029
</PropertyGroup>
2130

Directory.Build.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
<Project>
2+
3+
<Target Name="UpdateBuildDetails" BeforeTargets="Pack" Condition="'$(APPVEYOR)' == 'true'">
4+
<Exec Command="appveyor UpdateBuild -Version $(PackageVersion)"
5+
IgnoreExitCode="true"
6+
IgnoreStandardErrorWarningFormat="true" />
7+
</Target>
8+
29
</Project>

build.ps1

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env powershell
12
param(
23
[ValidateSet('Debug', 'Release')]
34
$Configuration = $null
@@ -7,13 +8,20 @@ Set-StrictMode -Version 1
78
$ErrorActionPreference = 'Stop'
89

910
function exec([string]$_cmd) {
10-
Write-Host -ForegroundColor DarkGray ">>> $_cmd $args"
11+
write-host -ForegroundColor DarkGray ">>> $_cmd $args"
12+
$ErrorActionPreference = 'Continue'
1113
& $_cmd @args
14+
$ErrorActionPreference = 'Stop'
1215
if ($LASTEXITCODE -ne 0) {
13-
Write-Error "Command exited with code $LASTEXITCODE"
16+
write-error "Failed with exit code $LASTEXITCODE"
17+
exit 1
1418
}
1519
}
1620

21+
#
22+
# Main
23+
#
24+
1725
if (!$Configuration) {
1826
$Configuration = if ($env:CI) { 'Release' } else { 'Debug' }
1927
}
@@ -22,6 +30,6 @@ $artifacts = "$PSScriptRoot/artifacts/"
2230

2331
Remove-Item -Recurse $artifacts -ErrorAction Ignore
2432

25-
exec dotnet restore /p:BuildNumber=t000
33+
exec dotnet restore
2634
exec dotnet pack -c $Configuration -o $artifacts
2735
exec dotnet test -c $Configuration "$PSScriptRoot/test/CommandLineUtils.Tests/McMaster.Extensions.CommandLineUtils.Tests.csproj"

src/CommandLineUtils/McMaster.Extensions.CommandLineUtils.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<GenerateDocumentationFile>true</GenerateDocumentationFile>
6+
<IsPackable>true</IsPackable>
67
<Description>Command-line parsing API. A drop-in replacement for Microsoft.Extensions.CommandLineUtils, plus extras.
78
Commonly used types:
89

@@ -11,6 +12,8 @@ McMaster.Extensions.CommandLineUtils.CommandOption
1112
</Description>
1213
<PackageTags>commandline;parsing</PackageTags>
1314
<NoWarn>$(NoWarn);CS1591</NoWarn>
15+
<IncludeSymbols>true</IncludeSymbols>
16+
<IncludeSource>true</IncludeSource>
1417
</PropertyGroup>
1518

1619
</Project>

test/CommandLineUtils.Tests/DotNetExeTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@ public void FindsTheDoNetPath()
2121
}
2222
}
2323
}
24+
#elif NET461
25+
#else
26+
#error Update target frameworks
2427
#endif

test/CommandLineUtils.Tests/McMaster.Extensions.CommandLineUtils.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<PropertyGroup>
44
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
55
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
6-
<IsPackable>false</IsPackable>
76
</PropertyGroup>
87

98
<ItemGroup>

0 commit comments

Comments
 (0)