forked from robotlegs/robotlegs-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildfile
104 lines (80 loc) · 3.88 KB
/
buildfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
require "fileutils"
require "buildr/as3" # needs buildr-as3 v0.2.25.pre
# You can use bundler to install the correct buildr gem: bundle install
# Then you can run buildr isolated: bundle exec buildr [tasks] ...
repositories.remote << "http://artifacts.devboy.org" << "http://repo2.maven.org/maven2"
repositories.release_to[:url] = 'http://snapshot.artifacts.devboy.org/'
repositories.release_to[:username] = ENV["ruser"]
repositories.release_to[:password] = ENV["rpass"]
layout = Layout::Default.new
layout[:source, :main, :as3] = "src"
layout[:source, :test, :as3] = "test"
THIS_VERSION = "2.0.0b1-SNAPSHOT"
define "robotlegs-framework", :layout => layout do
project.group = "org.robotlegs"
project.version = THIS_VERSION
args = [
"-namespace+=http://ns.robotlegs.org/flex/rl2,#{_(:src,"manifest.xml")}",
"-include-namespaces+=http://ns.robotlegs.org/flex/rl2"
]
compile.using( :compc, :flexsdk => flexsdk, :args => args ).
with( _(:lib,"as3commons-logging-2.7.swc"),
_(:lib,"SwiftSuspenders-v2.0.0b1.swc"),
_(:lib,"robotlegs-framework-v1.5.2.swc") )
testrunner = _(:source, :test, :as3, "RobotlegsTest.mxml")
test.using(:flexunit4 => true, :headless => false, :antjar => _(:lib, "flexUnitTasks-4.1.0-8.jar"))
test.compile.using( :main => testrunner, :args => [] ).with( _(:lib) )
doc_title = "Robotlegs v#{THIS_VERSION}"
doc.using :maintitle => doc_title,
:windowtitle => doc_title,
:args => doc_args
task package => doc
package(:swc).
include( _(:src,"*.xml") ).
path('docs').
include( _(:target,:doc,:tempdita,'packages.dita*') ).
include( _(:target,:doc,:tempdita,'org.*') )
end
desc "Creates a zip archive containing a swc, sources, libraries and documentation."
task :archive => "robotlegs-framework:doc" do
rl = project( "robotlegs-framework" )
rl_swc = artifacts( rl ).first
rl_vname = File.basename( rl_swc.to_s, ".swc" )
rl_zip = rl._(:target, "#{rl_vname}.zip")
filter.from(rl._(:build,:templates)).into( rl._(:target) ).
using( :ant, "date" => Time.now.localtime.strftime("%d-%m-%Y"),
"rlversion" => THIS_VERSION,
"releasename" => File.basename( rl_swc.to_s, "swc" ),
"ssversion" => THIS_VERSION,
"sslink" => "http://github.com/tschneidereit/SwiftSuspenders",
"rlprojectlink" => "http://github.com/robotlegs/robotlegs-framework",
"bestpracticeslink" => "http://github.com/robotlegs/robotlegs-framework/wiki/Best-Practices",
"faqlink" => "http://knowledge.robotlegs.com" ).run
FileUtils.move rl._(:target,"README.tmpl"), rl._(:target,"README")
puts "Packaging archive in #{rl_zip}"
rl_zip = zip( rl_zip )
rl_zip.include(rl._(:src))
rl_zip.include(rl._(:LICENSE))
rl_zip.include(rl._(:target,:README))
rl_zip.include(rl._("CHANGELOG.textile"), :as => "CHANGELOG")
rl_zip.path('bin').include( rl_swc )
rl_zip.path('docs').include( rl._(:target,:doc), :as => "docs" ).exclude( rl._(:target,:doc,:tempdita) )
rl_zip.include( rl._(:lib) )
rl_zip.invoke
FileUtils.rm_r rl._(:target, "README")
end
def doc_args
[ "-keep-xml=true",
"-lenient=true",
"-footer", "Robotlegs - http://www.robotlegs.org/ - Documentation generated at: #{Time.now.localtime.strftime("%d-%m-%Y")}",
"-package", "org.robotlegs.v2.core.api", "Core framework API",
"-package", "org.robotlegs.v2.core.impl", "Core framework implementation" ]
end
def flexsdk
@flexsdk ||= begin
# should be using the flex sdk version from user.properties (if it exists) or environment
flexsdk = FlexSDK.new("4.1.0.16076")
flexsdk.default_options << "-keep-as3-metadata+=Inject" << "-keep-as3-metadata+=PostConstruct"
flexsdk
end
end