-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: introduce top-level Rakefile for easier task management across…
… packages (#120)
- Loading branch information
Showing
6 changed files
with
70 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,75 @@ | ||
require "rake/clean" | ||
require "bundler/gem_tasks" | ||
|
||
CLOBBER.include "pkg", "node_modules" | ||
|
||
# add npm-install as pre-req for build | ||
Rake::Task[:build].enhance [:npm] | ||
|
||
########### | ||
# npm | ||
########### | ||
desc "alias for npm:install" | ||
task :npm => "npm:install" | ||
namespace :npm do | ||
desc "Install npm dependencies" | ||
task :install do | ||
sh "npm install" | ||
end | ||
|
||
desc "Update npm dependencies to latest version allowed by package.json" | ||
task :update do | ||
sh "npm update" | ||
# bootstrap | ||
desc "bootstrap all packages" | ||
task :bootstrap, [:pkg] do |t, args| | ||
if args[:pkg].nil? | ||
sh " | ||
baseDir=$PWD | ||
for dir in ./packages/* | ||
do | ||
cd $dir | ||
bundle install | ||
cd $baseDir | ||
done | ||
" | ||
else | ||
pkgDir = "./packages/#{args[:pkg]}" | ||
sh "cd #{pkgDir} && bundle install" | ||
end | ||
end | ||
|
||
desc "Upgrade axe-core dependency to latest version available, overwriting package.json" | ||
task :upgrade do | ||
sh "npm install --save axe-core@latest" | ||
# test | ||
desc "Test all packages" | ||
task :test, [:pkg] do |t, args| | ||
if args[:pkg].nil? | ||
sh " | ||
baseDir=$PWD | ||
for dir in ./packages/* | ||
do | ||
cd $dir | ||
rake test | ||
cd $baseDir | ||
done | ||
" | ||
else | ||
pkgDir = "./packages/#{args[:pkg]}" | ||
sh "cd #{pkgDir} && rake test" | ||
end | ||
end | ||
|
||
desc "Upgrade axe-core dependency to latest prerelease version, overwriting package.json" | ||
task :next do | ||
sh "npm install --save axe-core@next" | ||
# build | ||
desc "Build all packages" | ||
task :build, [:pkg] do |t, args| | ||
if args[:pkg].nil? | ||
sh " | ||
baseDir=$PWD | ||
for dir in ./packages/* | ||
do | ||
cd $dir | ||
rake build | ||
cd $baseDir | ||
done | ||
" | ||
else | ||
pkgDir = "./packages/#{args[:pkg]}" | ||
sh "cd #{pkgDir} && rake build" | ||
end | ||
end | ||
|
||
desc "Display currently-installed and latest-available versions of axe-core lib" | ||
task :status do | ||
sh "npm view axe-core version && npm list axe-core" | ||
# format | ||
desc "format code in all packages" | ||
task :format, [:pkg] do |t, args| | ||
if args[:pkg].nil? | ||
sh " | ||
baseDir=$PWD | ||
for dir in ./packages/* | ||
do | ||
cd $dir | ||
rake format | ||
cd $baseDir | ||
done | ||
" | ||
else | ||
pkgDir = "./packages/#{args[:pkg]}" | ||
sh "cd #{pkgDir} && rake format" | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.