|
|
@ -48,35 +48,3 @@ fi |
|
|
|
tools/buildgen/generate_projects.py build.json $gen_build_files |
|
|
|
tools/buildgen/generate_projects.py build.json $gen_build_files |
|
|
|
|
|
|
|
|
|
|
|
rm $gen_build_files |
|
|
|
rm $gen_build_files |
|
|
|
|
|
|
|
|
|
|
|
exit |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global_plugins=`find ./tools/buildgen/plugins -name '*.py' | |
|
|
|
|
|
|
|
sort | grep -v __init__ | awk ' { printf "-p %s ", $0 } '` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for dir in . ; do |
|
|
|
|
|
|
|
local_plugins=`find $dir/templates -name '*.py' | |
|
|
|
|
|
|
|
sort | grep -v __init__ | awk ' { printf "-p %s ", $0 } '` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugins="$global_plugins $local_plugins" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
find -L $dir/templates -type f -and -name *.template | while read file ; do |
|
|
|
|
|
|
|
out=${dir}/${file#$dir/templates/} # strip templates dir prefix |
|
|
|
|
|
|
|
out=${out%.*} # strip template extension |
|
|
|
|
|
|
|
echo "generating file: $out" |
|
|
|
|
|
|
|
json_files="build.json $gen_build_files" |
|
|
|
|
|
|
|
data=`for i in $json_files ; do echo $i ; done | awk ' { printf "-d %s ", $0 } '` |
|
|
|
|
|
|
|
if [ "x$TEST" = "xtrue" ] ; then |
|
|
|
|
|
|
|
actual_out=$out |
|
|
|
|
|
|
|
out=`mktemp /tmp/gentXXXXXX` |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
mkdir -p `dirname $out` # make sure dest directory exist |
|
|
|
|
|
|
|
$mako_renderer $plugins $data -o $out $file |
|
|
|
|
|
|
|
if [ "x$TEST" = "xtrue" ] ; then |
|
|
|
|
|
|
|
diff -q $out $actual_out |
|
|
|
|
|
|
|
rm $out |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rm $gen_build_files |
|
|
|
|
|
|
|