realityforge-buildr 1.5.9 → 1.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/addon/buildr/jacoco.rb +3 -0
- data/addon/buildr/shade.rb +62 -0
- data/buildr.gemspec +2 -2
- data/lib/buildr.rb +1 -0
- data/lib/buildr/core/transports.rb +2 -2
- data/lib/buildr/ide/idea.rb +128 -1
- data/lib/buildr/java/annotation_processor.rb +59 -0
- data/lib/buildr/java/commands.rb +15 -8
- data/lib/buildr/java/compiler.rb +8 -3
- data/lib/buildr/version.rb +1 -1
- data/rakelib/release.rake +1 -1
- metadata +4 -4
- data/CHANGELOG.md +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18706f32d591f5eee4b371e56f0e9ab2eae2faeab9e3b108c785727939c9089a
|
4
|
+
data.tar.gz: d27fbad9b2d4ec3a1965d15cfbde2ad56222f6f0569a574c280dfe59d5e23fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 408323c4e663adaa82994b3192a48def7380cf05aa4b6bf264617195141f7d1cb4875918d32a7bb8e6dea03a0b5c3a5e83f49739c27122dd58214ef23f63b08a
|
7
|
+
data.tar.gz: a06f1222cb77ec21ed799ab6655f4bfcb761fa150c4459e20710314e40500546b0e73faf980ce8c2089dfe1eda11cfccbdea7b9bc1fb4b9a04280104966f05b5
|
data/addon/buildr/jacoco.rb
CHANGED
@@ -148,6 +148,9 @@ module Buildr
|
|
148
148
|
options[:html_output_directory] = project._(:reports, :jacoco, 'docs')
|
149
149
|
|
150
150
|
unless execution_files.empty?
|
151
|
+
FileUtils.mkdir_p File.dirname(options[:xml_output_file])
|
152
|
+
FileUtils.mkdir_p File.dirname(options[:csv_output_file])
|
153
|
+
FileUtils.mkdir_p options[:html_output_directory]
|
151
154
|
Buildr::JaCoCo.jacoco_report(execution_files, class_paths, source_paths, options)
|
152
155
|
end
|
153
156
|
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
3
|
+
# you may not use this file except in compliance with the License.
|
4
|
+
# You may obtain a copy of the License at
|
5
|
+
#
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
#
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
11
|
+
# See the License for the specific language governing permissions and
|
12
|
+
# limitations under the License.
|
13
|
+
#
|
14
|
+
|
15
|
+
module Buildr
|
16
|
+
# Provides the shade method.
|
17
|
+
module Shade
|
18
|
+
|
19
|
+
class << self
|
20
|
+
|
21
|
+
# The specs for requirements
|
22
|
+
def dependencies
|
23
|
+
%w(
|
24
|
+
net.sourceforge.pmd:pmd-core:jar:6.11.0
|
25
|
+
net.sourceforge.pmd:pmd-java:jar:6.11.0
|
26
|
+
net.sourceforge.pmd:pmd-java8:jar:6.11.0
|
27
|
+
jaxen:jaxen:jar:1.1.6
|
28
|
+
commons-io:commons-io:jar:2.6
|
29
|
+
com.beust:jcommander:jar:1.72
|
30
|
+
org.ow2.asm:asm:jar:7.1
|
31
|
+
com.google.code.gson:gson:jar:2.8.5
|
32
|
+
net.java.dev.javacc:javacc:jar:5.0
|
33
|
+
net.sourceforge.saxon:saxon:jar:9.1.0.8
|
34
|
+
org.apache.commons:commons-lang3:jar:3.8.1
|
35
|
+
org.antlr:antlr4-runtime:jar:4.7
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def shade(input_jar, output_jar, relocations = {})
|
40
|
+
|
41
|
+
shaded_jar = (input_jar.to_s + '-shaded')
|
42
|
+
a = Buildr.artifact('org.realityforge.shade:shade-cli:jar:1.0.0')
|
43
|
+
a.invoke
|
44
|
+
|
45
|
+
args = []
|
46
|
+
args << Java::Commands.path_to_bin('java')
|
47
|
+
args << '-jar'
|
48
|
+
args << a.to_s
|
49
|
+
args << '--input'
|
50
|
+
args << input_jar.to_s
|
51
|
+
args << '--output'
|
52
|
+
args << shaded_jar.to_s
|
53
|
+
relocations.each_pair do |k, v|
|
54
|
+
args << "-r#{k}#{v}"
|
55
|
+
end
|
56
|
+
|
57
|
+
sh args.join(' ')
|
58
|
+
FileUtils.mv shaded_jar, output_jar.to_s
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
data/buildr.gemspec
CHANGED
@@ -35,12 +35,12 @@ for those one-off tasks, with a language that's a joy to use.
|
|
35
35
|
TEXT
|
36
36
|
|
37
37
|
spec.files = Dir['{addon,bin,lib,rakelib,spec}/**/*', '*.{gemspec}'] +
|
38
|
-
%w(LICENSE NOTICE
|
38
|
+
%w(LICENSE NOTICE README.md Rakefile)
|
39
39
|
spec.require_paths = 'lib', 'addon'
|
40
40
|
spec.bindir = 'bin'
|
41
41
|
spec.executable = 'buildr'
|
42
42
|
|
43
|
-
spec.extra_rdoc_files = 'README.md', '
|
43
|
+
spec.extra_rdoc_files = 'README.md', 'LICENSE', 'NOTICE'
|
44
44
|
spec.rdoc_options = '--title', 'Buildr', '--main', 'README.md',
|
45
45
|
'--webcvs', 'https://github.com/realityforge/buildr'
|
46
46
|
spec.post_install_message = 'To get started run buildr --help'
|
data/lib/buildr.rb
CHANGED
@@ -65,6 +65,7 @@ require 'buildr/java/packaging'
|
|
65
65
|
require 'buildr/java/commands'
|
66
66
|
require 'buildr/java/doc'
|
67
67
|
require 'buildr/java/custom_pom'
|
68
|
+
require 'buildr/java/annotation_processor'
|
68
69
|
require 'buildr/ide/idea'
|
69
70
|
|
70
71
|
# Methods defined in Buildr are both instance methods (e.g. when included in Project)
|
@@ -273,7 +273,7 @@ module URI
|
|
273
273
|
headers['Cache-Control'] = 'no-cache'
|
274
274
|
headers['User-Agent'] = "Buildr-#{Buildr::VERSION}"
|
275
275
|
request = Net::HTTP::Get.new(request_uri.empty? ? '/' : request_uri, headers)
|
276
|
-
request.basic_auth
|
276
|
+
request.basic_auth CGI.unescape(self.user), CGI.unescape(self.password) if self.user
|
277
277
|
http.verify_mode = ::OpenSSL::SSL.const_get(ENV['SSL_VERIFY_MODE']) if ENV['SSL_VERIFY_MODE']
|
278
278
|
http.ca_path = ENV['SSL_CA_CERTS'] if ENV['SSL_CA_CERTS']
|
279
279
|
http.request request do |response|
|
@@ -330,7 +330,7 @@ module URI
|
|
330
330
|
end
|
331
331
|
headers = { 'Content-MD5'=>Digest::MD5.hexdigest(content.string), 'Content-Type'=>'application/octet-stream', 'User-Agent'=>"Buildr-#{Buildr::VERSION}" }
|
332
332
|
request = Net::HTTP::Put.new(request_uri.empty? ? '/' : request_uri, headers)
|
333
|
-
request.basic_auth
|
333
|
+
request.basic_auth CGI.unescape(self.user), CGI.unescape(self.password) if self.user
|
334
334
|
response = nil
|
335
335
|
with_progress_bar options[:progress], path.split('/').last, content.size do |progress|
|
336
336
|
request.content_length = content.size
|
data/lib/buildr/ide/idea.rb
CHANGED
@@ -56,6 +56,12 @@ module Buildr #:nodoc:
|
|
56
56
|
self.components << create_component(name, attrs, &xml)
|
57
57
|
end
|
58
58
|
|
59
|
+
def add_component_in_lambda(name, attrs = {}, &xml)
|
60
|
+
self.components << lambda do
|
61
|
+
create_component(name, attrs, &xml)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
59
65
|
def add_component_from_file(filename)
|
60
66
|
self.components << lambda do
|
61
67
|
raise "Unable to locate file #{filename} adding component to idea file" unless File.exist?(filename)
|
@@ -719,6 +725,16 @@ module Buildr #:nodoc:
|
|
719
725
|
@jdk_version ||= buildr_project.compile.options.source || '1.7'
|
720
726
|
end
|
721
727
|
|
728
|
+
def nonnull_assertions?
|
729
|
+
@nonnull_assertions.nil? ? true : !!@nonnull_assertions
|
730
|
+
end
|
731
|
+
|
732
|
+
attr_writer :nonnull_assertions
|
733
|
+
|
734
|
+
def wildcard_resource_patterns
|
735
|
+
@wildcard_resource_patterns ||= %w(!?*.java !?*.form !?*.class !?*.groovy !?*.scala !?*.flex !?*.kt !?*.clj !?*.aj)
|
736
|
+
end
|
737
|
+
|
722
738
|
def add_artifact(name, type, build_on_make = false)
|
723
739
|
add_to_composite_component(self.artifacts) do |xml|
|
724
740
|
xml.artifact(:name => name, :type => type, 'build-on-make' => build_on_make) do |xml|
|
@@ -793,7 +809,7 @@ module Buildr #:nodoc:
|
|
793
809
|
}.merge(options)
|
794
810
|
|
795
811
|
if params[:url]
|
796
|
-
if /jdbc
|
812
|
+
if /jdbc:jtds:sqlserver:\/\/[^:\\]+(:\d+)?\/([^;]*)(;.*)?/ =~ params[:url]
|
797
813
|
database_name = $2
|
798
814
|
params[:schema_pattern] = "#{database_name}.*"
|
799
815
|
params[:default_schemas] = "#{database_name}.*"
|
@@ -803,6 +819,47 @@ module Buildr #:nodoc:
|
|
803
819
|
add_data_source(name, params)
|
804
820
|
end
|
805
821
|
|
822
|
+
def add_javac_settings(javac_args)
|
823
|
+
add_component('JavacSettings') do |xml|
|
824
|
+
xml.option(:name => 'ADDITIONAL_OPTIONS_STRING', :value => javac_args)
|
825
|
+
end
|
826
|
+
end
|
827
|
+
|
828
|
+
def add_code_insight_settings(options = {})
|
829
|
+
excluded_names = options[:excluded_names] || default_code_sight_excludes
|
830
|
+
excluded_names += (options[:extra_excluded_names] || [])
|
831
|
+
add_component('JavaProjectCodeInsightSettings') do |xml|
|
832
|
+
xml.tag!('excluded-names') do
|
833
|
+
excluded_names.each do |excluded_name|
|
834
|
+
xml << "<name>#{excluded_name}</name>"
|
835
|
+
end
|
836
|
+
end
|
837
|
+
end
|
838
|
+
end
|
839
|
+
|
840
|
+
def add_nullable_manager
|
841
|
+
add_component('NullableNotNullManager') do |component|
|
842
|
+
component.option :name => 'myDefaultNullable', :value => 'javax.annotation.Nullable'
|
843
|
+
component.option :name => 'myDefaultNotNull', :value => 'javax.annotation.Nonnull'
|
844
|
+
component.option :name => 'myNullables' do |option|
|
845
|
+
option.value do |value|
|
846
|
+
value.list :size => '2' do |list|
|
847
|
+
list.item :index => '0', :class => 'java.lang.String', :itemvalue => 'org.jetbrains.annotations.Nullable'
|
848
|
+
list.item :index => '1', :class => 'java.lang.String', :itemvalue => 'javax.annotation.Nullable'
|
849
|
+
end
|
850
|
+
end
|
851
|
+
end
|
852
|
+
component.option :name => 'myNotNulls' do |option|
|
853
|
+
option.value do |value|
|
854
|
+
value.list :size => '2' do |list|
|
855
|
+
list.item :index => '0', :class => 'java.lang.String', :itemvalue => 'org.jetbrains.annotations.NotNull'
|
856
|
+
list.item :index => '1', :class => 'java.lang.String', :itemvalue => 'javax.annotation.Nonnull'
|
857
|
+
end
|
858
|
+
end
|
859
|
+
end
|
860
|
+
end
|
861
|
+
end
|
862
|
+
|
806
863
|
def add_less_compiler_component(project, options = {})
|
807
864
|
source_dir = options[:source_dir] || project._(:source, :main, :webapp, :less).to_s
|
808
865
|
source_pattern = options[:pattern] || '*.less'
|
@@ -1376,6 +1433,7 @@ module Buildr #:nodoc:
|
|
1376
1433
|
lambda { modules_component },
|
1377
1434
|
vcs_component,
|
1378
1435
|
artifacts_component,
|
1436
|
+
compiler_configuration_component,
|
1379
1437
|
lambda { data_sources_component },
|
1380
1438
|
configurations_component,
|
1381
1439
|
lambda { framework_detection_exclusion_component }
|
@@ -1477,6 +1535,60 @@ module Buildr #:nodoc:
|
|
1477
1535
|
create_composite_component('ArtifactManager', {}, self.artifacts)
|
1478
1536
|
end
|
1479
1537
|
|
1538
|
+
def compiler_configuration_component
|
1539
|
+
lambda do
|
1540
|
+
create_component('CompilerConfiguration') do |component|
|
1541
|
+
component.addNotNullAssertions :enabled => 'false' unless nonnull_assertions?
|
1542
|
+
component.wildcardResourcePatterns do |xml|
|
1543
|
+
wildcard_resource_patterns.each do |pattern|
|
1544
|
+
xml.entry :name => pattern.to_s
|
1545
|
+
end
|
1546
|
+
end
|
1547
|
+
component.annotationProcessing do |xml|
|
1548
|
+
xml.profile(:default => true, :name => 'Default', :enabled => true) do
|
1549
|
+
xml.sourceOutputDir :name => 'generated/processors/main/java'
|
1550
|
+
xml.sourceTestOutputDir :name => 'generated/processors/test/java'
|
1551
|
+
xml.outputRelativeToContentRoot :value => true
|
1552
|
+
xml.processorPath :useClasspath => true
|
1553
|
+
end
|
1554
|
+
disabled = []
|
1555
|
+
Buildr.projects.each do |prj|
|
1556
|
+
next unless prj.iml?
|
1557
|
+
main_processor = !!prj.compile.options[:processor] || prj.compile.options[:processor].nil?
|
1558
|
+
test_processor = !!prj.test.compile.options[:processor] || prj.test.compile.options[:processor].nil?
|
1559
|
+
if main_processor || test_processor
|
1560
|
+
xml.profile(:name => "#{prj.name}", :enabled => true) do
|
1561
|
+
xml.sourceOutputDir :name => 'generated/processors/main/java' if main_processor
|
1562
|
+
xml.sourceTestOutputDir :name => 'generated/processors/test/java' if test_processor
|
1563
|
+
xml.outputRelativeToContentRoot :value => true
|
1564
|
+
xml.module :name => prj.iml.name
|
1565
|
+
processor_path = (prj.compile.options[:processor_path] || []) + (prj.test.compile.options[:processor_path] || [])
|
1566
|
+
if processor_path.empty?
|
1567
|
+
xml.processorPath :useClasspath => true
|
1568
|
+
else
|
1569
|
+
xml.processorPath :useClasspath => false do
|
1570
|
+
Buildr.artifacts(processor_path).each do |path|
|
1571
|
+
xml.entry :name => resolve_path(path.to_s)
|
1572
|
+
end
|
1573
|
+
end
|
1574
|
+
end
|
1575
|
+
end
|
1576
|
+
else
|
1577
|
+
disabled << prj
|
1578
|
+
end
|
1579
|
+
end
|
1580
|
+
unless disabled.empty?
|
1581
|
+
xml.profile(:name => 'Disabled') do
|
1582
|
+
disabled.each do |p|
|
1583
|
+
xml.module :name => p.iml.name
|
1584
|
+
end
|
1585
|
+
end
|
1586
|
+
end
|
1587
|
+
end
|
1588
|
+
end
|
1589
|
+
end
|
1590
|
+
end
|
1591
|
+
|
1480
1592
|
def configurations_component
|
1481
1593
|
create_composite_component('ProjectRunConfigurationManager', {}, self.configurations)
|
1482
1594
|
end
|
@@ -1487,6 +1599,21 @@ module Buildr #:nodoc:
|
|
1487
1599
|
|
1488
1600
|
private
|
1489
1601
|
|
1602
|
+
def default_code_sight_excludes
|
1603
|
+
%w(
|
1604
|
+
com.sun.istack.internal.NotNull
|
1605
|
+
com.sun.istack.internal.Nullable
|
1606
|
+
org.jetbrains.annotations.Nullable
|
1607
|
+
org.jetbrains.annotations.NotNull
|
1608
|
+
org.testng.AssertJUnit
|
1609
|
+
org.testng.internal.Nullable
|
1610
|
+
org.mockito.internal.matchers.NotNull
|
1611
|
+
edu.umd.cs.findbugs.annotations.Nonnull
|
1612
|
+
edu.umd.cs.findbugs.annotations.Nullable
|
1613
|
+
edu.umd.cs.findbugs.annotations.SuppressWarnings
|
1614
|
+
)
|
1615
|
+
end
|
1616
|
+
|
1490
1617
|
def to_artifact_name(project, options)
|
1491
1618
|
options[:name] || project.iml.id
|
1492
1619
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# This file is licensed to you under the Apache License, Version 2.0 (the
|
2
|
+
# "License"); you may not use this file except in compliance with the License.
|
3
|
+
# You may obtain a copy of the License at
|
4
|
+
#
|
5
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
#
|
7
|
+
# Unless required by applicable law or agreed to in writing, software
|
8
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
9
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
10
|
+
# License for the specific language governing permissions and limitations under
|
11
|
+
# the License.
|
12
|
+
|
13
|
+
module Buildr
|
14
|
+
module ProcessorPath
|
15
|
+
module ProjectExtension
|
16
|
+
include Extension
|
17
|
+
|
18
|
+
before_define do |project|
|
19
|
+
if project.iml?
|
20
|
+
project.iml.instance_variable_set('@main_generated_source_directories', [])
|
21
|
+
project.iml.instance_variable_set('@test_generated_source_directories', [])
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
after_define do |project|
|
26
|
+
if project.compile.options.processor?
|
27
|
+
project.file(project._(:target, :generated, 'processors/main/java'))
|
28
|
+
project.compile.enhance do
|
29
|
+
mkdir_p project._(:target, :generated, 'processors/main/java')
|
30
|
+
end
|
31
|
+
project.compile.options[:other] = [] unless project.compile.options[:other]
|
32
|
+
project.compile.options[:other] += ['-s', project._(:target, :generated, 'processors/main/java')]
|
33
|
+
project.iml.main_generated_source_directories << project._(:target, :generated, 'processors/main/java') if project.iml?
|
34
|
+
|
35
|
+
project.clean do
|
36
|
+
rm_rf project._(:target, :generated, 'processors/main/java')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
if project.test.compile.options.processor?
|
40
|
+
project.file(project._(:target, :generated, 'processors/test/java'))
|
41
|
+
project.test.compile.enhance do
|
42
|
+
mkdir_p project._(:target, :generated, 'processors/test/java')
|
43
|
+
end
|
44
|
+
project.test.compile.options[:other] = [] unless project.test.compile.options[:other]
|
45
|
+
project.test.compile.options[:other] += ['-s', project._(:target, :generated, 'processors/test/java')]
|
46
|
+
project.iml.test_generated_source_directories << project._(:target, :generated, 'processors/test/java') if project.iml?
|
47
|
+
|
48
|
+
project.clean do
|
49
|
+
rm_rf project._(:target, :generated, 'processors/test/java')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class Buildr::Project
|
58
|
+
include Buildr::ProcessorPath::ProjectExtension
|
59
|
+
end
|
data/lib/buildr/java/commands.rb
CHANGED
@@ -63,7 +63,7 @@ module Java
|
|
63
63
|
cmd_args << "cd '#{options[:dir]}' && "
|
64
64
|
end
|
65
65
|
cmd_args << path_to_bin('java')
|
66
|
-
cp = classpath_from(options)
|
66
|
+
cp = classpath_from(options[:classpath])
|
67
67
|
|
68
68
|
unless cp.empty?
|
69
69
|
if options[:pathing_jar] == true
|
@@ -112,14 +112,16 @@ module Java
|
|
112
112
|
#
|
113
113
|
# The last argument may be a Hash with additional options:
|
114
114
|
# * :output -- Target directory for all compiled class files.
|
115
|
-
# * :classpath -- One or more file names, tasks or artifact specifications.
|
116
|
-
# These are all expanded into artifacts, and all tasks are invoked.
|
115
|
+
# * :classpath -- One or more file names, tasks or artifact specifications. These are all expanded into artifacts, and all tasks are invoked.
|
117
116
|
# * :sourcepath -- Additional source paths to use.
|
117
|
+
# * :processor_path -- Annotation processor path. These are all expanded into artifacts, and all tasks are invoked.
|
118
118
|
# * :javac_args -- Any additional arguments to pass (e.g. -extdirs, -encoding)
|
119
119
|
# * :name -- Shows this name, otherwise shows the working directory.
|
120
120
|
def javac(*args, &block)
|
121
121
|
options = Hash === args.last ? args.pop : {}
|
122
|
-
rake_check_options options, :classpath, :sourcepath, :output, :javac_args, :name
|
122
|
+
rake_check_options options, :classpath, :sourcepath, :output, :javac_args, :name, :processor, :processor_path
|
123
|
+
|
124
|
+
processor = !!options[:processor]
|
123
125
|
|
124
126
|
files = args.flatten.each { |f| f.invoke if f.respond_to?(:invoke) }.map(&:to_s).
|
125
127
|
collect { |arg| File.directory?(arg) ? FileList["#{File.expand_path(arg)}/**/*.java"] : File.expand_path(arg) }.flatten
|
@@ -127,9 +129,15 @@ module Java
|
|
127
129
|
|
128
130
|
cmd_args = []
|
129
131
|
cmd_args << path_to_bin('javac')
|
130
|
-
cp = classpath_from(options)
|
132
|
+
cp = classpath_from(options[:classpath])
|
131
133
|
cmd_args << '-classpath' << cp.join(File::PATH_SEPARATOR) unless cp.empty?
|
132
134
|
cmd_args << '-sourcepath' << [options[:sourcepath]].flatten.join(File::PATH_SEPARATOR) if options[:sourcepath]
|
135
|
+
if processor
|
136
|
+
processor_path = classpath_from(options[:processor_path])
|
137
|
+
cmd_args << '-processorpath' << processor_path.join(File::PATH_SEPARATOR) unless processor_path.empty?
|
138
|
+
else
|
139
|
+
cmd_args << '-proc:none'
|
140
|
+
end
|
133
141
|
cmd_args << '-d' << File.expand_path(options[:output].to_s) if options[:output]
|
134
142
|
cmd_args += options[:javac_args].flatten if options[:javac_args]
|
135
143
|
Tempfile.open('javac') do |tmp|
|
@@ -221,9 +229,8 @@ module Java
|
|
221
229
|
#
|
222
230
|
# Extracts the classpath from the options, expands it by calling artifacts, invokes
|
223
231
|
# each of the artifacts and returns an array of paths.
|
224
|
-
def classpath_from(
|
225
|
-
Buildr.artifacts(
|
226
|
-
map { |t| task(t).invoke; File.expand_path(t) }
|
232
|
+
def classpath_from(classpath)
|
233
|
+
Buildr.artifacts(classpath || []).flatten.map(&:to_s).map { |t| task(t).invoke; File.expand_path(t) }
|
227
234
|
end
|
228
235
|
end
|
229
236
|
end
|
data/lib/buildr/java/compiler.rb
CHANGED
@@ -33,9 +33,9 @@ module Buildr #:nodoc:
|
|
33
33
|
# (e.g. ['-implicit:none', '-encoding', 'iso-8859-1'])
|
34
34
|
class Javac < Base
|
35
35
|
|
36
|
-
OPTIONS = [:warnings, :debug, :deprecation, :source, :target, :lint, :other]
|
36
|
+
OPTIONS = [:warnings, :debug, :deprecation, :source, :target, :lint, :other, :processor_path, :processor]
|
37
37
|
|
38
|
-
specify :language
|
38
|
+
specify :language => :java, :target => 'classes', :target_ext => 'class', :packaging => :jar
|
39
39
|
|
40
40
|
def initialize(project, options) #:nodoc:
|
41
41
|
super
|
@@ -43,15 +43,20 @@ module Buildr #:nodoc:
|
|
43
43
|
options[:warnings] ||= false
|
44
44
|
options[:deprecation] ||= false
|
45
45
|
options[:lint] ||= false
|
46
|
+
options[:processor] ||= nil
|
47
|
+
options[:processor_path] ||= []
|
46
48
|
end
|
47
49
|
|
48
50
|
def compile(sources, target, dependencies) #:nodoc:
|
49
51
|
check_options options, OPTIONS
|
52
|
+
processor = !!options[:processor] || options[:processor].nil?
|
50
53
|
Java::Commands.javac(files_from_sources(sources),
|
51
54
|
:classpath => dependencies,
|
52
55
|
:sourcepath => sources.select { |source| File.directory?(source) },
|
53
56
|
:output => target,
|
54
|
-
:
|
57
|
+
:processor => processor,
|
58
|
+
:processor_path => (processor ? options[:processor_path] : []),
|
59
|
+
:javac_args => javac_args)
|
55
60
|
end
|
56
61
|
|
57
62
|
# Filter out source files that are known to not produce any corresponding .class output file. If we leave
|
data/lib/buildr/version.rb
CHANGED
data/rakelib/release.rake
CHANGED
@@ -79,7 +79,7 @@ task 'perform_release' do
|
|
79
79
|
|
80
80
|
stage('PostReleaseUpdateVersion', 'Update the version to the non-dev version') do
|
81
81
|
filename = 'lib/buildr/version.rb'
|
82
|
-
parts = ENV['PRODUCT_VERSION'].split
|
82
|
+
parts = ENV['PRODUCT_VERSION'].split('.')
|
83
83
|
next_version = "#{parts[0]}.#{parts[1]}.#{parts[2].to_i + 1}"
|
84
84
|
content = IO.read(filename).sub(/VERSION = '(.*)'\.freeze/, "VERSION = '#{next_version}.dev'.freeze")
|
85
85
|
IO.write(filename, content)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: realityforge-buildr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Apache Buildr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -175,11 +175,9 @@ executables:
|
|
175
175
|
extensions: []
|
176
176
|
extra_rdoc_files:
|
177
177
|
- README.md
|
178
|
-
- CHANGELOG.md
|
179
178
|
- LICENSE
|
180
179
|
- NOTICE
|
181
180
|
files:
|
182
|
-
- CHANGELOG.md
|
183
181
|
- LICENSE
|
184
182
|
- NOTICE
|
185
183
|
- README.md
|
@@ -191,6 +189,7 @@ files:
|
|
191
189
|
- addon/buildr/gwt.rb
|
192
190
|
- addon/buildr/jacoco.rb
|
193
191
|
- addon/buildr/pmd.rb
|
192
|
+
- addon/buildr/shade.rb
|
194
193
|
- addon/buildr/single_intermediate_layout.rb
|
195
194
|
- addon/buildr/spotbugs.rb
|
196
195
|
- addon/buildr/top_level_generate_dir.rb
|
@@ -214,6 +213,7 @@ files:
|
|
214
213
|
- lib/buildr/core/transports.rb
|
215
214
|
- lib/buildr/core/util.rb
|
216
215
|
- lib/buildr/ide/idea.rb
|
216
|
+
- lib/buildr/java/annotation_processor.rb
|
217
217
|
- lib/buildr/java/commands.rb
|
218
218
|
- lib/buildr/java/compiler.rb
|
219
219
|
- lib/buildr/java/custom_pom.rb
|