SourceLink.props
This commit is contained in:
Родитель
2c0cf77781
Коммит
db9ef0c7e2
|
@ -15,6 +15,7 @@
|
|||
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="15.7.0" />
|
||||
<PackageReference Update="MSTest.TestAdapter" Version="1.2.1" />
|
||||
<PackageReference Update="MSTest.TestFramework" Version="1.2.1" />
|
||||
<PackageReference Update="Microsoft.SourceLink.Github" Version="1.0.0-beta-63127-02" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<RestoreSources>
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<IncludeSourceLink Condition=" '$(IncludeSourceLink)' == '' ">False</IncludeSourceLink>
|
||||
</PropertyGroup>
|
||||
|
||||
<Choose>
|
||||
<When Condition=" '$(IncludeSourceLink)' == 'True' ">
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.SourceLink.Github" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
</Project>
|
10
build.fsx
10
build.fsx
|
@ -73,20 +73,12 @@ let msbuild (buildType: BuildType) (definition: ProjectDefinition) =
|
|||
MSBuild.run id outputDir "Build" properties [project] |> Trace.logItems (definition.Name + "Build-Output: ")
|
||||
|
||||
let dotnetPack (definition: ProjectDefinition) =
|
||||
let createPackageParam includeVersion project =
|
||||
let p = sprintf "\"%s\" package Microsoft.SourceLink.Github" project
|
||||
match includeVersion with true -> (p + " -v 1.0.0-beta-63127-02") | false -> p
|
||||
|
||||
// Inject SourceLink before packaging and remove it afterwards
|
||||
// Could have been set in fsproj, but Visual Studio for Mac can't reliably ignore SourceLink when not packaging
|
||||
for project in definition.Path do
|
||||
DotNet.exec id "add" (createPackageParam true project) |> ignore
|
||||
DotNet.restore id project
|
||||
DotNet.pack (fun opt ->
|
||||
{ opt with
|
||||
Common = { opt.Common with CustomParams = Some "-p:IncludeSourceLink=True" }
|
||||
Configuration = DotNet.BuildConfiguration.Release
|
||||
OutputPath = Some definition.OutputPath }) project
|
||||
DotNet.exec id "remove" (createPackageParam false project) |> ignore
|
||||
|
||||
let nugetPack (definition: ProjectDefinition) =
|
||||
for nuspec in definition.Path do
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\SourceLink.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\SourceLink.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<NoWarn>NU1701;NU5104</NoWarn>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\SourceLink.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\SourceLink.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\SourceLink.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче