This commit is contained in:
Jon Ruskin 2018-06-21 11:27:02 -07:00
Родитель 8aa006d6d9
Коммит 66454d0bbb
3 изменённых файлов: 32 добавлений и 23 удалений

Просмотреть файл

@ -52,30 +52,37 @@ namespace :test do
end
end
task :package, [:target] do |task, args|
target = args[:target]
target = "*" if target.nil? || target.empty?
Dir["script/packages/#{target}"].each do |script|
puts "Building #{script}"
if Bundler.with_original_env { system(script) }
# green
puts "\033[32mCompleted #{script}.\e[0m"
else
# red
puts "\033[31mEncountered an error running #{script}.\e[0m"
end
puts
end
end
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
packages_search = File.expand_path("script/packages/*", __dir__)
platforms = Dir[packages_search].map { |f| File.basename(f, ".*")}
namespace :package do
platforms.each do |platform|
desc "Package licensed for #{platform}"
task platform.to_sym do
puts "Packaging licensed for #{platform}"
if Bundler.with_original_env { system("script/packages/#{platform}") }
# green
puts "\033[32mCompleted packaging for #{platform}.\e[0m"
else
# red
puts "\033[31mEncountered an error packaging for #{platform}.\e[0m"
end
puts
end
end
end
desc "Package licensed for all platforms"
task package: platforms.map { |platform| "package:#{platform}" }
# add rubocop task
# -S adds styleguide urls to offense messages
RuboCop::RakeTask.new do |t|

Просмотреть файл

@ -36,10 +36,7 @@ $ script/package linux
or
```bash
# build package for linux
$ bundle exec rake package[linux]
# if using the zsh shell then you'll need to escape the brackets
$ bundle exec rake package\[linux\]
$ bundle exec rake package:linux
```
#### Building packages for a specific version

Просмотреть файл

@ -12,4 +12,9 @@
set -e
bundle exec rake package["$1"]
PLATFORM=""
if [ -n "$1" ]; then
PLATFORM=":$1"
fi
bundle exec rake "package$PLATFORM"