mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Improve variable handling when rebuilding build.ninja
Variables which are not referencing other variables are no longer provided with their literal value. Variables which do reference other variables have the reference escaped, so that ninja won’t expand the reference when rebuilding build.ninja. There is still some redundancy in that APP_VERSION has the major + tag part stated both at the top and as a command line argument, haven’t yet figured out how to best deal with this.
This commit is contained in:
@@ -668,7 +668,7 @@ open("#{builddir}/build.ninja", "w") do |io|
|
||||
io << user_variables.map { |arr| format("%-#{width}s = %s\n", *arr) }
|
||||
io << "\n"
|
||||
|
||||
args = variables.map { |key, value| "-d'#{key}=#{key =~ /APP_\w+/ ? "$#$&" : value.gsub(/\$/, '$\&')}'" }.join(' ')
|
||||
args = variables.map { |key, value| "-d'#{key}=#{value =~ /\$/ ? value.gsub(/\$/, '$$') : "$#{key}"}'" }.join(' ')
|
||||
io << "rule configure\n"
|
||||
io << " command = bin/gen_build -C \"$builddir\" #{args} -o $out $in\n"
|
||||
io << " depfile = $builddir/$out.d\n"
|
||||
|
||||
Reference in New Issue
Block a user