| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This should be synced to r304096. This drops the
'use_ozone' flag for the linux builds (no longer needed and
didn't really make sense) and updates some instructions.
TBR=brettw@chromium.org
BUG=
Review URL: https://codereview.chromium.org/720353002
Cr-Commit-Position: refs/heads/master@{#304146}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The main use-case is to support using a fast SSD or ramdisk for the
build directory, but a slower persistent disk for the source code.
The general idea behind this change is modifying
- RebaseSourceAbsolutePath()
- SourceDir::ResolveRelativeFile()
- SourceDir::ResolveRelativeDir()
- GetOutputDirForSourceDirAsOutputFile()
- PathOutput
to work with paths reaching out of the source directory.
Thanks to jam@ for the Windows-fixes.
BUG=343728
TEST=New unit tests + Unit tests pass.
TEST=`gn gen /ssd/out/Debug && ninja -C /ssd/out/Debug` work as expected.
Review URL: https://codereview.chromium.org/630223002
Cr-Commit-Position: refs/heads/master@{#303719}
|
|
|
|
|
|
|
|
|
|
| |
I wanted this feature to more easily track down undefined refs at link time. This command can tell you what targets include a file, or tell you a tree on how to get there, so you can more easily figure out what dependencies to add.
Also adds the ability to write a tree for the normal refs case for multiple targets.
Review URL: https://codereview.chromium.org/700753005
Cr-Commit-Position: refs/heads/master@{#303328}
|
|
|
|
|
|
|
|
|
|
|
|
| |
I couldn't come up with anything that worked in 100% of cases, so switch
to mostly maintaining line breaks from input file instead.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/713463003
Cr-Commit-Position: refs/heads/master@{#303313}
|
|
|
|
|
|
|
|
| |
R=brettw@chromium.org,cjhopman@chromium.org
Review URL: https://codereview.chromium.org/707193006
Cr-Commit-Position: refs/heads/master@{#303312}
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also add some more disabled tests for things noted in reformatting all
chromium's gn files (see bug).
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/707973002
Cr-Commit-Position: refs/heads/master@{#303155}
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes tools/gn/format_test_data/033.gn which was the worst problem in
https://codereview.chromium.org/707593002/.
BUG=348474
R=brettw@chromium.org
Review URL: https://codereview.chromium.org/700893004
Cr-Commit-Position: refs/heads/master@{#302904}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously it didn't, and perhaps there was no need for
it to, but it seems like NaCl has a need. Specifically,
NaCl has two targets A and B with both run fine on their
own, but A can delete the output of B, and so needs to run
before B.
R=brettw@chromium.org
BUG=428576
Review URL: https://codereview.chromium.org/693443002
Cr-Commit-Position: refs/heads/master@{#302342}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC's stdext::hash_map, unlike C++11's std::unordered_map and GCC's
__gnu_cxx::hash_map, requires a total order on the key. It also has a very
different syntax for supplying a default hash function.
Switch MSVC to std::unordered_map, but exposed as base::hash_map. This aligns
both the container and the default hash function. The default hash function now
differs from our GCC one in that const char * is no longer hashed as a C string.
To align GCC with C++11 semantics and the MSVC ones this CL introduces, also
provide a new hash function and swap the default hash with it. This new
function is identical to __gnu_cxx::hash, but it does not specialize const
char* and does specialize T* (which was already aligned by
https://codereview.chromium.org/630503002/).
Note: This CL changes a file in mojo/ and will need to be mirrored in the
mojo repository before the next sync.
BUG=420242
Review URL: https://codereview.chromium.org/623383002
Cr-Commit-Position: refs/heads/master@{#301185}
|
|
|
|
|
|
|
|
| |
R=brettw@chromium.org
Review URL: https://codereview.chromium.org/670833003
Cr-Commit-Position: refs/heads/master@{#300640}
|
|
|
|
|
|
|
|
|
|
|
| |
Also some #include fixes (from OVERRIDE -> override conversion).
BUG=417463
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/643063004
Cr-Commit-Position: refs/heads/master@{#300635}
|
|
|
|
|
|
|
|
|
|
|
| |
This step is a giant search and replace for OVERRIDE to
replace them with their lowercase versions.
BUG=417463
Review URL: https://codereview.chromium.org/631653002
Cr-Commit-Position: refs/heads/master@{#300594}
|
|
|
|
|
|
|
|
|
|
|
| |
This is mostly to fix MSVC warnings about possible value truncation.
BUG=81439
TEST=none
Review URL: https://codereview.chromium.org/644433003
Cr-Commit-Position: refs/heads/master@{#300131}
|
|
|
|
|
|
|
|
|
|
| |
Also removes a couple more PassAs() calls.
BUG=423621
Review URL: https://codereview.chromium.org/654263004
Cr-Commit-Position: refs/heads/master@{#300129}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are still ARRAYSIZE_UNSAFEs in ppapi/tests/test_audio.cc, but it
defines it itself, and it might be compiled by some older NaCl toolchain
that doesn't support C++11. third_party/npapi/npspy/common/format.cpp
also has its own ARRAYSIZE_UNSAFE, but I'm hoping to delete npspy
completely.)
I'll remove ARRAYSIZE_UNSAFE from base/macro.h separately, since it's
quite likely we have deps that use our base (and those deps may use it).
R=ben@chromium.org
TBR=armansito@chromium.org
BUG=423134
Review URL: https://codereview.chromium.org/663673002
Cr-Commit-Position: refs/heads/master@{#300034}
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bad error messages remind me of working with gyp.
This change just stores the parser error in the InputFileData so that we
can actually report a useful error message from whichever thread first
reports an error.
Review URL: https://codereview.chromium.org/645253002
Cr-Commit-Position: refs/heads/master@{#299953}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This moves ExecProcess to exec_process.h/cc and adds capturing
of stderr on linux.
Adds unittests for ExecProcess.
Windows is not supported.
Review URL: https://codereview.chromium.org/646013003
Cr-Commit-Position: refs/heads/master@{#299951}
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's a convention in unix for programs to first search for a program
specific editor variable. For example, SVN_EDITOR or GIT_EDITOR. This
makes GN follow this same convention.
BUG=none
Review URL: https://codereview.chromium.org/654333002
Cr-Commit-Position: refs/heads/master@{#299798}
|
|
|
|
|
|
|
|
| |
BUG=423621
Review URL: https://codereview.chromium.org/656093004
Cr-Commit-Position: refs/heads/master@{#299748}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C++11's std::hash provides a default hash for T* that hashes by pointer value.
So does MSVC's stdext::hash_value, but not GCC's __gnu_cxx::hash (and STLPort's
std::hash). To align non-MSVC with both MSVC and the standard, provide a
default hash for pointers. This removes a lot of GCC-specific hash definitions.
Confusingly, all three provide a default hash for const char * that hashes as C
string, while not changing their equality. This CL does not change this on any
platform.
BUG=420242
Review URL: https://codereview.chromium.org/630503002
Cr-Commit-Position: refs/heads/master@{#299217}
|
|
|
|
|
|
| |
Review URL: https://codereview.chromium.org/647623002
Cr-Commit-Position: refs/heads/master@{#299155}
|
|
|
|
|
|
|
|
| |
BUG=102853
Review URL: https://codereview.chromium.org/630403003
Cr-Commit-Position: refs/heads/master@{#298532}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This seems to be a lot closer to standard usage, basically "short stuff"
isn't blank-line separated.
Also, add 3 not-working-yet unreferenced tests so I don't forget about
fixing those things.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/603823003
Cr-Commit-Position: refs/heads/master@{#298513}
|
|
|
|
|
|
|
|
|
| |
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/636663002
Cr-Commit-Position: refs/heads/master@{#298341}
|
|
|
|
|
|
|
|
|
| |
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/629763002
Cr-Commit-Position: refs/heads/master@{#298251}
|
|
|
|
|
|
|
|
|
|
|
|
| |
Track parent precedence down through emitting expressions so that if
necessary the child expression can use () to maintain evaluation order.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/624353002
Cr-Commit-Position: refs/heads/master@{#298179}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pulls out function call formatting separate from list/block, and fixes
line length when blocks attached. Function call is still kind of
complex, but at least list/block are simpler.
R=brettw@chromium.org
BUG=384474
Review URL: https://codereview.chromium.org/623643002
Cr-Commit-Position: refs/heads/master@{#298143}
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also add test for empty function call (which was asserting
with invalid iterator).
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/626093003
Cr-Commit-Position: refs/heads/master@{#298106}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is helpful for editor integration. e.g. in Vim:
au BufRead,BufNewFile,BufEnter *.gn map <silent> <F1> :w<cr>:silent! exe "!/path/to/gn/gn.exe format --in-place " . expand('%:p')<cr>:e<cr>
to reformat the current file.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/614683006
Cr-Commit-Position: refs/heads/master@{#298058}
|
|
|
|
|
|
|
|
|
|
|
| |
And update help text.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/613083003
Cr-Commit-Position: refs/heads/master@{#297926}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For function call arguments:
- if all arguments plus ')' fit at current point, insert
- if all arguments fit at current, one per line
- otherwise at minimum of current and margin+4, one per line, recurse into children. Similar for binary expressions so that "a + b" can wrap.
Also, add basic output of AccessorNode + test.
(not as fancy as clang-format, but there's not that many long
function calls in .gn files.)
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/607243002
Cr-Commit-Position: refs/heads/master@{#297765}
|
|
|
|
|
|
| |
Review URL: https://codereview.chromium.org/610293003
Cr-Commit-Position: refs/heads/master@{#297508}
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=354261
R=brettw
TBR=piman,wtc
NOTRY=true
Review URL: https://codereview.chromium.org/603143002
Cr-Commit-Position: refs/heads/master@{#297481}
|
|
|
|
|
|
|
|
| |
See Visibility::FillItemVisibility for code implementing default.
Review URL: https://codereview.chromium.org/608293002
Cr-Commit-Position: refs/heads/master@{#297237}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously
a = [
"x",
"y", # Comment1
# Comment2
]
would turn into
a = [
"x",
"y", # Comment1# Comment2
]
(Child of https://codereview.chromium.org/606123002/)
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/613473002
Cr-Commit-Position: refs/heads/master@{#297235}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this, gn format //BUILD.gn results in no changes, other than to
make 'deps += [ "a" ]' turn into one line instead of multiline.
(Child of https://codereview.chromium.org/608593006/)
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/606123002
Cr-Commit-Position: refs/heads/master@{#297231}
|
|
|
|
|
|
|
|
|
|
|
| |
(Child of https://codereview.chromium.org/607173002/)
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/608593006
Cr-Commit-Position: refs/heads/master@{#297228}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes comments at the end of a block like:
stuff() {
sources = []
# wee
}
This is done by storing an EndNode (instead of just a Token) as the
end of Block and List nodes. This means there's a node in the tree
traversal for the trailing ], and gives a place to attach the comment.
Also collapses some of the expression output code to reuse Sequence.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/607173002
Cr-Commit-Position: refs/heads/master@{#297226}
|
|
|
|
|
|
|
|
|
|
| |
Reworks DepsIterator so it is compatible with STL iterators enough to work with range-based for loops. The iterator is now created by a target rather than taking a target as an argument, which makes the loops more natural.
I also changed some loops around code I was touching to use range-based.
Review URL: https://codereview.chromium.org/610043002
Cr-Commit-Position: refs/heads/master@{#297122}
|
|
|
|
|
|
|
|
|
| |
This will pretty much always result in a bad build but is only a warning
in ninja.
Review URL: https://codereview.chromium.org/455193003
Cr-Commit-Position: refs/heads/master@{#297077}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds `gn format` command. Currently accepts one //path/to/BUILD.gn and
attempts to reformat it (to stdout). Handles the basics, but does not
handle all constructs yet, and doesn't attempt any rewrites.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/591373002
Cr-Commit-Position: refs/heads/master@{#296876}
|
|
|
|
|
|
|
|
|
|
| |
The GN binaries have moved to src/buildtools. So, this script was removing GN binaries from tools/gn/bin that aren't used anymore. It was kept with the same intent till july 2014 (expected), and now think so, it is the good time to remove this script.
BUG=
Review URL: https://codereview.chromium.org/598493002
Cr-Commit-Position: refs/heads/master@{#296344}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rebased on https://codereview.chromium.org/588893006/
Comments that look like standalone line comments but immediately follow
a previous suffix comment should be considered suffix as well so they
can be added to the same node.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/595753002
Cr-Commit-Position: refs/heads/master@{#296339}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(Split off of https://codereview.chromium.org/588813002)
The main change here is to restructure the ParseNode tree to include
comments. Comments are not included in the tree as normal nodes, but
instead attached subordinate to other |ParseNode|s. This is useful
for two reasons:
- it means neither the evaluator nor the main code of the parser need
to get more complicated, as they do not need to constantly consider
comments.
- it confers additional information about the relative location of
of the comments to their surrounding code when (in the future)
outputting the formatted code.
Comments are added in relation to the node they're attached to as
before, after, or suffix. This is so that formatting can keep them
attached to the correct thing when things are reflowed.
Timing data (Windows, Release):
Before:
Done. Wrote 1618 targets from 530 files in 2613ms
Done. Wrote 1618 targets from 530 files in 2952ms
Done. Wrote 1618 targets from 530 files in 3093ms
After:
Done. Wrote 1618 targets from 530 files in 2767ms
Done. Wrote 1618 targets from 530 files in 3120ms
Done. Wrote 1618 targets from 530 files in 2872ms
So, it seems within the noise at this point.
R=brettw@chromium.org
BUG=348474
Review URL: https://codereview.chromium.org/588893006
Cr-Commit-Position: refs/heads/master@{#296331}
|
|
|
|
|
|
|
|
|
|
| |
A copy and paste error meant it used the link output file for dependency tracking. This is valid but inefficient, which was why it wasn't caught. Added a new test for this case
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/583363003
Cr-Commit-Position: refs/heads/master@{#295985}
|
|
|
|
|
|
|
|
|
|
| |
BUG=None
TEST=ninja -C out/Debug gn_unittests
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/583453003
Cr-Commit-Position: refs/heads/master@{#295853}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SubstitutionPatterm -> SubstitutionPattern
SubstutitionWriter -> SubstitutionWriter
BUG=None
TEST=ninja -C out/Debug gn_unittests - compare the output before and
after this change.
TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/590683002
Cr-Commit-Position: refs/heads/master@{#295846}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I went through and made "gn check //ui/*" pass, and did a lot of enhancements for the bugs I found.
Fixes a big bug in the header checker where it did not consider direct private dependencies to be OK from a header include perspective. However, private deps only change things when there are intermediate targets. This patch marks direct deps OK, and changes the variable names from is_public to is_permitted (since it may not actually be public).
Allow includes to be permitted if any target allows the include, rather than all of them. This happens if multiple targets have the same file as sources.
Strip the generated file directory from the beginning of sources. Previously, this was only for outputs (since typically they're included assuming the root gen dir is on the path). This comes up when an action generates a file, and then it's put into a source set (which we do a lot). This change allows a public dependency on the source set to count for header include purposes.
Track public/private deps in the dependency path finder so the error message can show which deps are private that break the chain. This was really helpful when tracking down errors.
Add deps and public deps to the build to make check pass.
R=scottmg@chromium.org
Review URL: https://codereview.chromium.org/584683002
Cr-Commit-Position: refs/heads/master@{#295783}
|
|
|
|
|
|
|
|
|
| |
BUG=414880
R=brettw
Review URL: https://codereview.chromium.org/576293003
Cr-Commit-Position: refs/heads/master@{#295620}
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Trying to use ar to put a static lib inside a complete static lib doesn't
work. GN should enforce and document this restriction.
BUG=None
TEST=gn_unittests, including new test for this case.
R=brettw
Review URL: https://codereview.chromium.org/582863002
Cr-Commit-Position: refs/heads/master@{#295609}
|