Return-Path: X-Original-To: apmail-buildr-commits-archive@www.apache.org Delivered-To: apmail-buildr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 32B3D100A7 for ; Sun, 6 Oct 2013 07:18:38 +0000 (UTC) Received: (qmail 29266 invoked by uid 500); 6 Oct 2013 07:18:32 -0000 Delivered-To: apmail-buildr-commits-archive@buildr.apache.org Received: (qmail 29208 invoked by uid 500); 6 Oct 2013 07:18:30 -0000 Mailing-List: contact commits-help@buildr.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@buildr.apache.org Delivered-To: mailing list commits@buildr.apache.org Received: (qmail 29192 invoked by uid 99); 6 Oct 2013 07:18:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Oct 2013 07:18:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 Oct 2013 07:18:25 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F0AF22388C1C; Sun, 6 Oct 2013 07:17:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1529576 [9/18] - in /buildr/site: ./ rdoc/ rdoc/Benchmark/ rdoc/Buildr/ rdoc/Buildr/ArchiveTask/ rdoc/Buildr/ArtifactNamespace/ rdoc/Buildr/Assets/ rdoc/Buildr/Checks/ rdoc/Buildr/Cobertura/ rdoc/Buildr/Cobertura/CoberturaExtension/ rdoc/B... Date: Sun, 06 Oct 2013 07:17:12 -0000 To: commits@buildr.apache.org From: donaldp@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131006071730.F0AF22388C1C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: buildr/site/rdoc/Buildr/IntellijIdea/IdeaModule.html URL: http://svn.apache.org/viewvc/buildr/site/rdoc/Buildr/IntellijIdea/IdeaModule.html?rev=1529576&r1=1529575&r2=1529576&view=diff ============================================================================== --- buildr/site/rdoc/Buildr/IntellijIdea/IdeaModule.html (original) +++ buildr/site/rdoc/Buildr/IntellijIdea/IdeaModule.html Sun Oct 6 07:17:05 2013 @@ -131,6 +131,8 @@
  • #resolve_path +
  • #root_project +
  • #skip_content!
  • #skip_content? @@ -204,6 +206,12 @@
  • Buildr::ArtifactSearch +
  • Buildr::Assets + +
  • Buildr::Assets::AssetsTask + +
  • Buildr::Assets::ProjectExtension +
  • Buildr::Build
  • Buildr::CC @@ -738,6 +746,10 @@
  • Rake +
  • Rake::FileList + +
  • Rake::FileList +
  • Rake::FileTask
  • Range @@ -1125,18 +1137,30 @@
    -
    # File lib/buildr/ide/idea.rb, line 360
    +            
    # File lib/buildr/ide/idea.rb, line 402
     def add_ejb_facet(options = {})
       name = options[:name] || "EJB"
    -  default_ejb_xml = buildr_project._(:source, :main, :resources, "WEB-INF/ejb-jar.xml")
    -  ejb_xml = options[:ejb_xml] || default_ejb_xml
    -  ejb_roots = options[:ejb_roots] || [buildr_project.compile.sources, buildr_project.resources.sources].flatten
    +
    +  default_ejb_roots = [buildr_project.iml.main_source_directories, buildr_project.compile.sources, buildr_project.resources.sources].flatten.compact
    +  ejb_roots = options[:ejb_roots] || default_ejb_roots
    +
    +  default_deployment_descriptors = []
    +  ['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'].
    +    each do |descriptor|
    +    ejb_roots.each do |path|
    +      d = "#{path}/WEB-INF/#{descriptor}"
    +      default_deployment_descriptors << d if File.exist?(d)
    +    end
    +  end
    +  deployment_descriptors = options[:deployment_descriptors] || default_deployment_descriptors
     
       add_facet(name, "ejb") do |facet|
         facet.configuration do |c|
           c.descriptors do |d|
    -        if File.exist?(ejb_xml) || default_ejb_xml != ejb_xml
    -          d.deploymentDescriptor :name => 'ejb-jar.xml', :url => file_path(ejb_xml)
    +        deployment_descriptors.each do |deployment_descriptor|
    +          d.deploymentDescriptor :name => File.basename(deployment_descriptor), :url => file_path(deployment_descriptor)
             end
           end
           c.ejbRoots do |e|
    @@ -1287,28 +1311,49 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 334
    +            
    # File lib/buildr/ide/idea.rb, line 355
     def add_jpa_facet(options = {})
       name = options[:name] || "JPA"
    +
    +  source_roots = [buildr_project.iml.main_source_directories, buildr_project.compile.sources, buildr_project.resources.sources].flatten.compact
    +  default_deployment_descriptors = []
    +  ['orm.xml', 'persistence.xml'].
    +    each do |descriptor|
    +    source_roots.each do |path|
    +      d = "#{path}/META-INF/#{descriptor}"
    +      default_deployment_descriptors << d if File.exist?(d)
    +    end
    +  end
    +  deployment_descriptors = options[:deployment_descriptors] || default_deployment_descriptors
    +
       factory_entry = options[:factory_entry] || buildr_project.name.to_s
       validation_enabled = options[:validation_enabled].nil? ? true : options[:validation_enabled]
    -  provider_enabled = options[:provider_enabled] || 'Hibernate'
    -  default_persistence_xml = buildr_project._(:source, :main, :resources, "META-INF/persistence.xml")
    -  persistence_xml = options[:persistence_xml] || default_persistence_xml
    -  default_orm_xml = buildr_project._(:source, :main, :resources, "META-INF/orm.xml")
    -  orm_xml = options[:orm_xml] || default_orm_xml
    +  if options[:provider_enabled]
    +    provider = options[:provider_enabled]
    +  else
    +    provider = nil
    +    {'org.hibernate.ejb.HibernatePersistence' => 'Hibernate',
    +     'org.eclipse.persistence.jpa.PersistenceProvider' => 'EclipseLink'}.
    +      each_pair do |match, candidate_provider|
    +      deployment_descriptors.each do |descriptor|
    +        if File.exist?(descriptor) && /#{Regexp.escape(match)}/ =~ IO.read(descriptor)
    +          provider = candidate_provider
    +        end
    +      end
    +    end
    +  end
    +
       add_facet(name, "jpa") do |f|
         f.configuration do |c|
    -      c.setting :name => "validation-enabled", :value => validation_enabled
    -      c.setting :name => "provider-name", :value => provider_enabled
    +      if provider
    +        c.setting :name => "validation-enabled", :value => validation_enabled
    +        c.setting :name => "provider-name", :value => provider
    +      end
           c.tag!('datasource-mapping') do |ds|
             ds.tag!('factory-entry', :name => factory_entry)
           end
    -      if File.exist?(persistence_xml) || default_persistence_xml != persistence_xml
    -        c.deploymentDescriptor :name => 'persistence.xml', :url => file_path(persistence_xml)
    -      end
    -      if File.exist?(orm_xml) || default_orm_xml != orm_xml
    -        c.deploymentDescriptor :name => 'orm.xml', :url => file_path(orm_xml)
    +      deployment_descriptors.each do |descriptor|
    +        c.deploymentDescriptor :name => File.basename(descriptor), :url => file_path(descriptor)
           end
         end
       end
    @@ -1342,13 +1387,18 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 324
    +            
    # File lib/buildr/ide/idea.rb, line 340
     def add_jruby_facet(options = {})
       name = options[:name] || "JRuby"
    -  jruby_version = options[:jruby_version] || "jruby-1.5.2-p249"
    +
    +  ruby_version_file = buildr_project._('.ruby-version')
    +  default_jruby_version = File.exist?(ruby_version_file) ? "rbenv: #{IO.read(ruby_version_file).strip}" : 'jruby-1.6.7.2'
    +  jruby_version = options[:jruby_version] || default_jruby_version
       add_facet(name, "JRUBY") do |f|
    -    f.configuration(:number => 0) do |c|
    +    f.configuration do |c|
           c.JRUBY_FACET_CONFIG_ID :NAME => "JRUBY_SDK_NAME", :VALUE => jruby_version
    +      c.LOAD_PATH :number => "0"
    +      c.I18N_FOLDERS :number => "0"
         end
       end
     end
    @@ -1384,26 +1434,42 @@
    # File lib/buildr/ide/idea.rb, line 299
     def add_web_facet(options = {})
       name = options[:name] || "Web"
    -  url_base = options[:url_base] || "/"
    -  default_webroots = [buildr_project._(:source, :main, :webapp)]
    +  default_webroots = {}
    +  buildr_project.assets.paths.each {|p| default_webroots[p] = "/" }
       webroots = options[:webroots] || default_webroots
    -  default_web_xml = "#{buildr_project._(:source, :main, :webapp)}/WEB-INF/web.xml"
    -  web_xml = options[:web_xml] || default_web_xml
    -  version = options[:version] || "3.0"
    +  default_deployment_descriptors = []
    +  ['web.xml', 'sun-web.xml', 'glassfish-web.xml', 'jetty-web.xml', 'geronimo-web.xml',
    +   'context.xml', 'weblogic.xml',
    +   'jboss-deployment-structure.xml', 'jboss-web.xml',
    +   'ibm-web-bnd.xml', 'ibm-web-ext.xml', 'ibm-web-ext-pme.xml'].
    +    each do |descriptor|
    +    webroots.each_pair do |path, relative_url|
    +      next unless relative_url == "/"
    +      d = "#{path}/WEB-INF/#{descriptor}"
    +      default_deployment_descriptors << d if File.exist?(d)
    +    end
    +  end
    +  deployment_descriptors = options[:deployment_descriptors] || default_deployment_descriptors
     
       add_facet(name, "web") do |f|
         f.configuration do |c|
           c.descriptors do |d|
    -        if File.exist?(web_xml) || default_web_xml != web_xml
    -          d.deploymentDescriptor :name => 'web.xml', :url => file_path(web_xml), :optional => "true", :version => version
    +        deployment_descriptors.each do |deployment_descriptor|
    +          d.deploymentDescriptor :name => File.basename(deployment_descriptor), :url => file_path(deployment_descriptor)
             end
           end
           c.webroots do |w|
    -        webroots.each do |webroot|
    -          w.root :url => file_path(webroot), :relative => url_base
    +        webroots.each_pair do |webroot, relative_url|
    +          w.root :url => file_path(webroot), :relative => relative_url
             end
           end
         end
    +    default_enable_jsf = webroots.select{|webroot| File.exist?("#{webroot}/WEB-INF/faces-config.xml")}
    +    enable_jsf = options[:enable_jsf].nil? ? default_enable_jsf : options[:enable_jsf]
    +    enable_jsf = false if root_project.ipr? && root_project.ipr.version >= '13'
    +    f.facet(:type => 'jsf', :name => 'JSF') do |jsf|
    +      jsf.configuration
    +    end if enable_jsf
       end
     end
    @@ -1852,7 +1918,7 @@
    -
    # File lib/buildr/ide/idea.rb, line 400
    +            
    # File lib/buildr/ide/idea.rb, line 462
     def base_document
       target = StringIO.new
       Builder::XmlMarkup.new(:target => target).module(:version => "4", :relativePaths => "true", :type => self.type)
    @@ -1887,7 +1953,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 410
    +            
    # File lib/buildr/ide/idea.rb, line 472
     def default_components
       [
         lambda { module_root_component },
    @@ -1923,9 +1989,9 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 417
    +            
    # File lib/buildr/ide/idea.rb, line 479
     def facet_component
    -  create_composite_component("FacetManager", self.facets)
    +  create_composite_component("FacetManager", {}, self.facets)
     end
    @@ -1956,7 +2022,7 @@
    -
    # File lib/buildr/ide/idea.rb, line 476
    +            
    # File lib/buildr/ide/idea.rb, line 538
     def generate_compile_output(xml)
       xml.output(:url => file_path(self.main_output_dir.to_s))
       xml.tag!("output-test", :url => file_path(self.test_output_dir.to_s))
    @@ -1991,7 +2057,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 482
    +            
    # File lib/buildr/ide/idea.rb, line 544
     def generate_content(xml)
       xml.content(:url => "file://$MODULE_DIR$") do
         # Source folders
    @@ -2042,7 +2108,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 508
    +            
    # File lib/buildr/ide/idea.rb, line 570
     def generate_initial_order_entries(xml)
       xml.orderEntry :type => "sourceFolder", :forTests => "false"
       xml.orderEntry :type => "jdk", :jdkName => jdk_version, :jdkType => "JavaSDK"
    @@ -2076,7 +2142,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 443
    +            
    # File lib/buildr/ide/idea.rb, line 505
     def generate_lib(xml, dependency_path, export, source_path, project_dependencies)
       project_for_dependency = Buildr.projects.detect do |project|
         [project.packages, project.compile.target, project.resources.target, project.test.compile.target, project.test.resources.target].flatten.
    @@ -2122,7 +2188,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 520
    +            
    # File lib/buildr/ide/idea.rb, line 582
     def generate_module_lib(xml, path, export, source_path, test = false)
       attribs = {:type => 'module-library'}
       attribs[:exported] = '' if export
    @@ -2170,7 +2236,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 513
    +            
    # File lib/buildr/ide/idea.rb, line 575
     def generate_project_dependency(xml, other_project, export, test = false)
       attribs = {:type => 'module', "module-name" => other_project}
       attribs[:exported] = '' if export
    @@ -2206,7 +2272,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 406
    +            
    # File lib/buildr/ide/idea.rb, line 468
     def initial_components
       []
     end
    @@ -2239,7 +2305,7 @@
    -
    # File lib/buildr/ide/idea.rb, line 460
    +            
    # File lib/buildr/ide/idea.rb, line 522
     def jar_path(path)
       "jar://#{resolve_path(path)}!/"
     end
    @@ -2272,7 +2338,7 @@
    -
    # File lib/buildr/ide/idea.rb, line 421
    +            
    # File lib/buildr/ide/idea.rb, line 483
     def module_root_component
       create_component("NewModuleRootManager", "inherit-compiler-output" => "false") do |xml|
         generate_compile_output(xml)
    @@ -2323,7 +2389,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 540
    +            
    # File lib/buildr/ide/idea.rb, line 602
     def net_excluded_directories
       net = []
       all = self.excluded_directories.map { |dir| buildr_project._(dir.to_s) }.sort_by { |d| d.size }
    @@ -2363,7 +2429,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 504
    +            
    # File lib/buildr/ide/idea.rb, line 566
     def relative_dir_inside_dir?(dir)
       !dir.include?("../")
     end
    @@ -2396,7 +2462,7 @@
    -
    # File lib/buildr/ide/idea.rb, line 472
    +            
    # File lib/buildr/ide/idea.rb, line 534
     def resolve_path(path)
       resolve_path_from_base(path, "$MODULE_DIR$")
     end
    @@ -2410,6 +2476,43 @@
    +
    + +
    + root_project() + + click to toggle source + +
    + + +
    + + + + + + +
    +
    # File lib/buildr/ide/idea.rb, line 438
    +def root_project
    +  p = buildr_project
    +  while p.parent
    +    p = p.parent
    +  end
    +  p
    +end
    +
    + +
    + + + + +
    + +
    @@ -2429,7 +2532,7 @@
    -
    # File lib/buildr/ide/idea.rb, line 384
    +            
    # File lib/buildr/ide/idea.rb, line 446
     def test_dependency_details
       main_dependencies_paths = main_dependencies.map(&:to_s)
       target_dir = buildr_project.compile.target.to_s
    @@ -2474,7 +2577,7 @@
     
               
               
    -
    # File lib/buildr/ide/idea.rb, line 464
    +            
    # File lib/buildr/ide/idea.rb, line 526
     def url_for_path(path)
       if path =~ /jar$/
         jar_path(path)