Skip to content

Commit

Permalink
initial cut
Browse files Browse the repository at this point in the history
  • Loading branch information
haf committed Oct 9, 2014
1 parent 99c89a3 commit ed75dd0
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Rakefile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require 'albacore/tasks/versionizer'
require 'albacore/ext/teamcity'

load 'tools/pack.rb'

Configuration = ENV['Configuration'] || 'Release'

Albacore::Tasks::Versionizer.new :versioning
Expand Down Expand Up @@ -69,7 +71,7 @@ def maybe_sign conf
end

desc 'perform full build'
build :build => [:versioning, :assembly_info, :restore] do |b|
build :compile => [:versioning, :assembly_info, :restore] do |b|
b.prop 'Configuration', Configuration
b.sln = 'src/Logary.sln'
maybe_sign b
Expand All @@ -96,7 +98,7 @@ def maybe_sign conf
end

desc 'package nugets - finds all projects and package them'
task :nugets => ['build/pkg', :versioning, :build, :nugets_quick]
task :nugets => ['build/pkg', :versioning, :compile, :nugets_quick]

task :tests_unit do
Dir.glob("src/*.Tests/bin/#{Configuration}/*.Tests.exe").
Expand Down Expand Up @@ -125,7 +127,7 @@ def maybe_sign conf
end

desc 'run unit tests'
task :tests => [:build, :tests_unit]
task :tests => [:compile, :tests_unit]

task :default => [:tests, :nugets]

Expand Down
52 changes: 52 additions & 0 deletions tools/pack.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
require 'albacore'
require 'albacore/project'
require 'albacore/paths'

# reference:
# https://github.com/EventStore/EventStore/blob/dev/scripts/package-mono/package-mono.sh

def mkbundle bin, configuration = 'Release'
fail 'on Windows, use another tool, e.g. ' if Albacore.windows?
fail 'invalid "bin" parameter' unless bin
material = Dir[Paths.join(bin, '*.{dll,config}')]
mono_config = 'TODO'
machine_config = 'TODO'
# this doesn't help me much since I'm not merging into an executable
system 'mkbundle',
%w|-o -oo logary.a|.concat(material).concat(
%W|--static --deps --config #{monoconfig} --machine-config #{machineconfig}|
)
system 'cc',
%W|-o logary #{ES_COMPILE_FLAGS} testclient.c testclient.a $MONOPREFIX/lib/libmonosgen-2.0.a $MONOPREFIX/lib/libMonoPosixHelper.a|
end

def install_nuget name
unless Dir.exist? "tools/#{name}"
system 'tools/NuGet.exe',
%W|install -ExcludeVersion -OutputDirectory tools #{name}|
end
end

def pack tool = 'tools/ILRepack/tools/ILRepack.exe'
dir = 'src/Logary/bin/Release'
files = %w|FSharp.Actor FSharp.Core Intelliplan.JsonNet.NodaTime
Intelliplan.JsonNet Newtonsoft.Json NodaTime
policy.2.3.FSharp.Core|.
map { |f| "#{dir}/#{f}.dll" }

system tool,
%W|--keyfile:src/signing/LogaryPublic.snk --ver:#{ENV['FORMAL_VERSION']}
--xmldocs --internalize --parallel --index --verbose
--targetplatform:v4
--out:Logary.dll
--lib:tools/IKVM/lib|.
concat(files),
clr_command: true
end

desc 'pack the release of Logary with ILRepack'
task :pack do
install_nuget 'IKVM'
install_nuget 'ILRepack'
pack
end

0 comments on commit ed75dd0

Please sign in to comment.