From 71c22643519b7254b8f1a963f560b4ff5ba41bf5 Mon Sep 17 00:00:00 2001 From: Olivier Coanet Date: Tue, 2 May 2017 18:30:30 +0200 Subject: [PATCH] Update build scripts to support netcoreapp1.1 --- Cake-Pack.bat | 2 + Cake-Perf.bat | 20 +++ script-Build.bat => Cake.bat | 0 appveyor.yml | 2 +- build/Disruptor-net.nuspec | 5 +- build/build.cake | 138 +++++++++--------- script-CreatePackage.bat | 2 - script-RunAllPerfTestsIsolated.bat | 20 --- .../Disruptor.PerfTests.csproj | 1 + src/Disruptor/Disruptor.csproj | 13 +- src/Disruptor/Properties/AssemblyInfo.cs | 2 + versions.json | 5 - 12 files changed, 105 insertions(+), 105 deletions(-) create mode 100644 Cake-Pack.bat create mode 100644 Cake-Perf.bat rename script-Build.bat => Cake.bat (100%) delete mode 100644 script-CreatePackage.bat delete mode 100644 script-RunAllPerfTestsIsolated.bat delete mode 100644 versions.json diff --git a/Cake-Pack.bat b/Cake-Pack.bat new file mode 100644 index 00000000..c26092ca --- /dev/null +++ b/Cake-Pack.bat @@ -0,0 +1,2 @@ +powershell build\build.ps1 -Script build\build.cake -Target Pack +pause \ No newline at end of file diff --git a/Cake-Perf.bat b/Cake-Perf.bat new file mode 100644 index 00000000..517e5428 --- /dev/null +++ b/Cake-Perf.bat @@ -0,0 +1,20 @@ +powershell build\build.ps1 -Script build\build.cake -Target Build-Perf + +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Raw.OneToOneRawBatchThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Raw.OneToOneRawThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedBatchThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedLongArrayThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedPollerThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Translator.OneToOneTranslatorThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToThreeDiamondSequencedThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToThreePipelineSequencedThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.WorkHandler.OneToThreeReleasingWorkerPoolThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToThreeSequencedThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.WorkHandler.OneToThreeWorkerPoolThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.ThreeToOneSequencedBatchThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.ThreeToOneSequencedThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.ThreeToThreeSequencedThroughputTest +output\perf\Disruptor.PerfTests.exe Disruptor.PerfTests.WorkHandler.TwoToTwoWorkProcessorThroughputTest + +pause \ No newline at end of file diff --git a/script-Build.bat b/Cake.bat similarity index 100% rename from script-Build.bat rename to Cake.bat diff --git a/appveyor.yml b/appveyor.yml index 12c493a0..3c30c13a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 3.3.4.{build} +version: 3.3.6.{build} build: off test_script: - ps: build\build.ps1 -Script build\build.cake \ No newline at end of file diff --git a/build/Disruptor-net.nuspec b/build/Disruptor-net.nuspec index 06b35bbd..bdf63be1 100644 --- a/build/Disruptor-net.nuspec +++ b/build/Disruptor-net.nuspec @@ -12,8 +12,7 @@ - - - + + \ No newline at end of file diff --git a/build/build.cake b/build/build.cake index 8506c334..5268c497 100644 --- a/build/build.cake +++ b/build/build.cake @@ -1,93 +1,91 @@ -#tool "nuget:?package=NUnit.Runners.Net4&version=2.6.4" -#addin "Cake.Json" - -var target = Argument("target", "Default"); +var target = Argument("target", "Run-Tests"); var configuration = Argument("configuration", "Release"); - var paths = new { - output = MakeAbsolute(Directory("./../output")), - nugetOutput = MakeAbsolute(Directory("./../output/nuget")), - solution = MakeAbsolute(File("./../src/Disruptor-net.sln")), - nuspec = MakeAbsolute(File("./Disruptor-net.nuspec")), - assemblyInfo = MakeAbsolute(File("./../src/Version.cs")), - versions = MakeAbsolute(File("./../versions.json")) + AssemblyOutput = MakeAbsolute(Directory("../output/assembly")), + TestsOutput = MakeAbsolute(Directory("../output/tests")), + PerfOutput = MakeAbsolute(Directory("../output/perf")), + NugetOutput = MakeAbsolute(Directory("../output/nuget")), + AssemblyProject = MakeAbsolute(File("../src/Disruptor/Disruptor.csproj")), + TestsProject = MakeAbsolute(File("../src/Disruptor.Tests/Disruptor.Tests.csproj")), + PerfProject = MakeAbsolute(File("../src/Disruptor.PerfTests/Disruptor.PerfTests.csproj")), + Nuspec = MakeAbsolute(File("Disruptor-net.nuspec")), + Projects = GetFiles("../src/**/*.csproj").Select(MakeAbsolute), }; -Task("Clean") - .Does(() =>{ - CleanDirectory(paths.output); - CleanDirectory(paths.nugetOutput); - } ); +var nugetVersion = XmlPeek(paths.AssemblyProject, "//InformationalVersion/text()"); +var targetFrameworks = XmlPeek(paths.AssemblyProject, "//TargetFrameworks/text()").Split(';'); Task("Restore-NuGet-Packages") - .IsDependentOn("Clean") - .Does(() => NuGetRestore(paths.solution)); + .Does(() => + { + foreach (var project in paths.Projects) + { + Information("Restoring {0}", project.FullPath); + NuGetRestore(project); + } + }); -/// Build tasks +Task("Clean-Tests") + .Does(() => CleanDirectory(paths.TestsOutput)); -Task("Create-AssemblyInfo") - .Does(()=>{ - var versionDetails = DeserializeJsonFromFile(paths.versions.FullPath); - CreateAssemblyInfo(paths.assemblyInfo, new AssemblyInfoSettings { - Company = "https://github.com/disruptor-net/Disruptor-net", - Product = "Disruptor", - Copyright = "Copyright © disruptor-net", - Version = versionDetails.AssemblyVersion, - FileVersion = versionDetails.AssemblyVersion, - InformationalVersion = versionDetails.NugetVersion + " (from java commit: " + versionDetails.LastJavaRevisionPortedVersion +")" - }); +Task("Build-Tests") + .IsDependentOn("Clean-Tests") + .IsDependentOn("Restore-NuGet-Packages") + .Does(() => + { + var settings = new DotNetCoreBuildSettings { Configuration = configuration, OutputDirectory = paths.TestsOutput.FullPath }; + DotNetCoreBuild(paths.TestsProject.FullPath, settings); }); -Task("MSBuild") - .Does(() => MSBuild(paths.solution, settings => settings - .SetConfiguration(configuration) - .SetPlatformTarget(PlatformTarget.MSIL) - .WithProperty("OutDir", paths.output.FullPath + "/build"))); +Task("Run-Tests") + .IsDependentOn("Build-Tests") + .Does(() => NUnit(paths.TestsOutput.FullPath + "/*.Tests.dll", new NUnitSettings { Framework = "net-4.6.1", NoResults = true })); -Task("Clean-AssemblyInfo") - .Does(()=>{ - DeleteFile(paths.assemblyInfo); - System.IO.File.Create(paths.assemblyInfo.FullPath); - }); +Task("Clean-Perf") + .Does(() => CleanDirectory(paths.PerfOutput)); -Task("Build") +Task("Build-Perf") + .IsDependentOn("Clean-Perf") .IsDependentOn("Restore-NuGet-Packages") - .IsDependentOn("Create-AssemblyInfo") - .IsDependentOn("MSBuild") - .IsDependentOn("Clean-AssemblyInfo"); - -/// Unit test tasks + .Does(() => + { + var settings = new DotNetCoreBuildSettings { Configuration = configuration, OutputDirectory = paths.TestsOutput.FullPath }; + DotNetCoreBuild(paths.PerfProject.FullPath, settings); + }); -Task("Run-Unit-Tests") - .IsDependentOn("Build") - .Does(() => NUnit(paths.output.FullPath + "/build/*.Tests.dll", new NUnitSettings { - Framework = "net-4.6.1", - NoResults = true - })); +Task("Clean-Assembly") + .Does(() => CleanDirectory(paths.AssemblyOutput)); -/// Package tasks +Task("Build-Assembly") + .IsDependentOn("Clean-Assembly") + .IsDependentOn("Restore-NuGet-Packages") + .Does(() => + { + foreach (var targetFramework in targetFrameworks) + { + Information("Building {0}", targetFramework); + var settings = new DotNetCoreBuildSettings + { + Framework = targetFramework, + Configuration = configuration, + OutputDirectory = paths.AssemblyOutput.FullPath + "/" + targetFramework, + }; + DotNetCoreBuild(paths.AssemblyProject.FullPath, settings); + } + }); -Task("Nuget-Pack") - .IsDependentOn("Run-Unit-Tests") +Task("Pack") + .IsDependentOn("Build-Assembly") .Does(() => { - var versionDetails = DeserializeJsonFromFile(paths.versions.FullPath); - NuGetPack(paths.nuspec, new NuGetPackSettings { - Version = versionDetails.NugetVersion, - BasePath = paths.output.FullPath + "/build", - OutputDirectory = paths.nugetOutput + Information("Packing {0}", nugetVersion); + NuGetPack(paths.Nuspec, new NuGetPackSettings + { + Version = nugetVersion, + BasePath = paths.AssemblyOutput.FullPath, + OutputDirectory = paths.NugetOutput }); }); -Task("Default") - .IsDependentOn("Run-Unit-Tests"); - RunTarget(target); - -private class VersionDetails -{ - public string LastJavaRevisionPortedVersion { get; set; } - public string AssemblyVersion { get; set; } - public string NugetVersion { get; set; } -} \ No newline at end of file diff --git a/script-CreatePackage.bat b/script-CreatePackage.bat deleted file mode 100644 index 7aa4a083..00000000 --- a/script-CreatePackage.bat +++ /dev/null @@ -1,2 +0,0 @@ -powershell build\build.ps1 -Script build\build.cake -Target Nuget-Pack -pause \ No newline at end of file diff --git a/script-RunAllPerfTestsIsolated.bat b/script-RunAllPerfTestsIsolated.bat deleted file mode 100644 index f4bf9d49..00000000 --- a/script-RunAllPerfTestsIsolated.bat +++ /dev/null @@ -1,20 +0,0 @@ -powershell build\build.ps1 -Script build\build.cake -Target Build - -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Raw.OneToOneRawBatchThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Raw.OneToOneRawThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedBatchThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedLongArrayThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedPollerThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToOneSequencedThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Translator.OneToOneTranslatorThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToThreeDiamondSequencedThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToThreePipelineSequencedThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.WorkHandler.OneToThreeReleasingWorkerPoolThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.OneToThreeSequencedThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.WorkHandler.OneToThreeWorkerPoolThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.ThreeToOneSequencedBatchThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.ThreeToOneSequencedThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.Sequenced.ThreeToThreeSequencedThroughputTest -output\build\Disruptor.PerfTests.exe Disruptor.PerfTests.WorkHandler.TwoToTwoWorkProcessorThroughputTest - -pause \ No newline at end of file diff --git a/src/Disruptor.PerfTests/Disruptor.PerfTests.csproj b/src/Disruptor.PerfTests/Disruptor.PerfTests.csproj index a6f454bb..027b4722 100644 --- a/src/Disruptor.PerfTests/Disruptor.PerfTests.csproj +++ b/src/Disruptor.PerfTests/Disruptor.PerfTests.csproj @@ -6,6 +6,7 @@ Disruptor.PerfTests net46 false + exe diff --git a/src/Disruptor/Disruptor.csproj b/src/Disruptor/Disruptor.csproj index f7344972..dca2cdea 100644 --- a/src/Disruptor/Disruptor.csproj +++ b/src/Disruptor/Disruptor.csproj @@ -2,12 +2,17 @@ Disruptor - Disruptor + Disruptor Disruptor + Disruptor A High Performance Inter-Thread Messaging Library + 3.3.6 + 3.3.6.0 + 3.3.6 + b1e425ea7d5f0e4c48af75876e2a50231e8e69eb netcoreapp1.1;net45 - true - $(Configuration)\$(TargetFramework)\Disruptor.xml + true + bin\$(Configuration)\$(TargetFramework)\Disruptor.xml @@ -18,4 +23,4 @@ - \ No newline at end of file + diff --git a/src/Disruptor/Properties/AssemblyInfo.cs b/src/Disruptor/Properties/AssemblyInfo.cs index 8f0faace..608a8ecd 100644 --- a/src/Disruptor/Properties/AssemblyInfo.cs +++ b/src/Disruptor/Properties/AssemblyInfo.cs @@ -12,6 +12,8 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] +[assembly: AssemblyCopyright("Copyright © disruptor-net")] + // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("d80ab069-2ad5-46b5-8a6f-60d2e6b3e30d")] [assembly: InternalsVisibleTo("Disruptor.Tests")] diff --git a/versions.json b/versions.json deleted file mode 100644 index 4a833c4c..00000000 --- a/versions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "LastJavaRevisionPortedVersion": "b1e425ea7d5f0e4c48af75876e2a50231e8e69eb", - "AssemblyVersion": "3.3.6", - "NugetVersion": "3.3.6-alpha" -} \ No newline at end of file