buildr-hx 0.0.22.pre → 0.0.23.pre

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.22.pre
1
+ 0.0.23.pre
data/buildr-hx.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "buildr-hx"
8
- s.version = "0.0.22.pre"
8
+ s.version = "0.0.23.pre"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dominic Graefen"]
@@ -1,6 +1,7 @@
1
1
  require 'buildr'
2
2
  require 'fileutils'
3
3
  require "rexml/document"
4
+ require "pathname"
4
5
 
5
6
  module Buildr
6
7
  module Haxe
@@ -12,7 +13,7 @@ module Buildr
12
13
 
13
14
  def initialize(test_task, options)
14
15
  super
15
- @task.compile.from generate_test_suites
16
+ @task.compile.enhance [generate_test_suites]
16
17
  end
17
18
 
18
19
  def tests(dependencies) #:nodoc:
@@ -58,7 +59,8 @@ module Buildr
58
59
  end
59
60
 
60
61
  def generate_test_suites
61
- @generate ||= file task.project.path_to(:source, :test, :hx) do
62
+ Rake::Task.define_task :generate_test_suites do
63
+ puts "Generating MUnit Test Suite"
62
64
  create_munit_config
63
65
  appwd = Dir.pwd
64
66
  Dir.chdir task.project.base_dir
@@ -69,24 +71,33 @@ module Buildr
69
71
  end
70
72
 
71
73
  def create_munit_config
72
- file = File.join(task.project.base_dir, ".munit")
73
- puts "Creating munit config '#{file}'"
74
+ file = get_munit_file()
75
+ puts "Generating MUnit configuration '#{file}'"
74
76
  File.open(file, 'w') { |f| f.write(
75
- "version=#{options[:version].nil? ? DEFAULT_VERSION : options[:version]}\n" +
76
- "src=#{task.project.path_to(:source, :test, :hx)}\n" +
77
- "bin=#{task.project.test.compile.target}\n" +
78
- "report=#{task.project.path_to(:reports, :munit)}\n" +
79
- "hxml=#{get_hxml_file}\n" +
80
- "classPaths=#{task.project.compile.sources.map(&:to_s).join(',')}"
77
+ <<-FILE
78
+ version=#{options[:version].nil? ? DEFAULT_VERSION : options[:version]}
79
+ src=#{relative_path task.project.path_to(:source, :test, :hx), @task.project.base_dir}
80
+ bin=#{relative_path task.project.test.compile.target.to_s, @task.project.base_dir}
81
+ report=#{relative_path task.project.path_to(:reports, :munit).to_s, @task.project.base_dir}
82
+ hxml=#{relative_path get_hxml_file, @task.project.base_dir}
83
+ classPaths=#{task.project.compile.sources.map(&:to_s).map{|s| relative_path s, @task.project.base_dir}.join(',')}
84
+ FILE
81
85
  ) }
82
86
  end
83
87
 
88
+ def get_munit_file
89
+ File.join(task.project.base_dir, ".munit")
90
+ end
91
+
84
92
  def get_hxml_file
85
- file = "test.hxml"
86
- file = task.project.test.compile.options[:hxml] unless task.project.test.compile.options[:hxml].nil?
93
+ file = task.compile.options[:hxml] || "test.hxml"
87
94
  File.join(task.project.base_dir, file)
88
95
  end
89
96
 
97
+ def relative_path path, from
98
+ Pathname.new(path).relative_path_from(Pathname.new(from)).to_s
99
+ end
100
+
90
101
  end
91
102
  end
92
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildr-hx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22.pre
4
+ version: 0.0.23.pre
5
5
  prerelease: 7
6
6
  platform: ruby
7
7
  authors:
@@ -213,7 +213,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
213
  version: '0'
214
214
  segments:
215
215
  - 0
216
- hash: -681211570645267667
216
+ hash: -1921226282182041393
217
217
  required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  none: false
219
219
  requirements: