Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A4AC2200C58 for ; Sun, 12 Mar 2017 03:08:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A33E8160B88; Sun, 12 Mar 2017 02:08:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B8B1D160BA3 for ; Sun, 12 Mar 2017 03:08:19 +0100 (CET) Received: (qmail 55050 invoked by uid 500); 12 Mar 2017 02:08:19 -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 54419 invoked by uid 99); 12 Mar 2017 02:08:17 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Mar 2017 02:08:17 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id EF0CD3A47F1 for ; Sun, 12 Mar 2017 02:08:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r18690 [22/44] - in /dev/buildr/1.5.1: ./ dist/ site/ site/css/ site/images/ site/rdoc/ site/rdoc/Buildr/ site/rdoc/Buildr/ArchiveTask/ site/rdoc/Buildr/ArtifactNamespace/ site/rdoc/Buildr/Assets/ site/rdoc/Buildr/CPom/ site/rdoc/Buildr/Che... Date: Sun, 12 Mar 2017 02:08:14 -0000 To: commits@buildr.apache.org From: toulmean@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20170312020815.EF0CD3A47F1@svn01-us-west.apache.org> archived-at: Sun, 12 Mar 2017 02:08:22 -0000 Added: dev/buildr/1.5.1/site/rdoc/Buildr/HgRelease.html ============================================================================== --- dev/buildr/1.5.1/site/rdoc/Buildr/HgRelease.html (added) +++ dev/buildr/1.5.1/site/rdoc/Buildr/HgRelease.html Sun Mar 12 02:08:13 2017 @@ -0,0 +1,301 @@ + + + + + + +class Buildr::HgRelease - buildr + + + + + + + + + + + + + + +
+

+ class Buildr::HgRelease +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ applies_to?() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/core/build.rb, line 460
+def applies_to?
+  if File.exist? '.hg/requires'
+    true
+  else
+    curr_pwd = Dir.pwd
+    Dir.chdir('..') do
+      return false if curr_pwd == Dir.pwd # Means going up one level is not possible.
+      applies_to?
+    end
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+
+

Public Instance Methods

+
+ + +
+ +
+ check() + + click to toggle source + +
+ + +
+ +

Fails if one of these 2 conditions are not met:

+ +
1. The reository is not 'clean'; no content staged or unstaged
+2. The repository is only a local repository and has no remote refs
+ + +
+ Calls superclass method + +
+ + + +
+
# File lib/buildr/core/build.rb, line 476
+def check
+  super
+  info "Working in branch '#{Hg.current_branch}'"
+  uncommitted = Hg.uncommitted_files
+  fail "Uncommitted files violate the First Principle Of Release!\n#{uncommitted.join("\n")}" unless uncommitted.empty?
+  fail "You are releasing from a local branch that does not track a remote!" if Hg.remote.empty?
+end
+
+ +
+ + + + +
+ + +
+ +
+ tag_release(tag) + + click to toggle source + +
+ + +
+ +

Tag this release in Mercurial

+ + + + +
+
# File lib/buildr/core/build.rb, line 485
+def tag_release(tag)
+  unless this_version == extract_version
+    info "Committing buildfile with version number #{extract_version}"
+    Hg.commit File.basename(version_file), message
+    Hg.push if Hg.remote
+  end
+  info "Tagging release #{tag}"
+  Hg.hg 'tag', tag, '-m', "[buildr] Cutting release #{tag}"
+  Hg.push if Hg.remote
+end
+
+ +
+ + + + +
+ + +
+ +
+ update_version_to_next() + + click to toggle source + +
+ + +
+ +

Update buildfile with next version number

+ + +
+ Calls superclass method + +
+ + + +
+
# File lib/buildr/core/build.rb, line 497
+def update_version_to_next
+  super
+  info "Current version is now #{extract_version}"
+  Hg.commit File.basename(version_file), message
+  Hg.push if Hg.remote
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + Added: dev/buildr/1.5.1/site/rdoc/Buildr/IntegrationTestsTask.html ============================================================================== --- dev/buildr/1.5.1/site/rdoc/Buildr/IntegrationTestsTask.html (added) +++ dev/buildr/1.5.1/site/rdoc/Buildr/IntegrationTestsTask.html Sun Mar 12 02:08:13 2017 @@ -0,0 +1,215 @@ + + + + + + +class Buildr::IntegrationTestsTask - buildr + + + + + + + + + + + + + + +
+

+ class Buildr::IntegrationTestsTask +

+ +
+ +

The integration tests task. Buildr has one +such task (see Buildr#integration) that runs all tests marked with +:integration=>true, and has a setup/teardown tasks separate from the +unit tests.

+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Instance Methods

+
+ + +
+ + +
+ + setup(*prereqs) → task + + + click to toggle source + +
+ +
+ + setup(*prereqs) { |task| .. } → task + + +
+ + + +
+ +

Returns the setup task. The setup task is executed before running the +integration tests.

+ + + + +
+
# File lib/buildr/core/test.rb, line 597
+def setup(*prereqs, &block)
+  @setup.enhance prereqs, &block
+end
+
+ +
+ + + + +
+ + +
+ + +
+ + teardown(*prereqs) → task + + + click to toggle source + +
+ +
+ + teardown(*prereqs) { |task| .. } → task + + +
+ + + +
+ +

Returns the teardown task. The teardown task is executed after running the +integration tests.

+ + + + +
+
# File lib/buildr/core/test.rb, line 606
+def teardown(*prereqs, &block)
+  @teardown.enhance prereqs, &block
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + Added: dev/buildr/1.5.1/site/rdoc/Buildr/IntellijIdea.html ============================================================================== --- dev/buildr/1.5.1/site/rdoc/Buildr/IntellijIdea.html (added) +++ dev/buildr/1.5.1/site/rdoc/Buildr/IntellijIdea.html Sun Mar 12 02:08:13 2017 @@ -0,0 +1,146 @@ + + + + + + +module Buildr::IntellijIdea - buildr + + + + + + + + + + + + + + +
+

+ module Buildr::IntellijIdea +

+ +
+ +
+ + + + +
+ + + + + + + + + +
+
+

Public Class Methods

+
+ + +
+ +
+ new_document(value) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 18
+def self.new_document(value)
+  REXML::Document.new(value, :attribute_quote => :quote)
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + + Added: dev/buildr/1.5.1/site/rdoc/Buildr/IntellijIdea/IdeaFile.html ============================================================================== --- dev/buildr/1.5.1/site/rdoc/Buildr/IntellijIdea/IdeaFile.html (added) +++ dev/buildr/1.5.1/site/rdoc/Buildr/IntellijIdea/IdeaFile.html Sun Mar 12 02:08:13 2017 @@ -0,0 +1,1075 @@ + + + + + + +class Buildr::IntellijIdea::IdeaFile - buildr + + + + + + + + + + + + + + +
+

+ class Buildr::IntellijIdea::IdeaFile +

+ +
+ +

Abstract base class for IdeaModule and IdeaProject

+ +
+ + + + +
+ + + + + +
+
+

Constants

+
+
+ +
DEFAULT_LOCAL_REPOSITORY_ENV_OVERRIDE + +
+ + +
DEFAULT_PREFIX + +
+ + +
DEFAULT_SUFFIX + +
+ + +
+
+ + + +
+
+

Attributes

+
+ + +
+
+ buildr_project[R] +
+ +
+ + + +
+
+ +
+
+ id[W] +
+ +
+ + + +
+
+ +
+
+ local_repository_env_override[RW] +
+ +
+ + + +
+
+ +
+
+ prefix[W] +
+ +
+ + + +
+
+ +
+
+ suffix[W] +
+ +
+ + + +
+
+ +
+
+ template[RW] +
+ +
+ + + +
+
+ +
+ + + +
+
+

Public Class Methods

+
+ + +
+ +
+ new() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 35
+def initialize
+  @local_repository_env_override = DEFAULT_LOCAL_REPOSITORY_ENV_OVERRIDE
+end
+
+ +
+ + + + +
+ + +
+ +
+
+

Public Instance Methods

+
+ + +
+ +
+ add_component(name, attrs = {}, &xml) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 55
+def add_component(name, attrs = {}, &xml)
+  self.components << create_component(name, attrs, &xml)
+end
+
+ +
+ + + + +
+ + +
+ +
+ add_component_from_artifact(artifact) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 66
+def add_component_from_artifact(artifact)
+  self.components << lambda do
+    a = Buildr.artifact(artifact)
+    a.invoke
+    Buildr::IntellijIdea.new_document(IO.read(a.to_s)).root
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+ add_component_from_file(filename) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 59
+def add_component_from_file(filename)
+  self.components << lambda do
+    raise "Unable to locate file #{filename} adding component to idea file" unless File.exist?(filename)
+    Buildr::IntellijIdea.new_document(IO.read(filename)).root
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+ filename() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 47
+def filename
+  buildr_project.path_to("#{name}.#{extension}")
+end
+
+ +
+ + + + +
+ + +
+ +
+ id() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 51
+def id
+  @id ||= buildr_project.name.split(':').last
+end
+
+ +
+ + + + +
+ + +
+ +
+ name() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 80
+def name
+  "#{prefix}#{self.id}#{suffix}"
+end
+
+ +
+ + + + +
+ + +
+ +
+ prefix() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 39
+def prefix
+  @prefix ||= DEFAULT_PREFIX
+end
+
+ +
+ + + + +
+ + +
+ +
+ suffix() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 43
+def suffix
+  @suffix ||= DEFAULT_SUFFIX
+end
+
+ +
+ + + + +
+ + +
+ +
+ write(f) + + click to toggle source + +
+ + +
+ +

IDEA can not handle text content with indents so need to removing indenting +Can not pass true as third argument as the ruby library seems broken

+ + + + +
+
# File lib/buildr/ide/idea.rb, line 76
+def write(f)
+  document.write(f, -1, false, true)
+end
+
+ +
+ + + + +
+ + +
+ +
+
+

Protected Instance Methods

+
+ + +
+ +
+ add_to_composite_component(components) { |xml_markup(:target => target, :indent => 2)| ... } + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 134
+def add_to_composite_component(components)
+  components << lambda do
+    target = StringIO.new
+    yield Builder::XmlMarkup.new(:target => target, :indent => 2)
+    Buildr::IntellijIdea.new_document(target.string).root
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+ base_directory() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 90
+def base_directory
+  buildr_project.path_to
+end
+
+ +
+ + + + +
+ + +
+ +
+ components() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 120
+def components
+  @components ||= []
+end
+
+ +
+ + + + +
+ + +
+ +
+ create_component(name, attrs = {}) { |xml| ... } + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 112
+def create_component(name, attrs = {})
+  target = StringIO.new
+  Builder::XmlMarkup.new(:target => target, :indent => 2).component({:name => name}.merge(attrs)) do |xml|
+    yield xml if block_given?
+  end
+  Buildr::IntellijIdea.new_document(target.string).root
+end
+
+ +
+ + + + +
+ + +
+ +
+ create_composite_component(name, attrs, components) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 124
+def create_composite_component(name, attrs, components)
+  return nil if components.empty?
+  component = self.create_component(name, attrs)
+  components.each do |element|
+    element = element.call if element.is_a?(Proc)
+    component.add_element element
+  end
+  component
+end
+
+ +
+ + + + +
+ + +
+ +
+ document() + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 146
+def document
+  if File.exist?(self.filename)
+    doc = load_document(self.filename)
+  else
+    doc = base_document
+    inject_components(doc, self.initial_components)
+  end
+  if self.template
+    template_doc = load_document(self.template)
+    REXML::XPath.each(template_doc, '//component') do |element|
+      inject_component(doc, element)
+    end
+  end
+  inject_components(doc, self.default_components.compact + self.components)
+
+  # Sort the components in the same order the idea sorts them
+  sorted = doc.root.get_elements('//component').sort { |s1, s2| s1.attribute('name').value <=> s2.attribute('name').value }
+  doc = base_document
+  sorted.each do |element|
+    doc.root.add_element element
+  end
+
+  doc
+end
+
+ +
+ + + + +
+ + +
+ +
+ file_path(path) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 108
+def file_path(path)
+  "file://#{resolve_path(path)}"
+end
+
+ +
+ + + + +
+ + +
+ +
+ inject_component(doc, component) + + click to toggle source + +
+ + +
+ +

replace overridden component (if any) with specified component

+ + + + +
+
# File lib/buildr/ide/idea.rb, line 180
+def inject_component(doc, component)
+  doc.root.delete_element("//component[@name='#{component.attributes['name']}']")
+  doc.root.add_element component
+end
+
+ +
+ + + + +
+ + +
+ +
+ inject_components(doc, components) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 171
+def inject_components(doc, components)
+  components.each do |component|
+    # execute deferred components
+    component = component.call if Proc === component
+    inject_component(doc, component) if component
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+ load_document(filename) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 142
+def load_document(filename)
+  Buildr::IntellijIdea.new_document(File.read(filename))
+end
+
+ +
+ + + + +
+ + +
+ +
+ relative(path) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 86
+def relative(path)
+  ::Buildr::Util.relative_path(File.expand_path(path.to_s), self.base_directory)
+end
+
+ +
+ + + + +
+ + +
+ +
+ resolve_path_from_base(path, base_variable) + + click to toggle source + +
+ + +
+ + + + + + +
+
# File lib/buildr/ide/idea.rb, line 94
+def resolve_path_from_base(path, base_variable)
+  m2repo = Buildr::Repositories.instance.local
+  if path.to_s.index(m2repo) == 0 && !self.local_repository_env_override.nil?
+    return path.sub(m2repo, "$#{self.local_repository_env_override}$")
+  else
+    begin
+      return "#{base_variable}/#{relative(path)}"
+    rescue ArgumentError
+      # ArgumentError happens on windows when self.base_directory and path are on different drives
+      return path
+    end
+  end
+end
+
+ +
+ + + + +
+ + +
+ +
+
+ + + +