Skip to content

Commit

Permalink
get rid of hoe
Browse files Browse the repository at this point in the history
The de-factor standard bundler-based workflow works really well.
  • Loading branch information
doudou committed Sep 18, 2015
1 parent 04fbddc commit bb6202c
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 186 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ doc
webgen.cache
doc/guide/src/autoproj_bootstrap
pkg/
/vendor/
/.bundle
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gem 'autobuild', github: 'rock-core/autobuild', branch: 'autoproj-2.0'
gem 'pry'
gem 'pry-byebug'
gemspec
105 changes: 0 additions & 105 deletions Manifest.txt

This file was deleted.

121 changes: 40 additions & 81 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,93 +1,52 @@
require 'utilrb/rake_common'
$LOAD_PATH.unshift File.join(Dir.pwd, 'lib')
require "bundler/gem_tasks"
require "rake/testtask"

task 'default'
Utilrb::Rake.hoe do
namespace 'dist' do
Hoe.spec 'autoproj' do
self.developer "Sylvain Joyeux", "[email protected]"
task 'gem' => 'build'

self.urls = ["http://rock-robotics.org/documentation/autoproj"]
self.group_name = 'autobuild'
self.summary = 'Easy installation and management of sets of software packages'
self.description = "autoproj is a manager for sets of software packages. It allows the user to import and build packages from source, still using the underlying distribution's native package manager for software that is available on it."
self.email = "[email protected]"

self.spec_extras[:required_ruby_version] = ">= 1.9.3"

license 'BSD'

extra_deps <<
['autobuild', '~> 1.9', '>= 1.9.0'] <<
['utilrb', '~> 2.0', '>= 2.0.0'] <<
['highline', '~> 1.7', '>= 1.7.0'] <<
['thor', '~> 0.19.0', '>= 0.19.1'] <<
['concurrent-ruby']
end
end
Rake::TestTask.new(:test) do |t|
t.libs << "lib" << Dir.pwd
t.test_files = FileList['test/**/test_*.rb']
end

namespace 'dist' do
desc "generate the bootstrap script"
task 'bootstrap' do
require 'yaml'
build_option_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'build_option.rb'))
config_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'configuration.rb'))
osdeps_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'osdeps.rb'))
system_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'system.rb'))
osdeps_defaults = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'default.osdeps'))
require 'autobuild'
tools_code = File.read(File.join(Autobuild::LIB_DIR, 'autobuild', 'tools.rb'))
# Filter rubygems dependencies from the OSdeps default. They will be
# installed at first build
osdeps = YAML.load(osdeps_defaults)
osdeps.delete_if do |name, content|
if content.respond_to?(:delete)
content.delete('gem')
content.empty?
else
content == 'gem'
end
end
osdeps_defaults = YAML.dump(osdeps)
# Since we are using gsub to replace the content in the bootstrap file,
# we have to quote all \
[osdeps_code, system_code, osdeps_defaults, tools_code].each do |text|
text.gsub! /\\/, '\\\\\\\\'
end

bootstrap_code = File.read(File.join(Dir.pwd, 'bin', 'autoproj_bootstrap.in')).
gsub('BUILD_OPTION_CODE', build_option_code).
gsub('CONFIG_CODE', config_code).
gsub('OSDEPS_CODE', osdeps_code).
gsub('SYSTEM_CODE', system_code).
gsub('OSDEPS_DEFAULTS', osdeps_defaults).
gsub('TOOLS_CODE', tools_code)
File.open(File.join(Dir.pwd, 'bin', 'autoproj_bootstrap'), 'w') do |io|
io.write bootstrap_code
desc "generate the bootstrap script"
task 'bootstrap' do
require 'yaml'
build_option_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'build_option.rb'))
config_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'configuration.rb'))
osdeps_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'osdeps.rb'))
system_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'system.rb'))
osdeps_defaults = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'default.osdeps'))
require 'autobuild'
tools_code = File.read(File.join(Autobuild::LIB_DIR, 'autobuild', 'tools.rb'))
# Filter rubygems dependencies from the OSdeps default. They will be
# installed at first build
osdeps = YAML.load(osdeps_defaults)
osdeps.delete_if do |name, content|
if content.respond_to?(:delete)
content.delete('gem')
content.empty?
else
content == 'gem'
end
end
end
file 'bin/autoproj_bootstrap' => 'dist:bootstrap'

Utilrb::Rake.rdoc do
task 'doc' => 'doc:all'
task 'clobber_docs' => 'doc:clobber'
task 'redocs' do
Rake::Task['doc:clobber'].invoke
Rake::Task['doc'].invoke
osdeps_defaults = YAML.dump(osdeps)
# Since we are using gsub to replace the content in the bootstrap file,
# we have to quote all \
[osdeps_code, system_code, osdeps_defaults, tools_code].each do |text|
text.gsub! /\\/, '\\\\\\\\'
end

namespace 'doc' do
task 'all' => %w{api}
task 'clobber' => 'clobber_api'
RDoc::Task.new("api") do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "autoproj"
rdoc.options << '--show-hash'
rdoc.rdoc_files.include('lib/**/*.rb')
end
bootstrap_code = File.read(File.join(Dir.pwd, 'bin', 'autoproj_bootstrap.in')).
gsub('BUILD_OPTION_CODE', build_option_code).
gsub('CONFIG_CODE', config_code).
gsub('OSDEPS_CODE', osdeps_code).
gsub('SYSTEM_CODE', system_code).
gsub('OSDEPS_DEFAULTS', osdeps_defaults).
gsub('TOOLS_CODE', tools_code)
File.open(File.join(Dir.pwd, 'bin', 'autoproj_bootstrap'), 'w') do |io|
io.write bootstrap_code
end
end

file 'bin/autoproj_bootstrap' => 'bootstrap'

28 changes: 28 additions & 0 deletions autoproj.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'autoproj/version'

Gem::Specification.new do |s|
s.name = "autoproj"
s.version = Autoproj::VERSION
s.authors = ["Sylvain Joyeux"]
s.email = "[email protected]"
s.summary = "Easy installation and management of sets of software packages"
s.description = "autoproj is a manager for sets of software packages. It allows the user to import and build packages from source, still using the underlying distribution's native package manager for software that is available on it."
s.homepage = "http://rock-robotics.org"
s.licenses = ["BSD"]

s.require_paths = ["lib"]
s.extensions = []
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }

s.add_runtime_dependency "autobuild", ">= 1.10.0.a"
s.add_runtime_dependency "utilrb", ">= 2.0"
s.add_runtime_dependency "thor", '~> 0.19.0', '>= 0.19.1'
s.add_runtime_dependency 'concurrent-ruby'
s.add_development_dependency "flexmock", ">= 2.0.0"
s.add_development_dependency "minitest", ">= 5.0", "~> 5.0"
s.add_development_dependency "fakefs"
end

7 changes: 7 additions & 0 deletions manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
<maintainer>Sylvain Joyeux/[email protected]</maintainer>
<license>LGPLv3 or later</license>
<url>http://rock-robotics.org</url>

<depend package="autobuild" />
<depend package="thor" />
<depend package="utilrb" />
<depend package="concurrent-ruby" />
<test_depend package="flexmock" />
<test_depend package="minitest" />
</package>

0 comments on commit bb6202c

Please sign in to comment.