From 1e598ad5aa9bcc7afdccc2e2d4dec666e565f4ee Mon Sep 17 00:00:00 2001 From: "Mike D. Lowis" Date: Thu, 23 Feb 2012 11:19:47 -0500 Subject: [PATCH] Added rake_utils as an external repo --- .gitmodules | 3 +++ build/DUMMY | 0 rakefile.rb | 63 ++++++++---------------------------------------- tools/rake_utils | 1 + 4 files changed, 14 insertions(+), 53 deletions(-) create mode 100644 .gitmodules delete mode 100644 build/DUMMY create mode 160000 tools/rake_utils diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..70e5f5e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "tools/rake_utils"] + path = tools/rake_utils + url = git@github.com:mikedlowis/rake_utils.git diff --git a/build/DUMMY b/build/DUMMY deleted file mode 100644 index e69de29..0000000 diff --git a/rakefile.rb b/rakefile.rb index 58af960..1039925 100644 --- a/rakefile.rb +++ b/rakefile.rb @@ -1,69 +1,26 @@ include Rake::DSL -require 'tools/rake_utils/buildconfig.rb' -require 'tools/rake_utils/testconfig.rb' +require 'tools/rake_utils/source/binary.rb' +require 'tools/rake_utils/source/tests.rb' #------------------------------------------------------------------------------ # Configuration Objects #------------------------------------------------------------------------------ # Configuration for the binary artifact -Binary = BuildConfig.new({ +DLangParser = Binary.new({ :name => 'dlang', - :compiler_options => [ '-c', '-Wall', '-Werror' ], + :compiler_options => [ '-c', '-Wall', '-Werror', '-o' ], :source_files => [ 'source/**/*.c*' ], :include_dirs => [ 'source/**/' ], :preprocessor_defines => [ 'DETECT_MEM_LEAKS' ] }) +DLangParser.setup_default_rake_tasks() + # Configuration for the unit tests -UnitTest = TestConfig.new({ +UnitTest = Tests.new({ :test_files => [ 'tests/source/**.h' ], }) +UnitTest.setup_default_rake_tasks() -#------------------------------------------------------------------------------ -# Release Tasks -#------------------------------------------------------------------------------ -desc 'Execute a complete build including unit tests and binary' -task :default => [ :release ] - -desc 'Display build configuration info' -task :config do - puts 'Release Configuration' - puts '---------------------' - puts Binary - puts '' - puts 'Unit Test Configuration' - puts '-----------------------' - puts UnitTest -end - -desc 'Build and link the binary' -task :release => [ Binary.binary_name() ] - -task Binary.binary_name() => Binary.directories() + Binary.objects() do - Binary.link() -end - -rule(/obj\/.+.o$/ => Binary.obj_src_lookup()) do |t| - Binary.compile(t.source,t.name) -end - -#------------------------------------------------------------------------------ -# Testing Tasks -#------------------------------------------------------------------------------ -desc 'Execute all unit tests' -task :test => UnitTest.directories() + UnitTest.runners() do - UnitTest.run_all_test_runners(); -end - -rule '_runner.exe' => UnitTest.bin_obj_lookup() do |t| - UnitTest.link([t.source],t.name) -end - -rule( /test\/.+_runner.o$/ => UnitTest.obj_src_lookup() ) do |t| - UnitTest.compile(t.source,t.name) -end - -rule '_runner.cpp' => UnitTest.src_test_lookup() do |t| - UnitTest.generate_test_runner(t.source,t.name) -end - +desc 'Build and link all artifacts' +task :release => [ DLangParser.name() ] diff --git a/tools/rake_utils b/tools/rake_utils new file mode 160000 index 0000000..dfcf9e3 --- /dev/null +++ b/tools/rake_utils @@ -0,0 +1 @@ +Subproject commit dfcf9e3b0138ec4b320d8e34279ee91a19577c7b -- 2.52.0