buildr 1.3.0-java

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.
Files changed (138) hide show
  1. data/CHANGELOG +780 -0
  2. data/DISCLAIMER +7 -0
  3. data/KEYS +151 -0
  4. data/LICENSE +176 -0
  5. data/NOTICE +31 -0
  6. data/README +173 -0
  7. data/Rakefile +63 -0
  8. data/addon/buildr/antlr.rb +65 -0
  9. data/addon/buildr/cobertura.rb +232 -0
  10. data/addon/buildr/hibernate.rb +142 -0
  11. data/addon/buildr/javacc.rb +85 -0
  12. data/addon/buildr/jdepend.rb +60 -0
  13. data/addon/buildr/jetty.rb +248 -0
  14. data/addon/buildr/nailgun.rb +892 -0
  15. data/addon/buildr/openjpa.rb +90 -0
  16. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  17. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  18. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  19. data/addon/buildr/org/apache/buildr/JettyWrapper.java +144 -0
  20. data/addon/buildr/xmlbeans.rb +93 -0
  21. data/bin/buildr +21 -0
  22. data/buildr.gemspec +50 -0
  23. data/doc/css/default.css +225 -0
  24. data/doc/css/print.css +95 -0
  25. data/doc/css/syntax.css +43 -0
  26. data/doc/images/apache-incubator-logo.png +0 -0
  27. data/doc/images/buildr-hires.png +0 -0
  28. data/doc/images/buildr.png +0 -0
  29. data/doc/images/note.png +0 -0
  30. data/doc/images/tip.png +0 -0
  31. data/doc/images/zbuildr.tif +0 -0
  32. data/doc/pages/artifacts.textile +317 -0
  33. data/doc/pages/building.textile +501 -0
  34. data/doc/pages/contributing.textile +178 -0
  35. data/doc/pages/download.textile +25 -0
  36. data/doc/pages/extending.textile +229 -0
  37. data/doc/pages/getting_started.textile +337 -0
  38. data/doc/pages/index.textile +63 -0
  39. data/doc/pages/mailing_lists.textile +17 -0
  40. data/doc/pages/more_stuff.textile +367 -0
  41. data/doc/pages/packaging.textile +592 -0
  42. data/doc/pages/projects.textile +449 -0
  43. data/doc/pages/recipes.textile +127 -0
  44. data/doc/pages/settings_profiles.textile +339 -0
  45. data/doc/pages/testing.textile +475 -0
  46. data/doc/pages/troubleshooting.textile +121 -0
  47. data/doc/pages/whats_new.textile +389 -0
  48. data/doc/print.haml +52 -0
  49. data/doc/print.toc.yaml +28 -0
  50. data/doc/scripts/buildr-git.rb +411 -0
  51. data/doc/scripts/install-jruby.sh +44 -0
  52. data/doc/scripts/install-linux.sh +64 -0
  53. data/doc/scripts/install-osx.sh +52 -0
  54. data/doc/site.haml +55 -0
  55. data/doc/site.toc.yaml +44 -0
  56. data/lib/buildr.rb +47 -0
  57. data/lib/buildr/core.rb +27 -0
  58. data/lib/buildr/core/application.rb +373 -0
  59. data/lib/buildr/core/application_cli.rb +134 -0
  60. data/lib/buildr/core/build.rb +262 -0
  61. data/lib/buildr/core/checks.rb +382 -0
  62. data/lib/buildr/core/common.rb +155 -0
  63. data/lib/buildr/core/compile.rb +594 -0
  64. data/lib/buildr/core/environment.rb +120 -0
  65. data/lib/buildr/core/filter.rb +258 -0
  66. data/lib/buildr/core/generate.rb +195 -0
  67. data/lib/buildr/core/help.rb +118 -0
  68. data/lib/buildr/core/progressbar.rb +156 -0
  69. data/lib/buildr/core/project.rb +890 -0
  70. data/lib/buildr/core/test.rb +690 -0
  71. data/lib/buildr/core/transports.rb +486 -0
  72. data/lib/buildr/core/util.rb +235 -0
  73. data/lib/buildr/ide.rb +19 -0
  74. data/lib/buildr/ide/eclipse.rb +181 -0
  75. data/lib/buildr/ide/idea.ipr.template +300 -0
  76. data/lib/buildr/ide/idea.rb +194 -0
  77. data/lib/buildr/ide/idea7x.ipr.template +290 -0
  78. data/lib/buildr/ide/idea7x.rb +210 -0
  79. data/lib/buildr/java.rb +26 -0
  80. data/lib/buildr/java/ant.rb +71 -0
  81. data/lib/buildr/java/bdd_frameworks.rb +267 -0
  82. data/lib/buildr/java/commands.rb +210 -0
  83. data/lib/buildr/java/compilers.rb +432 -0
  84. data/lib/buildr/java/deprecated.rb +141 -0
  85. data/lib/buildr/java/groovyc.rb +137 -0
  86. data/lib/buildr/java/jruby.rb +99 -0
  87. data/lib/buildr/java/org/apache/buildr/BuildrNail$Main.class +0 -0
  88. data/lib/buildr/java/org/apache/buildr/BuildrNail.class +0 -0
  89. data/lib/buildr/java/org/apache/buildr/BuildrNail.java +41 -0
  90. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  91. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +116 -0
  92. data/lib/buildr/java/packaging.rb +706 -0
  93. data/lib/buildr/java/pom.rb +178 -0
  94. data/lib/buildr/java/rjb.rb +142 -0
  95. data/lib/buildr/java/test_frameworks.rb +290 -0
  96. data/lib/buildr/java/version_requirement.rb +172 -0
  97. data/lib/buildr/packaging.rb +21 -0
  98. data/lib/buildr/packaging/artifact.rb +729 -0
  99. data/lib/buildr/packaging/artifact_namespace.rb +957 -0
  100. data/lib/buildr/packaging/artifact_search.rb +140 -0
  101. data/lib/buildr/packaging/gems.rb +102 -0
  102. data/lib/buildr/packaging/package.rb +233 -0
  103. data/lib/buildr/packaging/tar.rb +104 -0
  104. data/lib/buildr/packaging/zip.rb +719 -0
  105. data/rakelib/apache.rake +126 -0
  106. data/rakelib/changelog.rake +56 -0
  107. data/rakelib/doc.rake +103 -0
  108. data/rakelib/package.rake +44 -0
  109. data/rakelib/release.rake +53 -0
  110. data/rakelib/rspec.rake +81 -0
  111. data/rakelib/rubyforge.rake +45 -0
  112. data/rakelib/scm.rake +49 -0
  113. data/rakelib/setup.rake +59 -0
  114. data/rakelib/stage.rake +45 -0
  115. data/spec/application_spec.rb +316 -0
  116. data/spec/archive_spec.rb +494 -0
  117. data/spec/artifact_namespace_spec.rb +635 -0
  118. data/spec/artifact_spec.rb +738 -0
  119. data/spec/build_spec.rb +193 -0
  120. data/spec/checks_spec.rb +537 -0
  121. data/spec/common_spec.rb +579 -0
  122. data/spec/compile_spec.rb +561 -0
  123. data/spec/groovy_compilers_spec.rb +239 -0
  124. data/spec/java_bdd_frameworks_spec.rb +238 -0
  125. data/spec/java_compilers_spec.rb +446 -0
  126. data/spec/java_packaging_spec.rb +1042 -0
  127. data/spec/java_test_frameworks_spec.rb +414 -0
  128. data/spec/packaging_helper.rb +63 -0
  129. data/spec/packaging_spec.rb +589 -0
  130. data/spec/project_spec.rb +739 -0
  131. data/spec/sandbox.rb +116 -0
  132. data/spec/scala_compilers_spec.rb +239 -0
  133. data/spec/spec.opts +6 -0
  134. data/spec/spec_helpers.rb +283 -0
  135. data/spec/test_spec.rb +871 -0
  136. data/spec/transport_spec.rb +300 -0
  137. data/spec/version_requirement_spec.rb +115 -0
  138. metadata +324 -0
@@ -0,0 +1,235 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+ require 'rbconfig'
17
+ require 'pathname'
18
+
19
+
20
+ module Buildr
21
+
22
+ module Util
23
+ extend self
24
+
25
+ def java_platform?
26
+ RUBY_PLATFORM =~ /java/
27
+ end
28
+
29
+ # In order to determine if we are running on a windows OS,
30
+ # prefer this function instead of using Gem.win_platform?.
31
+ #
32
+ # Gem.win_platform? only checks the RUBY_PLATFORM global,
33
+ # that in some cases like when running on JRuby is not
34
+ # succifient for our purpose:
35
+ #
36
+ # For JRuby, the value for RUBY_PLATFORM will always be 'java'
37
+ # That's why this function checks on Config::CONFIG['host_os']
38
+ def win_os?
39
+ Config::CONFIG['host_os'] =~ /windows|cygwin|bccwin|cygwin|djgpp|mingw|mswin|wince/i
40
+ end
41
+
42
+ # Runs Ruby with these command line arguments. The last argument may be a hash,
43
+ # supporting the following keys:
44
+ # :command -- Runs the specified script (e.g., :command=>'gem')
45
+ # :sudo -- Run as sudo on operating systems that require it.
46
+ # :verbose -- Override Rake's verbose flag.
47
+ def ruby(*args)
48
+ options = Hash === args.last ? args.pop : {}
49
+ cmd = []
50
+ ruby_bin = File.expand_path(Config::CONFIG['ruby_install_name'], Config::CONFIG['bindir'])
51
+ if options.delete(:sudo) && !(win_os? || Process.uid == File.stat(ruby_bin).uid)
52
+ cmd << 'sudo' << '-u' << "##{File.stat(ruby_bin).uid}"
53
+ end
54
+ cmd << ruby_bin
55
+ cmd << '-S' << options.delete(:command) if options[:command]
56
+ sh *cmd.push(*args.flatten).push(options) do |ok, status|
57
+ ok or fail "Command failed with status (#{status ? status.exitstatus : 'unknown'}): [#{cmd.join(" ")}]"
58
+ end
59
+ end
60
+
61
+ # Just like File.expand_path, but for windows systems it
62
+ # capitalizes the drive name and ensures backslashes are used
63
+ def normalize_path(path, *dirs)
64
+ path = File.expand_path(path, *dirs)
65
+ if win_os?
66
+ path.gsub!('/', '\\').gsub!(/^[a-zA-Z]+:/) { |s| s.upcase }
67
+ else
68
+ path
69
+ end
70
+ end
71
+
72
+ # Return the timestamp of file, without having to create a file task
73
+ def timestamp(file)
74
+ if File.exist?(file)
75
+ File.mtime(file)
76
+ else
77
+ Rake::EARLY
78
+ end
79
+ end
80
+
81
+ # Return the path to the first argument, starting from the path provided by the
82
+ # second argument.
83
+ #
84
+ # For example:
85
+ # relative_path('foo/bar', 'foo')
86
+ # => 'bar'
87
+ # relative_path('foo/bar', 'baz')
88
+ # => '../foo/bar'
89
+ # relative_path('foo/bar')
90
+ # => 'foo/bar'
91
+ # relative_path('/foo/bar', 'baz')
92
+ # => '/foo/bar'
93
+ def relative_path(to, from = '.')
94
+ to = Pathname.new(to).cleanpath
95
+ return to.to_s if from.nil?
96
+ to_path = Pathname.new(File.expand_path(to.to_s, "/"))
97
+ from_path = Pathname.new(File.expand_path(from.to_s, "/"))
98
+ to_path.relative_path_from(from_path).to_s
99
+ end
100
+
101
+ # Generally speaking, it's not a good idea to operate on dot files (files starting with dot).
102
+ # These are considered invisible files (.svn, .hg, .irbrc, etc). Dir.glob/FileList ignore them
103
+ # on purpose. There are few cases where we do have to work with them (filter, zip), a better
104
+ # solution is welcome, maybe being more explicit with include. For now, this will do.
105
+ def recursive_with_dot_files(*dirs)
106
+ FileList[dirs.map { |dir| File.join(dir, '/**/{*,.*}') }].reject { |file| File.basename(file) =~ /^[.]{1,2}$/ }
107
+ end
108
+
109
+ end
110
+ end
111
+
112
+
113
+ module Kernel #:nodoc:
114
+ # Borrowed from Ruby 1.9.
115
+ def tap
116
+ yield self if block_given?
117
+ self
118
+ end unless method_defined?('tap')
119
+ end
120
+
121
+
122
+ class Symbol #:nodoc:
123
+ # Borrowed from Ruby 1.9.
124
+ def to_proc
125
+ Proc.new{|*args| args.shift.__send__(self, *args)}
126
+ end unless method_defined?('to_proc')
127
+ end
128
+
129
+
130
+ # Also borrowed from Ruby 1.9.
131
+ class BasicObject #:nodoc:
132
+ (instance_methods - ['__send__', '__id__', '==', 'send', 'send!', 'respond_to?', 'equal?', 'object_id']).
133
+ each do |method|
134
+ undef_method method
135
+ end
136
+
137
+ def self.ancestors
138
+ [Kernel]
139
+ end
140
+ end
141
+
142
+
143
+ class OpenObject < Hash
144
+
145
+ def initialize(source=nil, &block)
146
+ @hash = Hash.new(&block)
147
+ @hash.update(source) if source
148
+ end
149
+
150
+ def [](key)
151
+ @hash[key]
152
+ end
153
+
154
+ def []=(key, value)
155
+ @hash[key] = value
156
+ end
157
+
158
+ def delete(key)
159
+ @hash.delete(key)
160
+ end
161
+
162
+ def to_hash
163
+ @hash.clone
164
+ end
165
+
166
+ def method_missing(symbol, *args)
167
+ if symbol.to_s =~ /=$/
168
+ self[symbol.to_s[0..-2].to_sym] = args.first
169
+ else
170
+ self[symbol]
171
+ end
172
+ end
173
+ end
174
+
175
+
176
+ class Hash
177
+
178
+ class << self
179
+
180
+ # :call-seq:
181
+ # Hash.from_java_properties(string)
182
+ #
183
+ # Returns a hash from a string in the Java properties file format. For example:
184
+ # str = 'foo=bar\nbaz=fab'
185
+ # Hash.from_properties(str)
186
+ # => { 'foo'=>'bar', 'baz'=>'fab' }.to_properties
187
+ def from_java_properties(string)
188
+ string.gsub(/\\\n/, '').split("\n").select { |line| line =~ /^[^#].*=.*/ }.
189
+ map { |line| line.gsub(/\\[trnf\\]/) { |escaped| {?t=>"\t", ?r=>"\r", ?n=>"\n", ?f=>"\f", ?\\=>"\\"}[escaped[1]] } }.
190
+ map { |line| line.split('=') }.
191
+ inject({}) { |hash, (name, value)| hash.merge(name=>value) }
192
+ end
193
+
194
+ end
195
+
196
+ # :call-seq:
197
+ # only(keys*) => hash
198
+ #
199
+ # Returns a new hash with only the specified keys.
200
+ #
201
+ # For example:
202
+ # { :a=>1, :b=>2, :c=>3, :d=>4 }.only(:a, :c)
203
+ # => { :a=>1, :c=>3 }
204
+ def only(*keys)
205
+ keys.inject({}) { |hash, key| has_key?(key) ? hash.merge(key=>self[key]) : hash }
206
+ end
207
+
208
+
209
+ # :call-seq:
210
+ # except(keys*) => hash
211
+ #
212
+ # Returns a new hash without the specified keys.
213
+ #
214
+ # For example:
215
+ # { :a=>1, :b=>2, :c=>3, :d=>4 }.except(:a, :c)
216
+ # => { :b=>2, :d=>4 }
217
+ def except(*keys)
218
+ (self.keys - keys).inject({}) { |hash, key| hash.merge(key=>self[key]) }
219
+ end
220
+
221
+ # :call-seq:
222
+ # to_java_properties => string
223
+ #
224
+ # Convert hash to string format used for Java properties file. For example:
225
+ # { 'foo'=>'bar', 'baz'=>'fab' }.to_properties
226
+ # => foo=bar
227
+ # baz=fab
228
+ def to_java_properties
229
+ keys.sort.map { |key|
230
+ value = self[key].gsub(/[\t\r\n\f\\]/) { |escape| "\\" + {"\t"=>"t", "\r"=>"r", "\n"=>"n", "\f"=>"f", "\\"=>"\\"}[escape] }
231
+ "#{key}=#{value}"
232
+ }.join("\n")
233
+ end
234
+
235
+ end
@@ -0,0 +1,19 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+
17
+ require 'buildr/ide/eclipse'
18
+ require 'buildr/ide/idea'
19
+ require 'buildr/ide/idea7x'
@@ -0,0 +1,181 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+
17
+ require 'buildr/core/project'
18
+ require 'buildr/packaging'
19
+
20
+
21
+ module Buildr
22
+ module Eclipse #:nodoc:
23
+
24
+ include Extension
25
+
26
+ first_time do
27
+ # Global task "eclipse" generates artifacts for all projects.
28
+ desc "Generate Eclipse artifacts for all projects"
29
+ Project.local_task "eclipse"=>"artifacts"
30
+ end
31
+
32
+ before_define do |project|
33
+ project.recursive_task("eclipse")
34
+ end
35
+
36
+ after_define do |project|
37
+ eclipse = project.task("eclipse")
38
+ # We need paths relative to the top project's base directory.
39
+ root_path = lambda { |p| f = lambda { |p| p.parent ? f[p.parent] : p.base_dir } ; f[p] }[project]
40
+
41
+ # We want the Eclipse files changed every time the Buildfile changes, but also anything loaded by
42
+ # the Buildfile (buildr.rb, separate file listing dependencies, etc), so we add anything required
43
+ # after the Buildfile. So which don't know where Buildr shows up exactly, ignore files that show
44
+ # in $LOADED_FEATURES that we cannot resolve.
45
+ sources = Buildr.application.build_files.map { |file| File.expand_path(file) }.select { |file| File.exist?(file) }
46
+ sources << File.expand_path(Buildr.application.buildfile, root_path) if Buildr.application.buildfile
47
+
48
+ # Check if project has scala facet
49
+ scala = project.compile.language == :scala
50
+
51
+ # Only for projects that we support
52
+ supported_languages = [:java, :scala]
53
+ supported_packaging = %w(jar war rar mar aar)
54
+ if (supported_languages.include? project.compile.language ||
55
+ project.packages.detect { |pkg| supported_packaging.include?(pkg.type.to_s) })
56
+ eclipse.enhance [ file(project.path_to(".classpath")), file(project.path_to(".project")) ]
57
+
58
+ # The only thing we need to look for is a change in the Buildfile.
59
+ file(project.path_to(".classpath")=>sources) do |task|
60
+ puts "Writing #{task.name}" if verbose
61
+
62
+ # Find a path relative to the project's root directory.
63
+ relative = lambda do |path|
64
+ path or raise "Invalid path '#{path.inspect}'"
65
+ msg = [:to_path, :to_str, :to_s].find { |msg| path.respond_to? msg }
66
+ path = path.__send__(msg)
67
+ Util.relative_path(File.expand_path(path), project.path_to)
68
+ end
69
+
70
+ m2repo = Buildr::Repositories.instance.local
71
+ excludes = [ '**/.svn/', '**/CVS/' ].join('|')
72
+
73
+ File.open(task.name, "w") do |file|
74
+ xml = Builder::XmlMarkup.new(:target=>file, :indent=>2)
75
+ xml.classpath do
76
+ # Note: Use the test classpath since Eclipse compiles both "main" and "test" classes using the same classpath
77
+ cp = project.test.compile.dependencies.map(&:to_s) - [ project.compile.target.to_s, project.resources.target.to_s ]
78
+ cp = cp.uniq
79
+
80
+ # Convert classpath elements into applicable Project objects
81
+ cp.collect! { |path| Buildr.projects.detect { |prj| prj.packages.detect { |pkg| pkg.to_s == path } } || path }
82
+
83
+ # project_libs: artifacts created by other projects
84
+ project_libs, others = cp.partition { |path| path.is_a?(Project) }
85
+
86
+ # Separate artifacts from Maven2 repository
87
+ m2_libs, others = others.partition { |path| path.to_s.index(m2repo) == 0 }
88
+
89
+ # Generated: classpath elements in the project are assumed to be generated
90
+ generated, libs = others.partition { |path| path.to_s.index(project.path_to.to_s) == 0 }
91
+
92
+ srcs = project.compile.sources
93
+
94
+ srcs = srcs.map { |src| relative[src] } + generated.map { |src| relative[src] }
95
+ srcs.sort.uniq.each do |path|
96
+ xml.classpathentry :kind=>'src', :path=>path, :excluding=>excludes
97
+ end
98
+
99
+ # Main resources implicitly copied into project.compile.target
100
+ main_resource_sources = project.resources.sources.map { |src| relative[src] }
101
+ main_resource_sources.each do |path|
102
+ if File.exist? project.path_to(path)
103
+ xml.classpathentry :kind=>'src', :path=>path, :excluding=>excludes
104
+ end
105
+ end
106
+
107
+ if project.test.compile.target
108
+ # Test classes are generated in a separate output directory
109
+ test_sources = project.test.compile.sources.map { |src| relative[src] }
110
+ test_sources.each do |paths|
111
+ paths.sort.uniq.each do |path|
112
+ xml.classpathentry :kind=>'src', :path=>path, :output => relative[project.test.compile.target], :excluding=>excludes
113
+ end
114
+ end
115
+
116
+ # Test resources go in separate output directory as well
117
+ project.test.resources.sources.each do |path|
118
+ if File.exist? project.path_to(path)
119
+ xml.classpathentry :kind=>'src', :path=>relative[path], :output => relative[project.test.compile.target], :excluding=>excludes
120
+ end
121
+ end
122
+ end
123
+
124
+ # Classpath elements from other projects
125
+ project_libs.map(&:id).sort.uniq.each do |project_id|
126
+ xml.classpathentry :kind=>'src', :combineaccessrules=>"false", :path=>"/#{project_id}"
127
+ end
128
+
129
+ { :output => relative[project.compile.target],
130
+ :lib => libs.map(&:to_s),
131
+ :var => m2_libs.map { |path| path.to_s.sub(m2repo, 'M2_REPO') }
132
+ }.each do |kind, paths|
133
+ paths.sort.uniq.each do |path|
134
+ xml.classpathentry :kind=>kind, :path=>path
135
+ end
136
+ end
137
+
138
+ xml.classpathentry :kind=>'con', :path=>'org.eclipse.jdt.launching.JRE_CONTAINER'
139
+ xml.classpathentry :kind=>'con', :path=>'ch.epfl.lamp.sdt.launching.SCALA_CONTAINER' if scala
140
+ end
141
+ end
142
+ end
143
+
144
+ # The only thing we need to look for is a change in the Buildfile.
145
+ file(project.path_to(".project")=>sources) do |task|
146
+ puts "Writing #{task.name}" if verbose
147
+ File.open(task.name, "w") do |file|
148
+ xml = Builder::XmlMarkup.new(:target=>file, :indent=>2)
149
+ xml.projectDescription do
150
+ xml.name project.id
151
+ xml.projects
152
+ xml.buildSpec do
153
+ xml.buildCommand do
154
+ xml.name "org.eclipse.jdt.core.javabuilder"
155
+ end
156
+ if scala
157
+ xml.buildCommand do
158
+ xml.name "ch.epfl.lamp.sdt.core.scalabuilder"
159
+ #xml.name "scala.plugin.scalabuilder"
160
+ end
161
+ end
162
+ end
163
+ xml.natures do
164
+ xml.nature "org.eclipse.jdt.core.javanature"
165
+ xml.nature "ch.epfl.lamp.sdt.core.scalanature" if scala
166
+ #xml.nature "scala.plugin.scalanature" if scala
167
+ end
168
+ end
169
+ end
170
+ end
171
+ end
172
+
173
+ end
174
+
175
+ end
176
+ end # module Buildr
177
+
178
+
179
+ class Buildr::Project
180
+ include Buildr::Eclipse
181
+ end
@@ -0,0 +1,300 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Licensed to the Apache Software Foundation (ASF) under one or more
4
+ contributor license agreements. See the NOTICE file distributed with this
5
+ work for additional information regarding copyright ownership. The ASF
6
+ licenses this file to you under the Apache License, Version 2.0 (the
7
+ "License"); you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ License for the specific language governing permissions and limitations under
16
+ the License.
17
+ -->
18
+ <project version="4" relativePaths="false">
19
+ <component name="AntConfiguration">
20
+ <defaultAnt bundledAnt="true" />
21
+ </component>
22
+ <component name="BuildJarProjectSettings">
23
+ <option name="BUILD_JARS_ON_MAKE" value="false" />
24
+ </component>
25
+ <component name="CodeStyleManager">
26
+ <option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true" />
27
+ <option name="CODE_STYLE_SCHEME" value="" />
28
+ </component>
29
+ <component name="CodeStyleProjectProfileManger">
30
+ <option name="PROJECT_PROFILE" />
31
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
32
+ </component>
33
+ <component name="CodeStyleSettingsManager">
34
+ <option name="PER_PROJECT_SETTINGS" />
35
+ <option name="USE_PER_PROJECT_SETTINGS" value="false" />
36
+ </component>
37
+ <component name="CompilerConfiguration">
38
+ <option name="DEFAULT_COMPILER" value="Javac" />
39
+ <option name="DEPLOY_AFTER_MAKE" value="0" />
40
+ <resourceExtensions />
41
+ <wildcardResourcePatterns>
42
+ <entry name="!?*.java" />
43
+ </wildcardResourcePatterns>
44
+ </component>
45
+ <component name="DataSourceManager" />
46
+ <component name="DataSourceManagerImpl" />
47
+ <component name="DependenciesAnalyzeManager">
48
+ <option name="myForwardDirection" value="false" />
49
+ </component>
50
+ <component name="DependencyValidationManager" />
51
+ <component name="EclipseCompilerSettings">
52
+ <option name="DEBUGGING_INFO" value="true" />
53
+ <option name="GENERATE_NO_WARNINGS" value="true" />
54
+ <option name="DEPRECATION" value="false" />
55
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
56
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
57
+ </component>
58
+ <component name="EclipseEmbeddedCompilerSettings">
59
+ <option name="DEBUGGING_INFO" value="true" />
60
+ <option name="GENERATE_NO_WARNINGS" value="true" />
61
+ <option name="DEPRECATION" value="false" />
62
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
63
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
64
+ </component>
65
+ <component name="EntryPointsManager">
66
+ <entry_points />
67
+ </component>
68
+ <component name="ExportToHTMLSettings">
69
+ <option name="PRINT_LINE_NUMBERS" value="false" />
70
+ <option name="OPEN_IN_BROWSER" value="false" />
71
+ <option name="OUTPUT_DIRECTORY" />
72
+ </component>
73
+ <component name="GUI Designer component loader factory" />
74
+ <component name="IdProvider" IDEtalkID="0246D33576B8D4BC3331F9A5BB848389" />
75
+ <component name="ImportConfiguration">
76
+ <option name="VENDOR" />
77
+ <option name="RELEASE_TAG" />
78
+ <option name="LOG_MESSAGE" />
79
+ <option name="CHECKOUT_AFTER_IMPORT" value="true" />
80
+ </component>
81
+ <component name="InspectionProjectProfileManager">
82
+ <option name="PROJECT_PROFILE" value="Project Default" />
83
+ <option name="USE_PROJECT_LEVEL_SETTINGS" value="false" />
84
+ <scopes />
85
+ <profiles>
86
+ <profile version="1.0" is_locked="false">
87
+ <option name="myName" value="Project Default" />
88
+ <option name="myLocal" value="false" />
89
+ <used_levels>
90
+ <error>
91
+ <option name="myName" value="ERROR" />
92
+ <option name="myVal" value="400" />
93
+ </error>
94
+ <warning>
95
+ <option name="myName" value="WARNING" />
96
+ <option name="myVal" value="300" />
97
+ </warning>
98
+ <information>
99
+ <option name="myName" value="INFO" />
100
+ <option name="myVal" value="200" />
101
+ </information>
102
+ <server>
103
+ <option name="myName" value="SERVER PROBLEM" />
104
+ <option name="myVal" value="100" />
105
+ </server>
106
+ </used_levels>
107
+ </profile>
108
+ </profiles>
109
+ </component>
110
+ <component name="JUnitProjectSettings">
111
+ <option name="TEST_RUNNER" value="UI" />
112
+ </component>
113
+ <component name="JavacSettings">
114
+ <option name="DEBUGGING_INFO" value="true" />
115
+ <option name="GENERATE_NO_WARNINGS" value="false" />
116
+ <option name="DEPRECATION" value="true" />
117
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
118
+ <option name="MAXIMUM_HEAP_SIZE" value="128" />
119
+ </component>
120
+ <component name="JavadocGenerationManager">
121
+ <option name="OUTPUT_DIRECTORY" />
122
+ <option name="OPTION_SCOPE" value="protected" />
123
+ <option name="OPTION_HIERARCHY" value="false" />
124
+ <option name="OPTION_NAVIGATOR" value="false" />
125
+ <option name="OPTION_INDEX" value="false" />
126
+ <option name="OPTION_SEPARATE_INDEX" value="false" />
127
+ <option name="OPTION_DOCUMENT_TAG_USE" value="false" />
128
+ <option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
129
+ <option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
130
+ <option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="false" />
131
+ <option name="OPTION_DEPRECATED_LIST" value="false" />
132
+ <option name="OTHER_OPTIONS" />
133
+ <option name="HEAP_SIZE" />
134
+ <option name="LOCALE" />
135
+ <option name="OPEN_IN_BROWSER" value="false" />
136
+ </component>
137
+ <component name="JikesSettings">
138
+ <option name="JIKES_PATH" value="" />
139
+ <option name="DEBUGGING_INFO" value="true" />
140
+ <option name="DEPRECATION" value="true" />
141
+ <option name="GENERATE_NO_WARNINGS" value="false" />
142
+ <option name="IS_EMACS_ERRORS_MODE" value="true" />
143
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
144
+ </component>
145
+ <component name="LogConsolePreferences">
146
+ <option name="FILTER_ERRORS" value="false" />
147
+ <option name="FILTER_WARNINGS" value="false" />
148
+ <option name="FILTER_INFO" value="true" />
149
+ <option name="CUSTOM_FILTER" />
150
+ </component>
151
+ <component name="Palette2">
152
+ <group name="Swing">
153
+ <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
154
+ <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
155
+ </item>
156
+ <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
157
+ <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
158
+ </item>
159
+ <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
160
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
161
+ </item>
162
+ <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
163
+ <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
164
+ </item>
165
+ <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
166
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
167
+ <initial-values>
168
+ <property name="text" value="Button" />
169
+ </initial-values>
170
+ </item>
171
+ <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
172
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
173
+ <initial-values>
174
+ <property name="text" value="RadioButton" />
175
+ </initial-values>
176
+ </item>
177
+ <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
178
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
179
+ <initial-values>
180
+ <property name="text" value="CheckBox" />
181
+ </initial-values>
182
+ </item>
183
+ <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
184
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
185
+ <initial-values>
186
+ <property name="text" value="Label" />
187
+ </initial-values>
188
+ </item>
189
+ <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
190
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
191
+ <preferred-size width="150" height="-1" />
192
+ </default-constraints>
193
+ </item>
194
+ <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
195
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
196
+ <preferred-size width="150" height="-1" />
197
+ </default-constraints>
198
+ </item>
199
+ <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
200
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
201
+ <preferred-size width="150" height="-1" />
202
+ </default-constraints>
203
+ </item>
204
+ <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
205
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
206
+ <preferred-size width="150" height="50" />
207
+ </default-constraints>
208
+ </item>
209
+ <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
210
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
211
+ <preferred-size width="150" height="50" />
212
+ </default-constraints>
213
+ </item>
214
+ <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
215
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
216
+ <preferred-size width="150" height="50" />
217
+ </default-constraints>
218
+ </item>
219
+ <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
220
+ <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
221
+ </item>
222
+ <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
223
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
224
+ <preferred-size width="150" height="50" />
225
+ </default-constraints>
226
+ </item>
227
+ <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
228
+ <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
229
+ <preferred-size width="150" height="50" />
230
+ </default-constraints>
231
+ </item>
232
+ <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
233
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
234
+ <preferred-size width="150" height="50" />
235
+ </default-constraints>
236
+ </item>
237
+ <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
238
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
239
+ <preferred-size width="200" height="200" />
240
+ </default-constraints>
241
+ </item>
242
+ <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
243
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
244
+ <preferred-size width="200" height="200" />
245
+ </default-constraints>
246
+ </item>
247
+ <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
248
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
249
+ </item>
250
+ <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
251
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
252
+ </item>
253
+ <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
254
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
255
+ </item>
256
+ <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
257
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
258
+ </item>
259
+ <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
260
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
261
+ <preferred-size width="-1" height="20" />
262
+ </default-constraints>
263
+ </item>
264
+ <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
265
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
266
+ </item>
267
+ <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
268
+ <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
269
+ </item>
270
+ </group>
271
+ </component>
272
+ <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5" />
273
+ <component name="ProjectRunConfigurationManager" />
274
+ <component name="RmicSettings">
275
+ <option name="IS_EANABLED" value="false" />
276
+ <option name="DEBUGGING_INFO" value="true" />
277
+ <option name="GENERATE_NO_WARNINGS" value="false" />
278
+ <option name="GENERATE_IIOP_STUBS" value="false" />
279
+ <option name="ADDITIONAL_OPTIONS_STRING" value="" />
280
+ </component>
281
+ <component name="StarteamVcsAdapter" />
282
+ <component name="VssVcs" />
283
+ <component name="com.intellij.jsf.UserDefinedFacesConfigs">
284
+ <option name="USER_DEFINED_CONFIGS">
285
+ <value>
286
+ <list size="0" />
287
+ </value>
288
+ </option>
289
+ </component>
290
+ <component name="uidesigner-configuration">
291
+ <option name="INSTRUMENT_CLASSES" value="true" />
292
+ <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true" />
293
+ <option name="DEFAULT_LAYOUT_MANAGER" value="GridLayoutManager" />
294
+ </component>
295
+ <UsedPathMacros>
296
+ <macro name="M2_REPO" />
297
+ </UsedPathMacros>
298
+ </project>
299
+
300
+