wagon 0.10.5 → 1.0.0
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/Rakefile +1 -0
- data/VERSION +1 -1
- data/bin/wagon +145 -145
- data/gui/Rakefile +5 -0
- data/gui/build.xml +74 -0
- data/gui/build/classes/.netbeans_automatic_build +0 -0
- data/gui/build/classes/org/rubyforge/rawr/Main.class +0 -0
- data/gui/build_configuration.rb +31 -0
- data/gui/icons/monkeybars.icns +0 -0
- data/gui/icons/monkeybars.ico +0 -0
- data/gui/lib/java/jruby-complete.jar +0 -0
- data/gui/lib/java/monkeybars-1.0.4.jar +0 -0
- data/gui/lib/ruby/README.txt +1 -0
- data/gui/manifest.mf +3 -0
- data/gui/nbproject/build-impl.xml +794 -0
- data/gui/nbproject/genfiles.properties +8 -0
- data/gui/nbproject/private/private.properties +3 -0
- data/gui/nbproject/project.properties +67 -0
- data/gui/nbproject/project.xml +13 -0
- data/gui/src/application_controller.rb +4 -0
- data/gui/src/application_view.rb +3 -0
- data/gui/src/main.rb +52 -0
- data/gui/src/manifest.rb +58 -0
- data/gui/src/org/rubyforge/rawr/Main.java +67 -0
- data/gui/src/resolver.rb +33 -0
- data/gui/tasks/monkeybars.rake +89 -0
- data/lib/wagon.rb +12 -10
- data/lib/wagon/address.rb +39 -39
- data/lib/wagon/connection.rb +73 -107
- data/lib/wagon/directory.rb +78 -78
- data/lib/wagon/household.rb +59 -74
- data/lib/wagon/member.rb +10 -10
- data/lib/wagon/page.rb +30 -31
- data/lib/wagon/phone_number.rb +22 -22
- data/lib/wagon/ward.rb +28 -28
- data/spec/wagon/directory_spec.rb +22 -22
- data/spec/wagon/ward_spec.rb +18 -18
- metadata +35 -2
data/Rakefile
CHANGED
@@ -14,6 +14,7 @@ begin
|
|
14
14
|
gem.add_dependency "nokogiri", ">= 1.4.0"
|
15
15
|
gem.add_dependency "highline", ">= 1.5.1"
|
16
16
|
gem.add_dependency "prawn", ">= 0.5.1"
|
17
|
+
gem.add_dependency "queue_to_the_future", ">= 0.1.0"
|
17
18
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
18
19
|
gem.add_development_dependency "yard", ">= 0"
|
19
20
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
data/bin/wagon
CHANGED
@@ -1,146 +1,146 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# == Usage
|
4
|
-
# wagon [options] [output_file]
|
5
|
-
#
|
6
|
-
# == Options
|
7
|
-
# -h, --help Displays this help message
|
8
|
-
# -v, --version Display the version, then exit
|
9
|
-
# -V, --verbose Verbose output
|
10
|
-
# -t, --title The title displayed on each page (default is the ward name)
|
11
|
-
# -r, --rows Number of rows per page (default is 6)
|
12
|
-
# -c, --columns Number of columns per page (default is 7)
|
13
|
-
# -p, --padding Padding between households (default is 2)
|
14
|
-
# -f, --font-size Primary font size (default is 8)
|
15
|
-
# --page-numbers Include page numbers in the footer, e.g. (1 of 3)
|
16
|
-
# --date Include the current date in the footer
|
17
|
-
# --no-picture Do not include pictures
|
18
|
-
# --no-address Do not include street addresses
|
19
|
-
# --no-phone Do not include phone numbers
|
20
|
-
# --no-email Do not include email addresses
|
21
|
-
#
|
22
|
-
# == Copyright
|
23
|
-
# Copyright (c) 2009 Devin Christensen. See LICENSE for details.
|
24
|
-
|
25
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
26
|
-
|
27
|
-
require 'optparse'
|
28
|
-
require 'rdoc/usage'
|
29
|
-
require 'ostruct'
|
30
|
-
require 'wagon'
|
31
|
-
require 'highline/import'
|
32
|
-
|
33
|
-
class WagonApp
|
34
|
-
def initialize(arguments, stdin)
|
35
|
-
@arguments = arguments
|
36
|
-
@stdin = stdin
|
37
|
-
@options = OpenStruct.new()
|
38
|
-
|
39
|
-
# Set defaults
|
40
|
-
@options.verbose = false
|
41
|
-
@options.title = nil
|
42
|
-
@options.rows = 6
|
43
|
-
@options.columns = 7
|
44
|
-
@options.padding = 2
|
45
|
-
@options.font_size = 8
|
46
|
-
@options.page_numbers = false
|
47
|
-
@options.include_date = false
|
48
|
-
@options.picture = true
|
49
|
-
@options.address = true
|
50
|
-
@options.phone_number = true
|
51
|
-
@options.email = true
|
52
|
-
@options.output_file = "./photo_directory.pdf"
|
53
|
-
end
|
54
|
-
|
55
|
-
def run
|
56
|
-
if arguments_valid?
|
57
|
-
puts "Start at #{DateTime.now}\n\n" if @options.verbose
|
58
|
-
|
59
|
-
output_options if @options.verbose # [Optional]
|
60
|
-
|
61
|
-
process
|
62
|
-
|
63
|
-
puts "\nFinished in #{DateTime.now}" if @options.verbose
|
64
|
-
|
65
|
-
else
|
66
|
-
output_usage
|
67
|
-
end
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
protected
|
72
|
-
def arguments_valid?
|
73
|
-
# Specify options
|
74
|
-
opts = OptionParser.new
|
75
|
-
opts.on('-v', '--version') { output_version ; exit 0 }
|
76
|
-
opts.on('-h', '--help') { output_help }
|
77
|
-
opts.on('-V', '--verbose') { @options.verbose = true }
|
78
|
-
opts.on('-t', '--title=TITLE') { |title| @options.title = title }
|
79
|
-
opts.on('-r', '--rows=ROWS') { |rows| @options.rows = rows }
|
80
|
-
opts.on('-c', '--columns=COLUMNS') { |columns| @options.columns = columns }
|
81
|
-
opts.on('-p', '--padding=PADDING') { |padding| @options.padding = padding }
|
82
|
-
opts.on('-f', '--font-size=SIZE') { |size| @options.font_size = size }
|
83
|
-
opts.on('--page-numbers') { @options.page_numbering = true }
|
84
|
-
opts.on('--date') { @options.include_date = true }
|
85
|
-
opts.on('--no-picture') { @options.picture = false }
|
86
|
-
opts.on('--no-address') { @options.address = false }
|
87
|
-
opts.on('--no-phone') { @options.phone_number = false }
|
88
|
-
opts.on('--no-email') { @options.email = false }
|
89
|
-
|
90
|
-
opts.parse!(@arguments) rescue return false
|
91
|
-
@options.output_file = @arguments.last unless @arguments.empty?
|
92
|
-
|
93
|
-
true
|
94
|
-
end
|
95
|
-
|
96
|
-
def output_options
|
97
|
-
puts "Options:\n"
|
98
|
-
|
99
|
-
@options.marshal_dump.each do |name, val|
|
100
|
-
puts " #{name} = #{val}"
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
def output_help
|
105
|
-
output_version
|
106
|
-
RDoc::usage()
|
107
|
-
end
|
108
|
-
|
109
|
-
def output_usage
|
110
|
-
RDoc::usage('usage') # gets usage from comments above
|
111
|
-
end
|
112
|
-
|
113
|
-
def output_version
|
114
|
-
puts "#{File.basename(__FILE__)} version #{Wagon::VERSION}"
|
115
|
-
end
|
116
|
-
|
117
|
-
def process
|
118
|
-
username = ask("What is your lds.org username? ")
|
119
|
-
password = ask("What is your lds.org password? ") { |q| q.echo = "*" }
|
120
|
-
|
121
|
-
user = Wagon::connect(username, password)
|
122
|
-
|
123
|
-
puts "\nAlright, we're in!"
|
124
|
-
puts "I'm gonna go ahead and create that PDF for ya now."
|
125
|
-
puts "It might take a few minutes to gather all the info"
|
126
|
-
puts "so grab a crisp cool beverage, sit back and relax."
|
127
|
-
puts "I'll take it from here."
|
128
|
-
|
129
|
-
directory = user.ward.to_pdf( @options.marshal_dump )
|
130
|
-
directory.render_file(@options.output_file)
|
131
|
-
|
132
|
-
puts "\nFinished. Enjoy.\n"
|
133
|
-
|
134
|
-
rescue Wagon::AuthenticationFailure
|
135
|
-
puts "\nThe username and password combination you entered is invalid."
|
136
|
-
rescue
|
137
|
-
if @options.verbose
|
138
|
-
raise
|
139
|
-
else
|
140
|
-
puts "\nI encountered an unexpected problem, and I don't know what to do. :("
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
app = WagonApp.new(ARGV, STDIN)
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# == Usage
|
4
|
+
# wagon [options] [output_file]
|
5
|
+
#
|
6
|
+
# == Options
|
7
|
+
# -h, --help Displays this help message
|
8
|
+
# -v, --version Display the version, then exit
|
9
|
+
# -V, --verbose Verbose output
|
10
|
+
# -t, --title The title displayed on each page (default is the ward name)
|
11
|
+
# -r, --rows Number of rows per page (default is 6)
|
12
|
+
# -c, --columns Number of columns per page (default is 7)
|
13
|
+
# -p, --padding Padding between households (default is 2)
|
14
|
+
# -f, --font-size Primary font size (default is 8)
|
15
|
+
# --page-numbers Include page numbers in the footer, e.g. (1 of 3)
|
16
|
+
# --date Include the current date in the footer
|
17
|
+
# --no-picture Do not include pictures
|
18
|
+
# --no-address Do not include street addresses
|
19
|
+
# --no-phone Do not include phone numbers
|
20
|
+
# --no-email Do not include email addresses
|
21
|
+
#
|
22
|
+
# == Copyright
|
23
|
+
# Copyright (c) 2009 Devin Christensen. See LICENSE for details.
|
24
|
+
|
25
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
26
|
+
|
27
|
+
require 'optparse'
|
28
|
+
require 'rdoc/usage'
|
29
|
+
require 'ostruct'
|
30
|
+
require 'wagon'
|
31
|
+
require 'highline/import'
|
32
|
+
|
33
|
+
class WagonApp
|
34
|
+
def initialize(arguments, stdin)
|
35
|
+
@arguments = arguments
|
36
|
+
@stdin = stdin
|
37
|
+
@options = OpenStruct.new()
|
38
|
+
|
39
|
+
# Set defaults
|
40
|
+
@options.verbose = false
|
41
|
+
@options.title = nil
|
42
|
+
@options.rows = 6
|
43
|
+
@options.columns = 7
|
44
|
+
@options.padding = 2
|
45
|
+
@options.font_size = 8
|
46
|
+
@options.page_numbers = false
|
47
|
+
@options.include_date = false
|
48
|
+
@options.picture = true
|
49
|
+
@options.address = true
|
50
|
+
@options.phone_number = true
|
51
|
+
@options.email = true
|
52
|
+
@options.output_file = "./photo_directory.pdf"
|
53
|
+
end
|
54
|
+
|
55
|
+
def run
|
56
|
+
if arguments_valid?
|
57
|
+
puts "Start at #{DateTime.now}\n\n" if @options.verbose
|
58
|
+
|
59
|
+
output_options if @options.verbose # [Optional]
|
60
|
+
|
61
|
+
process
|
62
|
+
|
63
|
+
puts "\nFinished in #{DateTime.now}" if @options.verbose
|
64
|
+
|
65
|
+
else
|
66
|
+
output_usage
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
protected
|
72
|
+
def arguments_valid?
|
73
|
+
# Specify options
|
74
|
+
opts = OptionParser.new
|
75
|
+
opts.on('-v', '--version') { output_version ; exit 0 }
|
76
|
+
opts.on('-h', '--help') { output_help }
|
77
|
+
opts.on('-V', '--verbose') { @options.verbose = true }
|
78
|
+
opts.on('-t', '--title=TITLE') { |title| @options.title = title }
|
79
|
+
opts.on('-r', '--rows=ROWS') { |rows| @options.rows = rows }
|
80
|
+
opts.on('-c', '--columns=COLUMNS') { |columns| @options.columns = columns }
|
81
|
+
opts.on('-p', '--padding=PADDING') { |padding| @options.padding = padding }
|
82
|
+
opts.on('-f', '--font-size=SIZE') { |size| @options.font_size = size }
|
83
|
+
opts.on('--page-numbers') { @options.page_numbering = true }
|
84
|
+
opts.on('--date') { @options.include_date = true }
|
85
|
+
opts.on('--no-picture') { @options.picture = false }
|
86
|
+
opts.on('--no-address') { @options.address = false }
|
87
|
+
opts.on('--no-phone') { @options.phone_number = false }
|
88
|
+
opts.on('--no-email') { @options.email = false }
|
89
|
+
|
90
|
+
opts.parse!(@arguments) rescue return false
|
91
|
+
@options.output_file = @arguments.last unless @arguments.empty?
|
92
|
+
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
def output_options
|
97
|
+
puts "Options:\n"
|
98
|
+
|
99
|
+
@options.marshal_dump.each do |name, val|
|
100
|
+
puts " #{name} = #{val}"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def output_help
|
105
|
+
output_version
|
106
|
+
RDoc::usage()
|
107
|
+
end
|
108
|
+
|
109
|
+
def output_usage
|
110
|
+
RDoc::usage('usage') # gets usage from comments above
|
111
|
+
end
|
112
|
+
|
113
|
+
def output_version
|
114
|
+
puts "#{File.basename(__FILE__)} version #{Wagon::VERSION}"
|
115
|
+
end
|
116
|
+
|
117
|
+
def process
|
118
|
+
username = ask("What is your lds.org username? ")
|
119
|
+
password = ask("What is your lds.org password? ") { |q| q.echo = "*" }
|
120
|
+
|
121
|
+
user = Wagon::connect(username, password)
|
122
|
+
|
123
|
+
puts "\nAlright, we're in!"
|
124
|
+
puts "I'm gonna go ahead and create that PDF for ya now."
|
125
|
+
puts "It might take a few minutes to gather all the info"
|
126
|
+
puts "so grab a crisp cool beverage, sit back and relax."
|
127
|
+
puts "I'll take it from here."
|
128
|
+
|
129
|
+
directory = user.ward.to_pdf( @options.marshal_dump )
|
130
|
+
directory.render_file(@options.output_file)
|
131
|
+
|
132
|
+
puts "\nFinished. Enjoy.\n"
|
133
|
+
|
134
|
+
rescue Wagon::AuthenticationFailure
|
135
|
+
puts "\nThe username and password combination you entered is invalid."
|
136
|
+
rescue
|
137
|
+
if @options.verbose
|
138
|
+
raise
|
139
|
+
else
|
140
|
+
puts "\nI encountered an unexpected problem, and I don't know what to do. :("
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
app = WagonApp.new(ARGV, STDIN)
|
146
146
|
app.run
|
data/gui/Rakefile
ADDED
data/gui/build.xml
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!-- You may freely edit this file. See commented blocks below for -->
|
3
|
+
<!-- some examples of how to customize the build. -->
|
4
|
+
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
5
|
+
<!-- By default, only the Clean and Build commands use this build script. -->
|
6
|
+
<!-- Commands such as Run, Debug, and Test only use this build script if -->
|
7
|
+
<!-- the Compile on Save feature is turned off for the project. -->
|
8
|
+
<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
|
9
|
+
<!-- in the project's Project Properties dialog box.-->
|
10
|
+
<project name="Wagon" default="default" basedir=".">
|
11
|
+
<description>Builds, tests, and runs the project Wagon.</description>
|
12
|
+
<import file="nbproject/build-impl.xml"/>
|
13
|
+
<!--
|
14
|
+
|
15
|
+
There exist several targets which are by default empty and which can be
|
16
|
+
used for execution of your tasks. These targets are usually executed
|
17
|
+
before and after some main targets. They are:
|
18
|
+
|
19
|
+
-pre-init: called before initialization of project properties
|
20
|
+
-post-init: called after initialization of project properties
|
21
|
+
-pre-compile: called before javac compilation
|
22
|
+
-post-compile: called after javac compilation
|
23
|
+
-pre-compile-single: called before javac compilation of single file
|
24
|
+
-post-compile-single: called after javac compilation of single file
|
25
|
+
-pre-compile-test: called before javac compilation of JUnit tests
|
26
|
+
-post-compile-test: called after javac compilation of JUnit tests
|
27
|
+
-pre-compile-test-single: called before javac compilation of single JUnit test
|
28
|
+
-post-compile-test-single: called after javac compilation of single JUunit test
|
29
|
+
-pre-jar: called before JAR building
|
30
|
+
-post-jar: called after JAR building
|
31
|
+
-post-clean: called after cleaning build products
|
32
|
+
|
33
|
+
(Targets beginning with '-' are not intended to be called on their own.)
|
34
|
+
|
35
|
+
Example of inserting an obfuscator after compilation could look like this:
|
36
|
+
|
37
|
+
<target name="-post-compile">
|
38
|
+
<obfuscate>
|
39
|
+
<fileset dir="${build.classes.dir}"/>
|
40
|
+
</obfuscate>
|
41
|
+
</target>
|
42
|
+
|
43
|
+
For list of available properties check the imported
|
44
|
+
nbproject/build-impl.xml file.
|
45
|
+
|
46
|
+
|
47
|
+
Another way to customize the build is by overriding existing main targets.
|
48
|
+
The targets of interest are:
|
49
|
+
|
50
|
+
-init-macrodef-javac: defines macro for javac compilation
|
51
|
+
-init-macrodef-junit: defines macro for junit execution
|
52
|
+
-init-macrodef-debug: defines macro for class debugging
|
53
|
+
-init-macrodef-java: defines macro for class execution
|
54
|
+
-do-jar-with-manifest: JAR building (if you are using a manifest)
|
55
|
+
-do-jar-without-manifest: JAR building (if you are not using a manifest)
|
56
|
+
run: execution of project
|
57
|
+
-javadoc-build: Javadoc generation
|
58
|
+
test-report: JUnit report generation
|
59
|
+
|
60
|
+
An example of overriding the target for project execution could look like this:
|
61
|
+
|
62
|
+
<target name="run" depends="Wagon-impl.jar">
|
63
|
+
<exec dir="bin" executable="launcher.exe">
|
64
|
+
<arg file="${dist.jar}"/>
|
65
|
+
</exec>
|
66
|
+
</target>
|
67
|
+
|
68
|
+
Notice that the overridden target depends on the jar target and not only on
|
69
|
+
the compile target as the regular run target does. Again, for a list of available
|
70
|
+
properties which you can use, check the target you are overriding in the
|
71
|
+
nbproject/build-impl.xml file.
|
72
|
+
|
73
|
+
-->
|
74
|
+
</project>
|
File without changes
|
Binary file
|
@@ -0,0 +1,31 @@
|
|
1
|
+
configuration do |c|
|
2
|
+
c.project_name = 'ChangeMe'
|
3
|
+
c.output_dir = 'package'
|
4
|
+
c.main_ruby_file = 'main'
|
5
|
+
c.main_java_file = 'org.rubyforge.rawr.Main'
|
6
|
+
|
7
|
+
# Compile all Ruby and Java files recursively
|
8
|
+
# Copy all other files taking into account exclusion filter
|
9
|
+
c.source_dirs = ['src', 'lib/ruby']
|
10
|
+
c.source_exclude_filter = []
|
11
|
+
|
12
|
+
# Location of the jruby-complete.jar. Override this if your jar lives elsewhere.
|
13
|
+
# This allows Rawr to make sure it uses a compatible jrubyc when compiling,
|
14
|
+
# so the class files are always compatible, regardless of your system JRuby.
|
15
|
+
#c.jruby_jar = 'lib/java/jruby-complete.jar'
|
16
|
+
c.compile_ruby_files = true
|
17
|
+
#c.java_lib_files = []
|
18
|
+
c.java_lib_dirs = ['lib/java']
|
19
|
+
#c.files_to_copy = Dir['other_files/dir/**/*']
|
20
|
+
|
21
|
+
c.target_jvm_version = 1.5
|
22
|
+
#c.jars[:data] = { :directory => 'data/images', :location_in_jar => 'images', :exclude => /bak/}
|
23
|
+
#c.jvm_arguments = "-server"
|
24
|
+
#c.java_library_path = "lib/java/native"
|
25
|
+
|
26
|
+
# Bundler options
|
27
|
+
# c.do_not_generate_plist = false
|
28
|
+
c.mac_icon_path = File.expand_path('icons/monkeybars.icns')
|
29
|
+
c.windows_icon_path = File.expand_path('icons/monkeybars.ico')
|
30
|
+
end
|
31
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
3rd party Ruby libs and unpacked gems go here.
|
data/gui/manifest.mf
ADDED
@@ -0,0 +1,794 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!--
|
3
|
+
*** GENERATED FROM project.xml - DO NOT EDIT ***
|
4
|
+
*** EDIT ../build.xml INSTEAD ***
|
5
|
+
|
6
|
+
For the purpose of easier reading the script
|
7
|
+
is divided into following sections:
|
8
|
+
|
9
|
+
- initialization
|
10
|
+
- compilation
|
11
|
+
- jar
|
12
|
+
- execution
|
13
|
+
- debugging
|
14
|
+
- javadoc
|
15
|
+
- junit compilation
|
16
|
+
- junit execution
|
17
|
+
- junit debugging
|
18
|
+
- applet
|
19
|
+
- cleanup
|
20
|
+
|
21
|
+
-->
|
22
|
+
<project xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" basedir=".." default="default" name="Wagon-impl">
|
23
|
+
<fail message="Please build using Ant 1.7.1 or higher.">
|
24
|
+
<condition>
|
25
|
+
<not>
|
26
|
+
<antversion atleast="1.7.1"/>
|
27
|
+
</not>
|
28
|
+
</condition>
|
29
|
+
</fail>
|
30
|
+
<target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
|
31
|
+
<!--
|
32
|
+
======================
|
33
|
+
INITIALIZATION SECTION
|
34
|
+
======================
|
35
|
+
-->
|
36
|
+
<target name="-pre-init">
|
37
|
+
<!-- Empty placeholder for easier customization. -->
|
38
|
+
<!-- You can override this target in the ../build.xml file. -->
|
39
|
+
</target>
|
40
|
+
<target depends="-pre-init" name="-init-private">
|
41
|
+
<property file="nbproject/private/config.properties"/>
|
42
|
+
<property file="nbproject/private/configs/${config}.properties"/>
|
43
|
+
<property file="nbproject/private/private.properties"/>
|
44
|
+
</target>
|
45
|
+
<target depends="-pre-init,-init-private" name="-init-user">
|
46
|
+
<property file="${user.properties.file}"/>
|
47
|
+
<!-- The two properties below are usually overridden -->
|
48
|
+
<!-- by the active platform. Just a fallback. -->
|
49
|
+
<property name="default.javac.source" value="1.4"/>
|
50
|
+
<property name="default.javac.target" value="1.4"/>
|
51
|
+
</target>
|
52
|
+
<target depends="-pre-init,-init-private,-init-user" name="-init-project">
|
53
|
+
<property file="nbproject/configs/${config}.properties"/>
|
54
|
+
<property file="nbproject/project.properties"/>
|
55
|
+
</target>
|
56
|
+
<target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
|
57
|
+
<available file="${manifest.file}" property="manifest.available"/>
|
58
|
+
<condition property="main.class.available">
|
59
|
+
<and>
|
60
|
+
<isset property="main.class"/>
|
61
|
+
<not>
|
62
|
+
<equals arg1="${main.class}" arg2="" trim="true"/>
|
63
|
+
</not>
|
64
|
+
</and>
|
65
|
+
</condition>
|
66
|
+
<condition property="manifest.available+main.class">
|
67
|
+
<and>
|
68
|
+
<isset property="manifest.available"/>
|
69
|
+
<isset property="main.class.available"/>
|
70
|
+
</and>
|
71
|
+
</condition>
|
72
|
+
<condition property="do.mkdist">
|
73
|
+
<and>
|
74
|
+
<isset property="libs.CopyLibs.classpath"/>
|
75
|
+
<not>
|
76
|
+
<istrue value="${mkdist.disabled}"/>
|
77
|
+
</not>
|
78
|
+
</and>
|
79
|
+
</condition>
|
80
|
+
<condition property="manifest.available+main.class+mkdist.available">
|
81
|
+
<and>
|
82
|
+
<istrue value="${manifest.available+main.class}"/>
|
83
|
+
<isset property="do.mkdist"/>
|
84
|
+
</and>
|
85
|
+
</condition>
|
86
|
+
<condition property="manifest.available+mkdist.available">
|
87
|
+
<and>
|
88
|
+
<istrue value="${manifest.available}"/>
|
89
|
+
<isset property="do.mkdist"/>
|
90
|
+
</and>
|
91
|
+
</condition>
|
92
|
+
<condition property="manifest.available-mkdist.available">
|
93
|
+
<or>
|
94
|
+
<istrue value="${manifest.available}"/>
|
95
|
+
<isset property="do.mkdist"/>
|
96
|
+
</or>
|
97
|
+
</condition>
|
98
|
+
<condition property="manifest.available+main.class-mkdist.available">
|
99
|
+
<or>
|
100
|
+
<istrue value="${manifest.available+main.class}"/>
|
101
|
+
<isset property="do.mkdist"/>
|
102
|
+
</or>
|
103
|
+
</condition>
|
104
|
+
<condition property="have.tests">
|
105
|
+
<or/>
|
106
|
+
</condition>
|
107
|
+
<condition property="have.sources">
|
108
|
+
<or>
|
109
|
+
<available file="${src.dir}"/>
|
110
|
+
</or>
|
111
|
+
</condition>
|
112
|
+
<condition property="netbeans.home+have.tests">
|
113
|
+
<and>
|
114
|
+
<isset property="netbeans.home"/>
|
115
|
+
<isset property="have.tests"/>
|
116
|
+
</and>
|
117
|
+
</condition>
|
118
|
+
<condition property="no.javadoc.preview">
|
119
|
+
<and>
|
120
|
+
<isset property="javadoc.preview"/>
|
121
|
+
<isfalse value="${javadoc.preview}"/>
|
122
|
+
</and>
|
123
|
+
</condition>
|
124
|
+
<property name="run.jvmargs" value=""/>
|
125
|
+
<property name="javac.compilerargs" value=""/>
|
126
|
+
<property name="work.dir" value="${basedir}"/>
|
127
|
+
<condition property="no.deps">
|
128
|
+
<and>
|
129
|
+
<istrue value="${no.dependencies}"/>
|
130
|
+
</and>
|
131
|
+
</condition>
|
132
|
+
<property name="javac.debug" value="true"/>
|
133
|
+
<property name="javadoc.preview" value="true"/>
|
134
|
+
<property name="application.args" value=""/>
|
135
|
+
<property name="source.encoding" value="${file.encoding}"/>
|
136
|
+
<property name="runtime.encoding" value="${source.encoding}"/>
|
137
|
+
<condition property="javadoc.encoding.used" value="${javadoc.encoding}">
|
138
|
+
<and>
|
139
|
+
<isset property="javadoc.encoding"/>
|
140
|
+
<not>
|
141
|
+
<equals arg1="${javadoc.encoding}" arg2=""/>
|
142
|
+
</not>
|
143
|
+
</and>
|
144
|
+
</condition>
|
145
|
+
<property name="javadoc.encoding.used" value="${source.encoding}"/>
|
146
|
+
<property name="includes" value="**"/>
|
147
|
+
<property name="excludes" value=""/>
|
148
|
+
<property name="do.depend" value="false"/>
|
149
|
+
<condition property="do.depend.true">
|
150
|
+
<istrue value="${do.depend}"/>
|
151
|
+
</condition>
|
152
|
+
<path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
|
153
|
+
<condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
|
154
|
+
<length length="0" string="${endorsed.classpath}" when="greater"/>
|
155
|
+
</condition>
|
156
|
+
<property name="javac.fork" value="false"/>
|
157
|
+
</target>
|
158
|
+
<target name="-post-init">
|
159
|
+
<!-- Empty placeholder for easier customization. -->
|
160
|
+
<!-- You can override this target in the ../build.xml file. -->
|
161
|
+
</target>
|
162
|
+
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
|
163
|
+
<fail unless="src.dir">Must set src.dir</fail>
|
164
|
+
<fail unless="build.dir">Must set build.dir</fail>
|
165
|
+
<fail unless="dist.dir">Must set dist.dir</fail>
|
166
|
+
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
|
167
|
+
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
|
168
|
+
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
|
169
|
+
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
|
170
|
+
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
|
171
|
+
<fail unless="dist.jar">Must set dist.jar</fail>
|
172
|
+
</target>
|
173
|
+
<target name="-init-macrodef-property">
|
174
|
+
<macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
|
175
|
+
<attribute name="name"/>
|
176
|
+
<attribute name="value"/>
|
177
|
+
<sequential>
|
178
|
+
<property name="@{name}" value="${@{value}}"/>
|
179
|
+
</sequential>
|
180
|
+
</macrodef>
|
181
|
+
</target>
|
182
|
+
<target name="-init-macrodef-javac">
|
183
|
+
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
|
184
|
+
<attribute default="${src.dir}" name="srcdir"/>
|
185
|
+
<attribute default="${build.classes.dir}" name="destdir"/>
|
186
|
+
<attribute default="${javac.classpath}" name="classpath"/>
|
187
|
+
<attribute default="${includes}" name="includes"/>
|
188
|
+
<attribute default="${excludes}" name="excludes"/>
|
189
|
+
<attribute default="${javac.debug}" name="debug"/>
|
190
|
+
<attribute default="${empty.dir}" name="sourcepath"/>
|
191
|
+
<attribute default="${empty.dir}" name="gensrcdir"/>
|
192
|
+
<element name="customize" optional="true"/>
|
193
|
+
<sequential>
|
194
|
+
<property location="${build.dir}/empty" name="empty.dir"/>
|
195
|
+
<mkdir dir="${empty.dir}"/>
|
196
|
+
<javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
|
197
|
+
<src>
|
198
|
+
<dirset dir="@{gensrcdir}" erroronmissingdir="false">
|
199
|
+
<include name="*"/>
|
200
|
+
</dirset>
|
201
|
+
</src>
|
202
|
+
<classpath>
|
203
|
+
<path path="@{classpath}"/>
|
204
|
+
</classpath>
|
205
|
+
<compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
|
206
|
+
<compilerarg line="${javac.compilerargs}"/>
|
207
|
+
<customize/>
|
208
|
+
</javac>
|
209
|
+
</sequential>
|
210
|
+
</macrodef>
|
211
|
+
<macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
|
212
|
+
<attribute default="${src.dir}" name="srcdir"/>
|
213
|
+
<attribute default="${build.classes.dir}" name="destdir"/>
|
214
|
+
<attribute default="${javac.classpath}" name="classpath"/>
|
215
|
+
<sequential>
|
216
|
+
<depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
|
217
|
+
<classpath>
|
218
|
+
<path path="@{classpath}"/>
|
219
|
+
</classpath>
|
220
|
+
</depend>
|
221
|
+
</sequential>
|
222
|
+
</macrodef>
|
223
|
+
<macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
|
224
|
+
<attribute default="${build.classes.dir}" name="destdir"/>
|
225
|
+
<sequential>
|
226
|
+
<fail unless="javac.includes">Must set javac.includes</fail>
|
227
|
+
<pathconvert pathsep="," property="javac.includes.binary">
|
228
|
+
<path>
|
229
|
+
<filelist dir="@{destdir}" files="${javac.includes}"/>
|
230
|
+
</path>
|
231
|
+
<globmapper from="*.java" to="*.class"/>
|
232
|
+
</pathconvert>
|
233
|
+
<delete>
|
234
|
+
<files includes="${javac.includes.binary}"/>
|
235
|
+
</delete>
|
236
|
+
</sequential>
|
237
|
+
</macrodef>
|
238
|
+
</target>
|
239
|
+
<target name="-init-macrodef-junit">
|
240
|
+
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
|
241
|
+
<attribute default="${includes}" name="includes"/>
|
242
|
+
<attribute default="${excludes}" name="excludes"/>
|
243
|
+
<attribute default="**" name="testincludes"/>
|
244
|
+
<sequential>
|
245
|
+
<junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
|
246
|
+
<batchtest todir="${build.test.results.dir}"/>
|
247
|
+
<classpath>
|
248
|
+
<path path="${run.test.classpath}"/>
|
249
|
+
</classpath>
|
250
|
+
<syspropertyset>
|
251
|
+
<propertyref prefix="test-sys-prop."/>
|
252
|
+
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
253
|
+
</syspropertyset>
|
254
|
+
<formatter type="brief" usefile="false"/>
|
255
|
+
<formatter type="xml"/>
|
256
|
+
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
257
|
+
<jvmarg line="${run.jvmargs}"/>
|
258
|
+
</junit>
|
259
|
+
</sequential>
|
260
|
+
</macrodef>
|
261
|
+
</target>
|
262
|
+
<target depends="-init-debug-args" name="-init-macrodef-nbjpda">
|
263
|
+
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
|
264
|
+
<attribute default="${main.class}" name="name"/>
|
265
|
+
<attribute default="${debug.classpath}" name="classpath"/>
|
266
|
+
<attribute default="" name="stopclassname"/>
|
267
|
+
<sequential>
|
268
|
+
<nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
|
269
|
+
<classpath>
|
270
|
+
<path path="@{classpath}"/>
|
271
|
+
</classpath>
|
272
|
+
</nbjpdastart>
|
273
|
+
</sequential>
|
274
|
+
</macrodef>
|
275
|
+
<macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
|
276
|
+
<attribute default="${build.classes.dir}" name="dir"/>
|
277
|
+
<sequential>
|
278
|
+
<nbjpdareload>
|
279
|
+
<fileset dir="@{dir}" includes="${fix.classes}">
|
280
|
+
<include name="${fix.includes}*.class"/>
|
281
|
+
</fileset>
|
282
|
+
</nbjpdareload>
|
283
|
+
</sequential>
|
284
|
+
</macrodef>
|
285
|
+
</target>
|
286
|
+
<target name="-init-debug-args">
|
287
|
+
<property name="version-output" value="java version "${ant.java.version}"/>
|
288
|
+
<condition property="have-jdk-older-than-1.4">
|
289
|
+
<or>
|
290
|
+
<contains string="${version-output}" substring="java version "1.0"/>
|
291
|
+
<contains string="${version-output}" substring="java version "1.1"/>
|
292
|
+
<contains string="${version-output}" substring="java version "1.2"/>
|
293
|
+
<contains string="${version-output}" substring="java version "1.3"/>
|
294
|
+
</or>
|
295
|
+
</condition>
|
296
|
+
<condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
|
297
|
+
<istrue value="${have-jdk-older-than-1.4}"/>
|
298
|
+
</condition>
|
299
|
+
<condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
|
300
|
+
<os family="windows"/>
|
301
|
+
</condition>
|
302
|
+
<condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
|
303
|
+
<isset property="debug.transport"/>
|
304
|
+
</condition>
|
305
|
+
</target>
|
306
|
+
<target depends="-init-debug-args" name="-init-macrodef-debug">
|
307
|
+
<macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
|
308
|
+
<attribute default="${main.class}" name="classname"/>
|
309
|
+
<attribute default="${debug.classpath}" name="classpath"/>
|
310
|
+
<element name="customize" optional="true"/>
|
311
|
+
<sequential>
|
312
|
+
<java classname="@{classname}" dir="${work.dir}" fork="true">
|
313
|
+
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
314
|
+
<jvmarg line="${debug-args-line}"/>
|
315
|
+
<jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
|
316
|
+
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
|
317
|
+
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
|
318
|
+
<jvmarg line="${run.jvmargs}"/>
|
319
|
+
<classpath>
|
320
|
+
<path path="@{classpath}"/>
|
321
|
+
</classpath>
|
322
|
+
<syspropertyset>
|
323
|
+
<propertyref prefix="run-sys-prop."/>
|
324
|
+
<mapper from="run-sys-prop.*" to="*" type="glob"/>
|
325
|
+
</syspropertyset>
|
326
|
+
<customize/>
|
327
|
+
</java>
|
328
|
+
</sequential>
|
329
|
+
</macrodef>
|
330
|
+
</target>
|
331
|
+
<target name="-init-macrodef-java">
|
332
|
+
<macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
|
333
|
+
<attribute default="${main.class}" name="classname"/>
|
334
|
+
<attribute default="${run.classpath}" name="classpath"/>
|
335
|
+
<element name="customize" optional="true"/>
|
336
|
+
<sequential>
|
337
|
+
<java classname="@{classname}" dir="${work.dir}" fork="true">
|
338
|
+
<jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
|
339
|
+
<jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
|
340
|
+
<redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
|
341
|
+
<jvmarg line="${run.jvmargs}"/>
|
342
|
+
<classpath>
|
343
|
+
<path path="@{classpath}"/>
|
344
|
+
</classpath>
|
345
|
+
<syspropertyset>
|
346
|
+
<propertyref prefix="run-sys-prop."/>
|
347
|
+
<mapper from="run-sys-prop.*" to="*" type="glob"/>
|
348
|
+
</syspropertyset>
|
349
|
+
<customize/>
|
350
|
+
</java>
|
351
|
+
</sequential>
|
352
|
+
</macrodef>
|
353
|
+
</target>
|
354
|
+
<target name="-init-presetdef-jar">
|
355
|
+
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
|
356
|
+
<jar compress="${jar.compress}" jarfile="${dist.jar}">
|
357
|
+
<j2seproject1:fileset dir="${build.classes.dir}"/>
|
358
|
+
</jar>
|
359
|
+
</presetdef>
|
360
|
+
</target>
|
361
|
+
<target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar" name="init"/>
|
362
|
+
<!--
|
363
|
+
===================
|
364
|
+
COMPILATION SECTION
|
365
|
+
===================
|
366
|
+
-->
|
367
|
+
<target name="-deps-jar-init" unless="built-jar.properties">
|
368
|
+
<property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
|
369
|
+
<delete file="${built-jar.properties}" quiet="true"/>
|
370
|
+
</target>
|
371
|
+
<target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
|
372
|
+
<echo level="warn" message="Cycle detected: Wagon was already built"/>
|
373
|
+
</target>
|
374
|
+
<target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
|
375
|
+
<mkdir dir="${build.dir}"/>
|
376
|
+
<touch file="${built-jar.properties}" verbose="false"/>
|
377
|
+
<property file="${built-jar.properties}" prefix="already.built.jar."/>
|
378
|
+
<antcall target="-warn-already-built-jar"/>
|
379
|
+
<propertyfile file="${built-jar.properties}">
|
380
|
+
<entry key="${basedir}" value=""/>
|
381
|
+
</propertyfile>
|
382
|
+
</target>
|
383
|
+
<target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
|
384
|
+
<target depends="init" name="-check-automatic-build">
|
385
|
+
<available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
|
386
|
+
</target>
|
387
|
+
<target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
|
388
|
+
<antcall target="clean"/>
|
389
|
+
</target>
|
390
|
+
<target depends="init,deps-jar" name="-pre-pre-compile">
|
391
|
+
<mkdir dir="${build.classes.dir}"/>
|
392
|
+
</target>
|
393
|
+
<target name="-pre-compile">
|
394
|
+
<!-- Empty placeholder for easier customization. -->
|
395
|
+
<!-- You can override this target in the ../build.xml file. -->
|
396
|
+
</target>
|
397
|
+
<target if="do.depend.true" name="-compile-depend">
|
398
|
+
<pathconvert property="build.generated.subdirs">
|
399
|
+
<dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
|
400
|
+
<include name="*"/>
|
401
|
+
</dirset>
|
402
|
+
</pathconvert>
|
403
|
+
<j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
|
404
|
+
</target>
|
405
|
+
<target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-compile-depend" if="have.sources" name="-do-compile">
|
406
|
+
<j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
|
407
|
+
<copy todir="${build.classes.dir}">
|
408
|
+
<fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
|
409
|
+
</copy>
|
410
|
+
</target>
|
411
|
+
<target name="-post-compile">
|
412
|
+
<!-- Empty placeholder for easier customization. -->
|
413
|
+
<!-- You can override this target in the ../build.xml file. -->
|
414
|
+
</target>
|
415
|
+
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
|
416
|
+
<target name="-pre-compile-single">
|
417
|
+
<!-- Empty placeholder for easier customization. -->
|
418
|
+
<!-- You can override this target in the ../build.xml file. -->
|
419
|
+
</target>
|
420
|
+
<target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
|
421
|
+
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
|
422
|
+
<j2seproject3:force-recompile/>
|
423
|
+
<j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.dir}"/>
|
424
|
+
</target>
|
425
|
+
<target name="-post-compile-single">
|
426
|
+
<!-- Empty placeholder for easier customization. -->
|
427
|
+
<!-- You can override this target in the ../build.xml file. -->
|
428
|
+
</target>
|
429
|
+
<target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
|
430
|
+
<!--
|
431
|
+
====================
|
432
|
+
JAR BUILDING SECTION
|
433
|
+
====================
|
434
|
+
-->
|
435
|
+
<target depends="init" name="-pre-pre-jar">
|
436
|
+
<dirname file="${dist.jar}" property="dist.jar.dir"/>
|
437
|
+
<mkdir dir="${dist.jar.dir}"/>
|
438
|
+
</target>
|
439
|
+
<target name="-pre-jar">
|
440
|
+
<!-- Empty placeholder for easier customization. -->
|
441
|
+
<!-- You can override this target in the ../build.xml file. -->
|
442
|
+
</target>
|
443
|
+
<target depends="init,compile,-pre-pre-jar,-pre-jar" name="-do-jar-without-manifest" unless="manifest.available-mkdist.available">
|
444
|
+
<j2seproject1:jar/>
|
445
|
+
</target>
|
446
|
+
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" name="-do-jar-with-manifest" unless="manifest.available+main.class-mkdist.available">
|
447
|
+
<j2seproject1:jar manifest="${manifest.file}"/>
|
448
|
+
</target>
|
449
|
+
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" name="-do-jar-with-mainclass" unless="manifest.available+main.class+mkdist.available">
|
450
|
+
<j2seproject1:jar manifest="${manifest.file}">
|
451
|
+
<j2seproject1:manifest>
|
452
|
+
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
|
453
|
+
</j2seproject1:manifest>
|
454
|
+
</j2seproject1:jar>
|
455
|
+
<echo>To run this application from the command line without Ant, try:</echo>
|
456
|
+
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
457
|
+
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
458
|
+
<pathconvert property="run.classpath.with.dist.jar">
|
459
|
+
<path path="${run.classpath}"/>
|
460
|
+
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
|
461
|
+
</pathconvert>
|
462
|
+
<echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
|
463
|
+
</target>
|
464
|
+
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available" name="-do-jar-with-libraries">
|
465
|
+
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
466
|
+
<pathconvert property="run.classpath.without.build.classes.dir">
|
467
|
+
<path path="${run.classpath}"/>
|
468
|
+
<map from="${build.classes.dir.resolved}" to=""/>
|
469
|
+
</pathconvert>
|
470
|
+
<pathconvert pathsep=" " property="jar.classpath">
|
471
|
+
<path path="${run.classpath.without.build.classes.dir}"/>
|
472
|
+
<chainedmapper>
|
473
|
+
<flattenmapper/>
|
474
|
+
<globmapper from="*" to="lib/*"/>
|
475
|
+
</chainedmapper>
|
476
|
+
</pathconvert>
|
477
|
+
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
478
|
+
<copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
479
|
+
<fileset dir="${build.classes.dir}"/>
|
480
|
+
<manifest>
|
481
|
+
<attribute name="Main-Class" value="${main.class}"/>
|
482
|
+
<attribute name="Class-Path" value="${jar.classpath}"/>
|
483
|
+
</manifest>
|
484
|
+
</copylibs>
|
485
|
+
<echo>To run this application from the command line without Ant, try:</echo>
|
486
|
+
<property location="${dist.jar}" name="dist.jar.resolved"/>
|
487
|
+
<echo>java -jar "${dist.jar.resolved}"</echo>
|
488
|
+
</target>
|
489
|
+
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+mkdist.available" name="-do-jar-with-libraries-without-mainclass" unless="main.class.available">
|
490
|
+
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
491
|
+
<pathconvert property="run.classpath.without.build.classes.dir">
|
492
|
+
<path path="${run.classpath}"/>
|
493
|
+
<map from="${build.classes.dir.resolved}" to=""/>
|
494
|
+
</pathconvert>
|
495
|
+
<pathconvert pathsep=" " property="jar.classpath">
|
496
|
+
<path path="${run.classpath.without.build.classes.dir}"/>
|
497
|
+
<chainedmapper>
|
498
|
+
<flattenmapper/>
|
499
|
+
<globmapper from="*" to="lib/*"/>
|
500
|
+
</chainedmapper>
|
501
|
+
</pathconvert>
|
502
|
+
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
503
|
+
<copylibs compress="${jar.compress}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
504
|
+
<fileset dir="${build.classes.dir}"/>
|
505
|
+
<manifest>
|
506
|
+
<attribute name="Class-Path" value="${jar.classpath}"/>
|
507
|
+
</manifest>
|
508
|
+
</copylibs>
|
509
|
+
</target>
|
510
|
+
<target depends="init,compile,-pre-pre-jar,-pre-jar" if="do.mkdist" name="-do-jar-with-libraries-without-manifest" unless="manifest.available">
|
511
|
+
<property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
|
512
|
+
<pathconvert property="run.classpath.without.build.classes.dir">
|
513
|
+
<path path="${run.classpath}"/>
|
514
|
+
<map from="${build.classes.dir.resolved}" to=""/>
|
515
|
+
</pathconvert>
|
516
|
+
<pathconvert pathsep=" " property="jar.classpath">
|
517
|
+
<path path="${run.classpath.without.build.classes.dir}"/>
|
518
|
+
<chainedmapper>
|
519
|
+
<flattenmapper/>
|
520
|
+
<globmapper from="*" to="lib/*"/>
|
521
|
+
</chainedmapper>
|
522
|
+
</pathconvert>
|
523
|
+
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
|
524
|
+
<copylibs compress="${jar.compress}" jarfile="${dist.jar}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
|
525
|
+
<fileset dir="${build.classes.dir}"/>
|
526
|
+
<manifest>
|
527
|
+
<attribute name="Class-Path" value="${jar.classpath}"/>
|
528
|
+
</manifest>
|
529
|
+
</copylibs>
|
530
|
+
</target>
|
531
|
+
<target name="-post-jar">
|
532
|
+
<!-- Empty placeholder for easier customization. -->
|
533
|
+
<!-- You can override this target in the ../build.xml file. -->
|
534
|
+
</target>
|
535
|
+
<target depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-do-jar-with-libraries-without-mainclass,-do-jar-with-libraries-without-manifest,-post-jar" description="Build JAR." name="jar"/>
|
536
|
+
<!--
|
537
|
+
=================
|
538
|
+
EXECUTION SECTION
|
539
|
+
=================
|
540
|
+
-->
|
541
|
+
<target depends="init,compile" description="Run a main class." name="run">
|
542
|
+
<j2seproject1:java>
|
543
|
+
<customize>
|
544
|
+
<arg line="${application.args}"/>
|
545
|
+
</customize>
|
546
|
+
</j2seproject1:java>
|
547
|
+
</target>
|
548
|
+
<target name="-do-not-recompile">
|
549
|
+
<property name="javac.includes.binary" value=""/>
|
550
|
+
</target>
|
551
|
+
<target depends="init,compile-single" name="run-single">
|
552
|
+
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
|
553
|
+
<j2seproject1:java classname="${run.class}"/>
|
554
|
+
</target>
|
555
|
+
<target depends="init,compile-test-single" name="run-test-with-main">
|
556
|
+
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
|
557
|
+
<j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
|
558
|
+
</target>
|
559
|
+
<!--
|
560
|
+
=================
|
561
|
+
DEBUGGING SECTION
|
562
|
+
=================
|
563
|
+
-->
|
564
|
+
<target depends="init" if="netbeans.home" name="-debug-start-debugger">
|
565
|
+
<j2seproject1:nbjpdastart name="${debug.class}"/>
|
566
|
+
</target>
|
567
|
+
<target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
|
568
|
+
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
|
569
|
+
</target>
|
570
|
+
<target depends="init,compile" name="-debug-start-debuggee">
|
571
|
+
<j2seproject3:debug>
|
572
|
+
<customize>
|
573
|
+
<arg line="${application.args}"/>
|
574
|
+
</customize>
|
575
|
+
</j2seproject3:debug>
|
576
|
+
</target>
|
577
|
+
<target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
|
578
|
+
<target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
|
579
|
+
<j2seproject1:nbjpdastart stopclassname="${main.class}"/>
|
580
|
+
</target>
|
581
|
+
<target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
|
582
|
+
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
|
583
|
+
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
|
584
|
+
<j2seproject3:debug classname="${debug.class}"/>
|
585
|
+
</target>
|
586
|
+
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
|
587
|
+
<target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
|
588
|
+
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
|
589
|
+
<j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
|
590
|
+
</target>
|
591
|
+
<target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
|
592
|
+
<target depends="init" name="-pre-debug-fix">
|
593
|
+
<fail unless="fix.includes">Must set fix.includes</fail>
|
594
|
+
<property name="javac.includes" value="${fix.includes}.java"/>
|
595
|
+
</target>
|
596
|
+
<target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
|
597
|
+
<j2seproject1:nbjpdareload/>
|
598
|
+
</target>
|
599
|
+
<target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
|
600
|
+
<!--
|
601
|
+
===============
|
602
|
+
JAVADOC SECTION
|
603
|
+
===============
|
604
|
+
-->
|
605
|
+
<target depends="init" name="-javadoc-build">
|
606
|
+
<mkdir dir="${dist.javadoc.dir}"/>
|
607
|
+
<javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
|
608
|
+
<classpath>
|
609
|
+
<path path="${javac.classpath}"/>
|
610
|
+
</classpath>
|
611
|
+
<fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
|
612
|
+
<filename name="**/*.java"/>
|
613
|
+
</fileset>
|
614
|
+
<fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
|
615
|
+
<include name="**/*.java"/>
|
616
|
+
</fileset>
|
617
|
+
</javadoc>
|
618
|
+
</target>
|
619
|
+
<target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
|
620
|
+
<nbbrowse file="${dist.javadoc.dir}/index.html"/>
|
621
|
+
</target>
|
622
|
+
<target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
|
623
|
+
<!--
|
624
|
+
=========================
|
625
|
+
JUNIT COMPILATION SECTION
|
626
|
+
=========================
|
627
|
+
-->
|
628
|
+
<target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
|
629
|
+
<mkdir dir="${build.test.classes.dir}"/>
|
630
|
+
</target>
|
631
|
+
<target name="-pre-compile-test">
|
632
|
+
<!-- Empty placeholder for easier customization. -->
|
633
|
+
<!-- You can override this target in the ../build.xml file. -->
|
634
|
+
</target>
|
635
|
+
<target if="do.depend.true" name="-compile-test-depend">
|
636
|
+
<j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir=""/>
|
637
|
+
</target>
|
638
|
+
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
|
639
|
+
<j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir=""/>
|
640
|
+
<copy todir="${build.test.classes.dir}"/>
|
641
|
+
</target>
|
642
|
+
<target name="-post-compile-test">
|
643
|
+
<!-- Empty placeholder for easier customization. -->
|
644
|
+
<!-- You can override this target in the ../build.xml file. -->
|
645
|
+
</target>
|
646
|
+
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
|
647
|
+
<target name="-pre-compile-test-single">
|
648
|
+
<!-- Empty placeholder for easier customization. -->
|
649
|
+
<!-- You can override this target in the ../build.xml file. -->
|
650
|
+
</target>
|
651
|
+
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
|
652
|
+
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
|
653
|
+
<j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
|
654
|
+
<j2seproject3:javac classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" sourcepath="" srcdir=""/>
|
655
|
+
<copy todir="${build.test.classes.dir}"/>
|
656
|
+
</target>
|
657
|
+
<target name="-post-compile-test-single">
|
658
|
+
<!-- Empty placeholder for easier customization. -->
|
659
|
+
<!-- You can override this target in the ../build.xml file. -->
|
660
|
+
</target>
|
661
|
+
<target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
|
662
|
+
<!--
|
663
|
+
=======================
|
664
|
+
JUNIT EXECUTION SECTION
|
665
|
+
=======================
|
666
|
+
-->
|
667
|
+
<target depends="init" if="have.tests" name="-pre-test-run">
|
668
|
+
<mkdir dir="${build.test.results.dir}"/>
|
669
|
+
</target>
|
670
|
+
<target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
|
671
|
+
<j2seproject3:junit testincludes="**/*Test.java"/>
|
672
|
+
</target>
|
673
|
+
<target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
|
674
|
+
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
|
675
|
+
</target>
|
676
|
+
<target depends="init" if="have.tests" name="test-report"/>
|
677
|
+
<target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
|
678
|
+
<target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
|
679
|
+
<target depends="init" if="have.tests" name="-pre-test-run-single">
|
680
|
+
<mkdir dir="${build.test.results.dir}"/>
|
681
|
+
</target>
|
682
|
+
<target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
|
683
|
+
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
|
684
|
+
<j2seproject3:junit excludes="" includes="${test.includes}"/>
|
685
|
+
</target>
|
686
|
+
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
|
687
|
+
<fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
|
688
|
+
</target>
|
689
|
+
<target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
|
690
|
+
<!--
|
691
|
+
=======================
|
692
|
+
JUNIT DEBUGGING SECTION
|
693
|
+
=======================
|
694
|
+
-->
|
695
|
+
<target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
|
696
|
+
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
|
697
|
+
<property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
|
698
|
+
<delete file="${test.report.file}"/>
|
699
|
+
<mkdir dir="${build.test.results.dir}"/>
|
700
|
+
<j2seproject3:debug classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
|
701
|
+
<customize>
|
702
|
+
<syspropertyset>
|
703
|
+
<propertyref prefix="test-sys-prop."/>
|
704
|
+
<mapper from="test-sys-prop.*" to="*" type="glob"/>
|
705
|
+
</syspropertyset>
|
706
|
+
<arg value="${test.class}"/>
|
707
|
+
<arg value="showoutput=true"/>
|
708
|
+
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
|
709
|
+
<arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
|
710
|
+
</customize>
|
711
|
+
</j2seproject3:debug>
|
712
|
+
</target>
|
713
|
+
<target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
|
714
|
+
<j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
|
715
|
+
</target>
|
716
|
+
<target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
|
717
|
+
<target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
|
718
|
+
<j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
|
719
|
+
</target>
|
720
|
+
<target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
|
721
|
+
<!--
|
722
|
+
=========================
|
723
|
+
APPLET EXECUTION SECTION
|
724
|
+
=========================
|
725
|
+
-->
|
726
|
+
<target depends="init,compile-single" name="run-applet">
|
727
|
+
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
|
728
|
+
<j2seproject1:java classname="sun.applet.AppletViewer">
|
729
|
+
<customize>
|
730
|
+
<arg value="${applet.url}"/>
|
731
|
+
</customize>
|
732
|
+
</j2seproject1:java>
|
733
|
+
</target>
|
734
|
+
<!--
|
735
|
+
=========================
|
736
|
+
APPLET DEBUGGING SECTION
|
737
|
+
=========================
|
738
|
+
-->
|
739
|
+
<target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
|
740
|
+
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
|
741
|
+
<j2seproject3:debug classname="sun.applet.AppletViewer">
|
742
|
+
<customize>
|
743
|
+
<arg value="${applet.url}"/>
|
744
|
+
</customize>
|
745
|
+
</j2seproject3:debug>
|
746
|
+
</target>
|
747
|
+
<target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
|
748
|
+
<!--
|
749
|
+
===============
|
750
|
+
CLEANUP SECTION
|
751
|
+
===============
|
752
|
+
-->
|
753
|
+
<target name="-deps-clean-init" unless="built-clean.properties">
|
754
|
+
<property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
|
755
|
+
<delete file="${built-clean.properties}" quiet="true"/>
|
756
|
+
</target>
|
757
|
+
<target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
|
758
|
+
<echo level="warn" message="Cycle detected: Wagon was already built"/>
|
759
|
+
</target>
|
760
|
+
<target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
|
761
|
+
<mkdir dir="${build.dir}"/>
|
762
|
+
<touch file="${built-clean.properties}" verbose="false"/>
|
763
|
+
<property file="${built-clean.properties}" prefix="already.built.clean."/>
|
764
|
+
<antcall target="-warn-already-built-clean"/>
|
765
|
+
<propertyfile file="${built-clean.properties}">
|
766
|
+
<entry key="${basedir}" value=""/>
|
767
|
+
</propertyfile>
|
768
|
+
</target>
|
769
|
+
<target depends="init" name="-do-clean">
|
770
|
+
<delete dir="${build.dir}"/>
|
771
|
+
<delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
|
772
|
+
</target>
|
773
|
+
<target name="-post-clean">
|
774
|
+
<!-- Empty placeholder for easier customization. -->
|
775
|
+
<!-- You can override this target in the ../build.xml file. -->
|
776
|
+
</target>
|
777
|
+
<target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
|
778
|
+
<target name="-check-call-dep">
|
779
|
+
<property file="${call.built.properties}" prefix="already.built."/>
|
780
|
+
<condition property="should.call.dep">
|
781
|
+
<not>
|
782
|
+
<isset property="already.built.${call.subproject}"/>
|
783
|
+
</not>
|
784
|
+
</condition>
|
785
|
+
</target>
|
786
|
+
<target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
|
787
|
+
<ant antfile="${call.script}" inheritall="false" target="${call.target}">
|
788
|
+
<propertyset>
|
789
|
+
<propertyref prefix="transfer."/>
|
790
|
+
<mapper from="transfer.*" to="*" type="glob"/>
|
791
|
+
</propertyset>
|
792
|
+
</ant>
|
793
|
+
</target>
|
794
|
+
</project>
|