buildr-hx 0.0.22.pre → 0.0.23.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/buildr-hx.gemspec +1 -1
- data/lib/buildr/hx/test/munit.rb +23 -12
- metadata +2 -2
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.0. | 
| 1 | 
            +
            0.0.23.pre
         | 
    
        data/buildr-hx.gemspec
    CHANGED
    
    
    
        data/lib/buildr/hx/test/munit.rb
    CHANGED
    
    | @@ -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. | 
| 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 | 
            -
                       | 
| 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 =  | 
| 73 | 
            -
                      puts " | 
| 74 | 
            +
                      file = get_munit_file()
         | 
| 75 | 
            +
                      puts "Generating MUnit configuration '#{file}'"
         | 
| 74 76 | 
             
                      File.open(file, 'w') { |f| f.write(
         | 
| 75 | 
            -
                           | 
| 76 | 
            -
             | 
| 77 | 
            -
             | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 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. | 
| 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: - | 
| 216 | 
            +
                  hash: -1921226282182041393
         | 
| 217 217 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 218 218 | 
             
              none: false
         | 
| 219 219 | 
             
              requirements:
         |