Skip to content

Commit

Permalink
Copy to staging location
Browse files Browse the repository at this point in the history
This is the first step in an effort to create a way to build offline-
only buildpacks.  This first step creates the Rake tasks required to
copy important files from their source locations to a staging area.

[#67851786]
  • Loading branch information
nebhale committed Mar 28, 2014
1 parent f79e04d commit 8b79953
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 25 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.bundle
.idea/tasks.xml
.idea/workspace.xml
.yardoc
build/
coverage
doc
out
2 changes: 1 addition & 1 deletion .idea/.rakeTasks

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/dictionaries/bhale.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
AllCops:
Excludes:
- vendor/**
- build/**
ClassLength:
Max: 200
ClassVars:
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.5)
addressable (2.3.6)
ast (1.1.0)
codeclimate-test-reporter (0.3.0)
simplecov (>= 0.7.1, < 1.0.0)
Expand All @@ -17,7 +17,7 @@ GEM
slop (~> 3.4, >= 3.4.5)
powerpack (0.0.9)
rainbow (2.0.0)
rake (10.1.1)
rake (10.2.0)
redcarpet (3.1.1)
rspec (3.0.0.beta2)
rspec-core (= 3.0.0.beta2)
Expand Down
51 changes: 34 additions & 17 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Encoding: utf-8
# Cloud Foundry Java Buildpack
# Copyright (c) 2013 the original author or authors.
#
Expand All @@ -13,29 +14,45 @@
# See the License for the specific language governing permissions and
# limitations under the License.

require 'rake/clean'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new

require 'rubocop/rake_task'
require 'yard'
YARD::Rake::YardocTask.new

require 'rubocop/rake_task'
# RSpec Tasks
RSpec::Core::RakeTask.new
CLOBBER.include 'coverage'

# Rubocop Tasks
Rubocop::RakeTask.new

require 'open3'
# Yard Tasks
YARD::Rake::YardocTask.new
CLEAN.include '.yardoc'
CLOBBER.include 'doc'

desc 'Check that all APIs have been documented'
task :check_api_doc do
puts "\nChecking API documentation..."
output = Open3.capture3('yard stats --list-undoc')[0]
if output !~ /100.00% documented/
puts "\nFailed due to undocumented public API:\n\n#{output}"
exit 1
else
puts "\n#{output}\n"
end
output = `yard stats --list-undoc`
abort "\nFailed due to undocumented public API:\n\n#{output}" if output !~ /100.00% documented/
end

require 'rake/clean'
CLEAN.include %w(.yardoc coverage)
CLOBBER.include %w(doc pkg)
# Offline Package Tasks
STAGING = 'build/staging'.freeze

task :stage
CLEAN.include STAGING

FileList['bin/**/*', 'config/**/*', 'lib/**/*', 'resources/**/*'].each do |source|
unless File.directory?(source)
target = "#{STAGING}/#{source}"
parent = File.dirname target

directory parent
file(target => [source, parent]) { |t| cp t.source, t.name }
task stage: target
end
end

task :default => [ :rubocop, :check_api_doc, :spec ]
# Default Task
task default: %w(rubocop check_api_doc spec)
4 changes: 2 additions & 2 deletions java-buildpack.iml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
</content>
<orderEntry type="jdk" jdkName="rbenv: 1.9.3-p545" jdkType="RUBY_SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.5, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.6, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="ast (v1.1.0, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.5.3, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="codeclimate-test-reporter (v0.3.0, rbenv: 1.9.3-p545) [gem]" level="application" />
Expand All @@ -281,7 +281,7 @@
<orderEntry type="library" scope="PROVIDED" name="parser (v2.1.7, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="powerpack (v0.0.9, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rainbow (v2.0.0, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rake (v10.1.1, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rake (v10.2.0, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="redcarpet (v3.1.1, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level="application" />
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.0.0.beta2, rbenv: 1.9.3-p545) [gem]" level="application" />
Expand Down

0 comments on commit 8b79953

Please sign in to comment.