Commit graph

1986 commits

Author SHA1 Message Date
Jeongik Cha
5860caea33 bpmodify: remove-property
`r` option removes only item(s) in a list, so add `remove-property`
option to remove a property itself.

Bug: 146436251
Test: unittest
Change-Id: I0c838d31e72358f094cfb5fa9468dce07018e061
2022-02-11 05:54:33 +00:00
Jooyung Han
451dd63611 bpmodify: -add-literal to add a value to the list
-a works with only string values. When we need to add numbers, booleans,
or even structs, -add-literal can be used now.

  bpmodify -m foo -property list-of-ints -add-literal 123
  bpmodify -m foo -property list-of-structs \
    -add-literal "{key: \"value\"}"

Bug: 146436251
Test: go test ./bpmodify
Change-Id: I91d23d7bf89491643aa595f5ebccd9410a9cbb09
2022-02-09 11:16:02 +09:00
Jooyung Han
0cb1064428 Add newlines around list of structs
Since a struct(parser.Map) occupies multiple lines, adding newlines
around brackets([]) looks better even the list has only a single value.

  prop: [ {
    name: "foo",
  }],

vs

  prop: [
    {
      name: "foo",
    },
  ],

Bug: n/a
Test: go test ./parser
Change-Id: I1a574aa038a26235848b6c9b5b4f01a0ab2c8c00
2022-02-09 11:10:12 +09:00
Liz Kammer
2df87f3cd9 Add a limit to blueprint filesystem accesses
Mac builds keep running into too many files open. Restrict access of
filesystem to the current limit.

Test: m nothing
Change-Id: I2365da7c641f7c7f5d948396c6862eb3a0d1d8b9
2022-02-08 15:16:59 -05:00
Treehugger Robot
fc56ef6e20 Merge "Rename saneSplit --> quickSplit" 2022-02-07 21:25:07 +00:00
Liz Kammer
6e7e6a92c7 Close file after reading
Test: m nothing
Change-Id: Ib2daa2081d47c52bd3994520d522c5df95973e4a
2022-02-07 10:04:51 -05:00
Liz Kammer
8b162be674 Rename saneSplit --> quickSplit
This better describes its goal and is more inclusive.

Test: go test blueprint pathtools tests
Change-Id: Ia382f1fe65d0b551dc5d92d40ddf3cb356f3204d
2022-02-07 09:41:01 -05:00
Usta Shrestha
1b438d6b7e gitignore intelliJ files
Bug: N/A
Test: N/A
Change-Id: Iff9eabb3915bff566ee62deb339f0cbe89b5c6ef
2022-02-02 11:36:11 -05:00
kgui
a78b020089 Support writing inputs/outputs of actions of modules into a file from the moduleInfo.actionDefs.
An example module variant in the module-actions.json:
{
	"Name": "metalava-gradle-plugin-deps",
	"Variations": null,
	"DependencyVariations": null,
	"Deps": [
		{
			"Name": "prebuilts_gradle-plugin_license",
			"Variations": null,
			"DependencyVariations": null,
			"Tag": ""
		}
	],
	"Type": "",
	"Blueprint": "prebuilts/gradle-plugin/Android.bp",
	"Module": {
		"Actions": [
			{
				"Inputs": [
					"prebuilts/gradle-plugin/com/android/tools/lint/lint-api/30.1.0-alpha13/lint-api-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/lint/lint-checks/30.1.0-alpha13/lint-checks-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/lint/lint/30.1.0-alpha13/lint-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/lint/lint-gradle/30.1.0-alpha13/lint-gradle-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/lint/lint-model/30.1.0-alpha13/lint-model-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/common/30.1.0-alpha13/common-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/sdk-common/30.1.0-alpha13/sdk-common-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/sdklib/30.1.0-alpha13/sdklib-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/external/org-jetbrains/uast/30.1.0-alpha13/uast-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/external/com-intellij/intellij-core/30.1.0-alpha13/intellij-core-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/external/com-intellij/kotlin-compiler/30.1.0-alpha13/kotlin-compiler-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/repository/30.1.0-alpha13/repository-30.1.0-alpha13.jar",
					"prebuilts/gradle-plugin/com/android/tools/build/manifest-merger/30.1.0-alpha13/manifest-merger-30.1.0-alpha13.jar"
				],
				"Outputs": [
					"out/soong/.intermediates/prebuilts/gradle-plugin/metalava-gradle-plugin-deps/linux_glibc_common/combined/metalava-gradle-plugin-deps.jar"
				]
			},
			{
				"Inputs": null,
				"Outputs": [
					"out/soong/.intermediates/prebuilts/gradle-plugin/metalava-gradle-plugin-deps/linux_glibc_common/meta_lic"
				]
			}
		]
	}
}

Test: local
Change-Id: Icbb7236507251e257f6773b110ae8a0788eef41e
2022-01-28 14:50:24 +08:00
Treehugger Robot
00895de89a Merge "Add support for maps in blueprint files." 2022-01-27 21:36:45 +00:00
Liz Kammer
42cb28f66e Add support for maps in blueprint files.
This limits support to allow-listed property names to prevent
proliferation of map types requiring additional support to migrate.

Test: go test blueprint tests
Test: m nothing && diff build.ninja & Android-aosp_arm.mk -- no changes
Change-Id: Id12637462f19ac5de1b562f63507de989a51600d
2022-01-26 12:18:31 -05:00
Usta Shrestha
53bc344a81 Blueprint to support multiline (Go style raw) strings
Bug: 206961391
Test: m nothing and diff the ninja files
Change-Id: I9a7ffafe6a3992bf05180a032f4b277cbecb7dc6
2022-01-19 22:58:01 +00:00
Usta Shrestha
62823dcf01 use iota for "enum"
Test: m nothing
Bug: N/A
Change-Id: I9d59796cbf1dc3dc8e1e9fc536b50c1dea3a5f61
2022-01-18 16:51:12 -05:00
Usta Shrestha
ee7a5d7a16 Typos and missing parameter names use in doc comment
Test: N/A
Bug: N/A
Change-Id: I01331365925decef22502da02a23ed4ce610da98
2022-01-18 16:46:30 -05:00
Liz Kammer
c643dd96cd Merge "Add proptools helper functions." 2022-01-12 13:23:33 +00:00
Liz Kammer
5319d07308 Add proptools helper functions.
Test: existing blueprint tests
Change-Id: Ie32bc2a0d075b1b7cc9fe1247d1f02dc1af67449
2022-01-11 10:21:05 -05:00
kgui
20f19a5d9b Add JSON data related struct and function into context.
Test: local test
Change-Id: I7a2000b458378f240cd6481066c15dec98d110ea
2022-01-10 14:55:06 +08:00
Treehugger Robot
33132a4fd5 Merge "Reset contexts before calling LoadHook" 2022-01-06 01:31:00 +00:00
Inseob Kim
1e01a4e7c2 Reset contexts before calling LoadHook
If more than one loadhooks exist, calls to CreateModule will make an
error because the contexts object isn't reset and the same modules are
added more than once. This fixes the bug by initializing contexts object
every time.

Bug: 213297238
Test: manual
Change-Id: I545c1592c3217b764968a8937c962e9d58a85291
2022-01-05 19:56:08 +09:00
Lukacs T. Berki
a67610a75f Allow soong_ui to set env vars for soong_build .
This is used to make GODEBUG=asyncpreemptoff=1 only be set in debug mode
so that production is not affected.

Test: Presubmits.
Change-Id: Idb15ad20bb74ba3f896699715e3208c1287a5e82
2022-01-05 10:29:48 +01:00
Lukács T. Berki
1a1ec4b59c Merge "Set GODEBUG=asyncpreemptoff=1 for soong_build." 2022-01-05 09:06:19 +00:00
Lukacs T. Berki
3dab5143bd Allow specifying the pool for soong_build calls.
Test: Presubmits.
Change-Id: Iff0edf595b1868ccdda4ea6391c1057e0f86cd9b
2022-01-04 14:49:54 +01:00
Lukacs T. Berki
635fc35a09 Set GODEBUG=asyncpreemptoff=1 for soong_build.
This makes debugging with Delve much faster, sometimes by an order of
magnitude because Delve does not have to deal with the many SIGURG
signals that are used to stop preempted goroutines this way.

This could in theory result in a performance loss, but running
`rm -f out/soong/build.ninja; time m nothing` five times demonstrated no
change in the execution time.

Test: Presubmits + performance testing as described above.
Change-Id: I438564bcaf70d2a50147cf54cdfac6dcfe925ce5
2022-01-04 12:37:24 +01:00
Yi Kong
a08e722192 Apply toNinjaName for variant names
Variant names are part of the name of the generated Ninja rule.
toNinjaName needs to be applied to it as well.

Test: presubmit
Change-Id: I4fb908b6824179440b1c207240bad59dc85009fa
2021-12-22 13:35:02 +08:00
Dan Willemsen
6dd6868dec Support go1.18, drop support for <go1.8
Change-Id: I676aabbd7173e6ae523e6fcedfaafcd44ba85c3a
2021-12-14 15:58:35 -08:00
Colin Cross
a0ec53a770 Merge "Add NinjaAndshellEscapeListIncludingSpaces" am: 1527beef42
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1899704

Change-Id: I7308e2e2c505df3c4d1d1d018a3aa57ed7de1d79
2021-12-10 22:04:40 +00:00
Colin Cross
1527beef42 Merge "Add NinjaAndshellEscapeListIncludingSpaces" 2021-12-10 21:43:49 +00:00
Jingwen Chen
1f77f7af15 Forward descriptions to primary build invocations. am: 8e7786a0fd
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1911018

Change-Id: Ic7edf1773d6c017c687d48ed6e9ef84d9f30cb64
2021-12-07 01:31:20 +00:00
Jingwen Chen
8e7786a0fd Forward descriptions to primary build invocations.
Test: m nothing bp2build json-module-graph queryview soong_docs
Change-Id: Ic64238dc10a90c923cf5559d1bbbc51fd0922e31
2021-12-06 13:30:18 +00:00
Usta
31b232ba4b Minor refactoring to remove a couple of warnings am: 5ff5fe3e66
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1909474

Change-Id: I1982017e263f44844514b8e5d00af28f47d3ff51
2021-12-02 21:54:52 +00:00
Usta
5ff5fe3e66 Minor refactoring to remove a couple of warnings
Test: m nothing
Bug: n/a

Change-Id: I3d5cf50974e84725d1d49113dfb9b74d4f426fb8
2021-12-02 15:21:59 -05:00
Colin Cross
97eda8939b Add NinjaAndshellEscapeListIncludingSpaces
Add a method that ninja and shell escapes each entry in a list
of strings as a single argument.

Test: escape_test.go
Change-Id: Iac05c64f1ae48cd6186f563790ea49b90618038d
2021-11-22 22:45:54 -08:00
TreeHugger Robot
fd0aed5f2c Merge "Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918" into stage-aosp-master 2021-11-17 19:24:11 +00:00
Liz Kammer
4a7a93e620 Add ShellEscapeListIncludingSpaces am: 3a988df18a
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1894576

Change-Id: Ibdd319237ef5dd125279ea14fa1d84f53e3d0fcb
2021-11-17 01:46:05 +00:00
Liz Kammer
3a988df18a Add ShellEscapeListIncludingSpaces
This simplifies escaping for aquery.

Test: build/bazel/ci/mixed_droid.sh
Change-Id: I88356a8eda0c6a6ac9426d37cd386f0a94b8818b
2021-11-16 17:17:02 -05:00
Lukacs T. Berki
ffa095e33e Move bpglob to outside of the Ninja action graph. am: 6fbc68d41d
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1879698

Change-Id: I67d9c22741b5e9e9816f0273a16f09d6aa00efc0
2021-11-10 17:29:12 +00:00
Lukacs T. Berki
6fbc68d41d Move bpglob to outside of the Ninja action graph.
It's in reality built by Microfactory quite early in the build which
takes care of incrementality in bpglob itself.

Test: Presubmits.
Change-Id: I066a6e85f48e9cfec4efd46cb1f615c68b806080
2021-11-10 12:37:55 +01:00
Xin Li
b5c1eddfac Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: Ide155fbc4b2a982177f4082d6a27d05ddc9bd675
Change-Id: Ie8925a553b34cad87fda1583784c0158ea65f956
2021-11-10 08:05:30 +00:00
Trevor Radcliffe
7224b3edcc Merge "Change bpdoc to separate entries with the same type" am: 0bf636f3ef
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1878636

Change-Id: Ie8f13a8b8d4bb12040a5f8d7ef00c11febf4859e
2021-11-05 16:31:45 +00:00
Trevor Radcliffe
0bf636f3ef Merge "Change bpdoc to separate entries with the same type" 2021-11-05 16:11:23 +00:00
Lukacs T. Berki
ebe9022a3a Remove the -v argument from bpglob. am: f12f1d7d1e
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1879699

Change-Id: I20ec093492a1a507e7c13ca57d5f1e5478acd122
2021-11-04 17:28:28 +00:00
Lukacs T. Berki
f12f1d7d1e Remove the -v argument from bpglob.
Now that we have bootstrapEpoch, it's not necessary anymore.

Test: Presubmits.
Change-Id: If36cf3c8f71c1023003f408b4e799bbbdba6fa27
2021-11-04 11:48:43 +01:00
Colin Cross
64310fcea0 Move bpglob out of ToolDir am: 37d151ff95
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1875757

Change-Id: Ie1f43f637177a9d0667f6d59ce9ab0e820d809bb
2021-11-02 21:06:54 +00:00
Trevor Radcliffe
d14f342fa6 Change bpdoc to separate entries with the same type
Presently, entries in the Soong reference docs that
share the same type are condensed into a single entry.
This is very unintuitive, so this change removes that
functionality.

Fixes: 204441523
Test: bpdoc_test.go
Test: build and compare Soong docs
Change-Id: Ic03891a8a7a29b5f7ee58c01b2fa05a0c27e0a2b
2021-11-02 15:59:48 +00:00
Colin Cross
37d151ff95 Move bpglob out of ToolDir
ToolDir is going to become unstable when switching between KatiEnabled
and Soong-only builds while the duplication between out/soong/host and
out/host is resolved.  bpglob gets executed very early during bootstrap,
before the primary builder has run to update the paths to match the
current configuration.  Move it into SoongOutDir() so that its path
is more stable.

The copy of bpglob in ToolDir is still used when bpglob is used by the
primary builder through bootstrap.GlobFile.

Bug: 204136549
Test: m nothing
Change-Id: Ida51997b6408d7c265f3ba343278e5e2968467d3
2021-11-01 22:54:02 -07:00
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
10ef8ee70c Merge "bpdocs for struct types created using reflection" am: 87fd4b11af am: 8c25febaf9 am: 678e2ea12b
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1820757

Change-Id: Ide155fbc4b2a982177f4082d6a27d05ddc9bd675
2021-09-21 20:46:57 +00:00
Spandan Das
678e2ea12b Merge "bpdocs for struct types created using reflection" am: 87fd4b11af am: 8c25febaf9
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1820757

Change-Id: I13b14dd9c9a56ac8a946b4c0a04f64d510098764
2021-09-21 20:34:25 +00: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