diff --git a/Content/Console/build.fsx b/Content/Console/build.fsx index c02bca8b..966061ce 100644 --- a/Content/Console/build.fsx +++ b/Content/Console/build.fsx @@ -76,10 +76,6 @@ module dotnet = let reportgenerator optionConfig args = tool optionConfig "reportgenerator" args - let sourcelink optionConfig args = - tool optionConfig "sourcelink" args - - Target.create "Clean" <| fun _ -> ["bin"; "temp" ; distDir; coverageReportDir] @@ -114,7 +110,6 @@ Target.create "DotnetBuild" <| fun ctx -> let args = [ sprintf "/p:PackageVersion=%s" release.NugetVersion - sprintf "/p:SourceLinkCreate=%b" (isRelease ctx.Context.AllExecutingTargets) "--no-restore" ] |> String.concat " " DotNet.build(fun c -> @@ -245,31 +240,35 @@ Target.create "AssemblyInfo" <| fun _ -> | Vbproj -> AssemblyInfoFile.createVisualBasic ((folderName @@ "My Project") @@ "AssemblyInfo.vb") attributes ) +let runtimes = [ + "linux-x64", "CreateTarball" + "osx-x64", "CreateTarball" + "win-x64", "CreateZip" +] -Target.create "DotnetPack" <| fun ctx -> - !! srcGlob - |> Seq.iter (fun proj -> +Target.create "CreatePackages" <| fun _ -> + + let targetFramework = "netcoreapp2.1" + runtimes + |> Seq.iter(fun (runtime, packageType) -> let args = [ + sprintf "/t:Restore;%s" packageType + sprintf "/p:TargetFramework=%s" targetFramework + sprintf "/p:CustomTarget=%s" packageType + sprintf "/p:RuntimeIdentifier=%s" runtime + sprintf "/p:Configuration=%s" "Release" sprintf "/p:PackageVersion=%s" release.NugetVersion - sprintf "/p:PackageReleaseNotes=\"%s\"" (release.Notes |> String.concat "\n") - sprintf "/p:SourceLinkCreate=%b" (isRelease (ctx.Context.AllExecutingTargets)) + sprintf "/p:PackagePath=%s" (distDir @@ (sprintf "%s-%s-%s" productName release.NugetVersion runtime )) ] |> String.concat " " - DotNet.pack (fun c -> - { c with - Configuration = configuration (ctx.Context.AllExecutingTargets) - OutputPath = Some distDir - Common = - c.Common - |> DotNet.Options.withCustomParams (Some args) - }) proj - ) - - -Target.create "SourcelinkTest" <| fun _ -> - !! distGlob - |> Seq.iter (fun nupkg -> - dotnet.sourcelink id (sprintf "test %s" nupkg) + let result = + DotNet.exec (fun opt -> + { opt with + WorkingDirectory = mainApp } + ) "msbuild" args + if result.OK |> not then + result.Errors |> Seq.iter Trace.traceError + failwith "package creation failed" ) @@ -277,15 +276,6 @@ let isReleaseBranchCheck () = let releaseBranch = "master" if Git.Information.getBranchName "" <> releaseBranch then failwithf "Not on %s. If you want to release please switch to this branch." releaseBranch -Target.create "Publish" <| fun _ -> - isReleaseBranchCheck () - - Paket.push(fun c -> - { c with - PublishUrl = "https://www.nuget.org" - WorkingDir = "dist" - } - ) Target.create "GitRelease" <| fun _ -> isReleaseBranchCheck () @@ -325,27 +315,25 @@ Target.create "Release" ignore // Only call Clean if DotnetPack was in the call chain // Ensure Clean is called before DotnetRestore "Clean" ?=> "DotnetRestore" -"Clean" ==> "DotnetPack" +"Clean" ==> "CreatePackages" // // Only call AssemblyInfo if Publish was in the call chain // // Ensure AssemblyInfo is called after DotnetRestore and before DotnetBuild "DotnetRestore" ?=> "AssemblyInfo" "AssemblyInfo" ?=> "DotnetBuild" -"AssemblyInfo" ==> "Publish" +"AssemblyInfo" ==> "CreatePackages" "DotnetRestore" ==> "DotnetBuild" ==> "DotnetTest" ==> "GenerateCoverageReport" - ==> "DotnetPack" - ==> "SourcelinkTest" - ==> "Publish" + ==> "CreatePackages" ==> "GitRelease" -// ==> "GitHubRelease" + ==> "GitHubRelease" ==> "Release" "DotnetRestore" ==> "WatchTests" -Target.runOrDefaultWithArguments "DotnetPack" +Target.runOrDefaultWithArguments "CreatePackages" diff --git a/Content/Console/paket.dependencies b/Content/Console/paket.dependencies index 4b29fefb..8d1a8441 100644 --- a/Content/Console/paket.dependencies +++ b/Content/Console/paket.dependencies @@ -3,15 +3,14 @@ source https://api.nuget.org/v3/index.json framework: netcoreapp2.1 storage: none clitool dotnet-mono 0.5.2 -clitool dotnet-sourcelink 2.8.1 clitool dotnet-fantomas 2.8.0 clitool dotnet-reportgenerator-cli 4.0.0-rc4 nuget FSharp.Core 4.3.4 nuget Expecto 8.0.0 -nuget SourceLink.Create.CommandLine 2.8.1 copy_local: true nuget YoloDev.Expecto.TestSdk 0.5.0 nuget Microsoft.NET.Test.Sdk 15.7.2 nuget altcover 4.0.603 +nuget Packaging.Targets 0.1.45 // [ FAKE GROUP ] group Build diff --git a/Content/Console/paket.lock b/Content/Console/paket.lock index af74db59..793a8126 100644 --- a/Content/Console/paket.lock +++ b/Content/Console/paket.lock @@ -29,13 +29,6 @@ NUGET Microsoft.Extensions.Configuration.Json (>= 2.1) Microsoft.NETCore.App (>= 2.0) SixLabors.ImageSharp.Drawing (>= 1.0.0-beta0004) - dotnet-sourcelink (2.8.1) - clitool: true - Microsoft.Extensions.CommandLineUtils (>= 1.1.1) - Microsoft.NETCore.App (>= 2.0) - Newtonsoft.Json (>= 10.0.3) - NuGet.Packaging (>= 4.4) - System.Reflection.Metadata (>= 1.5) - System.ValueTuple (>= 4.4) Expecto (8.0) Argu (>= 5.1) Mono.Cecil (>= 0.10) @@ -85,8 +78,6 @@ NUGET System.Runtime.Extensions (>= 4.1) System.Runtime.InteropServices (>= 4.1) System.Runtime.InteropServices.RuntimeInformation (>= 4.0) - Microsoft.Extensions.CommandLineUtils (1.1.1) - NETStandard.Library (>= 1.6.1) Microsoft.Extensions.Configuration (2.1.1) Microsoft.Extensions.Configuration.Abstractions (>= 2.1.1) Microsoft.Extensions.Configuration.Abstractions (2.1.1) @@ -170,24 +161,7 @@ NUGET NETStandard.Library (2.0.3) Microsoft.NETCore.Platforms (>= 1.1) Newtonsoft.Json (11.0.2) - NuGet.Common (4.8) - NETStandard.Library (>= 1.6.1) - NuGet.Frameworks (>= 4.8) - System.Diagnostics.Process (>= 4.3) - System.Threading.Thread (>= 4.3) - NuGet.Frameworks (4.8) - NETStandard.Library (>= 1.6.1) - NuGet.Packaging (4.8) - NETStandard.Library (>= 1.6.1) - Newtonsoft.Json (>= 9.0.1) - NuGet.Packaging.Core (>= 4.8) - System.Dynamic.Runtime (>= 4.3) - NuGet.Packaging.Core (4.8) - NETStandard.Library (>= 1.6.1) - NuGet.Common (>= 4.8) - NuGet.Versioning (>= 4.8) - NuGet.Versioning (4.8) - NETStandard.Library (>= 1.6.1) + Packaging.Targets (0.1.45) runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3) @@ -243,7 +217,6 @@ NUGET SixLabors.Shapes (>= 1.0.0-beta0007) SixLabors.Shapes (1.0.0-beta0007) SixLabors.Core (>= 1.0.0-beta0006) - SourceLink.Create.CommandLine (2.8.1) - copy_local: true System.AppContext (4.3) System.Runtime (>= 4.3) System.Buffers (4.5) @@ -652,7 +625,6 @@ NUGET System.Threading.ThreadPool (4.3) System.Runtime (>= 4.3) System.Runtime.Handles (>= 4.3) - System.ValueTuple (4.5) System.Xml.ReaderWriter (4.3.1) System.Collections (>= 4.3) System.Diagnostics.Debug (>= 4.3) diff --git a/Content/Console/src/MyLib.1/AssemblyInfo.fs b/Content/Console/src/MyLib.1/AssemblyInfo.fs index 6f273302..d1613d7d 100644 --- a/Content/Console/src/MyLib.1/AssemblyInfo.fs +++ b/Content/Console/src/MyLib.1/AssemblyInfo.fs @@ -9,7 +9,7 @@ open System.Reflection [] [] [] -[] +[] do () module internal AssemblyVersionInformation = @@ -20,4 +20,4 @@ module internal AssemblyVersionInformation = let [] AssemblyFileVersion = "0.1.0" let [] AssemblyInformationalVersion = "0.1.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "bb8964b54bee133e9af64d316dc2cfee16df7f72" + let [] AssemblyMetadata_GitHash = "b385af579477bb585016a6b5204121de4a485dac" diff --git a/Content/Console/src/MyLib.1/paket.references b/Content/Console/src/MyLib.1/paket.references index bfa7bf5a..9257b236 100644 --- a/Content/Console/src/MyLib.1/paket.references +++ b/Content/Console/src/MyLib.1/paket.references @@ -1,3 +1,3 @@ FSharp.Core -SourceLink.Create.CommandLine Argu +Packaging.Targets diff --git a/Content/Console/tests/MyLib.1.Tests/AssemblyInfo.fs b/Content/Console/tests/MyLib.1.Tests/AssemblyInfo.fs index 2a82b88f..923df5ad 100644 --- a/Content/Console/tests/MyLib.1.Tests/AssemblyInfo.fs +++ b/Content/Console/tests/MyLib.1.Tests/AssemblyInfo.fs @@ -9,7 +9,7 @@ open System.Reflection [] [] [] -[] +[] do () module internal AssemblyVersionInformation = @@ -20,4 +20,4 @@ module internal AssemblyVersionInformation = let [] AssemblyFileVersion = "0.1.0" let [] AssemblyInformationalVersion = "0.1.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "bb8964b54bee133e9af64d316dc2cfee16df7f72" + let [] AssemblyMetadata_GitHash = "b385af579477bb585016a6b5204121de4a485dac" diff --git a/Content/Console/tools/paket.references b/Content/Console/tools/paket.references index 5864ba74..cb3c72ed 100644 --- a/Content/Console/tools/paket.references +++ b/Content/Console/tools/paket.references @@ -1,3 +1,2 @@ -dotnet-sourcelink dotnet-fantomas dotnet-reportgenerator-cli diff --git a/build.fsx b/build.fsx index 5c8f61bf..9cdd7745 100644 --- a/build.fsx +++ b/build.fsx @@ -117,7 +117,7 @@ Target.create "IntegrationTests" <| fun _ -> "-n MyCoolLib --githubUsername CoolPersonNo2", "DotnetPack" // test for dashes in name https://github.com/dotnet/templating/issues/1168#issuecomment-364592031 "-n fsharp-data-sample --githubUsername CoolPersonNo2", "DotnetPack" - "-n MyCoolLib --githubUsername CoolPersonNo2 --outputType Console", "DotnetPack" + "-n MyCoolLib --githubUsername CoolPersonNo2 --outputType Console", "CreatePackages" ] |> Seq.iter(fun (param, testTarget) -> use directory = DisposableDirectory.Create()