Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
(maint) Updated main library to .net core 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Feb 1, 2020
1 parent 5d048ab commit 895730b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 31 deletions.
46 changes: 23 additions & 23 deletions Source/Codecov.Tests/Codecov.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="FluentAssertions" Version="5.10.0" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Codecov.Tool\Codecov.Tool.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp3.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="FluentAssertions" Version="5.10.0" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Codecov.Tool\Codecov.Tool.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/Codecov/Codecov.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Condition="'$(TargetFrameworks)' == ''">
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifiers>win7-x64;linux-x64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup>
Expand Down
21 changes: 14 additions & 7 deletions setup.cake
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#module "nuget:?package=Cake.DotNetTool.Module&version=0.2.0"
#addin "nuget:?package=Cake.Warp&version=0.1.0"
#load "nuget:?package=Cake.Recipe&version=1.0.0"
#load ".build/coverlet.cake"
#load ".build/codecov.cake"
Expand Down Expand Up @@ -52,39 +51,47 @@ Task("DotNetCore-Publish")
NoBuild = true,
NoRestore = true,
OutputDirectory = BuildParameters.Paths.Directories.NuGetPackages,
MSBuildSettings = msBuildSettings
MSBuildSettings = msBuildSettings,
});

var project = ParseProject(BuildParameters.SourceDirectoryPath + "/Codecov/Codecov.csproj", BuildParameters.Configuration);
var runtimeIdentifiers = project.NetCore.RuntimeIdentifiers;
EnsureDirectoryExists(BuildParameters.Paths.Directories.Build);

foreach (var runtime in runtimeIdentifiers) {
msBuildSettings = msBuildSettings
.WithProperty("PublishSingleFile", "true")
.WithProperty("PublishTrimmed", "true");
var outputDirectory = publishDirectory + "/" + runtime;
WarpPlatforms warpPlatform;
string warpOutputBase = BuildParameters.Paths.Directories.Build + "/codecov-";
if (runtime.StartsWith("win"))
{
warpPlatform = WarpPlatforms.WindowsX64;
warpOutputBase += "windows-x64.exe";
}
else if (runtime.StartsWith("osx"))
{
warpPlatform = WarpPlatforms.MacOSX64;
warpOutputBase += "osx-x64";
}
else
{
warpPlatform = WarpPlatforms.LinuxX64;
warpOutputBase += "linux-x64";
}

DotNetCorePublish(project.ProjectFilePath.FullPath, new DotNetCorePublishSettings {
Runtime = runtime,
SelfContained = true,
OutputDirectory = outputDirectory,
MSBuildSettings = msBuildSettings
});

Warp(outputDirectory, (warpPlatform == WarpPlatforms.WindowsX64 ? "codecov.exe" : "codecov"), warpOutputBase, warpPlatform);
var files = GetFiles(outputDirectory + "/codecov*");
foreach (var file in files)
{
if (file.GetExtension() != ".pdb")
{
CopyFile(file, warpOutputBase);
}
}
}
});

Expand Down

0 comments on commit 895730b

Please sign in to comment.