From c6107fe8acbc2c7631c728044bb57b608c3aeef1 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 20 Oct 2010 17:14:31 -0700 Subject: Rakefile should create the build directory when it is needed and doesn't exist --- Rakefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 414e6456..8d2afd7f 100644 --- a/Rakefile +++ b/Rakefile @@ -39,6 +39,12 @@ BUILD_DIR = 'build' task :default => [:compile, :test] +desc 'Init the build workspace' +task :init do + FileUtils.mkdir(BUILD_DIR) unless File.directory?(BUILD_DIR) +end + + desc 'Clean Generated Files' task :clean do FileUtils.rm_r(BUILD_DIR, :force => true) @@ -47,7 +53,7 @@ end desc 'Compile Scenario' -task :compile_scenario do +task :compile_scenario => :init do deps = [ 'lib/jquery/jquery-1.4.2.js', @@ -67,11 +73,8 @@ task :compile_scenario do end - - - desc 'Generate IE css js patch' -task :generate_ie_compat do +task :generate_ie_compat => :init do css = File.open('css/angular.css', 'r') {|f| f.read } # finds all css rules that contain backround images and extracts the rule name(s), content type of @@ -127,7 +130,7 @@ end desc 'Compile JavaScript' -task :compile => [:compile_scenario, :generate_ie_compat] do +task :compile => [:init, :compile_scenario, :generate_ie_compat] do deps = [ 'src/angular.prefix', @@ -149,7 +152,7 @@ end desc 'Create angular distribution' -task :package => :compile do +task :package => [:clean, :compile] do v = YAML::load( File.open( 'version.yaml' ) )['version'] match = v.match(/^([^-]*)(-snapshot)?$/) version = match[1] + (match[2] ? ('-' + %x(git rev-parse HEAD)[0..7]) : '') -- cgit v1.2.3