michaeljbishop / rake-subproject Goto Github PK
View Code? Open in Web Editor NEWImplements subproject support for Rake
License: MIT License
Implements subproject support for Rake
License: MIT License
The super-project will catch Exceptions that the sub-project raises as they are carried across the pipe, but they shoudl be reported in the cause
field of the proxy exception raised in the super-project execution.
Currently, the subproject
call expects a directory. It could also be a path to a Rakefile.
In other words, prevent this:
subproject 'foo'
subproject 'foo/bar' # fail here. it's up to `foo` to include `bar`
With the server in place, sending a SIGKILL to the main process should send the same to the sub-process and kill it.
Rake allows a -j
parameter which specifies the maximum number of jobs. This number should work not just for the super-project, but the sub-projects as well. To make matters more difficult, if the super-project can fill all the job-spots, then the sub-project shouldn't get any.
There should be communication between the super and sub-project instances as to how many tasks are being executed and if any more can without exceeding that limit as established in the super-project execution.
Right now there is no special code that checks that the subproject
call is passed a valid directory or Rakefile.
Add some more parameters to the subproject
call that would allow more configuration of the subproject. In particular, there should be some way of setting up the environment variables.
Issues to address:
As long as the super-project can reference tasks created in the sub-project, allow the sub-project tasks to have prerequisites attached to them in the super-project Rakefile.
So, to be clear, here are some tasks in in the subproject, located at foo
.
task :hello do
p "HELLO"
end
task :world => :hello do
p "WORLD"
end
task :cruel do
p "CRUEL"
end
And here is the super-project:
subproject 'foo'
task 'foo:world' => ['foo:cruel', 'period'] do
p "AGAIN"
end
task 'period' do
p "."
end
Now, when executing the super project:
$ rake foo:world
HELLO
CRUEL
.
WORLD
AGAIN
The sub-project prerequisites are all executed before the super-task prerequisites.
To reproduce, make a Rakefile with a task that depends on a Rakefile 2 subprojects away. Have that leaf task raise an expection. The top-level project will simply sit forever waiting for the task to complete.
As long as the super-project can reference tasks created in the sub-project, allow those tasks to have execution blocks attached to them in the super-project Rakefile.
So, to be clear, here's a task in in the subproject, located at foo
.
task :hello do
p "HELLO"
end
And here is the super-project:
subproject 'foo'
task 'foo:hello' do
p "WORLD"
end
Now, when executing the super project:
$ rake foo:hello
HELLO
WORLD
The sub-project blocks are all executed before the super-project blocks.
And undocument the private ones.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.