buildr 1.4.0-x86-mswin32 → 1.4.1-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/_buildr +5 -1
- data/_jbuildr +5 -1
- data/buildr.gemspec +6 -2
- data/doc/download.textile +24 -0
- data/doc/index.textile +15 -8
- data/lib/buildr.rb +1 -1
- data/lib/buildr/core/build.rb +1 -1
- data/lib/buildr/core/compile.rb +7 -1
- data/lib/buildr/java.rb +1 -0
- data/lib/buildr/java/ant.rb +1 -1
- data/lib/buildr/java/external.rb +73 -0
- data/lib/buildr/java/rjb.rb +1 -0
- data/lib/buildr/java/tests.rb +10 -3
- data/lib/buildr/packaging/package.rb +2 -1
- data/rakelib/checks.rake +1 -1
- data/spec/core/cc_spec.rb +3 -3
- data/spec/java/external_spec.rb +54 -0
- data/spec/java/packaging_spec.rb +14 -0
- data/spec/packaging/packaging_spec.rb +9 -1
- data/spec/spec_helpers.rb +1 -1
- metadata +45 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
1.4.1 (2010-07-07)
|
2
|
+
* Added: BUILDR-420 Support external compiler
|
3
|
+
* Added: BUILDR-425 Specify dev dependencies in .gemspec
|
4
|
+
* Change: BUILDR-459 Update gemspec to accept json_pure ~> 1.4.3
|
5
|
+
* Fixed: BUILDR-455 cc_spec.rb l 160 depends on time and thus fails intermittently
|
6
|
+
* Fixed: BUILDR-461 Packages with different ids collide
|
7
|
+
* Fixed: BUILDR-439 "The command line is too long" when running TestNG tests
|
8
|
+
* Fixed: BUILDR-463 Setting a system property in the buildfile causes a NoClassDefFoundError
|
9
|
+
|
1
10
|
1.4.0 (2010-06-18)
|
2
11
|
* Added: BUILDR-405 Enhance the idea7x extension to supply a task to delete generated files
|
3
12
|
(Peter Donald)
|
data/_buildr
CHANGED
@@ -20,8 +20,12 @@
|
|
20
20
|
require 'rubygems'
|
21
21
|
$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib') << File.join(File.dirname(__FILE__), 'addon')
|
22
22
|
spec = Gem::Specification.load(File.join(File.dirname(__FILE__), 'buildr.gemspec'))
|
23
|
+
# To avoid a warning about the version_requirements deprecation, we use this method inline.
|
24
|
+
def version_required(gem_def)
|
25
|
+
return Gem::Dependency.instance_methods.include?("requirement") ? gem_def.requirement : gem_def.version_requirements
|
26
|
+
end
|
23
27
|
spec.dependencies.each do |dep|
|
24
|
-
gem dep.name, dep.
|
28
|
+
gem dep.name, version_required(dep).to_s if dep.type == :runtime
|
25
29
|
end
|
26
30
|
Gem.loaded_specs['buildr'] = spec # Prevents RubyGem from loading files from installed Buildr gems
|
27
31
|
|
data/_jbuildr
CHANGED
@@ -20,8 +20,12 @@
|
|
20
20
|
require 'rubygems'
|
21
21
|
$LOAD_PATH << File.join(File.dirname(__FILE__), 'lib') << File.join(File.dirname(__FILE__), 'addon')
|
22
22
|
spec = Gem::Specification.load(File.join(File.dirname(__FILE__), 'buildr.gemspec'))
|
23
|
+
# To avoid a warning about the version_requirements deprecation, we use this method inline.
|
24
|
+
def version_required(gem_def)
|
25
|
+
return Gem::Dependency.instance_methods.include?("requirement") ? gem_def.requirement : gem_def.version_requirements
|
26
|
+
end
|
23
27
|
spec.dependencies.each do |dep|
|
24
|
-
gem dep.name, dep.
|
28
|
+
gem dep.name, version_required(dep).to_s if dep.type == :runtime
|
25
29
|
end
|
26
30
|
Gem.loaded_specs['buildr'] = spec # Prevents RubyGem from loading files from installed Buildr gems
|
27
31
|
|
data/buildr.gemspec
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
Gem::Specification.new do |spec|
|
18
18
|
spec.name = 'buildr'
|
19
|
-
spec.version = '1.4.
|
19
|
+
spec.version = '1.4.1'
|
20
20
|
spec.author = 'Apache Buildr'
|
21
21
|
spec.email = "users@buildr.apache.org"
|
22
22
|
spec.homepage = "http://buildr.apache.org/"
|
@@ -53,7 +53,7 @@ for those one-off tasks, with a language that's a joy to use.
|
|
53
53
|
spec.add_dependency 'net-sftp', '2.0.2'
|
54
54
|
spec.add_dependency 'rubyzip', '0.9.1'
|
55
55
|
spec.add_dependency 'highline', '1.5.1'
|
56
|
-
spec.add_dependency 'json_pure', '1.4.
|
56
|
+
spec.add_dependency 'json_pure', '1.4.3'
|
57
57
|
spec.add_dependency 'rubyforge', '2.0.3'
|
58
58
|
spec.add_dependency 'hoe', '2.3.3'
|
59
59
|
spec.add_dependency 'rjb', '1.2.5' if spec.platform.to_s == 'ruby'
|
@@ -63,4 +63,8 @@ for those one-off tasks, with a language that's a joy to use.
|
|
63
63
|
spec.add_dependency 'xml-simple', '1.0.12'
|
64
64
|
spec.add_dependency 'archive-tar-minitar', '0.5.2'
|
65
65
|
spec.add_dependency 'jruby-openssl', '0.5.2' if spec.platform.to_s == 'java'
|
66
|
+
spec.add_development_dependency 'jekyll', '~> 0.5.2'
|
67
|
+
spec.add_development_dependency 'sdoc'
|
68
|
+
spec.add_development_dependency 'rcov', '~>0.8'
|
69
|
+
spec.add_development_dependency 'win32console' if spec.platform.to_s == 'x86-mswin32'
|
66
70
|
end
|
data/doc/download.textile
CHANGED
@@ -20,6 +20,30 @@ The source code is included in both source and binary distribution, the Gem dist
|
|
20
20
|
|
21
21
|
h2(#dist). Binaries and Source Code
|
22
22
|
|
23
|
+
h3. buildr 1.4.1 (2010-07-07)
|
24
|
+
|
25
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
26
|
+
| "buildr-1.4.1-java.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.1/buildr-1.4.1-java.gem | "505edb298e41e38f59058990e34f216e":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1-java.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1-java.gem.asc |
|
27
|
+
| "buildr-1.4.1-x86-mswin32.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.1/buildr-1.4.1-x86-mswin32.gem | "0d8fe64d03c22dbec997a0f58aa5b4b7":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1-x86-mswin32.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1-x86-mswin32.gem.asc |
|
28
|
+
| "buildr-1.4.1.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.1/buildr-1.4.1.gem | "4ccbea74c98e36041c3e71404efca905":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1.gem.asc |
|
29
|
+
| "buildr-1.4.1.tgz":http://www.apache.org/dyn/closer.cgi/buildr/1.4.1/buildr-1.4.1.tgz | "bc05316ab453a9ae4b9e597286740700":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1.tgz.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1.tgz.asc |
|
30
|
+
| "buildr-1.4.1.zip":http://www.apache.org/dyn/closer.cgi/buildr/1.4.1/buildr-1.4.1.zip | "9482d9b56ecd1679e5a481bfb07e85e3":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1.zip.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.1/buildr-1.4.1.zip.asc |
|
31
|
+
|
32
|
+
p>. ("Release signing keys":http://www.apache.org/dist/buildr/1.4.1/KEYS)
|
33
|
+
|
34
|
+
|
35
|
+
h3. buildr 1.4.0 (2010-06-18)
|
36
|
+
|
37
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
38
|
+
| "buildr-1.4.0-java.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.0/buildr-1.4.0-java.gem | "6304234b3e4b49ffb95dd5f155442935":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0-java.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0-java.gem.asc |
|
39
|
+
| "buildr-1.4.0-x86-mswin32.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.0/buildr-1.4.0-x86-mswin32.gem | "6a4b0ab7cc651128c25a4b7cc4867479":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0-x86-mswin32.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0-x86-mswin32.gem.asc |
|
40
|
+
| "buildr-1.4.0.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.0/buildr-1.4.0.gem | "96c4c4d56ac4baffbaa1980af39c2220":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0.gem.asc |
|
41
|
+
| "buildr-1.4.0.tgz":http://www.apache.org/dyn/closer.cgi/buildr/1.4.0/buildr-1.4.0.tgz | "f025d57e1a71e40bb02def291eb02363":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0.tgz.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0.tgz.asc |
|
42
|
+
| "buildr-1.4.0.zip":http://www.apache.org/dyn/closer.cgi/buildr/1.4.0/buildr-1.4.0.zip | "a7c39d799e0e7f31827d803d788927f0":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0.zip.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.0/buildr-1.4.0.zip.asc |
|
43
|
+
|
44
|
+
p>. ("Release signing keys":http://www.apache.org/dist/buildr/1.4.0/KEYS)
|
45
|
+
|
46
|
+
|
23
47
|
h3. buildr 1.3.5 (2009-10-05)
|
24
48
|
|
25
49
|
|_. Package |_. MD5 Checksum |_. PGP |
|
data/doc/index.textile
CHANGED
@@ -46,14 +46,21 @@ So let's get started. You can "read the documentation online":quick_start.html,
|
|
46
46
|
|
47
47
|
h2(#news). What's New
|
48
48
|
|
49
|
-
New in Buildr 1.
|
50
|
-
|
51
|
-
*
|
52
|
-
*
|
53
|
-
*
|
54
|
-
*
|
55
|
-
*
|
56
|
-
*
|
49
|
+
New in Buildr 1.4.0:
|
50
|
+
|
51
|
+
* Support for Scala 2.8 compiler-level change detection and dependency tracking
|
52
|
+
* Continuous compilation
|
53
|
+
* Support for Eclipse classpath variables to avoid absolute pathnames in generated .classpath
|
54
|
+
* "buildr test=only" will only run tests explicitly specified on the command line (and ignore transitive test dependencies)
|
55
|
+
* Generic documentation framework (we do doc, not just javadoc)
|
56
|
+
* New "test:failed" task to execute only tests that failed during last run
|
57
|
+
* Project extensions (before/after_define) now support dependency ordering similar to Rake
|
58
|
+
* Support unzipping tar.gz files
|
59
|
+
* ScalaTest now generates JUnit XML reports in addition to text files.
|
60
|
+
* Support protocol buffer code generation
|
61
|
+
* Tested against Windows and Ubuntu on JRuby and MRI (and experimenting with Rubinius)
|
62
|
+
* Dependency upgrades such as Ant 1.8.0, JUnit 4.7, JMock 2.5.1, Cobertura 1.9.4.1, Scala Specs 1.6.2.1, ScalaCheck 1.6, ScalaTest 1.0.1
|
63
|
+
* And 60+ bug fixes !
|
57
64
|
|
58
65
|
See the "CHANGELOG":CHANGELOG for full details.
|
59
66
|
|
data/lib/buildr.rb
CHANGED
data/lib/buildr/core/build.rb
CHANGED
@@ -299,7 +299,7 @@ module Buildr
|
|
299
299
|
# Release.find.tag_name = lambda { |ver| "foo-#{ver}" }
|
300
300
|
# Deprecated: you should use Release.tag_name instead
|
301
301
|
def tag_name=(tag_proc)
|
302
|
-
|
302
|
+
Buildr.application.deprecated "Release.find.tag_name is deprecated. You should use Release.tag_name instead"
|
303
303
|
Release.tag_name=(tag_proc)
|
304
304
|
end
|
305
305
|
|
data/lib/buildr/core/compile.rb
CHANGED
@@ -50,7 +50,13 @@ module Buildr
|
|
50
50
|
def compilers
|
51
51
|
@compilers ||= []
|
52
52
|
end
|
53
|
-
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
# Only used by our specs.
|
57
|
+
def compilers=(compilers)
|
58
|
+
@compilers = compilers
|
59
|
+
end
|
54
60
|
end
|
55
61
|
|
56
62
|
# Base class for all compilers, with common functionality. Extend and over-ride as you see fit
|
data/lib/buildr/java.rb
CHANGED
data/lib/buildr/java/ant.rb
CHANGED
@@ -38,7 +38,7 @@ module Buildr
|
|
38
38
|
# Ant-Trax required for running the JUnitReport task, and there's no other place
|
39
39
|
# to put it but the root classpath.
|
40
40
|
@dependencies ||= ["org.apache.ant:ant:jar:#{version}", "org.apache.ant:ant-launcher:jar:#{version}",
|
41
|
-
|
41
|
+
"org.apache.ant:ant-trax:jar:#{version}"]
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
@@ -0,0 +1,73 @@
|
|
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
|
+
module Buildr
|
17
|
+
module Compiler
|
18
|
+
class ExternalJavac< Buildr::Compiler::Javac
|
19
|
+
|
20
|
+
OPTIONS = [:jvm, :warnings, :debug, :deprecation, :source, :target, :lint, :other]
|
21
|
+
|
22
|
+
specify :language=>:java, :sources => 'java', :source_ext => 'java',
|
23
|
+
:target=>'classes', :target_ext=>'class', :packaging=>:jar
|
24
|
+
|
25
|
+
|
26
|
+
def compile(sources, target, dependencies) #:nodoc:
|
27
|
+
check_options options, OPTIONS
|
28
|
+
cmd_args = []
|
29
|
+
# tools.jar contains the Java compiler.
|
30
|
+
dependencies << Java.tools_jar if Java.tools_jar
|
31
|
+
cmd_args << '-classpath' << dependencies.join(File::PATH_SEPARATOR) unless dependencies.empty?
|
32
|
+
source_paths = sources.select { |source| File.directory?(source) }
|
33
|
+
cmd_args << '-sourcepath' << source_paths.join(File::PATH_SEPARATOR) unless source_paths.empty?
|
34
|
+
cmd_args << '-d' << File.expand_path(target)
|
35
|
+
cmd_args += externaljavac_args
|
36
|
+
Tempfile.open("external") {|tmp|
|
37
|
+
tmp.write files_from_sources(sources).join(' ')
|
38
|
+
cmd_args << "@#{tmp.path}"
|
39
|
+
}
|
40
|
+
unless Buildr.application.options.dryrun
|
41
|
+
javac_path = File.join(options[:jvm] || ENV['JAVA_HOME'], "bin", "javac")
|
42
|
+
final_args = cmd_args.insert(0, javac_path).push('2>&1').join(' ')
|
43
|
+
trace(final_args)
|
44
|
+
info %x[#{final_args}]
|
45
|
+
fail 'Failed to compile, see errors above' unless $?.success?
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
# See arg list here: http://publib.boulder.ibm.com/infocenter/rsahelp/v7r0m0/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm
|
52
|
+
def externaljavac_args #:nodoc:
|
53
|
+
args = []
|
54
|
+
args << '-nowarn' unless options[:warnings]
|
55
|
+
args << '-verbose' if Buildr.application.options.trace
|
56
|
+
args << '-g' if options[:debug]
|
57
|
+
args << '-deprecation' if options[:deprecation]
|
58
|
+
args << '-source' << options[:source].to_s if options[:source]
|
59
|
+
args << '-target' << options[:target].to_s if options[:target]
|
60
|
+
case options[:lint]
|
61
|
+
when Array then args << "-Xlint:#{options[:lint].join(',')}"
|
62
|
+
when String then args << "-Xlint:#{options[:lint]}"
|
63
|
+
when true then args << '-Xlint'
|
64
|
+
end
|
65
|
+
args + Array(options[:other])
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
Buildr::Compiler.compilers << Buildr::Compiler::ExternalJavac
|
data/lib/buildr/java/rjb.rb
CHANGED
@@ -125,6 +125,7 @@ module Java
|
|
125
125
|
|
126
126
|
def method_missing(sym, *args, &block) #:nodoc:
|
127
127
|
raise ArgumentError, 'No arguments expected' unless args.empty?
|
128
|
+
Java.load # need to load RJB's classpath now!
|
128
129
|
name = sym.to_s
|
129
130
|
return ::Rjb.import(name) if name =~ /^[[:upper:]]/
|
130
131
|
__package__ name
|
data/lib/buildr/java/tests.rb
CHANGED
@@ -321,15 +321,20 @@ module Buildr
|
|
321
321
|
end
|
322
322
|
|
323
323
|
def run(tests, dependencies) #:nodoc:
|
324
|
-
cmd_args = [
|
324
|
+
cmd_args = ['-log', '2', '-sourcedir', task.compile.sources.join(';'), '-suitename', task.project.id ]
|
325
325
|
cmd_args << '-d' << task.report_to.to_s
|
326
326
|
# run all tests in the same suite
|
327
327
|
cmd_args << '-testclass' << tests
|
328
|
+
|
328
329
|
cmd_options = { :properties=>options[:properties], :java_args=>options[:java_args],
|
329
330
|
:classpath=>dependencies, :name => "TestNG in #{task.send(:project).name}" }
|
330
|
-
|
331
|
+
|
332
|
+
tmp = nil
|
331
333
|
begin
|
332
|
-
|
334
|
+
tmp = Tempfile.open("testNG")
|
335
|
+
tmp.write cmd_args.join("\n")
|
336
|
+
tmp.close
|
337
|
+
Java::Commands.java ['org.testng.TestNG', "@#{tmp.path}"], cmd_options
|
333
338
|
return tests
|
334
339
|
rescue
|
335
340
|
# testng-failed.xml contains the list of failed tests *only*
|
@@ -338,6 +343,8 @@ module Buildr
|
|
338
343
|
error "TestNG regexp returned unexpected failed tests #{failed.inspect}" unless (failed - tests).empty?
|
339
344
|
# return the list of passed tests
|
340
345
|
return tests - failed
|
346
|
+
ensure
|
347
|
+
tmp.close unless tmp.nil?
|
341
348
|
end
|
342
349
|
end
|
343
350
|
|
@@ -151,7 +151,7 @@ module Buildr
|
|
151
151
|
spec = send("package_as_#{spec[:type]}_spec", spec) if respond_to?("package_as_#{spec[:type]}_spec")
|
152
152
|
file_name = path_to(:target, Artifact.hash_to_file_name(spec))
|
153
153
|
end
|
154
|
-
package = (no_options && packages.detect { |pkg| pkg.type == spec[:type] &&
|
154
|
+
package = (no_options && packages.detect { |pkg| pkg.type == spec[:type] && (pkg.id.nil? || pkg.id == spec[:id]) &&
|
155
155
|
(pkg.respond_to?(:classifier) ? pkg.classifier : nil) == spec[:classifier]}) ||
|
156
156
|
packages.find { |pkg| pkg.name == file_name } ||
|
157
157
|
packager.call(file_name)
|
@@ -171,6 +171,7 @@ module Buildr
|
|
171
171
|
|
172
172
|
if spec[:file]
|
173
173
|
class << package ; self ; end.send(:define_method, :type) { spec[:type] }
|
174
|
+
class << package ; self ; end.send(:define_method, :id) { nil }
|
174
175
|
else
|
175
176
|
# Make it an artifact using the specifications, and tell it how to create a POM.
|
176
177
|
package.extend ActsAsArtifact
|
data/rakelib/checks.rake
CHANGED
@@ -45,7 +45,7 @@ task :dependency do
|
|
45
45
|
dep_spec.runtime_dependencies.map { |trans| transitive[trans].push(trans) }.flatten.uniq }
|
46
46
|
# For each dependency, make sure *all* its transitive dependencies are listed
|
47
47
|
# as a Buildr dependency, and order is preserved.
|
48
|
-
spec.dependencies.each_with_index do |dep, index|
|
48
|
+
spec.dependencies.select {|dep| dep.type == :runtime }.each_with_index do |dep, index|
|
49
49
|
puts "checking #{dep.name}"
|
50
50
|
transitive[dep].each do |trans|
|
51
51
|
matching = spec.dependencies.find { |existing| trans =~ existing }
|
data/spec/core/cc_spec.rb
CHANGED
@@ -108,7 +108,7 @@ describe Buildr::CCTask do
|
|
108
108
|
project.cc.invoke
|
109
109
|
end
|
110
110
|
|
111
|
-
sleep
|
111
|
+
sleep 0.5
|
112
112
|
|
113
113
|
compile.should_receive :reenable
|
114
114
|
compile.should_receive :invoke
|
@@ -120,7 +120,7 @@ describe Buildr::CCTask do
|
|
120
120
|
|
121
121
|
sleep 1 # Wait one sec as the timestamp needs to be different.
|
122
122
|
touch File.join(Dir.pwd, 'src/main/java/Example.java')
|
123
|
-
sleep 0.
|
123
|
+
sleep 0.3# Wait one standard delay and half
|
124
124
|
|
125
125
|
thread.exit
|
126
126
|
end
|
@@ -167,7 +167,7 @@ describe Buildr::CCTask do
|
|
167
167
|
|
168
168
|
sleep 1 # Wait one sec as the timestamp needs to be different.
|
169
169
|
touch File.join(Dir.pwd, 'foo/src/main/java/Example.java')
|
170
|
-
sleep 0.
|
170
|
+
sleep 0.3 # Wait one standard delay and half
|
171
171
|
|
172
172
|
thread.exit
|
173
173
|
end
|
@@ -0,0 +1,54 @@
|
|
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 File.join(File.dirname(__FILE__), '../spec_helpers')
|
18
|
+
|
19
|
+
COMPILERS = Buildr::Compiler.compilers.dup
|
20
|
+
COMPILERS_WITHOUT_JAVAC = COMPILERS.dup
|
21
|
+
COMPILERS_WITHOUT_JAVAC.delete Buildr::Compiler::Javac
|
22
|
+
|
23
|
+
describe Buildr::Compiler::ExternalJavac do
|
24
|
+
|
25
|
+
before(:all) do
|
26
|
+
Buildr::Compiler.send :compilers=, COMPILERS_WITHOUT_JAVAC
|
27
|
+
end
|
28
|
+
|
29
|
+
describe "should compile a Java project just in the same way javac does" do
|
30
|
+
javac_spec = File.read(File.join(File.dirname(__FILE__), "compiler_spec.rb"))
|
31
|
+
javac_spec = javac_spec.match(Regexp.escape("require File.join(File.dirname(__FILE__), '../spec_helpers')\n")).post_match
|
32
|
+
javac_spec.gsub!("javac", "externaljavac")
|
33
|
+
eval(javac_spec)
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should accept a :jvm option as JAVA_HOME" do
|
37
|
+
write 'src/main/java/Foo.java', 'public class Foo {}'
|
38
|
+
define "foo" do
|
39
|
+
compile.using(:externaljavac).options.jvm = "somepath"
|
40
|
+
end
|
41
|
+
begin
|
42
|
+
trace true #We set it true to grab the trace statement with the jvm path in it!
|
43
|
+
lambda {lambda {project("foo").compile.invoke}.should raise_error(RuntimeError, /Failed to compile, see errors above/)}.should show(/somepath\/bin\/javac .*/)
|
44
|
+
end
|
45
|
+
trace false
|
46
|
+
end
|
47
|
+
|
48
|
+
after :all do
|
49
|
+
Buildr::Compiler.send :compilers=, COMPILERS
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
|
data/spec/java/packaging_spec.rb
CHANGED
@@ -583,6 +583,20 @@ describe Packaging, 'war' do
|
|
583
583
|
define('foo', :version=>'1.0') { compile.with 'group:id:jar:1.0', 'group:id:jar:2.0' ; package(:war) }
|
584
584
|
inspect_war { |files| files.should include('META-INF/MANIFEST.MF', 'WEB-INF/lib/id-1.0.jar', 'WEB-INF/lib/id-2.0.jar') }
|
585
585
|
end
|
586
|
+
|
587
|
+
it 'should use artifacts from compile classpath if no libs specified, leaving the user specify which to exclude as files' do
|
588
|
+
make_jars
|
589
|
+
define('foo', :version=>'1.0') { compile.with 'group:id:jar:1.0', 'group:id:jar:2.0' ; package(:war).path('WEB-INF/lib').exclude('id-2.0.jar') }
|
590
|
+
inspect_war { |files| files.should include('META-INF/MANIFEST.MF', 'WEB-INF/lib/id-1.0.jar') }
|
591
|
+
end
|
592
|
+
|
593
|
+
it 'should use artifacts from compile classpath if no libs specified, leaving the user specify which to exclude as files with glob expressions' do
|
594
|
+
make_jars
|
595
|
+
define('foo', :version=>'1.0') { compile.with 'group:id:jar:1.0', 'group:id:jar:2.0' ; package(:war).path('WEB-INF/lib').exclude('**/id-2.0.jar') }
|
596
|
+
inspect_war { |files| files.should include('META-INF/MANIFEST.MF', 'WEB-INF/lib/id-1.0.jar') }
|
597
|
+
end
|
598
|
+
|
599
|
+
|
586
600
|
|
587
601
|
it 'should include only specified libraries' do
|
588
602
|
define 'foo', :version=>'1.0' do
|
@@ -263,7 +263,15 @@ describe Project, '#package' do
|
|
263
263
|
end
|
264
264
|
project('foo').packages.uniq.size.should be(5)
|
265
265
|
end
|
266
|
-
|
266
|
+
|
267
|
+
it 'should create different tasks for package with different ids' do
|
268
|
+
define 'foo', :version=>'1.0' do
|
269
|
+
package(:jar, :id=>'bar')
|
270
|
+
package(:jar)
|
271
|
+
end
|
272
|
+
project('foo').packages.uniq.size.should be(2)
|
273
|
+
end
|
274
|
+
|
267
275
|
it 'should create different tasks for package with classifier' do
|
268
276
|
define 'foo', :version=>'1.0' do
|
269
277
|
package(:jar)
|
data/spec/spec_helpers.rb
CHANGED
@@ -23,7 +23,7 @@ unless defined?(SpecHelpers)
|
|
23
23
|
# For testing we use the gem requirements specified on the buildr.gemspec
|
24
24
|
spec = Gem::Specification.load(File.expand_path('../buildr.gemspec', File.dirname(__FILE__)))
|
25
25
|
# Dependency.version_requirements deprecated in rubygems 1.3.6
|
26
|
-
spec.dependencies.each { |dep| gem dep.name, (dep.respond_to?(:requirement) ? dep.requirement.to_s : dep.version_requirements.to_s) }
|
26
|
+
spec.dependencies.select {|dep| dep.type == :runtime }.each { |dep| gem dep.name, (dep.respond_to?(:requirement) ? dep.requirement.to_s : dep.version_requirements.to_s) }
|
27
27
|
|
28
28
|
# Make sure to load from these paths first, we don't want to load any
|
29
29
|
# code from Gem library.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: x86-mswin32
|
6
6
|
authors:
|
7
7
|
- Apache Buildr
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-07-07 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
requirements:
|
81
81
|
- - "="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 1.4.
|
83
|
+
version: 1.4.3
|
84
84
|
version:
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: rubyforge
|
@@ -152,6 +152,46 @@ dependencies:
|
|
152
152
|
- !ruby/object:Gem::Version
|
153
153
|
version: 0.5.2
|
154
154
|
version:
|
155
|
+
- !ruby/object:Gem::Dependency
|
156
|
+
name: jekyll
|
157
|
+
type: :development
|
158
|
+
version_requirement:
|
159
|
+
version_requirements: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ~>
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: 0.5.2
|
164
|
+
version:
|
165
|
+
- !ruby/object:Gem::Dependency
|
166
|
+
name: sdoc
|
167
|
+
type: :development
|
168
|
+
version_requirement:
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: "0"
|
174
|
+
version:
|
175
|
+
- !ruby/object:Gem::Dependency
|
176
|
+
name: rcov
|
177
|
+
type: :development
|
178
|
+
version_requirement:
|
179
|
+
version_requirements: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
|
+
- - ~>
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: "0.8"
|
184
|
+
version:
|
185
|
+
- !ruby/object:Gem::Dependency
|
186
|
+
name: win32console
|
187
|
+
type: :development
|
188
|
+
version_requirement:
|
189
|
+
version_requirements: !ruby/object:Gem::Requirement
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
version: "0"
|
194
|
+
version:
|
155
195
|
description: |
|
156
196
|
Apache Buildr is a build system for Java-based applications, including support
|
157
197
|
for Scala, Groovy and a growing number of JVM languages and tools. We wanted
|
@@ -271,6 +311,7 @@ files:
|
|
271
311
|
- lib/buildr/java/deprecated.rb
|
272
312
|
- lib/buildr/java/doc.rb
|
273
313
|
- lib/buildr/java/emma.rb
|
314
|
+
- lib/buildr/java/external.rb
|
274
315
|
- lib/buildr/java/jruby.rb
|
275
316
|
- lib/buildr/java/jtestr_runner.rb.erb
|
276
317
|
- lib/buildr/java/org/apache/buildr/JavaTestFilter.class
|
@@ -336,6 +377,7 @@ files:
|
|
336
377
|
- spec/java/commands_spec.rb
|
337
378
|
- spec/java/compiler_spec.rb
|
338
379
|
- spec/java/emma_spec.rb
|
380
|
+
- spec/java/external_spec.rb
|
339
381
|
- spec/java/java_spec.rb
|
340
382
|
- spec/java/packaging_spec.rb
|
341
383
|
- spec/java/test_coverage_helper.rb
|