buildr 1.4.20-x86-mswin32 → 1.4.21-x86-mswin32
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.
- checksums.yaml +6 -14
- data/CHANGELOG +31 -0
- data/Rakefile +5 -3
- data/addon/buildr/checkstyle.rb +41 -19
- data/addon/buildr/gwt.rb +48 -20
- data/addon/buildr/jacoco.rb +2 -4
- data/addon/buildr/pmd.rb +33 -18
- data/buildr.gemspec +8 -6
- data/doc/download.textile +18 -6
- data/doc/index.textile +29 -25
- data/lib/buildr/ide/idea.rb +172 -135
- data/lib/buildr/packaging/archive.rb +15 -1
- data/lib/buildr/packaging/tar.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +2 -1
- data/lib/buildr/version.rb +1 -1
- data/rakelib/stage.rake +1 -1
- data/spec/packaging/archive_spec.rb +34 -0
- metadata +41 -46
data/doc/download.textile
CHANGED
@@ -18,16 +18,28 @@ The source code is included in both source and binary distribution, the Gem dist
|
|
18
18
|
|
19
19
|
h2(#dist). Binaries and Source Code
|
20
20
|
|
21
|
+
h3. buildr 1.4.20 (2014-08-23)
|
22
|
+
|
23
|
+
|_. Package |_. MD5 Checksum |_. PGP |
|
24
|
+
| "buildr-1.4.20-java.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.20/buildr-1.4.20-java.gem | "5c556432d31d1b6a8b7f6dc4d40adfd7":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20-java.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20-java.gem.asc |
|
25
|
+
| "buildr-1.4.20-x86-mswin32.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.20/buildr-1.4.20-x86-mswin32.gem | "4db296ff90d82306d80b47c763f771ae":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20-x86-mswin32.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20-x86-mswin32.gem.asc |
|
26
|
+
| "buildr-1.4.20.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.20/buildr-1.4.20.gem | "78987c8048d9c30c96f07b485df7077c":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20.gem.asc |
|
27
|
+
| "buildr-1.4.20.tgz":http://www.apache.org/dyn/closer.cgi/buildr/1.4.20/buildr-1.4.20.tgz | "682d1574dbc9c17db841df6a9632497e":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20.tgz.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20.tgz.asc |
|
28
|
+
| "buildr-1.4.20.zip":http://www.apache.org/dyn/closer.cgi/buildr/1.4.20/buildr-1.4.20.zip | "ad04e82d76268ec91a6bc33afcb77490":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20.zip.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.20/buildr-1.4.20.zip.asc |
|
29
|
+
|
30
|
+
p>. ("Release signing keys":http://www.apache.org/dist/buildr/1.4.20/KEYS)
|
31
|
+
|
32
|
+
|
21
33
|
h3. buildr 1.4.19 (2014-07-06)
|
22
34
|
|
23
35
|
|_. Package |_. MD5 Checksum |_. PGP |
|
24
|
-
| "buildr-1.4.19-java.gem":http://
|
25
|
-
| "buildr-1.4.19-x86-mswin32.gem":http://
|
26
|
-
| "buildr-1.4.19.gem":http://
|
27
|
-
| "buildr-1.4.19.tgz":http://
|
28
|
-
| "buildr-1.4.19.zip":http://
|
36
|
+
| "buildr-1.4.19-java.gem":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19-java.gem | "bdf35f947eab94766ec4a4ca4b82e73e":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19-java.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19-java.gem.asc |
|
37
|
+
| "buildr-1.4.19-x86-mswin32.gem":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19-x86-mswin32.gem | "9fbe0ac5148e5d3a6f449dfbd5dfc4a2":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19-x86-mswin32.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19-x86-mswin32.gem.asc |
|
38
|
+
| "buildr-1.4.19.gem":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.gem | "626af3aabef47a6c55587aaeca5d879d":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.gem.md5 | "Sig":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.gem.asc |
|
39
|
+
| "buildr-1.4.19.tgz":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.tgz | "f9bc0151a6ed9867c40393cced6195f5":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.tgz.md5 | "Sig":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.tgz.asc |
|
40
|
+
| "buildr-1.4.19.zip":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.zip | "1c88b93901524e236db41ec69a3bc72a":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.zip.md5 | "Sig":http://archive.apache.org/dist/buildr/1.4.19/buildr-1.4.19.zip.asc |
|
29
41
|
|
30
|
-
p>. ("Release signing keys":http://
|
42
|
+
p>. ("Release signing keys":http://archive.apache.org/dist/buildr/1.4.19/KEYS)
|
31
43
|
|
32
44
|
|
33
45
|
h3. buildr 1.4.18 (2014-06-24)
|
data/doc/index.textile
CHANGED
@@ -46,31 +46,35 @@ 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
|
-
Highlights from Buildr 1.4.
|
50
|
-
*
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
* Change:
|
55
|
-
*
|
56
|
-
*
|
57
|
-
*
|
58
|
-
|
59
|
-
*
|
60
|
-
|
61
|
-
*
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
* Fixed:
|
70
|
-
|
71
|
-
"
|
72
|
-
*
|
73
|
-
|
49
|
+
Highlights from Buildr 1.4.21 (2014-11-28)
|
50
|
+
* Change: Upgrade atoulme-Antwrap to 0.7.5 to remove deprecation warnings in
|
51
|
+
modern JRuby. Suggested by Pepijn Van Eeckhoudt.
|
52
|
+
* Fixed: BUILDR-702 - Retain Unix permission flags when merging
|
53
|
+
zip files into another zip or tar archive. Submitted by Pepijn Van Eeckhoudt.
|
54
|
+
* Change: Upgrade jacoco to 0.7.2 to support Java 8. Submitted by neher.
|
55
|
+
* Change: Update checkstyle addon to use Checkstyle 6.0.
|
56
|
+
* Added: Update checkstyle addon to support downloading checkstyle checks as an artifact.
|
57
|
+
* Added: Update checkstyle addon to supply checkstyle.config.dir property.
|
58
|
+
* Added: Update pmd addon to support downloading rule files as an artifact.
|
59
|
+
* Change: Update pmd addon to use pmd version 5.1.3.
|
60
|
+
* Change: Update rjb to version 1.5.1.
|
61
|
+
* Change: Update the gwt addon to add the validation dependencies required for GWT
|
62
|
+
compiles without requiring that the user specify the dependency.
|
63
|
+
* Added: Updated the gwt addon to support the GWT 2.7.0 release.
|
64
|
+
* Change: Update ipr.add_gwt_configuration method to support GWT 2.7 configuration
|
65
|
+
parameters and IDEA 14 parameters.
|
66
|
+
* Change: Enhance ipr.add_glassfish_configuration to support the ability to
|
67
|
+
define the version of GlassFish in uses. Change the default to 4.1.0
|
68
|
+
as that is the latest supported variant.
|
69
|
+
* Fixed: Change the name of the GlassFish install in ipr.add_glassfish_configuration
|
70
|
+
to use the same convention that IDEA uses by default. i.e. Name the
|
71
|
+
installation "GlassFish 4.1.0" rather than "Glassfish 4.1.0".
|
72
|
+
* Change: Change the default version of the jdk in IDEA project files to 1.7.
|
73
|
+
* Change: Change the default version of the IDEA project files created to the
|
74
|
+
current release version 13. To revert to the older versions specify
|
75
|
+
ipr.version = '12' in your buildfile.
|
76
|
+
* Added: Enhance the IdeaFile class to easily support mixing in of custom
|
77
|
+
components from either the filesystem or from an artifact.
|
74
78
|
|
75
79
|
This is a partial list -- see the "CHANGELOG":CHANGELOG for full details.
|
76
80
|
|
data/lib/buildr/ide/idea.rb
CHANGED
@@ -21,8 +21,8 @@ module Buildr #:nodoc:
|
|
21
21
|
|
22
22
|
# Abstract base class for IdeaModule and IdeaProject
|
23
23
|
class IdeaFile
|
24
|
-
DEFAULT_SUFFIX =
|
25
|
-
DEFAULT_LOCAL_REPOSITORY_ENV_OVERRIDE =
|
24
|
+
DEFAULT_SUFFIX = ''
|
25
|
+
DEFAULT_LOCAL_REPOSITORY_ENV_OVERRIDE = 'MAVEN_REPOSITORY'
|
26
26
|
|
27
27
|
attr_reader :buildr_project
|
28
28
|
attr_writer :suffix
|
@@ -50,6 +50,21 @@ module Buildr #:nodoc:
|
|
50
50
|
self.components << create_component(name, attrs, &xml)
|
51
51
|
end
|
52
52
|
|
53
|
+
def add_component_from_file(filename)
|
54
|
+
self.components << lambda do
|
55
|
+
raise "Unable to locate file #{filename} adding component to idea file" unless File.exist?(filename)
|
56
|
+
Buildr::IntellijIdea.new_document(IO.read(filename)).root
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def add_component_from_artifact(artifact)
|
61
|
+
self.components << lambda do
|
62
|
+
a = Buildr.artifact(artifact)
|
63
|
+
a.invoke
|
64
|
+
Buildr::IntellijIdea.new_document(IO.read(a.to_s)).root
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
53
68
|
# IDEA can not handle text content with indents so need to removing indenting
|
54
69
|
# Can not pass true as third argument as the ruby library seems broken
|
55
70
|
def write(f)
|
@@ -131,7 +146,7 @@ module Buildr #:nodoc:
|
|
131
146
|
end
|
132
147
|
if self.template
|
133
148
|
template_doc = load_document(self.template)
|
134
|
-
REXML::XPath.each(template_doc,
|
149
|
+
REXML::XPath.each(template_doc, '//component') do |element|
|
135
150
|
inject_component(doc, element)
|
136
151
|
end
|
137
152
|
end
|
@@ -164,7 +179,7 @@ module Buildr #:nodoc:
|
|
164
179
|
|
165
180
|
# IdeaModule represents an .iml file
|
166
181
|
class IdeaModule < IdeaFile
|
167
|
-
DEFAULT_TYPE =
|
182
|
+
DEFAULT_TYPE = 'JAVA_MODULE'
|
168
183
|
|
169
184
|
attr_accessor :type
|
170
185
|
attr_accessor :group
|
@@ -184,11 +199,11 @@ module Buildr #:nodoc:
|
|
184
199
|
end
|
185
200
|
|
186
201
|
def jdk_version
|
187
|
-
@jdk_version || buildr_project.compile.options.source ||
|
202
|
+
@jdk_version || buildr_project.compile.options.source || '1.7'
|
188
203
|
end
|
189
204
|
|
190
205
|
def extension
|
191
|
-
|
206
|
+
'iml'
|
192
207
|
end
|
193
208
|
|
194
209
|
def main_source_directories
|
@@ -252,7 +267,7 @@ module Buildr #:nodoc:
|
|
252
267
|
end
|
253
268
|
|
254
269
|
def add_gwt_facet(modules = {}, options = {})
|
255
|
-
name = options[:name] ||
|
270
|
+
name = options[:name] || 'GWT'
|
256
271
|
detected_gwt_version = nil
|
257
272
|
if options[:gwt_dev_artifact]
|
258
273
|
a = Buildr.artifact(options[:gwt_dev_artifact])
|
@@ -262,10 +277,10 @@ module Buildr #:nodoc:
|
|
262
277
|
|
263
278
|
settings =
|
264
279
|
{
|
265
|
-
:webFacet =>
|
266
|
-
:compilerMaxHeapSize =>
|
267
|
-
:compilerParameters =>
|
268
|
-
:gwtScriptOutputStyle =>
|
280
|
+
:webFacet => 'Web',
|
281
|
+
:compilerMaxHeapSize => '512',
|
282
|
+
:compilerParameters => '-draftCompile -localWorkers 2 -strict',
|
283
|
+
:gwtScriptOutputStyle => 'PRETTY'
|
269
284
|
}.merge(options[:settings] || {})
|
270
285
|
|
271
286
|
buildr_project.compile.dependencies.each do |d|
|
@@ -277,12 +292,12 @@ module Buildr #:nodoc:
|
|
277
292
|
|
278
293
|
if detected_gwt_version
|
279
294
|
settings[:gwtSdkUrl] = resolve_path(File.dirname(detected_gwt_version))
|
280
|
-
settings[:gwtSdkType] =
|
295
|
+
settings[:gwtSdkType] = 'maven'
|
281
296
|
else
|
282
|
-
settings[:gwtSdkUrl] =
|
297
|
+
settings[:gwtSdkUrl] = 'file://$GWT_TOOLS$'
|
283
298
|
end
|
284
299
|
|
285
|
-
add_facet(name,
|
300
|
+
add_facet(name, 'gwt') do |f|
|
286
301
|
f.configuration do |c|
|
287
302
|
settings.each_pair do |k, v|
|
288
303
|
c.setting :name => k.to_s, :value => v.to_s
|
@@ -297,10 +312,10 @@ module Buildr #:nodoc:
|
|
297
312
|
end
|
298
313
|
|
299
314
|
def add_web_facet(options = {})
|
300
|
-
name = options[:name] ||
|
315
|
+
name = options[:name] || 'Web'
|
301
316
|
default_webroots = {}
|
302
|
-
default_webroots[buildr_project._(:source, :main, :webapp)] =
|
303
|
-
buildr_project.assets.paths.each {|p| default_webroots[p] =
|
317
|
+
default_webroots[buildr_project._(:source, :main, :webapp)] = '/' if File.exist?(buildr_project._(:source, :main, :webapp))
|
318
|
+
buildr_project.assets.paths.each {|p| default_webroots[p] = '/' }
|
304
319
|
webroots = options[:webroots] || default_webroots
|
305
320
|
default_deployment_descriptors = []
|
306
321
|
['web.xml', 'sun-web.xml', 'glassfish-web.xml', 'jetty-web.xml', 'geronimo-web.xml',
|
@@ -309,14 +324,14 @@ module Buildr #:nodoc:
|
|
309
324
|
'ibm-web-bnd.xml', 'ibm-web-ext.xml', 'ibm-web-ext-pme.xml'].
|
310
325
|
each do |descriptor|
|
311
326
|
webroots.each_pair do |path, relative_url|
|
312
|
-
next unless relative_url ==
|
327
|
+
next unless relative_url == '/'
|
313
328
|
d = "#{path}/WEB-INF/#{descriptor}"
|
314
329
|
default_deployment_descriptors << d if File.exist?(d)
|
315
330
|
end
|
316
331
|
end
|
317
332
|
deployment_descriptors = options[:deployment_descriptors] || default_deployment_descriptors
|
318
333
|
|
319
|
-
add_facet(name,
|
334
|
+
add_facet(name, 'web') do |f|
|
320
335
|
f.configuration do |c|
|
321
336
|
c.descriptors do |d|
|
322
337
|
deployment_descriptors.each do |deployment_descriptor|
|
@@ -339,22 +354,22 @@ module Buildr #:nodoc:
|
|
339
354
|
end
|
340
355
|
|
341
356
|
def add_jruby_facet(options = {})
|
342
|
-
name = options[:name] ||
|
357
|
+
name = options[:name] || 'JRuby'
|
343
358
|
|
344
359
|
ruby_version_file = buildr_project._('.ruby-version')
|
345
360
|
default_jruby_version = File.exist?(ruby_version_file) ? "rbenv: #{IO.read(ruby_version_file).strip}" : 'jruby-1.6.7.2'
|
346
361
|
jruby_version = options[:jruby_version] || default_jruby_version
|
347
|
-
add_facet(name,
|
362
|
+
add_facet(name, 'JRUBY') do |f|
|
348
363
|
f.configuration do |c|
|
349
|
-
c.JRUBY_FACET_CONFIG_ID :NAME =>
|
350
|
-
c.LOAD_PATH :number =>
|
351
|
-
c.I18N_FOLDERS :number =>
|
364
|
+
c.JRUBY_FACET_CONFIG_ID :NAME => 'JRUBY_SDK_NAME', :VALUE => jruby_version
|
365
|
+
c.LOAD_PATH :number => '0'
|
366
|
+
c.I18N_FOLDERS :number => '0'
|
352
367
|
end
|
353
368
|
end
|
354
369
|
end
|
355
370
|
|
356
371
|
def add_jpa_facet(options = {})
|
357
|
-
name = options[:name] ||
|
372
|
+
name = options[:name] || 'JPA'
|
358
373
|
|
359
374
|
source_roots = [buildr_project.iml.main_source_directories, buildr_project.compile.sources, buildr_project.resources.sources].flatten.compact
|
360
375
|
default_deployment_descriptors = []
|
@@ -384,11 +399,11 @@ module Buildr #:nodoc:
|
|
384
399
|
end
|
385
400
|
end
|
386
401
|
|
387
|
-
add_facet(name,
|
402
|
+
add_facet(name, 'jpa') do |f|
|
388
403
|
f.configuration do |c|
|
389
404
|
if provider
|
390
|
-
c.setting :name =>
|
391
|
-
c.setting :name =>
|
405
|
+
c.setting :name => 'validation-enabled', :value => validation_enabled
|
406
|
+
c.setting :name => 'provider-name', :value => provider
|
392
407
|
end
|
393
408
|
c.tag!('datasource-mapping') do |ds|
|
394
409
|
ds.tag!('factory-entry', :name => factory_entry)
|
@@ -401,7 +416,7 @@ module Buildr #:nodoc:
|
|
401
416
|
end
|
402
417
|
|
403
418
|
def add_ejb_facet(options = {})
|
404
|
-
name = options[:name] ||
|
419
|
+
name = options[:name] || 'EJB'
|
405
420
|
|
406
421
|
default_ejb_roots = [buildr_project.iml.main_source_directories, buildr_project.compile.sources, buildr_project.resources.sources].flatten.compact
|
407
422
|
ejb_roots = options[:ejb_roots] || default_ejb_roots
|
@@ -420,7 +435,7 @@ module Buildr #:nodoc:
|
|
420
435
|
end
|
421
436
|
deployment_descriptors = options[:deployment_descriptors] || default_deployment_descriptors
|
422
437
|
|
423
|
-
add_facet(name,
|
438
|
+
add_facet(name, 'ejb') do |facet|
|
424
439
|
facet.configuration do |c|
|
425
440
|
c.descriptors do |d|
|
426
441
|
deployment_descriptors.each do |deployment_descriptor|
|
@@ -464,7 +479,7 @@ module Buildr #:nodoc:
|
|
464
479
|
|
465
480
|
def base_document
|
466
481
|
target = StringIO.new
|
467
|
-
Builder::XmlMarkup.new(:target => target).module(:version =>
|
482
|
+
Builder::XmlMarkup.new(:target => target).module(:version => '4', :relativePaths => 'true', :type => self.type)
|
468
483
|
Buildr::IntellijIdea.new_document(target.string)
|
469
484
|
end
|
470
485
|
|
@@ -480,11 +495,11 @@ module Buildr #:nodoc:
|
|
480
495
|
end
|
481
496
|
|
482
497
|
def facet_component
|
483
|
-
create_composite_component(
|
498
|
+
create_composite_component('FacetManager', {}, self.facets)
|
484
499
|
end
|
485
500
|
|
486
501
|
def module_root_component
|
487
|
-
create_component(
|
502
|
+
create_component('NewModuleRootManager', 'inherit-compiler-output' => 'false') do |xml|
|
488
503
|
generate_compile_output(xml)
|
489
504
|
generate_content(xml) unless skip_content?
|
490
505
|
generate_initial_order_entries(xml)
|
@@ -535,17 +550,17 @@ module Buildr #:nodoc:
|
|
535
550
|
end
|
536
551
|
|
537
552
|
def resolve_path(path)
|
538
|
-
resolve_path_from_base(path,
|
553
|
+
resolve_path_from_base(path, '$MODULE_DIR$')
|
539
554
|
end
|
540
555
|
|
541
556
|
def generate_compile_output(xml)
|
542
557
|
xml.output(:url => file_path(self.main_output_dir.to_s))
|
543
|
-
xml.tag!(
|
544
|
-
xml.tag!(
|
558
|
+
xml.tag!('output-test', :url => file_path(self.test_output_dir.to_s))
|
559
|
+
xml.tag!('exclude-output')
|
545
560
|
end
|
546
561
|
|
547
562
|
def generate_content(xml)
|
548
|
-
xml.content(:url =>
|
563
|
+
xml.content(:url => 'file://$MODULE_DIR$') do
|
549
564
|
# Source folders
|
550
565
|
{
|
551
566
|
:main => self.main_source_directories,
|
@@ -567,16 +582,16 @@ module Buildr #:nodoc:
|
|
567
582
|
end
|
568
583
|
|
569
584
|
def relative_dir_inside_dir?(dir)
|
570
|
-
!dir.include?(
|
585
|
+
!dir.include?('../')
|
571
586
|
end
|
572
587
|
|
573
588
|
def generate_initial_order_entries(xml)
|
574
|
-
xml.orderEntry :type =>
|
575
|
-
xml.orderEntry :type =>
|
589
|
+
xml.orderEntry :type => 'sourceFolder', :forTests => 'false'
|
590
|
+
xml.orderEntry :type => 'jdk', :jdkName => jdk_version, :jdkType => 'JavaSDK'
|
576
591
|
end
|
577
592
|
|
578
593
|
def generate_project_dependency(xml, other_project, export, test = false)
|
579
|
-
attribs = {:type => 'module',
|
594
|
+
attribs = {:type => 'module', 'module-name' => other_project}
|
580
595
|
attribs[:exported] = '' if export
|
581
596
|
attribs[:scope] = 'TEST' if test
|
582
597
|
xml.orderEntry attribs
|
@@ -633,27 +648,29 @@ module Buildr #:nodoc:
|
|
633
648
|
end
|
634
649
|
|
635
650
|
def version
|
636
|
-
@version ||
|
651
|
+
@version || '13'
|
637
652
|
end
|
638
653
|
|
639
654
|
def jdk_version
|
640
|
-
@jdk_version ||= buildr_project.compile.options.source ||
|
655
|
+
@jdk_version ||= buildr_project.compile.options.source || '1.7'
|
641
656
|
end
|
642
657
|
|
643
658
|
def add_artifact(name, type, build_on_make = false)
|
644
659
|
add_to_composite_component(self.artifacts) do |xml|
|
645
|
-
xml.artifact(:name => name, :type => type,
|
660
|
+
xml.artifact(:name => name, :type => type, 'build-on-make' => build_on_make) do |xml|
|
646
661
|
yield xml if block_given?
|
647
662
|
end
|
648
663
|
end
|
649
664
|
end
|
650
665
|
|
651
|
-
def add_configuration(name, type, factory_name, default = false)
|
666
|
+
def add_configuration(name, type, factory_name, default = false, options = {})
|
652
667
|
add_to_composite_component(self.configurations) do |xml|
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
668
|
+
params = options.dup
|
669
|
+
params[:type] = type
|
670
|
+
params[:factoryName] = factory_name
|
671
|
+
params[:name] = name unless default
|
672
|
+
params[:default] = true if default
|
673
|
+
xml.configuration(params) do |xml|
|
657
674
|
yield xml if block_given?
|
658
675
|
end
|
659
676
|
end
|
@@ -667,15 +684,15 @@ module Buildr #:nodoc:
|
|
667
684
|
|
668
685
|
def add_postgres_data_source(name, options = {})
|
669
686
|
if options[:url].nil? && options[:database]
|
670
|
-
default_url = "jdbc:postgresql://#{(options[:host] ||
|
687
|
+
default_url = "jdbc:postgresql://#{(options[:host] || '127.0.0.1')}:#{(options[:port] || '5432')}/#{options[:database]}"
|
671
688
|
end
|
672
689
|
|
673
690
|
params = {
|
674
691
|
:driver => 'org.postgresql.Driver',
|
675
692
|
:url => default_url,
|
676
|
-
:username => ENV[
|
693
|
+
:username => ENV['USER'],
|
677
694
|
:dialect => 'PostgreSQL',
|
678
|
-
:classpath => [
|
695
|
+
:classpath => ['org.postgresql:postgresql:jar:9.2-1003-jdbc4']
|
679
696
|
}.merge(options)
|
680
697
|
add_data_source(name, params)
|
681
698
|
end
|
@@ -683,13 +700,13 @@ module Buildr #:nodoc:
|
|
683
700
|
def add_sql_server_data_source(name, options = {})
|
684
701
|
default_url = nil
|
685
702
|
if options[:url].nil? && options[:database]
|
686
|
-
default_url = "jdbc:jtds:sqlserver://#{(options[:host] ||
|
703
|
+
default_url = "jdbc:jtds:sqlserver://#{(options[:host] || '127.0.0.1')}:#{(options[:port] || '1433')}/#{options[:database]}"
|
687
704
|
end
|
688
705
|
|
689
706
|
params = {
|
690
707
|
:driver => 'net.sourceforge.jtds.jdbc.Driver',
|
691
708
|
:url => default_url,
|
692
|
-
:username => ENV[
|
709
|
+
:username => ENV['USER'],
|
693
710
|
:dialect => 'TSQL',
|
694
711
|
:classpath => ['net.sourceforge.jtds:jtds:jar:1.2.7']
|
695
712
|
}.merge(options)
|
@@ -708,28 +725,28 @@ module Buildr #:nodoc:
|
|
708
725
|
def add_data_source(name, options = {})
|
709
726
|
add_to_composite_component(self.data_sources) do |xml|
|
710
727
|
data_source_options = {
|
711
|
-
:source =>
|
728
|
+
:source => 'LOCAL',
|
712
729
|
:name => name,
|
713
730
|
:uuid => Buildr::Util.uuid
|
714
731
|
}
|
715
732
|
classpath = options[:classpath] || []
|
716
|
-
xml.tag!(
|
717
|
-
xml.tag!(
|
718
|
-
xml.tag!(
|
719
|
-
xml.tag!(
|
720
|
-
xml.tag!(
|
721
|
-
xml.tag!(
|
722
|
-
xml.tag!(
|
723
|
-
xml.tag!(
|
724
|
-
xml.tag!(
|
725
|
-
xml.tag!(
|
733
|
+
xml.tag!('data-source', data_source_options) do |xml|
|
734
|
+
xml.tag!('synchronize', (options[:synchronize]||'true'))
|
735
|
+
xml.tag!('jdbc-driver', options[:driver]) if options[:driver]
|
736
|
+
xml.tag!('jdbc-url', options[:url]) if options[:url]
|
737
|
+
xml.tag!('user-name', options[:username]) if options[:username]
|
738
|
+
xml.tag!('user-password', encrypt(options[:password])) if options[:password]
|
739
|
+
xml.tag!('schema-pattern', options[:schema_pattern]) if options[:schema_pattern]
|
740
|
+
xml.tag!('default-schemas', options[:default_schemas]) if options[:default_schemas]
|
741
|
+
xml.tag!('table-pattern', options[:table_pattern]) if options[:table_pattern]
|
742
|
+
xml.tag!('default-dialect', options[:dialect]) if options[:dialect]
|
726
743
|
|
727
744
|
xml.libraries do |xml|
|
728
745
|
classpath.each do |classpath_element|
|
729
746
|
a = Buildr.artifact(classpath_element)
|
730
747
|
a.invoke
|
731
748
|
xml.library do |xml|
|
732
|
-
xml.tag!(
|
749
|
+
xml.tag!('url', resolve_path(a.to_s))
|
733
750
|
end
|
734
751
|
end
|
735
752
|
end if classpath.size > 0
|
@@ -741,17 +758,17 @@ module Buildr #:nodoc:
|
|
741
758
|
artifact_name = to_artifact_name(project, options)
|
742
759
|
artifacts = options[:artifacts] || []
|
743
760
|
|
744
|
-
add_artifact(artifact_name,
|
761
|
+
add_artifact(artifact_name, 'exploded-war', build_on_make(options)) do |xml|
|
745
762
|
dependencies = (options[:dependencies] || ([project] + project.compile.dependencies)).flatten
|
746
763
|
libraries, projects = partition_dependencies(dependencies)
|
747
764
|
|
748
765
|
emit_output_path(xml, artifact_name, options)
|
749
|
-
xml.root :id =>
|
750
|
-
xml.element :id =>
|
751
|
-
xml.element :id =>
|
766
|
+
xml.root :id => 'root' do
|
767
|
+
xml.element :id => 'directory', :name => 'WEB-INF' do
|
768
|
+
xml.element :id => 'directory', :name => 'classes' do
|
752
769
|
artifact_content(xml, project, projects, options)
|
753
770
|
end
|
754
|
-
xml.element :id =>
|
771
|
+
xml.element :id => 'directory', :name => 'lib' do
|
755
772
|
emit_libraries(xml, libraries)
|
756
773
|
emit_jar_artifacts(xml, artifacts)
|
757
774
|
end
|
@@ -760,16 +777,16 @@ module Buildr #:nodoc:
|
|
760
777
|
if options[:enable_war].nil? || options[:enable_war] || (options[:war_module_names] && options[:war_module_names].size > 0)
|
761
778
|
module_names = options[:war_module_names] || [project.iml.id]
|
762
779
|
module_names.each do |module_name|
|
763
|
-
facet_name = options[:war_facet_name] ||
|
764
|
-
xml.element :id =>
|
780
|
+
facet_name = options[:war_facet_name] || 'Web'
|
781
|
+
xml.element :id => 'javaee-facet-resources', :facet => "#{module_name}/web/#{facet_name}"
|
765
782
|
end
|
766
783
|
end
|
767
784
|
|
768
785
|
if options[:enable_gwt] || (options[:gwt_module_names] && options[:gwt_module_names].size > 0)
|
769
786
|
module_names = options[:gwt_module_names] || [project.iml.id]
|
770
787
|
module_names.each do |module_name|
|
771
|
-
facet_name = options[:gwt_facet_name] ||
|
772
|
-
xml.element :id =>
|
788
|
+
facet_name = options[:gwt_facet_name] || 'GWT'
|
789
|
+
xml.element :id => 'gwt-compiler-output', :facet => "#{module_name}/gwt/#{facet_name}"
|
773
790
|
end
|
774
791
|
end
|
775
792
|
end
|
@@ -779,14 +796,14 @@ module Buildr #:nodoc:
|
|
779
796
|
def add_exploded_ear_artifact(project, options ={})
|
780
797
|
artifact_name = to_artifact_name(project, options)
|
781
798
|
|
782
|
-
add_artifact(artifact_name,
|
799
|
+
add_artifact(artifact_name, 'exploded-ear', build_on_make(options)) do |xml|
|
783
800
|
dependencies = (options[:dependencies] || ([project] + project.compile.dependencies)).flatten
|
784
801
|
libraries, projects = partition_dependencies(dependencies)
|
785
802
|
|
786
803
|
emit_output_path(xml, artifact_name, options)
|
787
|
-
xml.root :id =>
|
804
|
+
xml.root :id => 'root' do
|
788
805
|
emit_module_output(xml, projects)
|
789
|
-
xml.element :id =>
|
806
|
+
xml.element :id => 'directory', :name => 'lib' do
|
790
807
|
emit_libraries(xml, libraries)
|
791
808
|
end
|
792
809
|
end
|
@@ -801,9 +818,9 @@ module Buildr #:nodoc:
|
|
801
818
|
raise "Unable to add non-project dependencies (#{libraries.inspect}) to jar artifact" if libraries.size > 0
|
802
819
|
|
803
820
|
jar_name = "#{artifact_name}.jar"
|
804
|
-
add_artifact(jar_name,
|
821
|
+
add_artifact(jar_name, 'jar', build_on_make(options)) do |xml|
|
805
822
|
emit_output_path(xml, artifact_name, options)
|
806
|
-
xml.root(:id =>
|
823
|
+
xml.root(:id => 'archive', :name => jar_name) do
|
807
824
|
artifact_content(xml, project, projects, options)
|
808
825
|
end
|
809
826
|
end
|
@@ -812,13 +829,13 @@ module Buildr #:nodoc:
|
|
812
829
|
def add_exploded_ejb_artifact(project, options = {})
|
813
830
|
artifact_name = to_artifact_name(project, options)
|
814
831
|
|
815
|
-
add_artifact(artifact_name,
|
832
|
+
add_artifact(artifact_name, 'exploded-ejb', build_on_make(options)) do |xml|
|
816
833
|
dependencies = (options[:dependencies] || [project]).flatten
|
817
834
|
libraries, projects = partition_dependencies(dependencies)
|
818
835
|
raise "Unable to add non-project dependencies (#{libraries.inspect}) to ejb artifact" if libraries.size > 0
|
819
836
|
|
820
837
|
emit_output_path(xml, artifact_name, options)
|
821
|
-
xml.root :id =>
|
838
|
+
xml.root :id => 'root' do
|
822
839
|
artifact_content(xml, project, projects, options)
|
823
840
|
end
|
824
841
|
end
|
@@ -826,7 +843,7 @@ module Buildr #:nodoc:
|
|
826
843
|
|
827
844
|
def add_java_configuration(project, classname, options = {})
|
828
845
|
args = options[:args] || ''
|
829
|
-
dir = options[:dir] ||
|
846
|
+
dir = options[:dir] || 'file://$PROJECT_DIR$/'
|
830
847
|
debug_port = options[:debug_port] || 2599
|
831
848
|
module_name = options[:module_name] || project.iml.id
|
832
849
|
jvm_args = options[:jvm_args] || ''
|
@@ -888,33 +905,53 @@ module Buildr #:nodoc:
|
|
888
905
|
end
|
889
906
|
end
|
890
907
|
|
891
|
-
def add_gwt_configuration(
|
892
|
-
|
893
|
-
|
894
|
-
|
908
|
+
def add_gwt_configuration(project, options = {})
|
909
|
+
launch_page = options[:launch_page]
|
910
|
+
name = options[:name] || (launch_page ? "Run #{launch_page}" : "Run #{project.name} DevMode")
|
911
|
+
shell_parameters = options[:shell_parameters]
|
912
|
+
vm_parameters = options[:vm_parameters] || '-Xmx512m'
|
913
|
+
singleton = options[:singleton].nil? ? true : !!options[:singleton]
|
914
|
+
super_dev = options[:super_dev].nil? ? true : !!options[:super_dev]
|
915
|
+
gwt_module = options[:gwt_module]
|
916
|
+
|
917
|
+
start_javascript_debugger = options[:start_javascript_debugger].nil? ? true : !!options[:start_javascript_debugger]
|
895
918
|
|
896
|
-
add_configuration(name,
|
919
|
+
add_configuration(name, 'GWT.ConfigurationType', 'GWT Configuration', false, :singleton => singleton) do |xml|
|
897
920
|
xml.module(:name => project.iml.id)
|
898
|
-
xml.option(:name => "RUN_PAGE", :value => launch_page)
|
899
|
-
xml.option(:name => "SHELL_PARAMETERS", :value => shell_parameters)
|
900
|
-
xml.option(:name => "VM_PARAMETERS", :value => vm_parameters)
|
901
921
|
|
902
|
-
xml.
|
903
|
-
xml.
|
922
|
+
xml.option(:name => 'VM_PARAMETERS', :value => vm_parameters)
|
923
|
+
xml.option(:name => 'RUN_PAGE', :value => launch_page) if launch_page
|
924
|
+
xml.option(:name => 'GWT_MODULE', :value => gwt_module) if gwt_module
|
925
|
+
|
926
|
+
xml.option(:name => 'START_JAVASCRIPT_DEBUGGER', :value => start_javascript_debugger)
|
927
|
+
xml.option(:name => 'USE_SUPER_DEV_MODE', :value => super_dev)
|
928
|
+
xml.option(:name => 'SHELL_PARAMETERS', :value => shell_parameters) if shell_parameters
|
929
|
+
|
930
|
+
xml.RunnerSettings(:RunnerId => 'Debug') do |xml|
|
931
|
+
xml.option(:name => 'DEBUG_PORT', :value => '')
|
932
|
+
xml.option(:name => 'TRANSPORT', :value => 0)
|
933
|
+
xml.option(:name => 'LOCAL', :value => true)
|
934
|
+
end
|
935
|
+
|
936
|
+
xml.RunnerSettings(:RunnerId => 'Run')
|
937
|
+
xml.ConfigurationWrapper(:RunnerId => 'Run')
|
938
|
+
xml.ConfigurationWrapper(:RunnerId => 'Debug')
|
904
939
|
xml.method()
|
905
940
|
end
|
906
941
|
end
|
907
942
|
|
908
943
|
def add_glassfish_configuration(project, options = {})
|
909
944
|
artifact_name = options[:name] || project.iml.id
|
910
|
-
|
945
|
+
version = options[:version] || '4.1.0'
|
946
|
+
server_name = options[:server_name] || "GlassFish #{version}"
|
947
|
+
configuration_name = options[:configuration_name] || server_name
|
911
948
|
domain_name = options[:domain] || project.iml.id
|
912
949
|
domain_port = options[:port] || '9009'
|
913
950
|
packaged = options[:packaged] || {}
|
914
951
|
exploded = options[:exploded] || {}
|
915
952
|
|
916
953
|
add_to_composite_component(self.configurations) do |xml|
|
917
|
-
xml.configuration(:name =>
|
954
|
+
xml.configuration(:name => configuration_name, :type => 'GlassfishConfiguration', :factoryName => 'Local', :default => false, :APPLICATION_SERVER_NAME => server_name) do |xml|
|
918
955
|
xml.option(:name => 'OPEN_IN_BROWSER', :value => 'false')
|
919
956
|
xml.option(:name => 'UPDATING_POLICY', :value => 'restart-server')
|
920
957
|
|
@@ -1041,12 +1078,12 @@ module Buildr #:nodoc:
|
|
1041
1078
|
end
|
1042
1079
|
|
1043
1080
|
def extension
|
1044
|
-
|
1081
|
+
'ipr'
|
1045
1082
|
end
|
1046
1083
|
|
1047
1084
|
def base_document
|
1048
1085
|
target = StringIO.new
|
1049
|
-
Builder::XmlMarkup.new(:target => target).project(:version =>
|
1086
|
+
Builder::XmlMarkup.new(:target => target).project(:version => '4')
|
1050
1087
|
Buildr::IntellijIdea.new_document(target.string)
|
1051
1088
|
end
|
1052
1089
|
|
@@ -1076,25 +1113,25 @@ module Buildr #:nodoc:
|
|
1076
1113
|
|
1077
1114
|
def project_root_manager_component
|
1078
1115
|
attribs = {}
|
1079
|
-
attribs[
|
1080
|
-
attribs[
|
1081
|
-
attribs[
|
1082
|
-
attribs[
|
1083
|
-
attribs[
|
1084
|
-
attribs[
|
1085
|
-
create_component(
|
1086
|
-
xml.output(
|
1116
|
+
attribs['version'] = '2'
|
1117
|
+
attribs['languageLevel'] = "JDK_#{self.jdk_version.gsub('.', '_')}"
|
1118
|
+
attribs['assert-keyword'] = 'true'
|
1119
|
+
attribs['jdk-15'] = (jdk_version >= '1.5').to_s
|
1120
|
+
attribs['project-jdk-name'] = self.jdk_version
|
1121
|
+
attribs['project-jdk-type'] = 'JavaSDK'
|
1122
|
+
create_component('ProjectRootManager', attribs) do |xml|
|
1123
|
+
xml.output('url' => file_path(buildr_project._(:target, :idea, :project_out)))
|
1087
1124
|
end
|
1088
1125
|
end
|
1089
1126
|
|
1090
1127
|
def project_details_component
|
1091
|
-
create_component(
|
1092
|
-
xml.option(
|
1128
|
+
create_component('ProjectDetails') do |xml|
|
1129
|
+
xml.option('name' => 'projectName', 'value' => self.name)
|
1093
1130
|
end
|
1094
1131
|
end
|
1095
1132
|
|
1096
1133
|
def modules_component
|
1097
|
-
create_component(
|
1134
|
+
create_component('ProjectModuleManager') do |xml|
|
1098
1135
|
xml.modules do
|
1099
1136
|
buildr_project.projects.select { |subp| subp.iml? }.each do |subproject|
|
1100
1137
|
module_path = subproject.base_dir.gsub(/^#{buildr_project.base_dir}\//, '')
|
@@ -1131,15 +1168,15 @@ module Buildr #:nodoc:
|
|
1131
1168
|
|
1132
1169
|
project_directories.each do |dir|
|
1133
1170
|
if File.directory?("#{dir}/.git")
|
1134
|
-
mappings[dir] =
|
1171
|
+
mappings[dir] = 'Git'
|
1135
1172
|
elsif File.directory?("#{dir}/.svn")
|
1136
|
-
mappings[dir] =
|
1173
|
+
mappings[dir] = 'svn'
|
1137
1174
|
end
|
1138
1175
|
end
|
1139
1176
|
|
1140
1177
|
return nil if 0 == mappings.size
|
1141
1178
|
|
1142
|
-
create_component(
|
1179
|
+
create_component('VcsDirectoryMappings') do |xml|
|
1143
1180
|
mappings.each_pair do |dir, vcs_type|
|
1144
1181
|
resolved_dir = resolve_path(dir)
|
1145
1182
|
mapped_dir = resolved_dir == '$PROJECT_DIR$/.' ? buildr_project.base_dir : resolved_dir
|
@@ -1149,19 +1186,19 @@ module Buildr #:nodoc:
|
|
1149
1186
|
end
|
1150
1187
|
|
1151
1188
|
def data_sources_component
|
1152
|
-
create_composite_component(
|
1189
|
+
create_composite_component('DataSourceManagerImpl', {:format => 'xml', :hash => '3208837817'}, self.data_sources)
|
1153
1190
|
end
|
1154
1191
|
|
1155
1192
|
def artifacts_component
|
1156
|
-
create_composite_component(
|
1193
|
+
create_composite_component('ArtifactManager', {}, self.artifacts)
|
1157
1194
|
end
|
1158
1195
|
|
1159
1196
|
def configurations_component
|
1160
|
-
create_composite_component(
|
1197
|
+
create_composite_component('ProjectRunConfigurationManager', {}, self.configurations)
|
1161
1198
|
end
|
1162
1199
|
|
1163
1200
|
def resolve_path(path)
|
1164
|
-
resolve_path_from_base(path,
|
1201
|
+
resolve_path_from_base(path, '$PROJECT_DIR$')
|
1165
1202
|
end
|
1166
1203
|
|
1167
1204
|
private
|
@@ -1176,19 +1213,19 @@ module Buildr #:nodoc:
|
|
1176
1213
|
|
1177
1214
|
def emit_jar_artifacts(xml, artifacts)
|
1178
1215
|
artifacts.each do |p|
|
1179
|
-
xml.element :id =>
|
1216
|
+
xml.element :id => 'artifact', 'artifact-name' => "#{p}.jar"
|
1180
1217
|
end
|
1181
1218
|
end
|
1182
1219
|
|
1183
1220
|
def emit_libraries(xml, libraries)
|
1184
1221
|
libraries.each(&:invoke).map(&:to_s).each do |dependency_path|
|
1185
|
-
xml.element :id =>
|
1222
|
+
xml.element :id => 'file-copy', :path => resolve_path(dependency_path)
|
1186
1223
|
end
|
1187
1224
|
end
|
1188
1225
|
|
1189
1226
|
def emit_module_output(xml, projects)
|
1190
1227
|
projects.each do |p|
|
1191
|
-
xml.element :id =>
|
1228
|
+
xml.element :id => 'module-output', :name => p.iml.id
|
1192
1229
|
end
|
1193
1230
|
end
|
1194
1231
|
|
@@ -1202,8 +1239,8 @@ module Buildr #:nodoc:
|
|
1202
1239
|
if options[:enable_ejb] || (options[:ejb_module_names] && options[:ejb_module_names].size > 0)
|
1203
1240
|
module_names = options[:ejb_module_names] || [project.iml.id]
|
1204
1241
|
module_names.each do |module_name|
|
1205
|
-
facet_name = options[:ejb_facet_name] ||
|
1206
|
-
xml.element :id =>
|
1242
|
+
facet_name = options[:ejb_facet_name] || 'EJB'
|
1243
|
+
xml.element :id => 'javaee-facet-resources', :facet => "#{module_name}/ejb/#{facet_name}"
|
1207
1244
|
end
|
1208
1245
|
end
|
1209
1246
|
end
|
@@ -1212,14 +1249,14 @@ module Buildr #:nodoc:
|
|
1212
1249
|
if options[:enable_jpa] || (options[:jpa_module_names] && options[:jpa_module_names].size > 0)
|
1213
1250
|
module_names = options[:jpa_module_names] || [project.iml.id]
|
1214
1251
|
module_names.each do |module_name|
|
1215
|
-
facet_name = options[:jpa_facet_name] ||
|
1216
|
-
xml.element :id =>
|
1252
|
+
facet_name = options[:jpa_facet_name] || 'JPA'
|
1253
|
+
xml.element :id => 'jpa-descriptors', :facet => "#{module_name}/jpa/#{facet_name}"
|
1217
1254
|
end
|
1218
1255
|
end
|
1219
1256
|
end
|
1220
1257
|
|
1221
1258
|
def encrypt(password)
|
1222
|
-
password.bytes.inject(
|
1259
|
+
password.bytes.inject('') { |x, y| x + (y ^ 0xdfaa).to_s(16) }
|
1223
1260
|
end
|
1224
1261
|
|
1225
1262
|
def partition_dependencies(dependencies)
|
@@ -1229,7 +1266,7 @@ module Buildr #:nodoc:
|
|
1229
1266
|
dependencies.each do |dependency|
|
1230
1267
|
artifacts = Buildr.artifacts(dependency)
|
1231
1268
|
artifacts_as_strings = artifacts.map(&:to_s)
|
1232
|
-
all_projects = Buildr::Project.instance_variable_get(
|
1269
|
+
all_projects = Buildr::Project.instance_variable_get('@projects').keys
|
1233
1270
|
project = Buildr.projects(all_projects).detect do |project|
|
1234
1271
|
[project.packages, project.compile.target, project.resources.target, project.test.compile.target, project.test.resources.target].flatten.
|
1235
1272
|
detect { |component| artifacts_as_strings.include?(component.to_s) }
|
@@ -1248,20 +1285,20 @@ module Buildr #:nodoc:
|
|
1248
1285
|
include Extension
|
1249
1286
|
|
1250
1287
|
first_time do
|
1251
|
-
desc
|
1252
|
-
Project.local_task
|
1288
|
+
desc 'Generate Intellij IDEA artifacts for all projects'
|
1289
|
+
Project.local_task 'idea' => 'artifacts'
|
1253
1290
|
|
1254
|
-
desc
|
1255
|
-
Project.local_task
|
1291
|
+
desc 'Delete the generated Intellij IDEA artifacts'
|
1292
|
+
Project.local_task 'idea:clean'
|
1256
1293
|
end
|
1257
1294
|
|
1258
1295
|
before_define do |project|
|
1259
|
-
project.recursive_task(
|
1260
|
-
project.recursive_task(
|
1296
|
+
project.recursive_task('idea')
|
1297
|
+
project.recursive_task('idea:clean')
|
1261
1298
|
end
|
1262
1299
|
|
1263
1300
|
after_define do |project|
|
1264
|
-
idea = project.task(
|
1301
|
+
idea = project.task('idea')
|
1265
1302
|
|
1266
1303
|
files = [
|
1267
1304
|
(project.iml if project.iml?),
|
@@ -1273,10 +1310,10 @@ module Buildr #:nodoc:
|
|
1273
1310
|
idea.enhance do |task|
|
1274
1311
|
mkdir_p module_dir
|
1275
1312
|
info "Writing #{ideafile.filename}"
|
1276
|
-
t = Tempfile.open(
|
1313
|
+
t = Tempfile.open('buildr-idea')
|
1277
1314
|
temp_filename = t.path
|
1278
1315
|
t.close!
|
1279
|
-
File.open(temp_filename,
|
1316
|
+
File.open(temp_filename, 'w') do |f|
|
1280
1317
|
ideafile.write f
|
1281
1318
|
end
|
1282
1319
|
mv temp_filename, ideafile.filename
|
@@ -1287,7 +1324,7 @@ module Buildr #:nodoc:
|
|
1287
1324
|
end
|
1288
1325
|
end
|
1289
1326
|
|
1290
|
-
project.task(
|
1327
|
+
project.task('idea:clean') do
|
1291
1328
|
files.each do |f|
|
1292
1329
|
info "Removing #{f.filename}" if File.exist?(f.filename)
|
1293
1330
|
rm_rf f.filename
|
@@ -1299,7 +1336,7 @@ module Buildr #:nodoc:
|
|
1299
1336
|
if ipr?
|
1300
1337
|
@ipr ||= IdeaProject.new(self)
|
1301
1338
|
else
|
1302
|
-
raise
|
1339
|
+
raise 'Only the root project has an IPR'
|
1303
1340
|
end
|
1304
1341
|
end
|
1305
1342
|
|