Commit graph

1979 commits

Author SHA1 Message Date
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
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
455adcb019 Merge "Document that blueprint:"mutated" properties are skipped." am: 9fd2ed93df am: 7cf283232e am: bd3c584db6
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1823195

Change-Id: Id3e35e8e3973df2e13d58717ebc58a7f7cb969e5
2021-09-10 11:03:32 +00:00
Martin Stjernholm
bd3c584db6 Merge "Document that blueprint:"mutated" properties are skipped." am: 9fd2ed93df am: 7cf283232e
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1823195

Change-Id: Ia746ffd8b5d1aaecccc6c0faef672bc19113d7cd
2021-09-10 10:48:41 +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
30a238a106 Merge "[LSC] Add LOCAL_LICENSE_KINDS to build/blueprint" am: b3ba44c8d3 am: 23621090db am: 2e6b19831c
Original change: https://android-review.googlesource.com/c/platform/build/blueprint/+/1822217

Change-Id: I8cf201aa786b61c17e7b07ad2d2ac89ed2857fb9
2021-09-09 22:48:38 +00:00