32 Commits

Author SHA1 Message Date
Thaddeus Crews
9cabe6a3f3 Implement type hints in ninja_syntax.py 2024-04-06 12:31:52 -05:00
Nathan Ringo
c161199646 Adds dyndep support to ninja_syntax.py. 2021-01-12 10:36:45 -08:00
Jan Niklas Hasse
ea9f736100 Add missing Apache license header, fix #1781 2020-05-25 10:58:34 +02:00
Alex Vallee
c6b67ac402 ninja_syntax.py: remove unused has_path argument
The usage of the parameter was removed a long time ago and was never cleaned up. The argument is not provided in the test.
2019-01-30 22:12:52 +08:00
Kareem Khazem
85fab32362 Support pool for Writer.build() in ninja_syntax.py
ninja_syntax.py now supports a pool being specified for individual
builds, as well as rules.
2018-02-20 18:51:01 +00:00
Nicolas Despres
d3c7da5893 Add support for implicit outputs in ninja_syntax.py. 2016-02-06 09:37:51 +01:00
Alex Vallée
97e96284a3 Disable long word wrapping entirely in comments.
As pointed out by nico, we should unconditionally disable breaking of
long words in comments. It is unlikely long words that are in comments
should be split (like pathnames).
2015-11-27 16:09:34 -05:00
Alex Vallee
8c18cf97ff Fix indent in pull request #1042. 2015-11-11 22:48:39 -05:00
Alex Vallée
8f658d6329 Fix wrapping file paths in Writer.comment
Long file names, especially with hyphens will get incorrectly wrapped by
the comment method. Pass has_path=True to prevent this type of wrapping.

This is mainly so that longer path names can show up in comments on
their on line without breaking them up.
2015-10-23 16:36:28 -04:00
Evan Martin
dcd41dcef3 add a --bootstrap mode for configure.py
Instead of bootstrapping through a separate script, instead make
configure.py able to either generate a build.ninja *or* just execute
all the computed commands to build a ninja binary.
2014-11-18 08:15:37 -08:00
Evan Martin
76a95e45bb add an "expand" function to ninja_syntax
Implements basic variable expansion for use in configure.py.
2014-11-18 08:15:36 -08:00
Chris Drake
fca5ea6ece Get rid of unused import 2014-05-04 19:55:09 -07:00
Chris Drake
c5ee738460 Use consistent indentation conventions 2014-05-04 19:55:02 -07:00
Daniel Bratell
cc533ecb29 performance: Writer.build should copy less.
The build method copies the input lists several times. That
cost about 0.1s in the gyp generation for the Chromium project for
no gain.
2014-04-14 13:52:02 +02:00
Evan Martin
a8d7d8163a rename "special" to "deps" 2013-04-08 15:02:15 -07:00
Evan Martin
85a4db7822 add "special=gcc" attribute, use to load depslog 2013-04-08 14:45:07 -07:00
Evan Martin
b883c291c1 ninja_syntax.py: don't add trailing space when build has no inputs
Seen in Ninja's configure.py where it creates an "rpmbuild" command.
2012-12-29 00:39:38 -08:00
Robert Iannucci
f5129c8174 Add python ninja_syntax.py support for pool 2012-12-13 23:11:48 -08:00
Zaheer Chothia
1d5daecfaf Add support for Python 3 2012-10-18 15:03:20 +02:00
Evan Martin
1e2514e521 ninja_syntax: escape colons in paths 2012-07-17 13:26:21 -07:00
Nico Weber
7ef52b4c6f Fix layout width in ninja_syntax.py.
The last line would sometimes be needlessly longer than the layout
width. One example is line 67 in the build.ninja generated by
ninja's own configure.py: Before this patch, ninja_syntax would
create a 81 character line.
2012-05-01 18:26:51 -07:00
Scott Graham
35544126cf add rspfile and rspfile_content to ninja_syntax 2012-03-26 17:36:43 -07:00
Scott Franklin
e257aa3fbd Explicitly turn input/output lists into list objects.
Python 3 does not support map.append/extend.
2012-01-28 15:16:47 -05:00
Evan Jones
16e4419e88 ninja_syntax.py: Fix a bug when passing dict variables to Writer.build()
Add a test to cover both dict and list variables.
2012-01-04 17:36:08 -05:00
Evan Martin
9cf5918cc5 ninja_syntax: add restat attribute to rules
Patch from Ami Fischman <fischman@chromium.org>.
2011-12-28 13:52:47 -08:00
Nico Weber
ebb6c59346 Let ninja_syntax handle escaped spaces correctly.
Revert the main loop changes made in 2e7ab75142,
and add just a few lines to the original main loop to make '$ ' escaping work.
Add several new tests, and make the existing tests pass again.
2011-12-22 12:21:12 -08:00
Jeremy Apthorp
9be1597a21 Update ninja_syntax.py and tests to reflect '$ ' syntax. 2011-11-29 16:36:33 +11:00
Peter Collingbourne
7cf2bdffe2 Implement generator rules
Introduce a rule attribute "generator" which, if present, specifies
that this rule is used to re-invoke the generator program.  Files built
using generator rules are treated specially in two ways: firstly,
they will not be rebuilt if the command line changes; and secondly,
they are not cleaned by default.

A command line flag "-g" is introduced for the clean tool, which
causes it to remove generator files.

Fixes issue #102.
2011-10-15 20:23:50 +01:00
Evan Martin
32855955c6 allow --with-gtest flag to use unpacked gtest dir
Useful for building on Macs.
2011-09-07 16:47:57 -07:00
Evan Martin
3becb3bbf5 add 'default' keyword to python module 2011-09-06 12:59:47 -07:00
Evan Martin
679305757e ninja_syntax.py: add include and subninja 2011-08-29 11:19:50 -07:00
Evan Martin
f5aed0b31f rename ninja module to ninja_syntax 2011-08-16 11:36:01 -07:00