Skip to content

Commit

Permalink
Update build scripts to support netcoreapp1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ocoanet committed May 2, 2017
1 parent ad1206c commit 71c2264
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 105 deletions.
2 changes: 2 additions & 0 deletions Cake-Pack.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
powershell build\build.ps1 -Script build\build.cake -Target Pack
pause
20 changes: 20 additions & 0 deletions Cake-Perf.bat
Original file line number Diff line number Diff line change
@@ -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
File renamed without changes.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 2 additions & 3 deletions build/Disruptor-net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<language />
</metadata>
<files>
<file src="Disruptor.dll" target="lib\net45" />
<file src="Disruptor.pdb" target="lib\net45" />
<file src="Disruptor.xml" target="lib\net45" />
<file src="net45\*" target="lib\net45" />
<file src="netcoreapp1.1\*" target="lib\netcoreapp1.1" />
</files>
</package>
138 changes: 68 additions & 70 deletions build/build.cake
Original file line number Diff line number Diff line change
@@ -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<VersionDetails>(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<VersionDetails>(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; }
}
2 changes: 0 additions & 2 deletions script-CreatePackage.bat

This file was deleted.

20 changes: 0 additions & 20 deletions script-RunAllPerfTestsIsolated.bat

This file was deleted.

1 change: 1 addition & 0 deletions src/Disruptor.PerfTests/Disruptor.PerfTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Title>Disruptor.PerfTests</Title>
<TargetFrameworks>net46</TargetFrameworks>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<OutputType>exe</OutputType>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net46'">
Expand Down
13 changes: 9 additions & 4 deletions src/Disruptor/Disruptor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

<PropertyGroup>
<AssemblyName>Disruptor</AssemblyName>
<RootNamespace>Disruptor</RootNamespace>
<RootNamespace>Disruptor</RootNamespace>
<Title>Disruptor</Title>
<Product>Disruptor</Product>
<Description>A High Performance Inter-Thread Messaging Library</Description>
<Version>3.3.6</Version>
<FileVersion>3.3.6.0</FileVersion>
<InformationalVersion>3.3.6</InformationalVersion>
<LastPortedJavaRevision>b1e425ea7d5f0e4c48af75876e2a50231e8e69eb</LastPortedJavaRevision>
<TargetFrameworks>netcoreapp1.1;net45</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>$(Configuration)\$(TargetFramework)\Disruptor.xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Disruptor.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
Expand All @@ -18,4 +23,4 @@
<None Remove="Disruptor.v3.ncrunchproject" />
</ItemGroup>

</Project>
</Project>
2 changes: 2 additions & 0 deletions src/Disruptor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
5 changes: 0 additions & 5 deletions versions.json

This file was deleted.

0 comments on commit 71c2264

Please sign in to comment.