The fix I used to get around this is:
Dir.chdir(File.dirname(Rake.application.rakefile))
This statement must be executed at all levels of the hierarchy, except the root, at the beginning of each rake file. A short example of how this works in practice:
/ rakefile:
task :default do sh "rake -f component/rakefile" end
/ Component / rakefile
Dir.chdir(File.dirname(Rake.application.rakefile)) task :binary => OBJECTS do sh "gcc #{SOURCES} -Iinclude -o #{TARGET}" end
Since I'm new to the rake, I'm not convinced that this is the cleanest method to solve it, but thatβs how I ended up getting it to work.
source share