realityforge-buildr 1.5.16 → 1.5.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bb76fb200fe200d5778bc6b4122991ccbea6825da382f688dd07afa06b4305d
4
- data.tar.gz: ba1bf6ce47d21b286c346bd9561d0191e93997041ba99fc36240ade14f58e421
3
+ metadata.gz: 2a51598b50db7a4f0b678b738e0f18df792161df18c1d6849ea5359c0d6f8e1c
4
+ data.tar.gz: 49256454336cd6ffc7abb0cef8eaa397ccd412ba1fb2a793663c49af38f6ce32
5
5
  SHA512:
6
- metadata.gz: 60f9fa50cec1fe1c4a6a806cf8687443963e36891000c0addeb2694204c6950933cde7fe28eb1d9df019207a3e9c380c8df8964858c8bafe6d36300808040289
7
- data.tar.gz: 5890f8221a6f8cb2a8e1462cb1d1b88f0f95df67f37a75eb85c37eb173b450a99b02d2d811b9d84035b7cecabc59bd9e1e5e73486cf3e72069922db739a1243e
6
+ metadata.gz: 5c54f5153fc5e16d3e5ca5e9d01d363552bd58622ae545512c50d584cc90ced78fc1651e79266e28d604c9c30c9a74016560b6e3a29fb40286674b71b3e6f4a4
7
+ data.tar.gz: b92533e27aba22bb5a576f407e05e396f60ff355c8cbd4e8d996fe76102661d6d4d5c88e0d50e6114d1c018d8914757eeb9a46bdb151ec2e917a65da084ec79f
@@ -49,6 +49,7 @@ module Buildr
49
49
  def update_differences_report(artifact_coordinate, old_version, new_version, new_file, output_directory, options = {})
50
50
  output_file = "#{output_directory}/#{old_version}-#{new_version}.json"
51
51
  generate_differences_report(artifact_coordinate, old_version, new_version, new_file, output_file, options)
52
+ sh "git add #{output_file}" if File.exist?(output_file)
52
53
  end
53
54
 
54
55
  def test_differences_report(artifact_coordinate, old_version, new_version, new_file, output_directory, options = {})
@@ -22,8 +22,7 @@ module Buildr
22
22
  unless project.version
23
23
  version_suffix = ENV['BUILD_NUMBER'] ? "-#{ENV['BUILD_NUMBER']}" : ''
24
24
  version_prefix = ENV['VERSION_PREFIX'] ? "#{ENV['VERSION_PREFIX']}-" : ''
25
- git_version = `git describe --tags --always`.strip
26
- git_version = git_version.gsub(/^v([0-9])/, '\1')
25
+ git_version = `git describe --always`.strip
27
26
  project.version = version_prefix + git_version + version_suffix
28
27
  end
29
28
  end
data/addon/buildr/gwt.rb CHANGED
@@ -266,10 +266,6 @@ module Buildr
266
266
  args << '-XenableClosureCompiler'
267
267
  end
268
268
 
269
- if options[:js_exports]
270
- args << '-generateJsInteropExports'
271
- end
272
-
273
269
  args += modules
274
270
 
275
271
  properties = options[:properties] ? options[:properties].dup : {}
data/addon/buildr/pmd.rb CHANGED
@@ -126,7 +126,7 @@ module Buildr
126
126
 
127
127
  # An array of paths that should be excluded no matter how they are added to pmd
128
128
  def exclude_paths
129
- @source_paths ||= []
129
+ @exclude_paths ||= []
130
130
  end
131
131
 
132
132
  # An array of additional projects to scan for main and test sources
@@ -132,11 +132,11 @@ module Buildr
132
132
  if change_descriptions.size > 0
133
133
  description = "The release includes "
134
134
  if 1 == change_descriptions.size
135
- description += "#{change_descriptions[0]}"
135
+ description += "#{change_descriptions[0]}."
136
136
  elsif 2 == change_descriptions.size
137
- description += "#{change_descriptions[0]} and #{change_descriptions[1]}"
137
+ description += "#{change_descriptions[0]} and #{change_descriptions[1]}."
138
138
  else
139
- description += "#{change_descriptions[0]}, #{change_descriptions[1]} and #{change_descriptions[2]}"
139
+ description += "#{change_descriptions[0]}, #{change_descriptions[1]} and #{change_descriptions[2]}."
140
140
  end
141
141
 
142
142
  sub_header_text = description
@@ -148,6 +148,15 @@ module Buildr
148
148
  header += "\n\n#{sub_header_text}" unless sub_header_text.empty?
149
149
  header += "\n"
150
150
 
151
+ release_notes_file = options[:release_notes_summary_file]
152
+ if release_notes_file && File.exist?(release_notes_file)
153
+ summary_content = IO.read(release_notes_file).strip
154
+ unless summary_content.empty?
155
+ header += summary_content + "\n"
156
+ IO.write(release_notes_file, "\n")
157
+ end
158
+ end
159
+
151
160
  header += <<CONTENT
152
161
 
153
162
  Changes in this release:
@@ -156,6 +165,7 @@ CONTENT
156
165
  IO.write('CHANGELOG.md', changelog.gsub("### Unreleased\n", header))
157
166
 
158
167
  sh 'git reset 2>&1 1> /dev/null'
168
+ sh "git add #{release_notes_file}" if release_notes_file && File.exist?(release_notes_file)
159
169
  sh 'git add CHANGELOG.md'
160
170
  sh 'git commit -m "Update CHANGELOG.md in preparation for release"'
161
171
  end
@@ -431,40 +431,6 @@ module Buildr #:nodoc:
431
431
  end
432
432
  end
433
433
 
434
- def add_ejb_facet(options = {})
435
- name = options[:name] || 'EJB'
436
-
437
- default_ejb_roots = [buildr_project.iml.main_source_directories, buildr_project.compile.sources, buildr_project.resources.sources].flatten.compact
438
- ejb_roots = options[:ejb_roots] || default_ejb_roots
439
-
440
- default_deployment_descriptors = []
441
- %w(ejb-jar.xml glassfish-ejb-jar.xml ibm-ejb-jar-bnd.xml ibm-ejb-jar-ext-pme.xml ibm-ejb-jar-ext.xml jboss.xml jbosscmp-jdbc.xml openejb-jar.xml sun-cmp-mapping.xml sun-ejb-jar.xml weblogic-cmp-rdbms-jar.xml weblogic-ejb-jar.xml).
442
- each do |descriptor|
443
- ejb_roots.each do |path|
444
- d = "#{path}/WEB-INF/#{descriptor}"
445
- default_deployment_descriptors << d if File.exist?(d)
446
- d = "#{path}/META-INF/#{descriptor}"
447
- default_deployment_descriptors << d if File.exist?(d)
448
- end
449
- end
450
- deployment_descriptors = options[:deployment_descriptors] || default_deployment_descriptors
451
-
452
- add_facet(name, 'ejb') do |facet|
453
- facet.configuration do |c|
454
- c.descriptors do |d|
455
- deployment_descriptors.each do |deployment_descriptor|
456
- d.deploymentDescriptor :name => File.basename(deployment_descriptor), :url => file_path(deployment_descriptor)
457
- end
458
- end
459
- c.ejbRoots do |e|
460
- ejb_roots.each do |ejb_root|
461
- e.root :url => file_path(ejb_root)
462
- end
463
- end
464
- end
465
- end
466
- end
467
-
468
434
  protected
469
435
 
470
436
  def main_dependency_details
@@ -850,14 +816,16 @@ module Buildr #:nodoc:
850
816
  value.list :size => '2' do |list|
851
817
  list.item :index => '0', :class => 'java.lang.String', :itemvalue => 'org.jetbrains.annotations.Nullable'
852
818
  list.item :index => '1', :class => 'java.lang.String', :itemvalue => 'javax.annotation.Nullable'
819
+ list.item :index => '2', :class => 'java.lang.String', :itemvalue => 'jsinterop.annotations.JsNullable'
853
820
  end
854
821
  end
855
822
  end
856
823
  component.option :name => 'myNotNulls' do |option|
857
824
  option.value do |value|
858
- value.list :size => '2' do |list|
825
+ value.list :size => '3' do |list|
859
826
  list.item :index => '0', :class => 'java.lang.String', :itemvalue => 'org.jetbrains.annotations.NotNull'
860
827
  list.item :index => '1', :class => 'java.lang.String', :itemvalue => 'javax.annotation.Nonnull'
828
+ list.item :index => '2', :class => 'java.lang.String', :itemvalue => 'jsinterop.annotations.JsNonNull'
861
829
  end
862
830
  end
863
831
  end
@@ -1419,7 +1387,6 @@ module Buildr #:nodoc:
1419
1387
  def artifact_content(xml, project, projects, options)
1420
1388
  emit_module_output(xml, projects)
1421
1389
  emit_jpa_descriptors(xml, project, options)
1422
- emit_ejb_descriptors(xml, project, options)
1423
1390
  end
1424
1391
 
1425
1392
  def extension
@@ -1563,12 +1530,17 @@ module Buildr #:nodoc:
1563
1530
  next unless prj.iml?
1564
1531
  main_processor = !!prj.compile.options[:processor] || (prj.compile.options[:processor].nil? && !(prj.compile.options[:processor_path] || []).empty?)
1565
1532
  test_processor = !!prj.test.compile.options[:processor] || (prj.test.compile.options[:processor].nil? && !(prj.test.compile.options[:processor_path] || []).empty?)
1533
+ processor_options = (prj.compile.options[:processor_options] || {}).merge(prj.test.compile.options[:processor_options] || {})
1566
1534
  if main_processor || test_processor
1567
1535
  xml.profile(:name => "#{prj.name}", :enabled => true) do
1568
1536
  xml.sourceOutputDir :name => 'generated/processors/main/java' if main_processor
1569
1537
  xml.sourceTestOutputDir :name => 'generated/processors/test/java' if test_processor
1570
1538
  xml.outputRelativeToContentRoot :value => true
1571
1539
  xml.module :name => prj.iml.name
1540
+ processor_options.each do |k, v|
1541
+ xml.option :name => k, :value => v
1542
+ end
1543
+
1572
1544
  processor_path = (prj.compile.options[:processor_path] || []) + (prj.test.compile.options[:processor_path] || [])
1573
1545
  if processor_path.empty?
1574
1546
  xml.processorPath :useClasspath => true
@@ -1653,16 +1625,6 @@ module Buildr #:nodoc:
1653
1625
  xml.tag!('output-path', resolve_path(output_dir))
1654
1626
  end
1655
1627
 
1656
- def emit_ejb_descriptors(xml, project, options)
1657
- if options[:enable_ejb] || (options[:ejb_module_names] && options[:ejb_module_names].size > 0)
1658
- module_names = options[:ejb_module_names] || [project.iml.name]
1659
- module_names.each do |module_name|
1660
- facet_name = options[:ejb_facet_name] || 'EJB'
1661
- xml.element :id => 'javaee-facet-resources', :facet => "#{module_name}/ejb/#{facet_name}"
1662
- end
1663
- end
1664
- end
1665
-
1666
1628
  def emit_jpa_descriptors(xml, project, options)
1667
1629
  if options[:enable_jpa] || (options[:jpa_module_names] && options[:jpa_module_names].size > 0)
1668
1630
  module_names = options[:jpa_module_names] || [project.iml.name]
@@ -23,6 +23,9 @@ module Buildr
23
23
  end
24
24
 
25
25
  after_define do |project|
26
+ Buildr.artifacts((project.compile.options[:processor_path] || []) + (project.test.compile.options[:processor_path] || [])).flatten.map(&:to_s).map do |t|
27
+ Rake::Task['rake:artifacts'].enhance([task(t)])
28
+ end
26
29
  if !!project.compile.options[:processor] || (project.compile.options[:processor].nil? && !(project.compile.options[:processor_path] || []).empty?)
27
30
  path = project._(:target, :generated, 'processors/main/java')
28
31
  f = project.file(path) do |t|
@@ -115,13 +115,15 @@ module Java
115
115
  # * :classpath -- One or more file names, tasks or artifact specifications. These are all expanded into artifacts, and all tasks are invoked.
116
116
  # * :sourcepath -- Additional source paths to use.
117
117
  # * :processor_path -- Annotation processor path. These are all expanded into artifacts, and all tasks are invoked.
118
+ # * :processor_options -- Annotation processor options.
118
119
  # * :javac_args -- Any additional arguments to pass (e.g. -extdirs, -encoding)
119
120
  # * :name -- Shows this name, otherwise shows the working directory.
120
121
  def javac(*args, &block)
121
122
  options = Hash === args.last ? args.pop : {}
122
- rake_check_options options, :classpath, :sourcepath, :output, :javac_args, :name, :processor, :processor_path
123
+ rake_check_options options, :classpath, :sourcepath, :output, :javac_args, :name, :processor, :processor_path, :processor_options
123
124
 
124
125
  processor = !!options[:processor]
126
+ processor_options = options[:processor_options] || {}
125
127
 
126
128
  files = args.flatten.each { |f| f.invoke if f.respond_to?(:invoke) }.map(&:to_s).
127
129
  collect { |arg| File.directory?(arg) ? FileList["#{File.expand_path(arg)}/**/*.java"] : File.expand_path(arg) }.flatten
@@ -135,6 +137,9 @@ module Java
135
137
  if processor
136
138
  processor_path = classpath_from(options[:processor_path])
137
139
  cmd_args << '-processorpath' << processor_path.join(File::PATH_SEPARATOR) unless processor_path.empty?
140
+ processor_options.each do |k, v|
141
+ cmd_args << "-A#{k}=#{v}"
142
+ end
138
143
  else
139
144
  cmd_args << '-proc:none'
140
145
  end
@@ -33,7 +33,7 @@ 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, :processor_path, :processor]
36
+ OPTIONS = [:warnings, :debug, :deprecation, :source, :target, :lint, :other, :processor_path, :processor_options, :processor]
37
37
 
38
38
  specify :language => :java, :target => 'classes', :target_ext => 'class', :packaging => :jar
39
39
 
@@ -45,6 +45,7 @@ module Buildr #:nodoc:
45
45
  options[:lint] ||= false
46
46
  options[:processor] ||= nil
47
47
  options[:processor_path] ||= []
48
+ options[:processor_options] ||= {}
48
49
  end
49
50
 
50
51
  def compile(sources, target, dependencies) #:nodoc:
@@ -76,6 +77,9 @@ module Buildr #:nodoc:
76
77
  args << '-deprecation' if options[:deprecation]
77
78
  args << '-source' << options[:source].to_s if options[:source]
78
79
  args << '-target' << options[:target].to_s if options[:target]
80
+ options[:processor_options].each do |k, v|
81
+ args << "-A#{k}=#{v}"
82
+ end
79
83
  case options[:lint]
80
84
  when Array then args << "-Xlint:#{options[:lint].join(',')}"
81
85
  when String then args << "-Xlint:#{options[:lint]}"
@@ -274,7 +274,7 @@ module Buildr #:nodoc:
274
274
  include Extension
275
275
 
276
276
  before_define(:package => :build) do |project|
277
- if project.parent && project.parent.manifest
277
+ if project.parent&.manifest
278
278
  project.manifest = project.parent.manifest.dup
279
279
  else
280
280
  project.manifest = {
@@ -282,7 +282,7 @@ module Buildr #:nodoc:
282
282
  'Implementation-Title'=>project.comment || project.name,
283
283
  'Implementation-Version'=>project.version }
284
284
  end
285
- if project.parent && project.parent.meta_inf
285
+ if project.parent&.meta_inf
286
286
  project.meta_inf = project.parent.meta_inf.dup
287
287
  else
288
288
  project.meta_inf = [project.file('LICENSE')].select { |file| File.exist?(file.to_s) }
@@ -95,10 +95,10 @@ module Buildr #:nodoc:
95
95
  tmp.close unless tmp.nil?
96
96
  end
97
97
  # testng-failed.xml contains the list of failed tests *only*
98
- failed_tests = File.join(task.report_to.to_s, 'testng-failed.xml')
98
+ failed_tests = File.join(task.report_to.to_s, task.project.id.to_s, 'Command line test.xml')
99
99
  if File.exist?(failed_tests)
100
100
  report = File.read(failed_tests)
101
- failed = report.scan(/<class name="(.*?)">/im).flatten
101
+ failed = report.scan(/<testcase [^>]+ classname="([^"]+)">/im).flatten
102
102
  # return the list of passed tests
103
103
  tests - failed
104
104
  else
@@ -14,5 +14,5 @@
14
14
  # the License.
15
15
 
16
16
  module Buildr #:nodoc:
17
- VERSION = '1.5.16'.freeze
17
+ VERSION = '1.5.19'.freeze
18
18
  end
data/rakelib/release.rake CHANGED
@@ -1,5 +1,3 @@
1
- WORKSPACE_DIR = File.expand_path(File.dirname(__FILE__) + '/..')
2
-
3
1
  ENV['PREVIOUS_PRODUCT_VERSION'] = nil if ENV['PREVIOUS_PRODUCT_VERSION'].to_s == ''
4
2
  ENV['PRODUCT_VERSION'] = nil if ENV['PRODUCT_VERSION'].to_s == ''
5
3
 
@@ -32,7 +30,8 @@ end
32
30
  desc 'Perform a release'
33
31
  task 'perform_release' do
34
32
 
35
- in_dir(WORKSPACE_DIR) do
33
+ base_directory = File.dirname(Buildr.application.buildfile.to_s)
34
+ in_dir(base_directory) do
36
35
  stage('ExtractVersion', 'Extract the version from the version constant', :always_run => true) do
37
36
  ENV['PRODUCT_VERSION'] ||= IO.read('lib/buildr/version.rb')[/VERSION = '(\d+\.\d+\.\d+)(\.dev)?'\.freeze/, 1]
38
37
  raise "Unable to extract version from lib/buildr/version.rb" unless ENV['PRODUCT_VERSION']
@@ -625,74 +625,6 @@ describe Buildr::IntellijIdea do
625
625
  end
626
626
  end
627
627
 
628
- describe "using add_ejb_facet" do
629
- before do
630
- write "src/main/java/com/bin/foo.java"
631
- write "src/main/resources/WEB-INF/ejb-jar.xml"
632
-
633
- @foo = define "foo" do
634
- iml.add_ejb_facet
635
- end
636
- invoke_generate_task
637
- end
638
-
639
- it "generates an ejb facet with appropriate deployment descriptors" do
640
- doc = xml_document(@foo._("foo.iml"))
641
- ejb_facet_xpath = ensure_facet_xpath(doc, 'ejb', 'EJB')
642
- deployment_descriptor_xpath = "#{ejb_facet_xpath}/configuration/descriptors/deploymentDescriptor"
643
- doc.should have_xpath("#{deployment_descriptor_xpath}[@name='ejb-jar.xml', url='file://$MODULE_DIR$/src/main/resources/WEB-INF/ejb-jar.xml']")
644
- end
645
-
646
- it "generates an ejb facet with derived ejbRoots" do
647
- doc = xml_document(@foo._("foo.iml"))
648
- ejb_facet_xpath = ensure_facet_xpath(doc, 'ejb', 'EJB')
649
- doc.should have_xpath("#{ejb_facet_xpath}/configuration/ejbRoots/root[@url='file://$MODULE_DIR$/src/main/java']")
650
- doc.should have_xpath("#{ejb_facet_xpath}/configuration/ejbRoots/root[@url='file://$MODULE_DIR$/src/main/resources']")
651
- end
652
- end
653
-
654
- describe "using add_ejb_facet specifying parameters" do
655
- before do
656
- @foo = define "foo" do
657
- iml.add_ejb_facet(:ejb_roots => %w[generated/main/java generated/main/resources],
658
- :deployment_descriptors => ["generated/main/resources/WEB-INF/ejb-jar.xml"])
659
- end
660
- invoke_generate_task
661
- end
662
-
663
- it "generates an ejb facet with appropriate deployment descriptors" do
664
- doc = xml_document(@foo._("foo.iml"))
665
- ejb_facet_xpath = ensure_facet_xpath(doc, 'ejb', 'EJB')
666
- deployment_descriptor_xpath = "#{ejb_facet_xpath}/configuration/descriptors/deploymentDescriptor"
667
- doc.should have_xpath("#{deployment_descriptor_xpath}[@name='ejb-jar.xml', url='file://$MODULE_DIR$/generated/main/resources/WEB-INF/ejb-jar.xml']")
668
- end
669
-
670
- it "generates an ejb facet with derived ejbRoots" do
671
- doc = xml_document(@foo._("foo.iml"))
672
- ejb_facet_xpath = ensure_facet_xpath(doc, 'ejb', 'EJB')
673
- doc.should have_xpath("#{ejb_facet_xpath}/configuration/ejbRoots/root[@url='file://$MODULE_DIR$/generated/main/java']")
674
- doc.should have_xpath("#{ejb_facet_xpath}/configuration/ejbRoots/root[@url='file://$MODULE_DIR$/generated/main/resources']")
675
- end
676
- end
677
-
678
- describe "using add_ejb_facet derived from main_source_directories" do
679
- before do
680
- write "src/main/resources2/WEB-INF/ejb-jar.xml"
681
- @foo = define "foo" do
682
- iml.main_source_directories << "src/main/resources2"
683
- iml.add_ejb_facet
684
- end
685
- invoke_generate_task
686
- end
687
-
688
- it "generates an ejb facet with appropriate deployment descriptors" do
689
- doc = xml_document(@foo._("foo.iml"))
690
- ejb_facet_xpath = ensure_facet_xpath(doc, 'ejb', 'EJB')
691
- deployment_descriptor_xpath = "#{ejb_facet_xpath}/configuration/descriptors/deploymentDescriptor"
692
- doc.should have_xpath("#{deployment_descriptor_xpath}[@name='ejb-jar.xml', url='file://$MODULE_DIR$/src/main/resources2/WEB-INF/ejb-jar.xml']")
693
- end
694
- end
695
-
696
628
  describe "with add_data_source" do
697
629
  before do
698
630
  artifact("org.postgresql:postgresql:jar:9.not-a-version") { |task| write task.name }
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.16
4
+ version: 1.5.19
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-04-14 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake