Commit graph

13 commits

Author SHA1 Message Date
Joe Onorato
749c1955a2 ALLOW_RULES_IN_PRODUCT_CONFIG
If ALLOW_RULES_IN_PRODUCT_CONFIG is set, pass it to kati via
.KATI_ALLOW_RULES, to issue warnings or errors about rules
during product configuration.

Test: CHECK_FOR_RULES=true ./build/make/tools/product_config/test.sh
Test: ALLOW_RULES_IN_PRODUCT_CONFIG=error m nothing
Test: ALLOW_RULES_IN_PRODUCT_CONFIG=warning m nothing
Test: m nothing
Change-Id: I35dd9ffe4ec71f97beaa8b8a2f10d80502088af2
2021-02-23 22:40:39 -08:00
Joe Onorato
38a57bf1df Generate FlatConfig objects from GenericConfig objects.
Doesn't include tests. More of those will come later.

Test: build/make/tools/product_config/test.sh
Change-Id: Icd2b455ac5f7b4773ba332fc40e994dc6f024f1b
2021-02-22 17:18:07 -08:00
Joe Onorato
2590206000 Move VarType out of its respective outer classes.
It's used more than I originally thought it would be and it's
unnecessarily nested.

Test: rm -rf out/config/ && m product-config-test product-config && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar && time ( product-config --ckati_bin /source/kati/ckati > ~/Desktop/out.txt )
Change-Id: Id5a075863151e37ec60e5d9dbeb817c2df245bc7
2021-02-21 14:33:33 -08:00
Joe Onorato
64f3db2ec1 Keep the first and last snapshot of variables.
So we can compare our reconstruction of the variable state.

Test: treehugger
Change-Id: I9c1995f8969dcf95256aa7c05a01d0431e36caa2
2021-02-17 10:02:41 -08:00
Joe Onorato
8523601ce9 Generate GenericConfig objects from MakeConfig objects.
Applies heuristics to the sequence of Blocks to do so.

Test: rm -rf out/config/ && m product-config-test product-config && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar && time ( out/host/linux-x86/bin/product-config --ckati_bin /source/kati/ckati > ~/Desktop/out.txt )
Change-Id: Id6763781bc876e2b2e0be320a7259c1ed41c2334
2021-02-17 10:02:41 -08:00
Joe Onorato
f20c93afa3 Emit and parse the product config variables from kati/make
Test: cls && rm -rf out/config/ && m product-config-test product-config && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar && time ( product-config --ckati_bin /source/kati/ckati > ~/Desktop/out.txt )
Change-Id: I52e5c07f9aaf899f9d45680313275c6d9e246ff2
2021-02-17 10:02:41 -08:00
Joe Onorato
9de9652582 Add class to fork and exec kati, based on the commandline option given.
Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: I4706e32ff7ac4424b6835b94fef40a2c838f8492
2021-02-17 10:02:41 -08:00
Joe Onorato
7c01d47c9a Add a CSV parser to parse the output from kati.
(Yet another class that would be great for android to have in a host
tools library)

Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: I7d74b2265393e4f340729ca5ba82d1ec92a20f85
2021-02-17 10:02:41 -08:00
Bob Badour
0390580262 [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  target/product/sysconfig/Android.bp
  tools/apicheck/Android.bp
  tools/product_config/Android.bp
  tools/releasetools/Android.bp
  tools/signapk/Android.bp
  tools/signtos/Android.bp
  tools/zipalign/Android.bp
  tools/ziptime/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-GPL-2.0 SPDX-license-identifier-LGPL
    SPDX-license-identifier-MIT legacy_not_a_contribution
    legacy_restricted
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-GPL
    SPDX-license-identifier-MIT
to:
  tools/Android.bp
  tools/droiddoc/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-LGPL SPDX-license-identifier-MIT
to:
  core/base_rules.mk
  core/dex_preopt_libart.mk
  core/package_internal.mk

Added SPDX-license-identifier-Apache-2.0 legacy_not_a_contribution
to:
  target/board/Android.mk

Added legacy_restricted
to:
  core/tasks/tools/package-modules.mk
  target/product/gsi/Android.bp
  target/product/gsi/Android.mk
  target/product/security/Android.bp
  target/product/security/Android.mk
  tools/acp/Android.bp
  tools/atree/Android.bp
  tools/fs_config/Android.bp
  tools/fs_config/Android.mk
  tools/fs_get_stats/Android.bp
  tools/libhost/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Id67a4eb1312940f999643b2ae57f45f34f120724
2021-02-14 10:37:20 -08:00
Joe Onorato
0c7e0c0e3c Rearrange the methods on ErrorReporter to be more convenient.
Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: Icd25d2d0897df99ba29de52cd08a42cd9e4b9514
2021-01-22 10:37:44 -08:00
Joe Onorato
6edf0ec2ed Add glue to run product-config-test as a standalone commandline executable.
Test: m product-config-test && java -jar out/host/linux-x86/testcases/product-config-test/product-config-test.jar
Change-Id: I39ef10b076eec3a313de23cab0202349b1bce799
2021-01-22 10:35:36 -08:00
Joe Onorato
a5dbb0a8f6 CommandException to cleanly exit product-config on error.
Test: none
Change-Id: I06bb80fe1cc21d77ca3e32ac3110a08fc8b5af54
2021-01-22 10:35:36 -08:00
Joe Onorato
841c3e3ea6 Add skeleton for product-config tool.
There's also a bunch of boilerplate error handling and option parsing
stuff that I wish someone would put into a library that's available to
the android tree.

Test: atest product-config-test
Change-Id: Ieebcc7bd47a8644d1374fb02c146e9038859f4a2
2021-01-21 12:38:04 -08:00