Commit graph

1885 commits

Author SHA1 Message Date
Colin Cross
30faeb6ad6 Handle dangling symlinks when following symlinks am: 0e306e7a89
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1851040

Change-Id: I7bf8c61931edc11888f1fc015dac7f596096ce32
2021-10-11 17:58:49 +00:00
Colin Cross
0e306e7a89 Handle dangling symlinks when following symlinks
When globbing with following symlinks enabled, treat dangling symlinks
as files instead of erroring.

Bug: 202547639
Test: TestGlobFollowDanglingSymlinks
Change-Id: Ic1b241d3fcf1bc6989cb724d00c2b97fefa8dcdb
2021-10-08 17:50:17 -07:00
Spandan Das
8c25febaf9 Merge "bpdocs for struct types created using reflection" am: 87fd4b11af
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1820757

Change-Id: I6c3b9563df74a1c55b3a784bceae915b9f9c7b98
2021-09-21 20:21:53 +00:00
Spandan Das
87fd4b11af Merge "bpdocs for struct types created using reflection" 2021-09-21 20:00:35 +00:00
Spandan Das
1109cd96b7 bpdocs for struct types created using reflection
struct types defined using reflection have empty PkgPaths(), due to
which they were not added to the generated bpdocs. This CL allows
us to generate bpdocs for such struct types.

For each field in the struct, the algorithm checks the following and
creates a PropertyStruct object accordingly
1. If field is a primitive type (Base condition)
2. If field is another exported struct (Base condition)
3. If field is another struct created using reflection (Recurse)

Test: m soong_docs
Test: java_sdk_library_import before
https://ci.android.com/builds/submitted/7710820/linux/latest/view/java.html#java_sdk_library_import
and after
https://spandandas.users.x20web.corp.google.com/docs/java.html#java_sdk_library_import
Bug: 172797653

Change-Id: I0349e405fd290d427fa0b38a109b4212aace50c6
2021-09-20 22:33:05 +00:00
Martin Stjernholm
7cf283232e Merge "Document that blueprint:"mutated" properties are skipped." am: 9fd2ed93df
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1823195

Change-Id: I4c4953ecf617632ed18bd1a682d4a1ff57dc7d25
2021-09-10 10:36:05 +00:00
Martin Stjernholm
9fd2ed93df Merge "Document that blueprint:"mutated" properties are skipped." 2021-09-10 10:17:55 +00:00
Treehugger Robot
23621090db Merge "[LSC] Add LOCAL_LICENSE_KINDS to build/blueprint" am: b3ba44c8d3
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1822217

Change-Id: Idc743777aff29b42995f11075916c9552a2668da
2021-09-09 22:11:42 +00:00
Treehugger Robot
b3ba44c8d3 Merge "[LSC] Add LOCAL_LICENSE_KINDS to build/blueprint" 2021-09-09 21:49:26 +00:00
Martin Stjernholm
af564e41a9 Document that blueprint:"mutated" properties are skipped.
Test: n/a - comment change only
Change-Id: I717c549093bf4b744af75a43219cb353510bfcad
2021-09-09 20:49:58 +01:00
Lukacs T. Berki
f16d2de6d0 Remove UseValidationsForGoTests. am: d9d298c760
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1821772

Change-Id: I8a4958fea48cb695ea632e880f01776dbbc902d2
2021-09-09 06:24:32 +00:00
Bob Badour
76f9b09e3d [LSC] Add LOCAL_LICENSE_KINDS to build/blueprint
Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Iba783a5b977976ee2d49a8553908fec1219dad68
2021-09-08 14:01:45 -07:00
Lukacs T. Berki
32d5d542d2 Remove PrimaryBuilderExtraFlags and cull Args. am: 5d5ed5fc6b
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1819862

Change-Id: I3c220d3d23862dd7c75e19a5c4c8ee999c275bb9
2021-09-08 13:39:21 +00:00
Lukacs T. Berki
2339404d67 Prefix file names with ctx.SrcDir() in docgen. am: 70d6564d7d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1821452

Change-Id: I910765324c5ec7bb9a8aafc23fee304b82f456ca
2021-09-08 13:39:19 +00:00
Lukacs T. Berki
d9d298c760 Remove UseValidationsForGoTests.
Whenever it was called, it returned true.

Test: Presubmits.
Change-Id: Iabe5a99b8363771d06b200d4641d9ce477ba5b6e
2021-09-08 15:32:52 +02:00
Lukacs T. Berki
5d5ed5fc6b Remove PrimaryBuilderExtraFlags and cull Args.
PrimaryBuilderExtra flags was only used from soong_ui and has nothing to
do with Blueprint files or modules and Args contained a lot of members
that were likewise only used for plumbing withing soong_ui or for
command line processing for soong_build.

Test: Presubmits.
Change-Id: Ibf009e446b4044309a331592a88a4aa86b4801e3
2021-09-08 09:35:56 +02:00
Lukacs T. Berki
70d6564d7d Prefix file names with ctx.SrcDir() in docgen.
This is because docgen will be called from the bootstrap Ninja file with
cwd == /.

Side cleanup: remove an unused template.

Test: Presubmits.
Change-Id: Ia5ff10247becbabc7a76c21f4ed05d654a7b20c3
2021-09-08 09:34:56 +02:00
Lukacs T. Berki
d77170912f Pass StopBefore as an argument to RunBlueprint. am: a9768e1ad7
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1820190

Change-Id: I5d6b62368bd4350aad66de45c92259138d86b0ad
2021-09-08 06:37:14 +00:00
Lukacs T. Berki
a9768e1ad7 Pass StopBefore as an argument to RunBlueprint.
Its value is a function of the call site, so it doesn't make a lot of
sense to plumb it through the configuration.

Test: Presubmits.
Change-Id: I5081650818664f283ebc5dc04daef90c26759353
2021-09-07 18:12:29 +02:00
Lukacs T. Berki
6a48d308a6 Remove ConfigRemoveAbandonedFilesUnder. am: f99e89c147
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1817977

Change-Id: I78ad77bcf99c77e372c3e2cf6c3b207df9965daa
2021-09-06 12:13:16 +00:00
Lukacs T. Berki
f99e89c147 Remove ConfigRemoveAbandonedFilesUnder.
It was not implemented by anyone.

Test: Presubmits.
Change-Id: I8b98620c0ef9c1f242fe7fc0a7d810f2af15d042
2021-09-06 11:35:28 +02:00
Lukács T. Berki
3b69a0a224 Merge "Rename Blueprints to Android.bp ." am: 5e56efb7c8
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1817978

Change-Id: I70d85f0dccdd6390ca198132455d5ea3b33292c1
2021-09-03 18:38:53 +00:00
Lukács T. Berki
5e56efb7c8 Merge "Rename Blueprints to Android.bp ." 2021-09-03 18:20:39 +00:00
Lukacs T. Berki
8a97f47ac3 Make cmdline args consistent with what they do. am: 9b435b8089
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1815793

Change-Id: I65e4a1ca16684ab1efe7600d55b67fdbb69550d9
2021-09-02 15:48:56 +00:00
Lukacs T. Berki
9b435b8089 Make cmdline args consistent with what they do.
Test: Presubmits.
Change-Id: I6d5f827e06526a121f915aae57c6f086ba44f21d
2021-09-02 13:29:10 +02:00
Lukacs T. Berki
cf5b271af2 Remove the bootstrap.Config class. am: d782b504e0
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1817976

Change-Id: Ifbd54ab958809635d39b49f52ed63765c7c7d3d1
2021-09-02 10:53:13 +00:00
Lukacs T. Berki
eef5685c65 Rename Blueprints to Android.bp .
This was the only one in the source tree.

Side cleanup: remove some dead code that I assume comes from the time
where Blueprint files had to specify what subdirectories other Blueprint
files are in.

Test: Presubmits.
Change-Id: If84c4e85bc5516f30da97c1be29b56e50dddb3c4
2021-09-02 11:48:19 +02:00
Lukacs T. Berki
d782b504e0 Remove the bootstrap.Config class.
It was confusing because there are two concepts with the same name:
thebootstrapping config special-cased in the bootstrap modules /
singletons and the "global" config.

This change folds the first into the second.

A further next step would be to split the Go parts and the Ninja parts
(subninjas + primary builder invocation) apart, but at some point, I
should stop gold-plating this.

Test: Presubmits.
Change-Id: Id341dee664a9d2527535f4f9980e5f0d10139eef
2021-09-02 09:58:45 +02:00
Lukacs T. Berki
8c57b1e2e9 Simplify bootstrapping: am: ceb3c43f65
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1814783

Change-Id: I9ef24bad2a7dd94fc6780768f590d94c32198d85
2021-09-01 14:28:44 +00:00
Lukacs T. Berki
ceb3c43f65 Simplify bootstrapping:
- Remove the bootstrap_go_binary module type in favor of
blueprint_go_binary
- Make it so that all the binaries used during bootstrapping are in the
host tool directory so that the bootstrap and main Ninja files are
consistent

Test: Presubmits.

Change-Id: I00744fec0474fbea89db6c0c0338856453138564
2021-09-01 11:55:00 +02:00
Lukacs T. Berki
f05ce1b487 Remove some unnecessary arguments from Blueprint. am: ce41c169b5
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1814158

Change-Id: Id3bfbe21e3c1cc94597b513a7f159b52a13e5820
2021-08-31 13:48:47 +00:00
Lukacs T. Berki
ce41c169b5 Remove some unnecessary arguments from Blueprint.
What's gone:

- TopFile (it's always Android.bp)
- GeneratingPrimaryBuilder (we don't make that distinction anymore)

Also rename BuildDir and NinjaBuildDir to SoongOutDir and OutDir,
respectively, to be consistent with the rest of the code.

Test: Presubmits.
Change-Id: I55ecb02a59fe68bf5674395a108181ea7557b21f
2021-08-31 10:58:04 +02:00
Lukacs T. Berki
10c8322ae6 Remove Depfiles from bootstrap.Args . am: 0459f6b18e
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1808877

Change-Id: Ic45a0fd380cb8288a58a7339885ca59d0248c73c
2021-08-27 19:56:54 +00:00
Lukacs T. Berki
0459f6b18e Remove Depfiles from bootstrap.Args .
It is not used anymore; Soong assumes that the depfile is just the name
of the output file with a ".d" suffix.

Test: Presubmits.
Change-Id: Ifbf722dcdffc8420e12a032e23ab791a6be5a736
2021-08-27 15:56:00 +02:00
Lukacs T. Berki
eb25e8caee Rename BuildDir and NinjaBuildDir. am: 5c4abb15e3
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1810317

Change-Id: Ie22c1062431149e97f3bc37395b5c7434e92a476
2021-08-27 13:54:13 +00:00
Lukacs T. Berki
5c4abb15e3 Rename BuildDir and NinjaBuildDir.
These are just out/ and out/soong/ and the old names were quite
confusing.

Test: Presubmits.
Merged-In: Idd9ce3c38a259faabcc56f0cd3fdac8b289123b1
Merged-In: I334ab40c668d2a94536f3e63d5f1fa0b401388ac
Change-Id: Ib7c568c6a97701f2240c5e3f0f2ce67397819ac0
2021-08-26 15:08:09 +02:00
Lukacs T. Berki
3377feea84 Do not separate .primary and .bootstrap dirs. am: 51b625928d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1802496

Change-Id: I2040b9b2de6bf90c09d8d1723c9165113c75ed6d
2021-08-19 18:17:09 +00:00
Lukacs T. Berki
2ece082345 Do not reference Ninja variables in Makefiles. am: 5f0a740fed
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1800994

Change-Id: I833d40edc47b402ec01770a6cb3e0ac9a2f9f909
2021-08-19 15:16:22 +00:00
Lukacs T. Berki
51b625928d Do not separate .primary and .bootstrap dirs.
This makes it possible to share work between the bootstrap and the main
Ninja file.

As a side fix, remove the reference to $srcDir from moduleSrcDir() since
that is hardwired to "." anyway.

Test: Presubmits.
Change-Id: Ia4a251dd34273ec3e0436ac7a2fbafe4ef46c73f
2021-08-19 16:26:36 +02:00
Lukacs T. Berki
5f0a740fed Do not reference Ninja variables in Makefiles.
installPath was included by androidmk.go in the Soong-generated
Android.mk file, which means that the Ninja variable reference
`$buildDir` passe through Kati, with unpredictable results.

`$buildDir` is still used in a few places, but those are not problematic
because they are not copied to Android.mk (they could probably be
removed, but it's not trivial enough to be done as a drive-by fix)

Test: Presubmits.
Change-Id: I6a5ea8b1679001ff685d263310cb061d3a6a992e
2021-08-19 13:46:22 +02:00
Lukács T. Berki
58c28580fd Merge "Do not do glob-related things in RunBlueprint()." am: 3bec89465e
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1799767

Change-Id: I6e7b980bcdfea32ba32a6f626e16f854ac5b8267
2021-08-19 06:31:35 +00:00
Lukács T. Berki
3bec89465e Merge "Do not do glob-related things in RunBlueprint()." 2021-08-19 06:17:32 +00:00
Lukacs T. Berki
008b6ea661 Do not do glob-related things in RunBlueprint().
From now on, the responsibility of writing build-globs.ninja and adding
the glob list files to build.ninja.d will be the responsibility of
whoever calls Blueprint.

It's nicer this way because the bootstrap Blueprint invocation does not
need globs and Blueprint can be invoked multiple times from the
soong_build binary depending on what it does.

Regrettably, the little Blueprint invocation that generates
build-globs.ninja still requires a reference to a BootstrapConfig
because GlobRule references ${buildDir}.

Side cleanup: remove Args.DocFile, which was unused.

Test: Presubmits.
Change-Id: I37586966e3d6b7557a490ed1ae81ec596ec66ee5
2021-08-19 08:16:19 +02:00
Liz Kammer
32d736310a Use pretty print for json module graph am: 6e4ee8db2d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1799130

Change-Id: I0d90d7f584ba32ab1af899b340ea265fd64deb64
2021-08-18 07:35:23 +00:00
Liz Kammer
6e4ee8db2d Use pretty print for json module graph
Test: SOONG_DUMP_JSON_MODULE_GRAPH=/tmp/json/srcs m nothing and verify
      output
Change-Id: I779dcebce7435f2f48263909c4c62c27c0fbfec4
2021-08-17 17:32:42 -04:00
Lukacs T. Berki
ee289293ea Remove Srcdir() from BootstrapConfig. am: 6ec924c12b
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1796651

Change-Id: If9394b2a7bc92ba04f37a77dd4138dc54e16cc3b
2021-08-17 15:14:21 +00:00
Lukacs T. Berki
b636b78072 Remove global variables in command.go . am: 980c1f0c72
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1796446

Change-Id: I6bfe4b9864b406e58aa6af2007f486dc6a442b81
2021-08-17 15:14:20 +00:00
Lukacs T. Berki
d812a01b1b Delete support for standalone Blueprint. am: 016a7dd6ef
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1796439

Change-Id: I0383b473121ed81fba0c6fe98ccc8109cced7258
2021-08-17 15:14:20 +00:00
Lukacs T. Berki
7f5966aea0 Remove the ability to emit Blueprint docs. am: 64ee4262a0
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1796437

Change-Id: I22125bda108939bbe6a603abf483a5dbf5d1a851
2021-08-17 15:14:19 +00:00
Lukacs T. Berki
6ec924c12b Remove Srcdir() from BootstrapConfig.
It was always ".".

Test: Presubmits.
Change-Id: I0612b9b07233659adc708b9710db9aec6e24f224
2021-08-16 17:04:50 +02:00