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

Targets netstandard1.0 and net45 and updates build infrastructure to latest .NET Core SDK #56

Merged
merged 2 commits into from
Feb 7, 2018
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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ matrix:
dist: trusty
sudo: required
mono: none
dotnet: 1.0.4
dotnet: 2.1.4

env:
global:
Expand Down
6 changes: 5 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>0.11.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>The OpenTracing Authors</Authors>
<PackageIconUrl>https://avatars0.githubusercontent.com/u/15482765</PackageIconUrl>
<PackageProjectUrl>https://github.com/opentracing/opentracing-csharp</PackageProjectUrl>
Expand All @@ -11,6 +10,11 @@

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugType>portable</DebugType>

<!-- There's currently a pack-warning because of the long "Description" tag. However, "Summary" is no longer supported.
This will be fixed in an upcoming version of nuget. The workaround for now is to just disable analysis.
https://github.com/NuGet/Home/issues/4587#issuecomment-288913324 -->
<NoPackageAnalysis>true</NoPackageAnalysis>
</PropertyGroup>

<!-- Create XML documentation for libraries -->
Expand Down
13 changes: 2 additions & 11 deletions build-definition.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Properties {

FormatTaskName ("`n" + ("-"*25) + "[{0}]" + ("-"*25) + "`n")

Task Default -depends init, clean, dotnet-install, dotnet-restore, dotnet-build, dotnet-test, dotnet-pack
Task Default -depends init, clean, dotnet-install, dotnet-build, dotnet-test, dotnet-pack

Task init {

Expand Down Expand Up @@ -66,13 +66,6 @@ Task dotnet-install {
}
}

Task dotnet-restore {

# If VersionSuffix isn't supplied here, dotnet pack will use wrong version numbers
# for dependant packages: https://github.com/NuGet/Home/issues/4337
exec { dotnet restore -v Minimal /p:VersionSuffix=$BuildNumber }
}

Task dotnet-build {

# --no-incremental to ensure that CI builds always result in a clean build
Expand Down Expand Up @@ -122,8 +115,6 @@ Task dotnet-pack {
Write-Host "Packaging $library to $libraryOutput"
Write-Host ""

$versionSuffixArg = if ([String]::IsNullOrWhiteSpace($BuildNumber)) { "" } else { "--version-suffix $BuildNumber" }

exec { dotnet pack $library -c $BuildConfiguration $versionSuffixArg --no-build --include-source --include-symbols -o $libraryOutput }
exec { dotnet pack $library -c $BuildConfiguration --version-suffix $BuildNumber --no-build --include-source --include-symbols -o $libraryOutput }
}
}
12 changes: 4 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ CONFIGURATION="Release"
# validations

if ! [ -x "$(command -v dotnet)" ]; then
echo "dotnet cli is not installed."
echo ".NET Core SDK is not installed."
exit 1
fi

# tasks

echo
echo dotnet-restore
echo ----------------------

dotnet restore

echo
echo dotnet-build
echo ----------------------
Expand All @@ -32,4 +26,6 @@ echo
echo dotnet-test
echo ----------------------

dotnet test test/OpenTracing.Tests/OpenTracing.Tests.csproj -c $CONFIGURATION --no-build
for d in test/*/*.csproj; do
dotnet test $d -c $CONFIGURATION --no-build
done
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "2.1.4"
}
}
6 changes: 5 additions & 1 deletion src/OpenTracing/OpenTracing.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<TargetFrameworks>netstandard1.0</TargetFrameworks>
<Description>This library is a .NET implementation of the OpenTracing API. To fully understand this platform API, it's helpful to be familiar with the OpenTracing project and terminology more generally.

For the time being, mild backwards-incompatible changes may be made without changing the major version number. As OpenTracing and opentracing-csharp mature, backwards compatibility will become more of a priority.</Description>
<PackageTags>opentracing;distributed-tracing;tracing;logging</PackageTags>
</PropertyGroup>

<PropertyGroup Condition="'$(OS)'=='Windows_NT'">
<TargetFrameworks>$(TargetFrameworks);net45</TargetFrameworks>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion test/OpenTracing.Tests/OpenTracing.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<ItemGroup>
Expand Down