From 3afc44973de4c65d43b8d395afd87bdf4b72d4f0 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Tue, 2 May 2017 10:12:23 -0400 Subject: ninjabackend: Use more consistent descriptions Use a titlecase for arbitrary language, this was we don't have 'C' in lowercase. Rename 'Static linking library $out' for 'Linking static target $out.'. Add missing punctuation. --- mesonbuild/backend/ninjabackend.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 2c3880b..d52aede 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -851,7 +851,7 @@ int dummy; quote_char + ninja_quote(self.environment.get_source_dir()) + quote_char, quote_char + ninja_quote(self.environment.get_build_dir()) + quote_char) outfile.write(" command = %s %s %s %s %s %s --backend ninja\n" % c) - outfile.write(' description = Regenerating build files\n') + outfile.write(' description = Regenerating build files.\n') outfile.write(' generator = 1\n\n') outfile.write('\n') @@ -1351,7 +1351,7 @@ int dummy; command = command_template.format( executable=' '.join(cmdlist), output_args=' '.join(static_linker.get_output_args('$out'))) - description = ' description = Static linking library $out\n\n' + description = ' description = Linking static target $out.\n\n' outfile.write(rule) outfile.write(command) outfile.write(description) @@ -1394,7 +1394,7 @@ int dummy; cross_args=' '.join(cross_args), output_args=' '.join(compiler.get_linker_output_args('$out')) ) - description = ' description = Linking target $out' + description = ' description = Linking target $out.' outfile.write(rule) outfile.write(command) outfile.write(description) @@ -1573,7 +1573,7 @@ rule FORTRAN_DEP_HACK output_args=' '.join(compiler.get_output_args('$out')), compile_only_args=' '.join(compiler.get_compile_only_args()) ) - description = ' description = Compiling %s object $out\n' % langname + description = ' description = Compiling %s object $out.\n' % langname.title() if compiler.get_id() == 'msvc': deps = ' deps = msvc\n' else: @@ -1617,7 +1617,7 @@ rule FORTRAN_DEP_HACK output_args=output, compile_only_args=' '.join(compiler.get_compile_only_args()) ) - description = ' description = Precompiling header %s\n' % '$in' + description = ' description = Precompiling header %s.\n' % '$in' if compiler.get_id() == 'msvc': deps = ' deps = msvc\n' else: @@ -2360,7 +2360,7 @@ rule FORTRAN_DEP_HACK e.add_item('COMMAND', [sys.executable, self.environment.get_build_command(), '--internal', 'cleantrees', d_file]) - e.add_item('description', 'Cleaning CustomTarget directories') + e.add_item('description', 'Cleaning CustomTarget directories.') e.write(outfile) # Write out the data file passed to the script with open(d_file, 'wb') as ofile: @@ -2372,14 +2372,14 @@ rule FORTRAN_DEP_HACK script_root = self.environment.get_script_dir() clean_script = os.path.join(script_root, 'delwithsuffix.py') gcno_elem.add_item('COMMAND', [sys.executable, clean_script, '.', 'gcno']) - gcno_elem.add_item('description', 'Deleting gcno files') + gcno_elem.add_item('description', 'Deleting gcno files.') gcno_elem.write(outfile) gcda_elem = NinjaBuildElement(self.all_outputs, 'clean-gcda', 'CUSTOM_COMMAND', 'PHONY') script_root = self.environment.get_script_dir() clean_script = os.path.join(script_root, 'delwithsuffix.py') gcda_elem.add_item('COMMAND', [sys.executable, clean_script, '.', 'gcda']) - gcda_elem.add_item('description', 'Deleting gcda files') + gcda_elem.add_item('description', 'Deleting gcda files.') gcda_elem.write(outfile) def get_user_option_args(self): @@ -2425,7 +2425,7 @@ rule FORTRAN_DEP_HACK raise MesonException('Could not detect Ninja v1.6 or newer') elem = NinjaBuildElement(self.all_outputs, 'clean', 'CUSTOM_COMMAND', 'PHONY') elem.add_item('COMMAND', [ninja_command, '-t', 'clean']) - elem.add_item('description', 'Cleaning') + elem.add_item('description', 'Cleaning.') # If we have custom targets in this project, add all their outputs to # the list that is passed to the `cleantrees.py` script. The script -- cgit v1.1 From 91dc6a60dfbeda99feeef0fa525ed496f9c4128c Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Tue, 2 May 2017 10:27:05 -0400 Subject: ninjabackend: Don't quote descriptions --- mesonbuild/backend/ninjabackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index d52aede..cc3b149 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -115,7 +115,7 @@ class NinjaBuildElement: for e in self.elems: (name, elems) = e should_quote = True - if name == 'DEPFILE' or name == 'DESC' or name == 'pool': + if name == 'DEPFILE' or name == 'DESC' or name == 'pool' or name == 'description': should_quote = False line = ' %s = ' % name q_templ = quote_char + "%s" + quote_char -- cgit v1.1 From f16232856e40e145a773a364c3e9a4013a76f719 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Tue, 2 May 2017 10:29:02 -0400 Subject: ninjabackend: Use 'custom targets' instead of 'CustomTarget' in description The build definition is basically cleaning all the directories of all custom targets. --- mesonbuild/backend/ninjabackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index cc3b149..abc0445 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2360,7 +2360,7 @@ rule FORTRAN_DEP_HACK e.add_item('COMMAND', [sys.executable, self.environment.get_build_command(), '--internal', 'cleantrees', d_file]) - e.add_item('description', 'Cleaning CustomTarget directories.') + e.add_item('description', 'Cleaning custom targets directories.') e.write(outfile) # Write out the data file passed to the script with open(d_file, 'wb') as ofile: -- cgit v1.1 From ce2e36fd6e6c6fa966ae5d1da72f0f3ef588dab4 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Tue, 2 May 2017 10:44:35 -0400 Subject: ninjabackend: Fix typography for JAR and C# in descriptions --- mesonbuild/backend/ninjabackend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index abc0445..d14ad6a 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -966,7 +966,7 @@ int dummy; def generate_java_link(self, outfile): rule = 'rule java_LINKER\n' command = ' command = jar $ARGS\n' - description = ' description = Creating jar $out.\n' + description = ' description = Creating JAR $out.\n' outfile.write(rule) outfile.write(command) outfile.write(description) @@ -1429,7 +1429,7 @@ int dummy; rule = 'rule %s_COMPILER\n' % compiler.get_language() invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) command = ' command = %s $ARGS $in\n' % invoc - description = ' description = Compiling cs target $out.\n' + description = ' description = Compiling C# target $out.\n' outfile.write(rule) outfile.write(command) outfile.write(description) -- cgit v1.1 From 253201d9bf1adb0e2cd55fb29dbbd22c3328ef32 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Tue, 2 May 2017 16:48:30 -0400 Subject: ninjabackend: Add a set of raw names --- mesonbuild/backend/ninjabackend.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index d14ad6a..19adb2a 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -112,11 +112,12 @@ class NinjaBuildElement: line = line.replace('\\', '/') outfile.write(line) + # All the entries that should remain unquoted + raw_names = {'DEPFILE', 'DESC', 'pool', 'description'} + for e in self.elems: (name, elems) = e - should_quote = True - if name == 'DEPFILE' or name == 'DESC' or name == 'pool' or name == 'description': - should_quote = False + should_quote = name not in raw_names line = ' %s = ' % name q_templ = quote_char + "%s" + quote_char noq_templ = "%s" -- cgit v1.1 From 820fc8ee2455ab8daf55237d08f6bc2530cf290a Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Tue, 2 May 2017 18:39:57 -0400 Subject: ninjabackend: Fix implicit comment for 'C#' rule description --- mesonbuild/backend/ninjabackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 19adb2a..90d8e60 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1430,7 +1430,7 @@ int dummy; rule = 'rule %s_COMPILER\n' % compiler.get_language() invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) command = ' command = %s $ARGS $in\n' % invoc - description = ' description = Compiling C# target $out.\n' + description = ' description = Compiling C Sharp target $out.\n' outfile.write(rule) outfile.write(command) outfile.write(description) -- cgit v1.1 From a96d79cc00289a6399f023015859e7c4767f84b0 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 2 May 2017 18:45:11 -0400 Subject: ninjabackend: Don't pluralize twice custom target cleaning description --- mesonbuild/backend/ninjabackend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 90d8e60..436b1fe 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2361,7 +2361,7 @@ rule FORTRAN_DEP_HACK e.add_item('COMMAND', [sys.executable, self.environment.get_build_command(), '--internal', 'cleantrees', d_file]) - e.add_item('description', 'Cleaning custom targets directories.') + e.add_item('description', 'Cleaning custom target directories.') e.write(outfile) # Write out the data file passed to the script with open(d_file, 'wb') as ofile: -- cgit v1.1