Skip to content
Browse files

a rake build script. yay!

  • Loading branch information...
1 parent c92cffa commit ef220edc460dd32a8e4379585dac464c75fefe85 @bvanderveen bvanderveen committed
View
2 Kayak.Tests/Http/HttpServerTransactionDelegateTests.cs
@@ -49,7 +49,7 @@ IEnumerable<TxCallbacks> Permute(Req req)
if (k != -1)
hooks[k].Add(() => context.CloseConnection());
- Console.WriteLine("i = {0}, j = {1}, k = {2}", i, j, k);
+ //Console.WriteLine("i = {0}, j = {1}, k = {2}", i, j, k);
yield return callbacks.Item1;
}
View
3 Kayak.Tests/Kayak.Tests.csproj
@@ -83,10 +83,9 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!--
<Target Name="BeforeBuild">
- <Exec Command="&quot;$(MSBuildProjectDirectory)\..\tools\nuget&quot; install &quot;$(ProjectDir)packages.config&quot; -o &quot;$(MSBuildProjectDirectory)\..\packages&quot;" />
</Target>
- <!--
<Target Name="AfterBuild">
</Target>
-->
View
14 Kayak.nuspec
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<package>
<metadata>
- <id>Kayak</id>
- <version>blank</version>
- <authors>Benjamin van der Veen</authors>
- <owners>Benjamin van der Veen</owners>
- <description>Kayak is an event-driven networking library for .NET. It allows you to easily create TCP clients and servers. Kayak contains an HTTP/1.1 server implementation.</description>
+ <id></id>
+ <version></version>
+ <authors></authors>
+ <owners></owners>
+ <description></description>
<language>en-US</language>
- <projectUrl>https://github.com/kayak/kayak</projectUrl>
- <licenseUrl>https://github.com/kayak/kayak/raw/HEAD/LICENSE</licenseUrl>
+ <projectUrl></projectUrl>
+ <licenseUrl></licenseUrl>
<dependencies>
<dependency id="HttpMachine" version="0.9.0.0"/>
</dependencies>
View
45 Kayak.sln
@@ -7,10 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KayakExamples", "KayakExamp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kayak.Tests", "Kayak.Tests\Kayak.Tests.csproj", "{DA201FE7-FDAF-4B9E-821D-589F93F7245F}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kayak.Cli", "Kayak.Cli\Kayak.Cli.csproj", "{E0365461-37C4-4BB5-AC95-B30241EA29F2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kayak.Cli.Tests", "Kayak.Cli.Tests\Kayak.Cli.Tests.csproj", "{A62ACE90-0793-4D6A-830D-7D99DABF17D2}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CC5F6A16-6B66-42D2-8AD8-4A8D171AB16B}"
EndProject
Global
@@ -89,52 +85,11 @@ Global
{DA201FE7-FDAF-4B9E-821D-589F93F7245F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{DA201FE7-FDAF-4B9E-821D-589F93F7245F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{DA201FE7-FDAF-4B9E-821D-589F93F7245F}.Release|x86.ActiveCfg = Release|Any CPU
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug 4.0|Any CPU.ActiveCfg = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug 4.0|Mixed Platforms.ActiveCfg = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug 4.0|Mixed Platforms.Build.0 = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug 4.0|x86.ActiveCfg = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug 4.0|x86.Build.0 = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug|Any CPU.ActiveCfg = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug|Mixed Platforms.Build.0 = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug|x86.ActiveCfg = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Debug|x86.Build.0 = Debug|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release 4.0|Any CPU.ActiveCfg = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release 4.0|Mixed Platforms.ActiveCfg = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release 4.0|Mixed Platforms.Build.0 = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release 4.0|x86.ActiveCfg = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release 4.0|x86.Build.0 = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release|Any CPU.ActiveCfg = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release|Mixed Platforms.ActiveCfg = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release|Mixed Platforms.Build.0 = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release|x86.ActiveCfg = Release|x86
- {E0365461-37C4-4BB5-AC95-B30241EA29F2}.Release|x86.Build.0 = Release|x86
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug 4.0|Any CPU.ActiveCfg = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug 4.0|Any CPU.Build.0 = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug 4.0|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug 4.0|Mixed Platforms.Build.0 = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug 4.0|x86.ActiveCfg = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Debug|x86.ActiveCfg = Debug|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release 4.0|Any CPU.ActiveCfg = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release 4.0|Any CPU.Build.0 = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release 4.0|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release 4.0|Mixed Platforms.Build.0 = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release 4.0|x86.ActiveCfg = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release|Any CPU.Build.0 = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {A62ACE90-0793-4D6A-830D-7D99DABF17D2} = {CC5F6A16-6B66-42D2-8AD8-4A8D171AB16B}
{DA201FE7-FDAF-4B9E-821D-589F93F7245F} = {CC5F6A16-6B66-42D2-8AD8-4A8D171AB16B}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
View
3 Kayak/Kayak.csproj
@@ -86,10 +86,9 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!--
<Target Name="BeforeBuild">
- <Exec Command="&quot;$(MSBuildProjectDirectory)\..\tools\nuget&quot; install &quot;$(ProjectDir)packages.config&quot; -o &quot;$(MSBuildProjectDirectory)\..\packages&quot;" />
</Target>
- <!--
<Target Name="AfterBuild">
</Target>
-->
View
37 Kayak/Properties/AssemblyInfo.cs
@@ -1,37 +1,12 @@
-using System.Reflection;
using System.Runtime.CompilerServices;
+using System.Reflection;
using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("Kayak")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyDescription("Kayak is an event-base IO libary for .NET. Kayak allows you to easily create TCP clients and servers, and contains an HTTP/1.1 server implementation.")]
[assembly: AssemblyProduct("Kayak")]
-[assembly: AssemblyCopyright("Copyright © 2011 Benjamin van der Veen")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
+[assembly: AssemblyCopyright("Copyright (c) 2007-2011 Benjamin van der Veen")]
+[assembly: AssemblyVersion("0.7.1")]
+[assembly: AssemblyFileVersion("0.7.1")]
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("f2a7f504-8fe7-4972-b4e4-180948460839")]
+[assembly: InternalsVisibleTo("Kayak.Tests")]
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.6.2")]
-[assembly: AssemblyFileVersion("0.6.2")]
-[assembly: InternalsVisibleTo("Kayak.Tests")]
View
5 KayakExamples/KayakExamples.csproj
@@ -69,11 +69,6 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
- <Content Include="testfile.txt">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
- <ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
View
1 KayakExamples/testfile.txt
@@ -1 +0,0 @@
-This is a test text file.
View
135 Rakefile.rb
@@ -0,0 +1,135 @@
+PRODUCT = "Kayak"
+DESCRIPTION = "Kayak is an event-base IO libary for .NET. Kayak allows you to easily create TCP clients and servers, and contains an HTTP/1.1 server implementation."
+VERSION = "0.7.1"
+AUTHORS = "Benjamin van der Veen"
+COPYRIGHT = "Copyright (c) 2007-2011 Benjamin van der Veen"
+LICENSE_URL = "https://github.com/kayak/kayak/raw/HEAD/LICENSE"
+PROJECT_URL = "https://github.com/kayak/kayak"
+
+require 'albacore'
+
+def is_nix
+ !RUBY_PLATFORM.match("linux|darwin").nil?
+end
+
+def invoke_runtime(cmd)
+ command = cmd
+ if is_nix()
+ command = "mono --runtime=v4.0 #{cmd}"
+ end
+ command
+end
+
+def transform_xml(input, output)
+ input_file = File.new(input)
+ xml = REXML::Document.new input_file
+
+ yield xml
+
+ input_file.close
+
+ output_file = File.open(output, "w")
+ formatter = REXML::Formatters::Default.new()
+ formatter.write(xml, output_file)
+ output_file.close
+end
+
+task :default => [:build, :test]
+
+CONFIGURATION = "Debug"
+BUILD_DIR = File.expand_path("build")
+OUTPUT_DIR = "#{BUILD_DIR}/out"
+BIN_DIR = "#{BUILD_DIR}/bin"
+NUGET_DIR = "#{BUILD_DIR}/nug"
+
+assemblyinfo :assemblyinfo => :clean do |a|
+ a.product_name = a.title = PRODUCT
+ a.description = DESCRIPTION
+ a.version = a.file_version = VERSION
+ a.copyright = COPYRIGHT
+ a.output_file = "Kayak/Properties/AssemblyInfo.cs"
+ a.namespaces "System.Runtime.CompilerServices"
+ a.custom_attributes :InternalsVisibleTo => "Kayak.Tests"
+end
+
+msbuild :build_msbuild do |b|
+ b.properties :configuration => CONFIGURATION, "OutputPath" => OUTPUT_DIR
+ b.targets :Build
+ b.solution = "Kayak.sln"
+end
+
+xbuild :build_xbuild do |b|
+ b.properties :configuration => CONFIGURATION, "OutputPath" => OUTPUT_DIR
+ b.targets :Build
+ b.solution = "Kayak.sln"
+end
+
+task :build => :assemblyinfo do
+ build_task = is_nix() ? "build_xbuild" : "build_msbuild"
+ Rake::Task[build_task].invoke
+end
+
+task :test => :build do
+ nunit = invoke_runtime("packages/NUnit.2.5.10.11092/tools/nunit-console.exe")
+ sh "#{nunit} -labels #{OUTPUT_DIR}/Kayak.Tests.dll"
+end
+
+task :binaries => :build do
+ Dir.mkdir(BIN_DIR)
+ binaries = FileList["#{OUTPUT_DIR}/*.dll", "#{OUTPUT_DIR}/*.pdb"]
+ .exclude(/nunit/)
+ .exclude(/.Tests/)
+ .exclude(/.exe/)
+
+ FileUtils.cp_r binaries, BIN_DIR
+end
+
+task :dist_nuget => [:binaries, :build] do
+ if is_nix()
+ puts "Not running on Windows, skipping NuGet package creation."
+ else
+ Dir.mkdir(NUGET_DIR)
+
+ input_nuspec = "Kayak.nuspec"
+ output_nuspec = "#{NUGET_DIR}/Kayak.nuspec"
+
+ transform_xml input_nuspec, output_nuspec do |x|
+ x.root.elements["metadata/id"].text = PRODUCT
+ x.root.elements["metadata/version"].text = VERSION
+ x.root.elements["metadata/authors"].text = AUTHORS
+ x.root.elements["metadata/owners"].text = AUTHORS
+ x.root.elements["metadata/description"].text = DESCRIPTION
+ x.root.elements["metadata/licenseUrl"].text = LICENSE_URL
+ x.root.elements["metadata/projectUrl"].text = PROJECT_URL
+ end
+
+ nuget_lib_dir = "#{NUGET_DIR}/lib"
+ FileUtils.mkdir nuget_lib_dir
+ FileUtils.cp_r FileList["#{BIN_DIR}/*"], nuget_lib_dir
+
+ nuget = NuGetPack.new
+ nuget.command = "tools/NuGet.exe"
+ nuget.nuspec = output_nuspec
+ nuget.output = BUILD_DIR
+ #using base_folder throws as there are two options that begin with b in nuget 1.4
+ nuget.parameters = "-Symbols", "-BasePath \"#{NUGET_DIR}\""
+ nuget.execute
+ end
+end
+
+zip :dist_zip => [:build, :binaries] do |z|
+ z.directories_to_zip BIN_DIR
+ z.output_file = "kayak-#{VERSION}.zip"
+ z.output_path = BUILD_DIR
+end
+
+task :dist => [:dist_nuget, :dist_zip] do
+end
+
+task :clean do
+ FileUtils.rm_rf BUILD_DIR
+ FileUtils.rm_rf "Kayak/bin"
+ FileUtils.rm_rf "Kayak/obj"
+ FileUtils.rm_rf "Kayak.Tests/bin"
+ FileUtils.rm_rf "Kayak.Tests/obj"
+end

0 comments on commit ef220ed

Please sign in to comment.
Something went wrong with that request. Please try again.