ivy4r 0.12.8 → 0.12.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ === 0.12.9 / 2011-01-17
2
+ * Added missing 'install' target, use it as defined in Ivy documentation
3
+
1
4
  === 0.12.8 / 2011-01-14
2
5
  * Converted all tests to RSpec2 specs and grouped them according to functional and normal spec
3
6
  * Started adding more specs to get a descent test coverage
@@ -471,32 +471,32 @@ module Buildr
471
471
  def valid_config_call?(method_name)
472
472
  valid_calls = []
473
473
  TYPES.each do|type|
474
- TARGETS.each do|target|
475
- valid_calls << type.to_s << target.to_s << "#{type}_#{target}" << "#{target}_#{type}"
474
+ TARGETS.each do|target|
475
+ valid_calls << type.to_s << target.to_s << "#{type}_#{target}" << "#{target}_#{type}"
476
+ end
477
+ end
478
+ valid_calls.member? method_name.to_s
476
479
  end
477
- end
478
- valid_calls.member? method_name.to_s
479
- end
480
480
 
481
- # Sets a variable for given basename and type to given values. If values are empty returns the
482
- # current value.
483
- # I.e. <tt>handle_variable(:package, :include, /blua.*\.jar/, /da.*\.jar/)</tt>
484
- def handle_variable(target, type, *values)
485
- unless TARGETS.member?(target) && TYPES.member?(type)
486
- raise ArgumentError, "Unknown config value for target #{target.inspect} and type #{type.inspect}"
487
- end
488
- if values.empty?
489
- @target_config[target][type] ||= [Ivy.setting("#{target.to_s}.#{type.to_s}") || ''].flatten.uniq
490
- else
491
- @target_config[target][type] = [values].flatten.uniq
492
- self
493
- end
494
- end
481
+ # Sets a variable for given basename and type to given values. If values are empty returns the
482
+ # current value.
483
+ # I.e. <tt>handle_variable(:package, :include, /blua.*\.jar/, /da.*\.jar/)</tt>
484
+ def handle_variable(target, type, *values)
485
+ unless TARGETS.member?(target) && TYPES.member?(type)
486
+ raise ArgumentError, "Unknown config value for target #{target.inspect} and type #{type.inspect}"
487
+ end
488
+ if values.empty?
489
+ @target_config[target][type] ||= [Ivy.setting("#{target.to_s}.#{type.to_s}") || ''].flatten.uniq
490
+ else
491
+ @target_config[target][type] = [values].flatten.uniq
492
+ self
493
+ end
494
+ end
495
495
 
496
- def post_resolve_tasks
497
- @base_ivy ? @base_ivy.post_resolve_task_list : post_resolve_task_list
498
- end
499
- end
496
+ def post_resolve_tasks
497
+ @base_ivy ? @base_ivy.post_resolve_task_list : post_resolve_task_list
498
+ end
499
+ end
500
500
 
501
501
  =begin rdoc
502
502
  The Ivy Buildr extension adding the new tasks for ivy.
@@ -518,290 +518,290 @@ To use ivy in a +buildfile+ do something like:
518
518
 
519
519
  For more configuration options see IvyConfig.
520
520
  =end
521
- module IvyExtension
522
- include Buildr::Extension
521
+ module IvyExtension
522
+ include Buildr::Extension
523
523
 
524
- class << self
524
+ class << self
525
525
 
526
- def add_ivy_deps_to_java_tasks(project)
527
- resolve_target = project.ivy.file_project.task('ivy:resolve')
528
- project.task :compiledeps => resolve_target do
529
- includes = project.ivy.compile_include
530
- excludes = project.ivy.compile_exclude
531
- types = project.ivy.compile_type
532
- confs = [project.ivy.compile_conf].flatten
533
- if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
534
- project.compile.with [deps, project.compile.dependencies].flatten
535
- sort_dependencies(project.compile.dependencies, deps, project.path_to(''))
536
- info "Ivy adding compile dependencies '#{confs.join(', ')}' to project '#{project.name}'"
537
- end
538
- end
526
+ def add_ivy_deps_to_java_tasks(project)
527
+ resolve_target = project.ivy.file_project.task('ivy:resolve')
528
+ project.task :compiledeps => resolve_target do
529
+ includes = project.ivy.compile_include
530
+ excludes = project.ivy.compile_exclude
531
+ types = project.ivy.compile_type
532
+ confs = [project.ivy.compile_conf].flatten
533
+ if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
534
+ project.compile.with [deps, project.compile.dependencies].flatten
535
+ sort_dependencies(project.compile.dependencies, deps, project.path_to(''))
536
+ info "Ivy adding compile dependencies '#{confs.join(', ')}' to project '#{project.name}'"
537
+ end
538
+ end
539
539
 
540
- project.task :compile => "#{project.name}:compiledeps"
540
+ project.task :compile => "#{project.name}:compiledeps"
541
+
542
+ project.task :testdeps => resolve_target do
543
+ includes = project.ivy.test_include
544
+ excludes = project.ivy.test_exclude
545
+ types = project.ivy.test_type
546
+ confs = [project.ivy.test_conf, project.ivy.compile_conf].flatten.uniq
547
+ if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
548
+ project.test.with [deps, project.test.dependencies].flatten
549
+ sort_dependencies(project.test.dependencies, deps, project.path_to(''))
550
+ sort_dependencies(project.test.compile.dependencies, deps, project.path_to(''))
551
+ info "Ivy adding test dependencies '#{confs.join(', ')}' to project '#{project.name}'"
552
+ end
553
+ end
554
+ project.task "test:compile" => "#{project.name}:testdeps"
541
555
 
542
- project.task :testdeps => resolve_target do
543
- includes = project.ivy.test_include
544
- excludes = project.ivy.test_exclude
545
- types = project.ivy.test_type
546
- confs = [project.ivy.test_conf, project.ivy.compile_conf].flatten.uniq
547
- if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
548
- project.test.with [deps, project.test.dependencies].flatten
549
- sort_dependencies(project.test.dependencies, deps, project.path_to(''))
550
- sort_dependencies(project.test.compile.dependencies, deps, project.path_to(''))
551
- info "Ivy adding test dependencies '#{confs.join(', ')}' to project '#{project.name}'"
552
- end
553
- end
554
- project.task "test:compile" => "#{project.name}:testdeps"
556
+ project.task :javadocdeps => resolve_target do
557
+ confs = [project.ivy.test_conf, project.ivy.compile_conf].flatten.uniq
558
+ if deps = project.ivy.deps(confs)
559
+ project.javadoc.with deps
560
+ info "Ivy adding javadoc dependencies '#{confs.join(', ')}' to project '#{project.name}'"
561
+ end
562
+ end
563
+ project.task :javadoc => "#{project.name}:javadocdeps"
555
564
 
556
- project.task :javadocdeps => resolve_target do
557
- confs = [project.ivy.test_conf, project.ivy.compile_conf].flatten.uniq
558
- if deps = project.ivy.deps(confs)
559
- project.javadoc.with deps
560
- info "Ivy adding javadoc dependencies '#{confs.join(', ')}' to project '#{project.name}'"
565
+ [project.task(:eclipse), project.task(:idea), project.task(:idea7x)].each do |task|
566
+ task.prerequisites.each{|p| p.enhance ["#{project.name}:compiledeps", "#{project.name}:testdeps"]}
567
+ end
561
568
  end
562
- end
563
- project.task :javadoc => "#{project.name}:javadocdeps"
564
-
565
- [project.task(:eclipse), project.task(:idea), project.task(:idea7x)].each do |task|
566
- task.prerequisites.each{|p| p.enhance ["#{project.name}:compiledeps", "#{project.name}:testdeps"]}
567
- end
568
- end
569
569
 
570
- # Sorts the dependencies in #deps replacing the old order.
571
- # Sorting is done as follows:
572
- # 1. all dependencies that belong to the project identified by #project_path,
573
- # .i.e. instrumented-classes, resources in the order the are contained in the array
574
- # 2. all ivy dependencies identified by #ivy_deps
575
- # 3. all dependencies added automatically by buildr
576
- def sort_dependencies(deps, ivy_deps, project_path)
577
- old_deps = deps.dup
578
- belongs_to_project = /#{project_path}/
579
- deps.sort! do |a, b|
580
- a_belongs_to_project = belongs_to_project.match(a.to_s)
581
- b_belongs_to_project = belongs_to_project.match(b.to_s)
582
- a_ivy = ivy_deps.member? a
583
- b_ivy = ivy_deps.member? b
570
+ # Sorts the dependencies in #deps replacing the old order.
571
+ # Sorting is done as follows:
572
+ # 1. all dependencies that belong to the project identified by #project_path,
573
+ # .i.e. instrumented-classes, resources in the order the are contained in the array
574
+ # 2. all ivy dependencies identified by #ivy_deps
575
+ # 3. all dependencies added automatically by buildr
576
+ def sort_dependencies(deps, ivy_deps, project_path)
577
+ old_deps = deps.dup
578
+ belongs_to_project = /#{project_path}/
579
+ deps.sort! do |a, b|
580
+ a_belongs_to_project = belongs_to_project.match(a.to_s)
581
+ b_belongs_to_project = belongs_to_project.match(b.to_s)
582
+ a_ivy = ivy_deps.member? a
583
+ b_ivy = ivy_deps.member? b
584
584
 
585
- if a_belongs_to_project && !b_belongs_to_project
586
- -1
587
- elsif !a_belongs_to_project && b_belongs_to_project
588
- 1
589
- elsif a_ivy && !b_ivy
590
- -1
591
- elsif !a_ivy && b_ivy
592
- 1
593
- else
594
- old_deps.index(a) <=> old_deps.index(b)
585
+ if a_belongs_to_project && !b_belongs_to_project
586
+ -1
587
+ elsif !a_belongs_to_project && b_belongs_to_project
588
+ 1
589
+ elsif a_ivy && !b_ivy
590
+ -1
591
+ elsif !a_ivy && b_ivy
592
+ 1
593
+ else
594
+ old_deps.index(a) <=> old_deps.index(b)
595
+ end
596
+ end
595
597
  end
596
- end
597
- end
598
598
 
599
- def add_manifest_to_distributeables(project)
600
- pkgs = project.packages.find_all { |pkg| ['jar', 'war', 'ear'].member? pkg.type.to_s }
601
- pkgs.each do |pkg|
602
- name = "#{pkg.name}manifest"
603
- task = project.task name => project.ivy.file_project.task('ivy:resolve') do
604
- if pkg.manifest # source jars have no manifest, only add to existing manifest files
605
- pkg.with :manifest => pkg.manifest.merge(project.manifest.merge(project.ivy.manifest))
606
- info "Adding manifest entries to package '#{pkg.name}'"
607
- else
608
- info "Could not merge info to package '#{pkg.to_s}' it has no manifest!"
599
+ def add_manifest_to_distributeables(project)
600
+ pkgs = project.packages.find_all { |pkg| ['jar', 'war', 'ear'].member? pkg.type.to_s }
601
+ pkgs.each do |pkg|
602
+ name = "#{pkg.name}manifest"
603
+ task = project.task name => project.ivy.file_project.task('ivy:resolve') do
604
+ if pkg.manifest # source jars have no manifest, only add to existing manifest files
605
+ pkg.with :manifest => pkg.manifest.merge(project.manifest.merge(project.ivy.manifest))
606
+ info "Adding manifest entries to package '#{pkg.name}'"
607
+ else
608
+ info "Could not merge info to package '#{pkg.to_s}' it has no manifest!"
609
+ end
610
+ end
611
+ project.task :build => task
609
612
  end
610
613
  end
611
- project.task :build => task
612
- end
613
- end
614
614
 
615
- def add_prod_libs_to_distributeables(project)
616
- pkgs = project.packages.find_all { |pkg| ['war'].member? pkg.type.to_s }
617
- pkgs.each do |pkg|
618
- task = project.task "#{pkg.name}deps" => project.ivy.file_project.task('ivy:resolve') do
619
- includes = project.ivy.package_include
620
- excludes = project.ivy.package_exclude
621
- types = project.ivy.package_type
622
- confs = project.ivy.package_conf
623
- if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
624
- pkg.with :libs => [deps, pkg.libs].flatten
625
- info "Adding production libs from conf '#{confs.join(', ')}' to WAR '#{pkg.name}' in project '#{project.name}'"
615
+ def add_prod_libs_to_distributeables(project)
616
+ pkgs = project.packages.find_all { |pkg| ['war'].member? pkg.type.to_s }
617
+ pkgs.each do |pkg|
618
+ task = project.task "#{pkg.name}deps" => project.ivy.file_project.task('ivy:resolve') do
619
+ includes = project.ivy.package_include
620
+ excludes = project.ivy.package_exclude
621
+ types = project.ivy.package_type
622
+ confs = project.ivy.package_conf
623
+ if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
624
+ pkg.with :libs => [deps, pkg.libs].flatten
625
+ info "Adding production libs from conf '#{confs.join(', ')}' to WAR '#{pkg.name}' in project '#{project.name}'"
626
+ end
627
+ end
628
+ project.task :build => task
626
629
  end
627
- end
628
- project.task :build => task
629
- end
630
630
 
631
- pkgs = project.packages.find_all { |pkg| ['ear'].member? pkg.type.to_s }
632
- pkgs.each do |pkg|
633
- task = project.task "#{pkg.name}deps" => project.ivy.file_project.task('ivy:resolve') do
634
- includes = project.ivy.package_include
635
- excludes = project.ivy.package_exclude
636
- types = project.ivy.package_type
637
- confs = project.ivy.package_conf
638
- if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
639
- pkg.add deps, :type => :lib, :path => ''
640
- info "Adding production libs from conf '#{confs.join(', ')}' to EAR '#{pkg.name}' in project '#{project.name}'"
631
+ pkgs = project.packages.find_all { |pkg| ['ear'].member? pkg.type.to_s }
632
+ pkgs.each do |pkg|
633
+ task = project.task "#{pkg.name}deps" => project.ivy.file_project.task('ivy:resolve') do
634
+ includes = project.ivy.package_include
635
+ excludes = project.ivy.package_exclude
636
+ types = project.ivy.package_type
637
+ confs = project.ivy.package_conf
638
+ if deps = project.ivy.filter(confs, :type => types, :include => includes, :exclude => excludes)
639
+ pkg.add deps, :type => :lib, :path => ''
640
+ info "Adding production libs from conf '#{confs.join(', ')}' to EAR '#{pkg.name}' in project '#{project.name}'"
641
+ end
642
+ end
643
+ project.task :build => task
641
644
  end
642
645
  end
643
- project.task :build => task
644
- end
645
- end
646
646
 
647
- def add_copy_tasks_for_publish(project)
648
- ivy_project = project
649
- until ivy_project.ivy.own_file?
650
- ivy_project = ivy_project.parent
651
- end
652
- project.packages.each do |pkg|
653
- target_file = project.ivy.publish[pkg] || File.basename(pkg.name).gsub(/-#{project.version}/, '')
654
- taskname = ivy_project.path_to(ivy_project.ivy.publish_from, target_file)
655
- if taskname != pkg.name
656
- project.file taskname => pkg.name do
657
- verbose "Ivy copying '#{pkg.name}' to '#{taskname}' for publishing"
658
- FileUtils.mkdir_p File.dirname(taskname) unless File.directory?(File.dirname(taskname))
659
- FileUtils.cp pkg.name, taskname
647
+ def add_copy_tasks_for_publish(project)
648
+ ivy_project = project
649
+ until ivy_project.ivy.own_file?
650
+ ivy_project = ivy_project.parent
660
651
  end
661
- end
652
+ project.packages.each do |pkg|
653
+ target_file = project.ivy.publish[pkg] || File.basename(pkg.name).gsub(/-#{project.version}/, '')
654
+ taskname = ivy_project.path_to(ivy_project.ivy.publish_from, target_file)
655
+ if taskname != pkg.name
656
+ project.file taskname => pkg.name do
657
+ verbose "Ivy copying '#{pkg.name}' to '#{taskname}' for publishing"
658
+ FileUtils.mkdir_p File.dirname(taskname) unless File.directory?(File.dirname(taskname))
659
+ FileUtils.cp pkg.name, taskname
660
+ end
661
+ end
662
662
 
663
- ivy_project.task 'ivy:publish' => taskname
663
+ ivy_project.task 'ivy:publish' => taskname
664
+ end
665
+ end
664
666
  end
665
- end
666
- end
667
667
 
668
- # Returns the +ivy+ configuration for the project. Use this to configure Ivy.
669
- # see IvyConfig for more details about configuration options.
670
- def ivy
671
- @ivy_config ||= IvyConfig.new(self)
672
- end
668
+ # Returns the +ivy+ configuration for the project. Use this to configure Ivy.
669
+ # see IvyConfig for more details about configuration options.
670
+ def ivy
671
+ @ivy_config ||= IvyConfig.new(self)
672
+ end
673
673
 
674
- first_time do
675
- namespace 'ivy' do
676
- desc 'Resolves the ivy dependencies'
677
- task :resolve
674
+ first_time do
675
+ namespace 'ivy' do
676
+ desc 'Resolves the ivy dependencies'
677
+ task :resolve
678
678
 
679
- desc 'Publish the artifacts to ivy repository as defined by environment'
680
- task :publish
679
+ desc 'Publish the artifacts to ivy repository as defined by environment'
680
+ task :publish
681
681
 
682
- desc 'Creates a dependency report for the project'
683
- task :report
682
+ desc 'Creates a dependency report for the project'
683
+ task :report
684
684
 
685
- desc 'Clean the local Ivy cache and the local ivy repository'
686
- task :clean
685
+ desc 'Clean the local Ivy cache and the local ivy repository'
686
+ task :clean
687
687
 
688
- desc 'Creates default Maven POM for project from ivy.xml'
689
- task :makepom
690
-
691
- desc 'Clean the local Ivy result cache to force execution of ivy targets'
692
- task :clean_result_cache
688
+ desc 'Creates default Maven POM for project from ivy.xml'
689
+ task :makepom
693
690
 
694
- desc 'Enable the local Ivy result cache by creating the marker file'
695
- task :enable_result_cache
691
+ desc 'Clean the local Ivy result cache to force execution of ivy targets'
692
+ task :clean_result_cache
696
693
 
697
- desc 'Disable the local Ivy result cache by removing the marker file'
698
- task :disable_result_cache
699
- end
700
- end
701
-
702
- after_define do |project|
703
- if project.ivy.enabled?
704
- IvyExtension.add_ivy_deps_to_java_tasks(project)
705
- IvyExtension.add_manifest_to_distributeables(project)
706
- IvyExtension.add_prod_libs_to_distributeables(project)
707
- IvyExtension.add_copy_tasks_for_publish(project)
694
+ desc 'Enable the local Ivy result cache by creating the marker file'
695
+ task :enable_result_cache
708
696
 
709
- namespace 'ivy' do
710
- task :configure do
711
- project.ivy.configure
697
+ desc 'Disable the local Ivy result cache by removing the marker file'
698
+ task :disable_result_cache
712
699
  end
700
+ end
701
+
702
+ after_define do |project|
703
+ if project.ivy.enabled?
704
+ IvyExtension.add_ivy_deps_to_java_tasks(project)
705
+ IvyExtension.add_manifest_to_distributeables(project)
706
+ IvyExtension.add_prod_libs_to_distributeables(project)
707
+ IvyExtension.add_copy_tasks_for_publish(project)
708
+
709
+ namespace 'ivy' do
710
+ task :configure do
711
+ project.ivy.configure
712
+ end
713
713
 
714
- task :clean => :configure do
715
- # TODO This is redundant, refactor ivy_ant_wrap and this to use a single config object
716
- rm_rf project.path_to(:reports, 'ivy')
717
- project.ivy.cleancache
718
- end
714
+ task :clean => :configure do
715
+ # TODO This is redundant, refactor ivy_ant_wrap and this to use a single config object
716
+ rm_rf project.path_to(:reports, 'ivy')
717
+ project.ivy.cleancache
718
+ end
719
719
 
720
- task :clean_result_cache do
721
- project.send(:info, "Deleting IVY result cache dir '#{project.ivy.result_cache_dir}'")
722
- rm_rf project.ivy.result_cache_dir
723
- end
720
+ task :clean_result_cache do
721
+ project.send(:info, "Deleting IVY result cache dir '#{project.ivy.result_cache_dir}'")
722
+ rm_rf project.ivy.result_cache_dir
723
+ end
724
724
 
725
- task :enable_result_cache do
726
- project.send(:info, "Creating IVY caching marker file '#{project.ivy.caching_marker}'")
727
- touch project.ivy.caching_marker
728
- end
725
+ task :enable_result_cache do
726
+ project.send(:info, "Creating IVY caching marker file '#{project.ivy.caching_marker}'")
727
+ touch project.ivy.caching_marker
728
+ end
729
729
 
730
- task :disable_result_cache do
731
- project.send(:info, "Deleting IVY caching marker file '#{project.ivy.caching_marker}'")
732
- rm_f project.ivy.caching_marker
733
- end
730
+ task :disable_result_cache do
731
+ project.send(:info, "Deleting IVY caching marker file '#{project.ivy.caching_marker}'")
732
+ rm_f project.ivy.caching_marker
733
+ end
734
734
 
735
- task :resolve => "#{project.name}:ivy:configure" do
736
- project.ivy.__resolve__
737
- end
735
+ task :resolve => "#{project.name}:ivy:configure" do
736
+ project.ivy.__resolve__
737
+ end
738
738
 
739
- task :report => "#{project.name}:ivy:resolve" do
740
- project.ivy.report
741
- end
739
+ task :report => "#{project.name}:ivy:resolve" do
740
+ project.ivy.report
741
+ end
742
742
 
743
- task :publish => "#{project.name}:ivy:resolve" do
744
- project.ivy.__publish__
745
- end
743
+ task :publish => "#{project.name}:ivy:resolve" do
744
+ project.ivy.__publish__
745
+ end
746
746
 
747
- task :makepom => "#{project.name}:ivy:resolve" do
748
- project.ivy.makepom
747
+ task :makepom => "#{project.name}:ivy:resolve" do
748
+ project.ivy.makepom
749
+ end
750
+ end
749
751
  end
750
752
  end
751
753
  end
752
- end
753
- end
754
754
 
755
- # Global targets that are not bound to a project
756
- namespace 'ivy' do
757
- task :clean do
758
- Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
759
- project.task('ivy:clean').invoke
760
- end
761
- end
755
+ # Global targets that are not bound to a project
756
+ namespace 'ivy' do
757
+ task :clean do
758
+ Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
759
+ project.task('ivy:clean').invoke
760
+ end
761
+ end
762
762
 
763
- task :clean_result_cache do
764
- Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
765
- project.task('ivy:clean_result_cache').invoke
766
- end
767
- end
763
+ task :clean_result_cache do
764
+ Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
765
+ project.task('ivy:clean_result_cache').invoke
766
+ end
767
+ end
768
768
 
769
- task :enable_result_cache do
770
- Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
771
- project.task('ivy:enable_result_cache').invoke
772
- end
773
- end
769
+ task :enable_result_cache do
770
+ Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
771
+ project.task('ivy:enable_result_cache').invoke
772
+ end
773
+ end
774
774
 
775
- task :disable_result_cache do
776
- Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
777
- project.task('ivy:disable_result_cache').invoke
778
- end
779
- end
775
+ task :disable_result_cache do
776
+ Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
777
+ project.task('ivy:disable_result_cache').invoke
778
+ end
779
+ end
780
780
 
781
- task :resolve do
782
- info "Resolving all distinct ivy files"
783
- Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
784
- project.task('ivy:resolve').invoke
785
- end
786
- end
781
+ task :resolve do
782
+ info "Resolving all distinct ivy files"
783
+ Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
784
+ project.task('ivy:resolve').invoke
785
+ end
786
+ end
787
787
 
788
- task :publish => :package do
789
- info "Publishing all distinct ivy files"
790
- Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
791
- project.task('ivy:publish').invoke
788
+ task :publish => :package do
789
+ info "Publishing all distinct ivy files"
790
+ Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
791
+ project.task('ivy:publish').invoke
792
+ end
793
+ end
794
+
795
+ task :makepom => :resolve do
796
+ info "Create Maven POMs for all projects with distinct ivy files"
797
+ Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
798
+ project.task('ivy:makepom').invoke
799
+ end
800
+ end
792
801
  end
793
- end
794
802
 
795
- task :makepom => :resolve do
796
- info "Create Maven POMs for all projects with distinct ivy files"
797
- Buildr.projects.find_all{ |p| p.ivy.own_file? }.each do |project|
798
- project.task('ivy:makepom').invoke
803
+ class Buildr::Project # :nodoc:
804
+ include IvyExtension
799
805
  end
800
806
  end
801
807
  end
802
-
803
- class Buildr::Project # :nodoc:
804
- include IvyExtension
805
- end
806
- end
807
- end
@@ -0,0 +1,33 @@
1
+ require 'ivy/target'
2
+
3
+ module Ivy
4
+ class Install < Ivy::Target
5
+ def parameter
6
+ [
7
+ Parameter.new(:from, true),
8
+ Parameter.new(:to, true),
9
+ Parameter.new(:organisation, true),
10
+ Parameter.new(:module, true),
11
+ Parameter.new(:branch, false),
12
+ Parameter.new(:revision, true),
13
+ Parameter.new(:type, false),
14
+ Parameter.new(:validate, false),
15
+ Parameter.new(:overwrite, false),
16
+ Parameter.new(:transitive, false),
17
+ Parameter.new(:matcher, false),
18
+ Parameter.new(:settingsRef, false),
19
+ Parameter.new(:haltonfailure, false)
20
+ ]
21
+ end
22
+
23
+ protected
24
+ def execute_ivy
25
+ call_nested :ivy_install => params
26
+ end
27
+
28
+ def create_return_values
29
+ nil
30
+ end
31
+
32
+ end
33
+ end
data/lib/ivy/targets.rb CHANGED
@@ -1,49 +1,50 @@
1
- require 'ivy/target'
2
- require 'ivy/info'
3
- require 'ivy/settings'
4
- require 'ivy/configure'
5
- require 'ivy/cleancache'
6
- require 'ivy/resolve'
7
- require 'ivy/makepom'
8
- require 'ivy/cachepath'
9
- #require 'ivy/listmodules'
10
- require 'ivy/artifactproperty'
11
- require 'ivy/artifactreport'
12
- require 'ivy/findrevision'
13
- require 'ivy/buildnumber'
14
- require 'ivy/retrieve'
15
- require 'ivy/publish'
16
- require 'ivy/report'
17
- require 'ivy/buildlist'
18
-
19
- =begin
20
- finished
21
- * info
22
- * settings
23
- * configure
24
- * cleancache
25
- * buildnumber
26
- * findrevision
27
- * cachepath
28
- * artifactreport
29
- * resolve
30
- * makepom
31
- * retrieve
32
- * publish
33
- * artifactproperty
34
- * report
35
- o Using yEd to layout report graphs
36
- * buildlist
37
-
38
- TODO
39
- * deliver
40
- * install
41
- * repreport
42
-
43
- not working:
44
- * listmodules
45
-
46
- makes no sense:
47
- * cachefileset
48
- * var
1
+ require 'ivy/target'
2
+ require 'ivy/info'
3
+ require 'ivy/settings'
4
+ require 'ivy/configure'
5
+ require 'ivy/cleancache'
6
+ require 'ivy/resolve'
7
+ require 'ivy/makepom'
8
+ require 'ivy/cachepath'
9
+ #require 'ivy/listmodules'
10
+ require 'ivy/artifactproperty'
11
+ require 'ivy/artifactreport'
12
+ require 'ivy/findrevision'
13
+ require 'ivy/install'
14
+ require 'ivy/buildnumber'
15
+ require 'ivy/retrieve'
16
+ require 'ivy/publish'
17
+ require 'ivy/report'
18
+ require 'ivy/buildlist'
19
+
20
+ =begin
21
+ finished
22
+ * info
23
+ * settings
24
+ * configure
25
+ * cleancache
26
+ * buildnumber
27
+ * findrevision
28
+ * cachepath
29
+ * artifactreport
30
+ * resolve
31
+ * makepom
32
+ * retrieve
33
+ * publish
34
+ * artifactproperty
35
+ * report
36
+ o Using yEd to layout report graphs
37
+ * buildlist
38
+
39
+ TODO
40
+ * deliver
41
+ * install
42
+ * repreport
43
+
44
+ not working:
45
+ * listmodules
46
+
47
+ makes no sense:
48
+ * cachefileset
49
+ * var
49
50
  =end
data/lib/ivy4r.rb CHANGED
@@ -148,6 +148,11 @@ class Ivy4r
148
148
  def findrevision(*params)
149
149
  Ivy::Findrevision.new(ant, cache_dir).execute(*params)
150
150
  end
151
+
152
+ # Calls the __install__ ivy target with given parameters always returns nil
153
+ def install(*params)
154
+ Ivy::Install.new(ant, cache_dir).execute(*params)
155
+ end
151
156
 
152
157
  # Calls the __artifactproperty__ ivy target with given parameters and returns
153
158
  # map with all defined properties
data/lib/ivy4r/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Ivy4r
2
- VERSION = "0.12.8"
2
+ VERSION = "0.12.9"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 12
8
- - 8
9
- version: 0.12.8
8
+ - 9
9
+ version: 0.12.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Klaas Reineke
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-14 00:00:00 +01:00
17
+ date: 2011-01-17 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -145,6 +145,7 @@ files:
145
145
  - lib/ivy/configure.rb
146
146
  - lib/ivy/findrevision.rb
147
147
  - lib/ivy/info.rb
148
+ - lib/ivy/install.rb
148
149
  - lib/ivy/java/all_version_matcher.rb
149
150
  - lib/ivy/java/java_object_wrapper.rb
150
151
  - lib/ivy/listmodules.rb