buildr-hx 0.0.4.pre → 0.0.5.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 +3 -1
- data/lib/buildr/hx/compiler/haxe_compiler_base.rb +8 -1
- data/lib/buildr/hx/core/haxe_lib.rb +7 -1
- data/lib/buildr/hx/packaging/haxelib.rb +78 -0
- data/lib/buildr/hx/packaging.rb +26 -0
- metadata +22 -20
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5.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.
|
8
|
+
s.version = "0.0.5.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"]
|
@@ -38,6 +38,8 @@ Gem::Specification.new do |s|
|
|
38
38
|
"lib/buildr/hx/compiler/hxxml.rb",
|
39
39
|
"lib/buildr/hx/core.rb",
|
40
40
|
"lib/buildr/hx/core/haxe_lib.rb",
|
41
|
+
"lib/buildr/hx/packaging.rb",
|
42
|
+
"lib/buildr/hx/packaging/haxelib.rb",
|
41
43
|
"lib/buildr/hx/project.rb",
|
42
44
|
"rake/jeweler.rb",
|
43
45
|
"rake/jeweler_prerelease_tasks.rb",
|
@@ -15,6 +15,7 @@ module Buildr
|
|
15
15
|
check_options options, COMPILE_OPTIONS
|
16
16
|
args = ["haxe"]
|
17
17
|
args += generate_source_args sources
|
18
|
+
args += generate_dependency_args dependencies
|
18
19
|
args += base_compiler_args
|
19
20
|
args += compiler_args if respond_to? :compiler_args
|
20
21
|
unless Buildr.application.options.dryrun
|
@@ -23,7 +24,6 @@ module Buildr
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def needed?(sources, target, dependencies)
|
26
|
-
puts "deps:", dependencies
|
27
27
|
return true unless File.exist?(@project.get_hx_output(is_test(sources,target,dependencies)))
|
28
28
|
source_files = Dir.glob(sources.collect{ |source| "#{source}/**/*"})
|
29
29
|
dep_files = dependencies.collect{ |dep|
|
@@ -47,6 +47,13 @@ module Buildr
|
|
47
47
|
sources.collect { |source| "-cp #{source}"}
|
48
48
|
end
|
49
49
|
|
50
|
+
def generate_dependency_args dependencies
|
51
|
+
dependencies.collect { |dep|
|
52
|
+
spec = HaxeLib.path_to_spec(dep)
|
53
|
+
spec ? "-lib #{spec[:id]}:#{spec[:version]}" : "-cp #{dep}"
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
50
57
|
def is_test( sources, target, dependencies )
|
51
58
|
test_task = @project.test.compile
|
52
59
|
sources==test_task.sources && dependencies==test_task.dependencies.collect{|dep|dep.to_s} && target==test_task.target.to_s
|
@@ -9,6 +9,12 @@ class HaxeLib < Rake::FileTask
|
|
9
9
|
File.join( home, id, version.gsub(".",",") )
|
10
10
|
end
|
11
11
|
|
12
|
+
def path_to_spec path
|
13
|
+
id, version = path.gsub(home,"").split(File::SEPARATOR)
|
14
|
+
return nil unless id && version && path.include?(home)
|
15
|
+
{:id => id, :version => version.gsub(",",".")}
|
16
|
+
end
|
17
|
+
|
12
18
|
def lookup spec
|
13
19
|
id, version = spec.split(":")
|
14
20
|
task = HaxeLib.define_task( spec_to_path spec )
|
@@ -49,7 +55,7 @@ end
|
|
49
55
|
module Buildr
|
50
56
|
def haxelib spec
|
51
57
|
haxelib = HaxeLib.lookup(spec)
|
52
|
-
haxelib.invoke
|
58
|
+
#haxelib.invoke
|
53
59
|
haxelib
|
54
60
|
end
|
55
61
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2011 by Dominic Graefen / http://devboy.org
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#
|
22
|
+
|
23
|
+
require 'buildr'
|
24
|
+
require "fileutils"
|
25
|
+
|
26
|
+
module Buildr
|
27
|
+
module Haxe
|
28
|
+
module Packaging
|
29
|
+
|
30
|
+
class HaxelibTask < Buildr::ZipTask
|
31
|
+
|
32
|
+
include Extension
|
33
|
+
|
34
|
+
attr_writer :target_swc, :src_swc
|
35
|
+
attr_reader :target_swc, :src_swc
|
36
|
+
|
37
|
+
def initialize(*args) #:nodoc:
|
38
|
+
super
|
39
|
+
enhance do
|
40
|
+
fail "File not found: #{src_swc}" unless File.exists? src_swc
|
41
|
+
merge src_swc
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def needed?
|
46
|
+
return true unless File.exists?(target_swc)
|
47
|
+
File.stat(src_swc).mtime > File.stat(target_swc).mtime
|
48
|
+
end
|
49
|
+
|
50
|
+
first_time do
|
51
|
+
desc 'create swc package task'
|
52
|
+
Project.local_task('package_swc')
|
53
|
+
end
|
54
|
+
|
55
|
+
before_define do |project|
|
56
|
+
HaxelibTask.define_task('package_swc').tap do |package_swc|
|
57
|
+
package_swc
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def package_swc(&block)
|
64
|
+
task("package_haxelib").enhance &block
|
65
|
+
end
|
66
|
+
|
67
|
+
protected
|
68
|
+
|
69
|
+
def package_as_swc(file_name)
|
70
|
+
HaxelibTask.define_task(file_name).tap do |swc|
|
71
|
+
swc.src_swc = get_as3_output
|
72
|
+
swc.target_swc = file_name
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#
|
2
|
+
# Copyright (C) 2011 by Dominic Graefen / http://devboy.org
|
3
|
+
#
|
4
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
5
|
+
# of this software and associated documentation files (the "Software"), to deal
|
6
|
+
# in the Software without restriction, including without limitation the rights
|
7
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
# copies of the Software, and to permit persons to whom the Software is
|
9
|
+
# furnished to do so, subject to the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be included in
|
12
|
+
# all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
16
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
17
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
18
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
19
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
20
|
+
# THE SOFTWARE.
|
21
|
+
#
|
22
|
+
require File.dirname(__FILE__)+"/packaging/haxelib"
|
23
|
+
|
24
|
+
class Buildr::Project
|
25
|
+
include Buildr::Haxe::Packaging
|
26
|
+
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.5.pre
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-17 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: buildr
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156625840 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.4.6
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156625840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: shoulda
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156624780 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156624780
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156623740 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.0.0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2156623740
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: jeweler
|
49
|
-
requirement: &
|
49
|
+
requirement: &2156622640 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.5.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2156622640
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: simplecov
|
60
|
-
requirement: &
|
60
|
+
requirement: &2156621380 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2156621380
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov-rcov
|
71
|
-
requirement: &
|
71
|
+
requirement: &2156619960 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2156619960
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rspec
|
82
|
-
requirement: &
|
82
|
+
requirement: &2156619080 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: 2.1.0
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2156619080
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: ci_reporter
|
93
|
-
requirement: &
|
93
|
+
requirement: &2156617780 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: 1.6.5
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *2156617780
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: buildr
|
104
|
-
requirement: &
|
104
|
+
requirement: &2156617200 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: 1.4.6
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *2156617200
|
113
113
|
description: Build like you code - now supporting haXe
|
114
114
|
email: dominic @nospam@ devboy.org
|
115
115
|
executables: []
|
@@ -139,6 +139,8 @@ files:
|
|
139
139
|
- lib/buildr/hx/compiler/hxxml.rb
|
140
140
|
- lib/buildr/hx/core.rb
|
141
141
|
- lib/buildr/hx/core/haxe_lib.rb
|
142
|
+
- lib/buildr/hx/packaging.rb
|
143
|
+
- lib/buildr/hx/packaging/haxelib.rb
|
142
144
|
- lib/buildr/hx/project.rb
|
143
145
|
- rake/jeweler.rb
|
144
146
|
- rake/jeweler_prerelease_tasks.rb
|
@@ -162,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
162
164
|
version: '0'
|
163
165
|
segments:
|
164
166
|
- 0
|
165
|
-
hash: -
|
167
|
+
hash: -3438841382965443593
|
166
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
169
|
none: false
|
168
170
|
requirements:
|