buildr 1.4.7.pre2-java → 1.4.8-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.
- data/CHANGELOG +65 -2
- data/Rakefile +3 -6
- data/addon/buildr/bnd.rb +13 -3
- data/addon/buildr/{checkstyle.rake → checkstyle.rb} +1 -1
- data/addon/buildr/{findbugs.rake → findbugs.rb} +0 -0
- data/addon/buildr/git_auto_version.rb +33 -0
- data/addon/buildr/gwt.rb +82 -0
- data/addon/buildr/jacoco.rb +194 -0
- data/addon/buildr/{javancss.rake → javancss.rb} +0 -0
- data/addon/buildr/nailgun.rb +2 -2
- data/addon/buildr/{pmd.rake → pmd.rb} +3 -1
- data/addon/buildr/sonar.rb +142 -0
- data/buildr.buildfile +1 -1
- data/buildr.gemspec +37 -26
- data/doc/_layouts/default.html +0 -2
- data/doc/contributing.textile +47 -0
- data/doc/download.textile +24 -0
- data/doc/index.textile +43 -23
- data/doc/languages.textile +65 -6
- data/doc/more_stuff.textile +43 -0
- data/doc/packaging.textile +2 -0
- data/doc/settings_profiles.textile +1 -1
- data/etc/KEYS +44 -0
- data/lib/buildr.rb +3 -7
- data/lib/buildr/core/application.rb +41 -8
- data/lib/buildr/core/build.rb +102 -1
- data/lib/buildr/core/cc.rb +14 -8
- data/lib/buildr/core/doc.rb +9 -3
- data/lib/buildr/core/generate.rb +150 -9
- data/lib/buildr/core/run.rb +1 -1
- data/lib/buildr/core/shell.rb +1 -1
- data/lib/buildr/core/test.rb +1 -1
- data/lib/buildr/core/util.rb +5 -5
- data/lib/buildr/ide/eclipse.rb +118 -4
- data/lib/buildr/ide/idea.rb +278 -1
- data/lib/buildr/java/ant.rb +2 -3
- data/lib/buildr/java/bdd.rb +4 -4
- data/lib/buildr/java/commands.rb +1 -1
- data/lib/buildr/java/pom.rb +5 -4
- data/lib/buildr/java/rjb.rb +5 -4
- data/lib/buildr/java/test_result.rb +4 -0
- data/lib/buildr/packaging/artifact.rb +1 -1
- data/lib/buildr/packaging/version_requirement.rb +1 -1
- data/lib/buildr/packaging/zip.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +2 -2
- data/lib/buildr/run.rb +3 -2
- data/lib/buildr/scala.rb +1 -1
- data/lib/buildr/scala/bdd.rb +9 -2
- data/lib/buildr/scala/compiler.rb +94 -4
- data/lib/buildr/scala/doc.rb +17 -5
- data/lib/buildr/scala/org/apache/buildr/Specs2Runner.class +0 -0
- data/lib/buildr/scala/tests.rb +15 -4
- data/lib/buildr/version.rb +1 -1
- data/rakelib/all-in-one.rake +50 -47
- data/rakelib/checks.rake +4 -4
- data/rakelib/doc.rake +84 -87
- data/rakelib/metrics.rake +9 -9
- data/rakelib/package.rake +14 -35
- data/rakelib/release.rake +11 -12
- data/rakelib/rspec.rake +73 -60
- data/rakelib/stage.rake +32 -54
- data/spec/addon/bnd_spec.rb +61 -7
- data/spec/core/application_spec.rb +1 -1
- data/spec/core/build_spec.rb +117 -0
- data/spec/core/cc_spec.rb +37 -15
- data/spec/core/common_spec.rb +3 -2
- data/spec/core/compile_spec.rb +3 -3
- data/spec/core/doc_spec.rb +1 -1
- data/spec/core/generate_from_eclipse_spec.rb +280 -0
- data/spec/core/run_spec.rb +17 -4
- data/spec/core/test_spec.rb +5 -3
- data/spec/ide/idea_spec.rb +2 -2
- data/spec/java/bdd_spec.rb +2 -2
- data/spec/java/cobertura_spec.rb +4 -0
- data/spec/java/emma_spec.rb +4 -1
- data/spec/java/java_spec.rb +1 -1
- data/spec/java/packaging_spec.rb +2 -1
- data/spec/java/pom_spec.rb +125 -0
- data/spec/packaging/archive_spec.rb +25 -2
- data/spec/packaging/artifact_spec.rb +3 -3
- data/spec/sandbox.rb +7 -2
- data/spec/scala/compiler_spec.rb +41 -0
- data/spec/scala/doc_spec.rb +22 -3
- data/spec/scala/scala.rb +2 -2
- data/spec/scala/tests_spec.rb +2 -2
- data/spec/spec_helpers.rb +6 -1
- data/spec/version_requirement_spec.rb +2 -0
- metadata +651 -480
- data/lib/buildr/ide/eclipse/java.rb +0 -49
- data/lib/buildr/ide/eclipse/plugin.rb +0 -67
- data/lib/buildr/ide/eclipse/scala.rb +0 -64
data/lib/buildr/ide/idea.rb
CHANGED
@@ -238,6 +238,114 @@ module Buildr
|
|
238
238
|
@skip_content = true
|
239
239
|
end
|
240
240
|
|
241
|
+
def add_gwt_facet(modules = {}, options = {})
|
242
|
+
name = options[:name] || "GWT"
|
243
|
+
settings =
|
244
|
+
{
|
245
|
+
:webFacet => "Web",
|
246
|
+
:compilerMaxHeapSize => "512",
|
247
|
+
:compilerParameters => "-draftCompile -localWorkers 2 -strict",
|
248
|
+
:gwtSdkUrl => "file://$GWT_TOOLS$",
|
249
|
+
:gwtScriptOutputStyle => "PRETTY"
|
250
|
+
}.merge(options[:settings] || {})
|
251
|
+
|
252
|
+
add_facet(name, "gwt") do |f|
|
253
|
+
f.configuration do |c|
|
254
|
+
settings.each_pair do |k, v|
|
255
|
+
c.setting :name => k.to_s, :value => v.to_s
|
256
|
+
end
|
257
|
+
c.packaging do |d|
|
258
|
+
modules.each_pair do |k, v|
|
259
|
+
d.module :name => k, :enabled => v
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
def add_web_facet(options = {})
|
267
|
+
name = options[:name] || "Web"
|
268
|
+
url_base = options[:url_base] || "/"
|
269
|
+
default_webroots = [buildr_project._(:source, :main, :webapp)]
|
270
|
+
webroots = options[:webroots] || default_webroots
|
271
|
+
default_web_xml = "#{buildr_project._(:source, :main, :webapp)}/WEB-INF/web.xml"
|
272
|
+
web_xml = options[:web_xml] || default_web_xml
|
273
|
+
version = options[:version] || "3.0"
|
274
|
+
|
275
|
+
add_facet(name, "web") do |f|
|
276
|
+
f.configuration do |c|
|
277
|
+
c.descriptors do |d|
|
278
|
+
if File.exist?(web_xml) || default_web_xml != web_xml
|
279
|
+
d.deploymentDescriptor :name => 'web.xml', :url => file_path(web_xml), :optional => "true", :version => version
|
280
|
+
end
|
281
|
+
end
|
282
|
+
c.webroots do |w|
|
283
|
+
webroots.each do |webroot|
|
284
|
+
w.root :url => file_path(webroot), :relative => url_base
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
def add_jruby_facet(options = {})
|
292
|
+
name = options[:name] || "JRuby"
|
293
|
+
jruby_version = options[:jruby_version] || "jruby-1.5.2-p249"
|
294
|
+
add_facet(name, "JRUBY") do |f|
|
295
|
+
f.configuration(:number => 0) do |c|
|
296
|
+
c.JRUBY_FACET_CONFIG_ID :NAME => "JRUBY_SDK_NAME", :VALUE => jruby_version
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
def add_jpa_facet(options = {})
|
302
|
+
name = options[:name] || "JPA"
|
303
|
+
factory_entry = options[:factory_entry] || buildr_project.name.to_s
|
304
|
+
validation_enabled = options[:validation_enabled].nil? ? true : options[:validation_enabled]
|
305
|
+
provider_enabled = options[:provider_enabled] || 'Hibernate'
|
306
|
+
default_persistence_xml = buildr_project._(:source, :main, :resources, "META-INF/persistence.xml")
|
307
|
+
persistence_xml = options[:persistence_xml] || default_persistence_xml
|
308
|
+
default_orm_xml = buildr_project._(:source, :main, :resources, "META-INF/orm.xml")
|
309
|
+
orm_xml = options[:orm_xml] || default_orm_xml
|
310
|
+
add_facet(name, "jpa") do |f|
|
311
|
+
f.configuration do |c|
|
312
|
+
c.setting :name => "validation-enabled", :value => validation_enabled
|
313
|
+
c.setting :name => "provider-name", :value => provider_enabled
|
314
|
+
c.tag!('datasource-mapping') do |ds|
|
315
|
+
ds.tag!('factory-entry', :name => factory_entry)
|
316
|
+
end
|
317
|
+
if File.exist?(persistence_xml) || default_persistence_xml != persistence_xml
|
318
|
+
c.deploymentDescriptor :name => 'persistence.xml', :url => file_path(persistence_xml)
|
319
|
+
end
|
320
|
+
if File.exist?(orm_xml) || default_orm_xml != orm_xml
|
321
|
+
c.deploymentDescriptor :name => 'orm.xml', :url => file_path(orm_xml)
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|
326
|
+
|
327
|
+
def add_ejb_facet(options = {})
|
328
|
+
name = options[:name] || "EJB"
|
329
|
+
default_ejb_xml = buildr_project._(:source, :main, :resources, "WEB-INF/ejb-jar.xml")
|
330
|
+
ejb_xml = options[:ejb_xml] || default_ejb_xml
|
331
|
+
ejb_roots = options[:ejb_roots] || [buildr_project.compile.sources, buildr_project.resources.sources].flatten
|
332
|
+
|
333
|
+
add_facet(name, "ejb") do |facet|
|
334
|
+
facet.configuration do |c|
|
335
|
+
c.descriptors do |d|
|
336
|
+
if File.exist?(ejb_xml) || default_ejb_xml != ejb_xml
|
337
|
+
d.deploymentDescriptor :name => 'ejb-jar.xml', :url => file_path(ejb_xml)
|
338
|
+
end
|
339
|
+
end
|
340
|
+
c.ejbRoots do |e|
|
341
|
+
ejb_roots.each do |ejb_root|
|
342
|
+
e.root :url => file_path(ejb_root)
|
343
|
+
end
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
241
349
|
protected
|
242
350
|
|
243
351
|
def test_dependency_details
|
@@ -445,6 +553,153 @@ module Buildr
|
|
445
553
|
end
|
446
554
|
end
|
447
555
|
|
556
|
+
def add_exploded_war_artifact(project, options = {})
|
557
|
+
artifact_name = options[:name] || project.iml.id
|
558
|
+
build_on_make = options[:build_on_make].nil? ? false : options[:build_on_make]
|
559
|
+
|
560
|
+
add_artifact(artifact_name, "exploded-war", build_on_make) do |xml|
|
561
|
+
dependencies = (options[:dependencies] || ([project] + project.compile.dependencies)).flatten
|
562
|
+
libraries, projects = partition_dependencies(dependencies)
|
563
|
+
|
564
|
+
## The content here can not be indented
|
565
|
+
output_dir = options[:output_dir] || project._(:artifacts, artifact_name)
|
566
|
+
xml.tag!('output-path', output_dir)
|
567
|
+
|
568
|
+
xml.root :id => "root" do
|
569
|
+
xml.element :id => "directory", :name => "WEB-INF" do
|
570
|
+
xml.element :id => "directory", :name => "classes" do
|
571
|
+
projects.each do |p|
|
572
|
+
xml.element :id => "module-output", :name => p.iml.id
|
573
|
+
end
|
574
|
+
if options[:enable_jpa]
|
575
|
+
module_names = options[:jpa_module_names] || [project.iml.id]
|
576
|
+
module_names.each do |module_name|
|
577
|
+
facet_name = options[:jpa_facet_name] || "JPA"
|
578
|
+
xml.element :id => "jpa-descriptors", :facet => "#{module_name}/jpa/#{facet_name}"
|
579
|
+
end
|
580
|
+
end
|
581
|
+
if options[:enable_ejb]
|
582
|
+
module_names = options[:ejb_module_names] || [project.iml.id]
|
583
|
+
module_names.each do |module_name|
|
584
|
+
facet_name = options[:ejb_facet_name] || "EJB"
|
585
|
+
xml.element :id => "javaee-facet-resources", :facet => "#{module_name}/ejb/#{facet_name}"
|
586
|
+
end
|
587
|
+
end
|
588
|
+
end
|
589
|
+
xml.element :id => "directory", :name => "lib" do
|
590
|
+
libraries.each(&:invoke).map(&:to_s).each do |dependency_path|
|
591
|
+
xml.element :id => "file-copy", :path => resolve_path(dependency_path)
|
592
|
+
end
|
593
|
+
end
|
594
|
+
end
|
595
|
+
|
596
|
+
if options[:enable_war].nil? || options[:enable_war]
|
597
|
+
module_names = options[:war_module_names] || [project.iml.id]
|
598
|
+
module_names.each do |module_name|
|
599
|
+
facet_name = options[:war_facet_name] || "Web"
|
600
|
+
xml.element :id => "javaee-facet-resources", :facet => "#{module_name}/web/#{facet_name}"
|
601
|
+
end
|
602
|
+
end
|
603
|
+
|
604
|
+
if options[:enable_gwt]
|
605
|
+
module_names = options[:gwt_module_names] || [project.iml.id]
|
606
|
+
module_names.each do |module_name|
|
607
|
+
facet_name = options[:gwt_facet_name] || "GWT"
|
608
|
+
xml.element :id => "gwt-compiler-output", :facet => "#{module_name}/gwt/#{facet_name}"
|
609
|
+
end
|
610
|
+
end
|
611
|
+
end
|
612
|
+
end
|
613
|
+
end
|
614
|
+
|
615
|
+
def add_exploded_ear_artifact(project, options ={})
|
616
|
+
|
617
|
+
artifact_name = options[:name] || project.iml.id
|
618
|
+
build_on_make = options[:build_on_make].nil? ? true : options[:build_on_make]
|
619
|
+
|
620
|
+
add_artifact(artifact_name, "exploded-ear", build_on_make) do |xml|
|
621
|
+
dependencies = (options[:dependencies] || ([project] + project.compile.dependencies)).flatten
|
622
|
+
libraries, projects = partition_dependencies(dependencies)
|
623
|
+
|
624
|
+
## The content here can not be indented
|
625
|
+
output_dir = options[:output_dir] || project._(:artifacts, artifact_name)
|
626
|
+
xml.tag!('output-path', output_dir)
|
627
|
+
|
628
|
+
xml.root :id => "root" do
|
629
|
+
|
630
|
+
xml.element :id => "module-output", :name => project.iml.id
|
631
|
+
|
632
|
+
projects.each do |p|
|
633
|
+
xml.element :id => "directory", :name => p.iml.id do
|
634
|
+
xml.element :id => "module-output", :name => p.iml.id
|
635
|
+
end
|
636
|
+
end
|
637
|
+
|
638
|
+
xml.element :id => "directory", :name => "lib" do
|
639
|
+
libraries.each(&:invoke).map(&:to_s).each do |dependency_path|
|
640
|
+
xml.element :id => "file-copy", :path => resolve_path(dependency_path)
|
641
|
+
end
|
642
|
+
end
|
643
|
+
|
644
|
+
end
|
645
|
+
end
|
646
|
+
end
|
647
|
+
|
648
|
+
def add_exploded_ejb_artifact(project, options = {})
|
649
|
+
|
650
|
+
artifact_name = options[:name] || project.iml.id
|
651
|
+
build_on_make = options[:build_on_make].nil? ? true : options[:build_on_make]
|
652
|
+
|
653
|
+
add_artifact(artifact_name, "exploded-ejb", build_on_make) do |xml|
|
654
|
+
dependencies = (options[:dependencies] || ([project] + project.compile.dependencies)).flatten
|
655
|
+
libraries, projects = partition_dependencies(dependencies)
|
656
|
+
|
657
|
+
## The content here can not be indented
|
658
|
+
output_dir = options[:output_dir] || project._(:artifacts, artifact_name)
|
659
|
+
xml.tag!('output-path', output_dir)
|
660
|
+
|
661
|
+
xml.root :id => "root" do
|
662
|
+
|
663
|
+
xml.element :id => "module-output", :name => project.iml.id
|
664
|
+
|
665
|
+
if options[:enable_jpa]
|
666
|
+
module_names = options[:jpa_module_names] || [project.iml.id]
|
667
|
+
module_names.each do |module_name|
|
668
|
+
facet_name = options[:jpa_facet_name] || "JPA"
|
669
|
+
xml.element :id => "jpa-descriptors", :facet => "#{module_name}/jpa/#{facet_name}"
|
670
|
+
end
|
671
|
+
end
|
672
|
+
|
673
|
+
if options[:enable_ejb].nil? || options[:enable_ejb]
|
674
|
+
module_names = options[:ejb_module_names] || [project.iml.id]
|
675
|
+
module_names.each do |module_name|
|
676
|
+
facet_name = options[:ejb_facet_name] || "EJB"
|
677
|
+
xml.element :id => "javaee-facet-resources", :facet => "#{module_name}/ejb/#{facet_name}"
|
678
|
+
end
|
679
|
+
end
|
680
|
+
|
681
|
+
end
|
682
|
+
end
|
683
|
+
end
|
684
|
+
|
685
|
+
|
686
|
+
def add_gwt_configuration(launch_page, project, options = {})
|
687
|
+
name = options[:name] || "Run #{launch_page}"
|
688
|
+
shell_parameters = options[:shell_parameters] || ""
|
689
|
+
vm_parameters = options[:vm_parameters] || "-Xmx512m"
|
690
|
+
|
691
|
+
add_configuration(name, "GWT.ConfigurationType", "GWT Configuration") do |xml|
|
692
|
+
xml.module(:name => project.iml.id)
|
693
|
+
xml.option(:name => "RUN_PAGE", :value => launch_page)
|
694
|
+
xml.option(:name => "SHELL_PARAMETERS", :value => shell_parameters)
|
695
|
+
xml.option(:name => "VM_PARAMETERS", :value => vm_parameters)
|
696
|
+
|
697
|
+
xml.RunnerSettings(:RunnerId => "Run")
|
698
|
+
xml.ConfigurationWrapper(:RunnerId => "Run")
|
699
|
+
xml.method()
|
700
|
+
end
|
701
|
+
end
|
702
|
+
|
448
703
|
protected
|
449
704
|
|
450
705
|
def extension
|
@@ -509,7 +764,7 @@ module Buildr
|
|
509
764
|
if subproject.iml.group == true
|
510
765
|
attribs[:group] = subproject.parent.name.gsub(':', '/')
|
511
766
|
elsif !subproject.iml.group.nil?
|
512
|
-
attribs[:group] = subproject.group.to_s
|
767
|
+
attribs[:group] = subproject.iml.group.to_s
|
513
768
|
end
|
514
769
|
xml.module attribs
|
515
770
|
end
|
@@ -544,6 +799,28 @@ module Buildr
|
|
544
799
|
def resolve_path(path)
|
545
800
|
resolve_path_from_base(path, "$PROJECT_DIR$")
|
546
801
|
end
|
802
|
+
|
803
|
+
private
|
804
|
+
|
805
|
+
def partition_dependencies(dependencies)
|
806
|
+
libraries = []
|
807
|
+
projects = []
|
808
|
+
|
809
|
+
dependencies.each do |dependency|
|
810
|
+
artifacts = Buildr.artifacts(dependency)
|
811
|
+
artifacts_as_strings = artifacts.map(&:to_s)
|
812
|
+
project = Buildr.projects.detect do |project|
|
813
|
+
[project.packages, project.compile.target, project.resources.target, project.test.compile.target, project.test.resources.target].flatten.
|
814
|
+
detect { |component| artifacts_as_strings.include?(component.to_s) }
|
815
|
+
end
|
816
|
+
if project
|
817
|
+
projects << project
|
818
|
+
else
|
819
|
+
libraries += artifacts
|
820
|
+
end
|
821
|
+
end
|
822
|
+
return libraries.uniq, projects.uniq
|
823
|
+
end
|
547
824
|
end
|
548
825
|
|
549
826
|
module ProjectExtension
|
data/lib/buildr/java/ant.rb
CHANGED
@@ -22,7 +22,7 @@ module Buildr
|
|
22
22
|
module Ant
|
23
23
|
|
24
24
|
# Which version of Ant we're using by default.
|
25
|
-
VERSION = '1.8.
|
25
|
+
VERSION = '1.8.3'
|
26
26
|
|
27
27
|
class << self
|
28
28
|
# Current version of Ant being used.
|
@@ -34,8 +34,7 @@ module Buildr
|
|
34
34
|
def dependencies
|
35
35
|
# Ant-Trax required for running the JUnitReport task, and there's no other place
|
36
36
|
# to put it but the root classpath.
|
37
|
-
@dependencies ||= ["org.apache.ant:ant:jar:#{version}", "org.apache.ant:ant-launcher:jar:#{version}"
|
38
|
-
"org.apache.ant:ant-trax:jar:#{version}"]
|
37
|
+
@dependencies ||= ["org.apache.ant:ant:jar:#{version}", "org.apache.ant:ant-launcher:jar:#{version}"]
|
39
38
|
end
|
40
39
|
|
41
40
|
private
|
data/lib/buildr/java/bdd.rb
CHANGED
@@ -115,7 +115,7 @@ module Buildr
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def jruby_home
|
118
|
-
@jruby_home ||= RUBY_PLATFORM =~ /java/ ?
|
118
|
+
@jruby_home ||= RUBY_PLATFORM =~ /java/ ? RbConfig::CONFIG['prefix'] :
|
119
119
|
( ENV['JRUBY_HOME'] || File.expand_path('~/.jruby') )
|
120
120
|
end
|
121
121
|
|
@@ -166,7 +166,7 @@ module Buildr
|
|
166
166
|
require 'jruby'
|
167
167
|
def JRuby.gem(name, version = '>0', *args)
|
168
168
|
require 'rbconfig'
|
169
|
-
jruby_home =
|
169
|
+
jruby_home = RbConfig::CONFIG['prefix']
|
170
170
|
expected_version = '#{TestFramework::JRubyBased.version}'
|
171
171
|
unless JRUBY_VERSION >= expected_version
|
172
172
|
fail "Expected JRuby version \#{expected_version} installed at \#{jruby_home} but got \#{JRUBY_VERSION}"
|
@@ -194,7 +194,7 @@ module Buildr
|
|
194
194
|
runner.requires ||= []
|
195
195
|
runner.requires.unshift File.join(File.dirname(__FILE__), 'test_result')
|
196
196
|
runner.gems ||= {}
|
197
|
-
runner.rspec ||= ['--format', 'progress', '--format',
|
197
|
+
runner.rspec ||= ['--format', 'progress', '--format', 'documentation']
|
198
198
|
runner.format.each { |format| runner.rspec << '--format' << format } if runner.format
|
199
199
|
runner.rspec.push '--format', "Buildr::TestFramework::TestResult::YamlFormatter"
|
200
200
|
runner.rspec.push '-o', runner.result
|
@@ -240,7 +240,7 @@ module Buildr
|
|
240
240
|
|
241
241
|
def runner_config
|
242
242
|
runner = super
|
243
|
-
runner.gems.update 'rspec' => '~> 2.
|
243
|
+
runner.gems.update 'rspec' => '~> 2.9.0'
|
244
244
|
runner.requires.unshift 'rspec'
|
245
245
|
runner
|
246
246
|
end
|
data/lib/buildr/java/commands.rb
CHANGED
@@ -62,7 +62,7 @@ module Java
|
|
62
62
|
# If our cmd line is longer, we create a batch file and execute it instead.
|
63
63
|
if Util.win_os? && cmd_args.map(&:inspect).join(' ').size > 2048
|
64
64
|
# remove '-classpath' and the classpath itself from the cmd line.
|
65
|
-
cp_i = cmd_args.index{|x| x.
|
65
|
+
cp_i = cmd_args.index{|x| x.to_s =~ /^-classpath/}
|
66
66
|
2.times do
|
67
67
|
cmd_args.delete_at cp_i unless cp_i.nil?
|
68
68
|
end
|
data/lib/buildr/java/pom.rb
CHANGED
@@ -103,10 +103,10 @@ module Buildr
|
|
103
103
|
if options[:scopes].include?(spec[:scope])
|
104
104
|
spec.delete(:scope)
|
105
105
|
|
106
|
-
exclusions = dep["exclusions"]["exclusion"] rescue nil
|
106
|
+
exclusions = dep["exclusions"].first["exclusion"] rescue nil
|
107
107
|
transitive_deps = POM.load(spec).dependencies(options[:scopes_transitive] || SCOPES_TRANSITIVE)
|
108
108
|
transitive_deps = transitive_deps.reject{|dep|
|
109
|
-
exclusions.find {|ex| dep.index("#{
|
109
|
+
exclusions.find {|ex| dep.index("#{ex['groupId'].first}:#{ex['artifactId'].first}:") == 0}
|
110
110
|
} if exclusions
|
111
111
|
|
112
112
|
[Artifact.to_spec(spec)] + transitive_deps
|
@@ -130,7 +130,7 @@ module Buildr
|
|
130
130
|
hash
|
131
131
|
}
|
132
132
|
props = project["properties"].first rescue {}
|
133
|
-
props = props.inject({}) { |mapped, pair| mapped[pair.first] = value_of(pair.last,
|
133
|
+
props = props.inject({}) { |mapped, pair| mapped[pair.first] = value_of(pair.last, props) ; mapped }
|
134
134
|
(parent ? parent.properties.merge(props) : props).merge(pom)
|
135
135
|
end
|
136
136
|
end
|
@@ -164,7 +164,8 @@ module Buildr
|
|
164
164
|
# property substitution.
|
165
165
|
def value_of(element, substitute = nil)
|
166
166
|
value = element.to_a.join.strip
|
167
|
-
|
167
|
+
value = value.gsub(/\$\{([^}]+)\}/) { |key| Array(substitute[$1]).join.strip } if substitute
|
168
|
+
value
|
168
169
|
end
|
169
170
|
|
170
171
|
# :call-seq:
|
data/lib/buildr/java/rjb.rb
CHANGED
@@ -13,6 +13,11 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
+
if RbConfig::CONFIG['host_os'] =~ /darwin/i
|
17
|
+
# On OS X we attempt to guess where JAVA_HOME is, if not set
|
18
|
+
# We set JAVA_HOME early so we can use it without calling Java.load first.
|
19
|
+
ENV['JAVA_HOME'] ||= '/System/Library/Frameworks/JavaVM.framework/Home'
|
20
|
+
end
|
16
21
|
|
17
22
|
require 'rjb'
|
18
23
|
|
@@ -72,10 +77,6 @@ module Java
|
|
72
77
|
|
73
78
|
end
|
74
79
|
|
75
|
-
# On OS X we know where the default JDK is. We can try to guess for other OS.
|
76
|
-
# We set JAVA_HOME early so we can use it without calling Java.load first.
|
77
|
-
ENV['JAVA_HOME'] ||= '/System/Library/Frameworks/JavaVM.framework/Home' if Config::CONFIG['host_os'] =~ /darwin/i
|
78
|
-
|
79
80
|
class << self
|
80
81
|
|
81
82
|
# Returns the classpath, an array listing directories, JAR files and
|
@@ -13,6 +13,10 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
+
# It is necessary to require these files here as the bdd plugin directly includes this file
|
17
|
+
require 'yaml'
|
18
|
+
require 'rspec/core/formatters/base_formatter'
|
19
|
+
|
16
20
|
module Buildr #:nodoc:
|
17
21
|
module TestFramework
|
18
22
|
|
@@ -814,7 +814,7 @@ module Buildr
|
|
814
814
|
def transitive(*args)
|
815
815
|
options = Hash === args.last ? args.pop : {}
|
816
816
|
dep_opts = {
|
817
|
-
:scopes => options[:scopes] || [nil, "compile", "runtime"
|
817
|
+
:scopes => options[:scopes] || [nil, "compile", "runtime"],
|
818
818
|
:optional => options[:optional]
|
819
819
|
}
|
820
820
|
specs = args.flatten
|