Commit Graph

192 Commits

Author SHA1 Message Date
Pete Gillin a1c9e9da55 Remove support for EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9.
Prior to this change, setting that to "false" turned the default Java
language level back to 8. This change removes that option.

Bug: 115604102
Test: m java droid docs tests cts
Change-Id: I97bfd0dc8d941008b4071c6efe1c0c24950c4f1f
2019-10-25 16:55:06 +01:00
Pete Gillin 1f52e93db2 Add experimental option to use OpenJDK 11 toolchain.
With this change, setting the environment variable
EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN=true switches from the OpenJDK 9
toolchain to the OpenJDK 11 one (prebuilts/jdk/jdk11).

Since the version of the java.base module has to match the version of
the jlink tool which consumes it, the --module-version argument to the
jmod create call is also switched.

Test: make
Test: EXPERIMENTAL_USE_OPENJDK11_TOOLCHAIN make
Bug: 131683177
Change-Id: I606d22538165f309fe5537bd67a26390b1dd5771
2019-10-09 18:38:14 +01:00
Colin Cross 6617b6d624 Merge "Use prebuilts for more tools in unbundled builds" 2019-09-09 17:21:44 +00:00
vichang adf1a128b0 Merge "Add new core-icu4j after separating icu4j from core-libart"
am: dfee9b4364

Change-Id: Ia46581e56d89d19e06511f9df6eedf8a5ea0d785
2019-08-12 09:11:38 -07:00
Colin Cross bdf9514e45 Use prebuilts for more tools in unbundled builds
Move the logic from Make that uses prebuilts for more tools for
unbundled builds, and export the values back to make.

Test: m checkbuild
Change-Id: I8c7031e0feaa9328a2b73db6dc8e63e12d1d12f7
2019-08-08 12:56:34 -07:00
Victor Chang 07b5b4cdb8 Add new core-icu4j after separating icu4j from core-libart
Bug: 138994281
Test: m droid
Change-Id: I1e9fe3e344dcdde14fe4880a19440c5085c092e5
2019-08-08 16:02:02 +01:00
Sasha Smundak 61272795a7 Merge "Support source code cross-referencing for C++ and Java"
am: 247de68b89

Change-Id: I5284d9be9865e95671ce8ec1927f74059f7fdf44
2019-07-29 18:13:05 -07:00
Sasha Smundak 2a4549ec98 Support source code cross-referencing for C++ and Java
Use Kythe (https://kythe.io) to build cross reference for the Android
source code. ~generate the input for it during the build. This is done
on demand: if XREF_CORPUS environment variable is set, build emits a
Ninja rule to generate Kythe input for each compilation rule. It
also emits two consolidation rules (`xref_cxx` and `xref_java`),
that depend on all Kythe input generation rules for C++ and Java.

The value of the XREF_CORPUS environment variable is recorded in the
generated files and thus passed to Kythe. For the AOSP master branch it is
`android.googlesource.com/platform/superproject`, so the command to build
all input for Kythe on that branch is:
```
XREF_CORPUS=android.googlesource.com/platform/superproject m xref_cxx xref_java
```

Each Kythe input generation rule generates a single file with .kzip
extension. Individual .kzip files have a lot of common information, so
there will be a post-build consolidation step run to combine them.
The consolidated .kzip file is then passed to Kythe backend.

The tools to generate .kzip files are provided by Kythe (it calls them
'extractors'). We are going to build them in toolbuilding branches
(clang-tools and build-tools) and check them in as binaries into master
and other PDK branches:
For C++,  `prebuilts/clang-tools/linux-x86/bin/cxx_extractor`
for Java, `prebuilts/build-tools/common/framework/javac_extractor.jar`

Bug: 121267023
Test: 1) When XREF_CORPUS is set, build generates Ninja rules to create
.kzip files; 2) When XREF_CORPUS is set, building
`xref_cxx`/`xref_java` creates .kzip files; 3) Unless XREF_CORPUS is
set, build generates the same Ninja rules as before

Change-Id: If957b35d7abc82dbfbb3665980e7c34afe7c789e
2019-07-26 09:16:47 -07:00
Colin Cross a373a94fc0 Merge changes Ic2a585ea,I11ccabc4,Icc932c4a,I020556c7,I08713e91
am: ed9a92c311

Change-Id: I0367335939181566063b777184e864a7afb02308
2019-07-22 14:04:58 -07:00
Colin Cross 33961b54e6 Convert droidstubs to android.RuleBuilder
The droiddoc rules are ripe for converting to android.RuleBuilder,
they conditionally use many input files which is hard to track
with the standard blueprint.Rule style, as the argument and the
dependency have to be handled independently.  Start converting
to android.RuleBuilder by converting the droidstubs module.

Test: m docs
Test: m checkapi
Test: m updateapi
Change-Id: I08713e91149471e88a40115f69824cf5eaf88fb6
2019-07-18 14:28:14 -07:00
Sasha Smundak e26ae3f2bf Merge "Tune invocations and print full diagnostics on crash for d8 and r8."
am: a89cf59a4f

Change-Id: I9afd4b5af3119e57bbd21ed1e42c340ca35d1962
2019-07-10 13:45:01 -07:00
Sasha Smundak ee5c60384f Tune invocations and print full diagnostics on crash for d8 and r8.
Bug: 132766811
Test: treehugger
Change-Id: Id6943008e65b9dc3479e8758445e8d679529a8cb
2019-07-09 11:26:20 -07:00
Dan Willemsen ebb0478869 Merge changes If25be604,I0a310229,I44155630 am: 42d33779cd
am: f32716e448

Change-Id: I08a9a38e59896cbec930d6087f96eaa9b327d4cc
2019-06-14 01:29:49 -07:00
Treehugger Robot 42d33779cd Merge changes If25be604,I0a310229,I44155630
* changes:
  Add another jar used by kotlinc
  Actually depend on the headers from renderscript
  Fix a few missing dependencies in APEX building
2019-06-13 17:40:01 +00:00
Dan Willemsen 1cfbdbe1b2 Add another jar used by kotlinc
Bug: 130111713
Test: treehugger
Change-Id: If25be6047625cec4ed9802142876cfd8e9ccd3eb
2019-06-13 05:22:03 +00:00
Alexander Smundak c98ec46440 Merge "Tune JVM, print full diagnostics on crash." am: 90aa101152
am: 8975b8f376

Change-Id: I85865160062d8ced76a239e9e5becbeff92227c9
2019-06-12 09:06:07 -07:00
Sasha Smundak 26c6d9e9fb Tune JVM, print full diagnostics on crash.
JVM occasionally (0.5% time) crashes on entering a method with SIGSEGV.
It might be due to excessive load on the host machine. Reduce the number
of the compiler threads to 6, and do not start all the GC threads
immediately. If JVM crashes, copy full diagnostics to stderr.

Bug: 132766811
Test: treehugger
Change-Id: Ib7bfd568f6d32456bf623cbb615ffc990c326a34
2019-06-11 13:30:13 -07:00
Jimmy Chen cc4923a063 Merge "Revert "Revert "Revert "Print full diagnostics file when Java process crashes."""" am: 7c9689f7b7
am: 3e0d465e8b

Change-Id: I378ddb41a37ef4274b11e97823e4495cf0536480
2019-06-05 03:17:18 -07:00
Treehugger Robot 7c9689f7b7 Merge "Revert "Revert "Revert "Print full diagnostics file when Java process crashes."""" 2019-06-05 09:53:22 +00:00
Jimmy Chen e88eaa7db7 Revert "Revert "Revert "Print full diagnostics file when Java process crashes."""
This reverts commit b4be092855.

Reason for revert: break build

Change-Id: I11fc5eb5f635a5d99eba962f5817851629e50ab2
2019-06-05 06:47:11 +00:00
Alexander Smundak 8d08aa2cdc Merge "Revert "Revert "Print full diagnostics file when Java process crashes.""" am: 22d3d6ba5c
am: 439ef91ee5

Change-Id: Ibd71d3e71449330b3cdd3d9505eeea0c8bf0f9cc
2019-06-04 17:51:29 -07:00
Treehugger Robot 22d3d6ba5c Merge "Revert "Revert "Print full diagnostics file when Java process crashes.""" 2019-06-04 17:16:10 +00:00
Alexander Smundak b4be092855 Revert "Revert "Print full diagnostics file when Java process crashes.""
This reverts commit d71dc6b5e0.

Reason for revert: ag/974065 fixes the problem that caused the revert

Change-Id: I3ba9eecdab34602aaf19fa518520ac932c9b97af
2019-06-03 16:53:22 +00:00
Alexander Smundak 2ca7d3ca58 Merge "Revert "Print full diagnostics file when Java process crashes."" am: d5dd534465
am: 62459d6586

Change-Id: Ibd9278cfcf0f20e3188da07d2cc6e61eb5bba50f
2019-05-31 02:56:34 -07:00
Treehugger Robot d5dd534465 Merge "Revert "Print full diagnostics file when Java process crashes."" 2019-05-31 09:37:36 +00:00
Alexander Smundak d71dc6b5e0 Revert "Print full diagnostics file when Java process crashes."
This reverts commit 9d6df2246c.

Reason for revert: This change set the value of JAVA make variable to a string containing "foo bar". When soong_ui is asked to evaluate such string, it drops the quotes, causing bash to treat 'foo' and 'bar' as separate command line arguments.

Change-Id: If4e3c4c950c305bb67a572de3d86119c2da81dc1
2019-05-31 03:15:55 +00:00
Sasha Smundak 9040ad7d49 Merge "Print full diagnostics file when Java process crashes." am: 7b1ca80579
am: 534d99369c

Change-Id: If3406f23f2f8048ed0872fd1b071fac31b138ec3
2019-05-30 14:43:10 -07:00
Treehugger Robot 7b1ca80579 Merge "Print full diagnostics file when Java process crashes." 2019-05-30 21:16:52 +00:00
Sasha Smundak 9d6df2246c Print full diagnostics file when Java process crashes.
Bug: 132766811
Test: treehugger
Change-Id: I8cca2486f2194a8643007a53e4a695d2a18abbf8
2019-05-29 17:46:22 -07:00
Colin Cross 67999a12d5 Merge changes If15abf79,Iaae177ef am: ff3f43857f
am: 45cc967424

Change-Id: I4b322e79f5177131cd35ae7b943a008fa26c95e2
2019-05-28 09:58:26 -07:00
Colin Cross 7211910fd0 Add manifest_check tool
Add a tool that can check that the <uses-library> tags in an
AndroidManifest.xml file match a list provided by the build.

Bug: 132357300
Test: manifest_check_test
Change-Id: If15abf792282bef677469595e80f19923b87ab62
2019-05-24 13:43:27 -07:00
Colin Cross 4af387c20e Move manifest_fixer to a python_binary_host module
In preparation for making it use multiple files so that some
implementation can be shared with a new tool.

Also make manifest_fixer_test a python_test_host, and add it
to TEST_MAPPING.

Test: m checkbuild
Change-Id: Iaae177efcb978187b126d90359b82cdfd3176857
2019-05-24 13:43:19 -07:00
Dan Willemsen 868e299039 Merge changes I2bff8fb8,Ifa584479 am: cb4e0551a2
am: 787b999bc0

Change-Id: Idbc987afbaf1fcc183629431a745c9ae41bb215f
2019-04-09 18:26:03 -07:00
Dan Willemsen aad19605c5 Add extra used dependencies
Found while executing the build actions remotely.

Bug: 130111713
Test: treehugger
Test: run actions remotely with given dependencies, they pass.
Change-Id: I2bff8fb8ccf50fde446d6bcef0f1dca9b2974b4b
2019-04-09 09:50:25 -07:00
Vladimir Marko d20a62f8e1 Check package restrictions for Java libs. am: 0975ee0de3
am: f81df9115f

Change-Id: I36ba3c8a96b0e566f79babf213e13737018bcb0c
2019-04-08 13:21:52 -07:00
Vladimir Marko 0975ee0de3 Check package restrictions for Java libs.
Test: m checkbuild; inspect verbose log.
Test: Manual - compile with unmet restrictions.
Bug: 122937705
Change-Id: I9360ae8b6d9ce016b7827be5e8ffc6eb521809b7
2019-04-08 14:02:14 +01:00
Adam Vartanian 1aad9078a2 Merge "Add Conscrypt to coverage" am: 36c70bcfcb am: cecf06a088
am: 637c287938

Change-Id: I082f23363577177ac00ee8f706eee0a9d960c986
2019-03-20 10:48:37 -07:00
Adam Vartanian fa62cfc2aa Add Conscrypt to coverage
Bug: 73156932
Test: manual coverage run
Change-Id: I20dc1595ba55d8425bf16770c1f2e6e4fa8bffae
2019-03-13 13:46:14 +00:00
Colin Cross 513b76d51f Update manifest merger to use binary am: 87ecbfe107 am: d8f3e6f5d4
am: 867b1daec4

Change-Id: I72f9f76865d19495cb340adcf5244e8c7f2f8a38
2019-03-04 14:24:58 -08:00
Colin Cross 87ecbfe107 Update manifest merger to use binary
Manifest merger is now a java_binary instead of a collection of jars,
it can use the single binary as the dependency.

Bug: 112607039
Test: m checkbuild
Change-Id: Iea6c97c99a3bb09952fed2b25437b644f4e863f8
2019-03-04 22:02:01 +00:00
Colin Cross 148a568ad9 Optimize CPU time when running d8 and r8 am: 6db4d4e613 am: f334ea833f
am: e6c2c1313c

Change-Id: I3a6b7ec5ca04250ec7e0e333ef64d9cfe6133553
2019-03-01 07:51:29 -08:00
Colin Cross 6db4d4e613 Optimize CPU time when running d8 and r8
Pass -XX:+TieredCompilation -XX:TieredStopAtLevel=1 to the JVM to
reduce the time spent JITing, which in local experiments reduced
the CPU time of R8 while increasing the wall time, and reduced the
total number of runnable threads.

Without the new flags:
$ time out/soong/host/linux-x86/bin/r8-compat-proguard -injars out/target/common/obj/APPS/Dialer_intermediates/classes.jar ...
real	0m30.090s
user	4m35.337s
sys	0m12.853s

With the new flags:
$ time out/soong/host/linux-x86/bin/r8-compat-proguard -JXX:+TieredCompilation -JXX:TieredStopAtLevel=1 -injars out/target/common/obj/APPS/Dialer_intermediates/classes.jar ...
real	0m35.674s
user	2m45.135s
sys	0m9.531s

The increase in wall time should be offset by the better parallelism from
the reduced CPU time.

Bug: 119270658
Test: m checkbuild
Change-Id: I8fc78b5ef1f8c6f51fd97a29461b96ae2b35cada
2019-03-01 15:28:19 +00:00
Paul Duffin 4ea7fb7c07 Merge changes Ib0389900,Ib2d69dea am: e28d0c0ff3 am: 7204ec83ef
am: 1a5d25499a

Change-Id: I5b2ce79790b12fab360339faba6f7ef548eb961a
2019-03-01 01:23:21 -08:00
Paul Duffin d2acecaeb7 Improve hiddenapi processing so it does not require white list
Rather than have a special white list to contain the names of modules
that provide additional hiddenapi for modules on the bootclasspath
this defines a convention that such modules must have a name which is
of the format <x>-hiddenapi, where <x> is the name of the module on the
bootclasspath.

Bug: 73711752
Test: make droid && flashall -w && atest -p cts/tests/signature
Change-Id: Ib2d69dea9541b60a9bb81496f00edb65036d1ebb
2019-02-28 16:13:20 +00:00
Paul Duffin 3a006cd771 Merge "Revert "Support libraries (not just boot jars) that have hiddenapi"" am: 724c5fd813 am: 4a33f24c2c
am: 927fba9706

Change-Id: I6c71b9199fe2d98dbcef61faaa7d00475cd6098a
2019-02-28 05:43:38 -08:00
Paul Duffin c02e834ad6 Revert "Support libraries (not just boot jars) that have hiddenapi"
This reverts commit e5b5657f87.

The reverted change was added in order to gather the information about
the hiddenapi that is needed for the runtime to enforce the hiddenapi
accessibility rules. Without it the build broke with the following
error when the android.test.base library was not in the
PRODUCT_BOOT_JARS list:

AssertionError: Error processing: frameworks/base/config/hiddenapi-greylist.txt
The following entries were unexpected:
  Ljunit/framework/TestSuite;->isPublicTestMethod(Ljava/lang/reflect/Method;)Z
  Landroid/test/AndroidTestCase;->setTestContext(Landroid/content/Context;)V
  Landroid/test/InstrumentationTestCase;->runMethod(Ljava/lang/reflect/Method;I)V
  Landroid/test/AndroidTestCase;->getTestContext()Landroid/content/Context;
  Ljunit/framework/TestCase;->fName:Ljava/lang/String;
  Ljunit/framework/TestSuite;->isTestMethod(Ljava/lang/reflect/Method;)Z
  Please visit go/hiddenapi for more information.

However, it turns out that the runtime does not currently enforce
access to the hiddenapi of libraries that are not on the
PRODUCT_BOOT_JARS list. Gathering hiddenapi information for a library
not on the PRODUCT_BOOT_JARS list breaks the
CtsHiddenApiBlacklistApi27TestCases and
CtsHiddenApiBlacklistApi28TestCases test modules which use that
information to ensure that correct runtime behavior.

This change is being reverted simply because it does not work.

Bug: 126519737
Bug: 73711752
Test: make REMOVE_ATB_FROM_BCP=true droid and make droid
Change-Id: I1b4a7786b1061effa0e2d37832afa8570953a06e
2019-02-27 12:49:21 +00:00
Paul Duffin 6e48ec715c Merge "Support libraries (not just boot jars) that have hiddenapi" am: f854d3e4be am: 31d68763ad
am: 919d0e7e5a

Change-Id: I9b17d19f5ae8d65a572463555c8cbae6b1c2d32c
2019-02-18 04:34:39 -08:00
Paul Duffin e5b5657f87 Support libraries (not just boot jars) that have hiddenapi
The build assumes (apart from one minor exception) that only modules
that are in the PRODUCT_BOOT_JARS list require processing as part of
the hiddenapi. Unfortunately, that is not true for android.test.base,
at least not when REMOVE_ATB_FROM_BCP=true.

This change adds a white list (containing android.test.base) of
additional modules that should be processed as part of the hiddenapi
and updates the hiddenapi.go file to use it.

It does not matter that android.test.base is a boot jar and in the
white list, the behavior is the same as it would be if it was only
in one.

Bug: 73711752
Test: make REMOVE_ATB_FROM_BCP=true droid and make droid
Change-Id: I1c64272f444e6866136c65fb7c48910d55811844
2019-02-15 14:35:30 +00:00
Colin Cross 28825f0e41 Merge changes from topic "hiddenapi" am: 4c3a4aded3 am: 19807e619e
am: ab9bfa1617

Change-Id: I148138a6723926af54620c6ce3379fdb61ed9e08
2019-02-07 00:09:49 -08:00
Colin Cross f24a22a98a Move hiddenapi singleton rules to Soong
Move the rules that build hiddenapi-stubs-flags.txt,
hiddenapi-flags.csv and hiddenapi-greylist.csv into Soong.

Bug: 123645297
Test: m checkbuild
Test: m UNSAFE_DISABLE_HIDDEN_API_FLAGS=true
Change-Id: I90bf58710f6153ee8565994f799d3ec5699bc7fa
2019-02-06 11:23:40 -08:00
Insun Kang 234338609b Add updatable_media_stubs to prevent private API use.
Bug: 123551910, Bug: 123253805
Test: build
Change-Id: Id46ff05fa01db726d613ee2299b0c27921c88aae
2019-01-31 13:12:39 -08:00
Colin Cross afbb1734f6 Pass annotation processors to kotlinc
Enable the kotlin-annotation-processing plugin and pass annotation
processors to it.

Bug: 122251693
Test: m checkbuild
Test: TestKapt in kotlin_test.go
Change-Id: I841df454beaaa7edd263eea714ca0d958a03c9de
2019-01-22 21:47:19 +00:00
Colin Cross 8faf8fc060 Move hiddenapi to Soong
Perform hiddenapi CSV generation and dex encoding for Soong modules
in Soong.  This fixes an issue where dexpreopting was happening on
a different jar than was being installed.

Bug: 122856783
Test: m checkbuild
Test: no change out/target/common/obj/PACKAGING/hiddenapi-flags.csv
Test: only ordering change to out/target/common/obj/PACKAGING/hiddenapi-greylist.csv
Test: cts/tests/signature/runSignatureTests.sh
Change-Id: I4fc481efc29e73cb2bdaacf672e86d5f6f0075ae
2019-01-17 22:19:28 +00:00
Neil Fuller 9b0d1f47fa Remove references to core-simple
core-simple was a demonstration jar and is being removed.

Bug: 119301609
Test: build
Change-Id: Ieb5e12ce0ce96f597da92660ea83dbf0e1860edb
2019-01-14 16:01:01 +00:00
Colin Cross 43f08db29e Dexpreopt soong modules inside soong
Port the dexpreopt logic from Make to the dexpreopt package in Soong,
and use it to dexpreopt Soong modules.  The same package is also
compiled into the dexpreopt_gen binary to generate dexpreopt scripts
for Make modules.

This relands Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb and
I462182638bd57b1367b5bfb0718e975c11ae66f7, along with multiple fixes
to depsfile generation in dexpreopt_gen that caused .odex files for
modules in defined make to be missing dependencies on boot.art, and
a fix to not dexpreopt and strip tests.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Test: OUT_DIR=$PWD/out m
Test: NINJA_ARGS="-t deps out/target/product/sailfish/obj/APPS/Contacts_intermediates/dexpreopt.zip" m
Change-Id: I6bb2c971cee65d2338839753aa0d84939f335b1b
2018-12-15 19:07:54 -08:00
Colin Cross 4ff85ebeb7 Revert "Dexpreopt soong modules inside soong"
This reverts commit 29ff88741e.

Test: none
Bug: 119412419
2018-12-14 11:49:58 -08:00
Colin Cross 29ff88741e Dexpreopt soong modules inside soong
Port the dexpreopt logic from Make to the dexpreopt package in Soong,
and use it to dexpreopt Soong modules.  The same package is also
compiled into the dexpreopt_gen binary to generate dexpreopt scripts
for Make modules.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb
2018-12-13 15:53:54 +00:00
Zoran Jovanovic 8736ce29e8 Enable kotlinc flags in blueprint files
Add support for adding kotlinc files in the module.

Some flags are unnecessary as they are added by
default (-no-jdk and -no-stdlib), or are not needed
on an Android build (-include-runtime), or may
conflict with the build (-kotlin-home and
-Xintellij-plugin-root), so the error stops the
build if they are added.

Test: part of java/java_test.go
Change-Id: If3b2777062daaa490a20c014e9b1bb4b1cb0a8df
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sony.com>
2018-11-14 15:02:46 +00:00
Neil Fuller bf210f7ea3 Build platform with core library stubs by default
Switch targets that don't explicitly specify an sdk_version
to using core.platform.api.stubs instead of the core library
implementations.

Note: the old core-oj target contained the source for
core-lambda-stubs too. The new core.platform.api.stubs
does not contain core-lambda-stubs so it is explicitly
added to the boot classpath list as part of the switch over.

Bug: 113148576
Test: build
Change-Id: I689d2127f6b69b4a7034fb96f3d9cf714f801794
2018-10-12 22:41:00 +01:00
Neil Fuller 1fee9f3dd0 Include all core libs in default boot classpath
To migrate the default compilation over to using
"core platform api" stubs we need to make the "before"
state as close to the "after" state as possible.

The stubs will include all "core libraries" so it
makes sense to include those that contribute to the
"core platform api": okhttp, bouncycastle and conscrypt.

(apache-xml is not included because it doesn't contribute
to the core platform API).

After this change all explicit dependencies to okhttp,
bouncycastle and conscrypt in situations where the
default boot classpath is used can be removed.

A knock-on of this change is that the conscrypt, bouncycastle
and okhttp targets need to be adjusted to explicitly
depend on core-oj / core-libart with no_standard_libs: true
to avoid a cycle.

Bug: 113148576
Test: treehugger
Change-Id: I1677af8d9d48fd026874ebce4c864f39ec1a5a3d
2018-10-10 08:42:12 +00:00
Nan Zhang 4c819fb590 Add jetifier support in Soong.
This is a blocker for droiddoc targets migration under vendor/.

Test: N/A
Bug: b/72552006
Change-Id: If85a0917c1ac0d88b9d5b488216a638b4dabd39f
2018-08-29 11:37:32 -07:00
Neil Fuller 6095259f5b Track changes to add core-simple to the boot cp
See the change in build/make for details.

Bug: 113148576
Test: make checkbuild / Treehugger
Change-Id: I6f7901642c6b907b1e8e9dd31ced3bf1ea6dfd4d
2018-08-28 13:16:19 +01:00
Nan Zhang 86d2d55ade Support Dokka in Soong.
Metalava is supposed to treat all the args after
"--generate-documentation" as either Javadoc or Dokka commands, and it starts
 seperate process to invoke javadoc or java -jar dokka...

Dokka doesn't support --bootclasspath in its args, so treat all the
bootclasspath as classpath.

Also continue to refactor code to seperate Dokka runs from Javadoc or
Metalava.

Test: m -j metalava-dokka-core-docs
Bug: b/72394196
Change-Id: I0f0f3dd80cb2dbb53f19da8fa11ae0b1d92ac5d7
2018-08-10 13:37:24 -07:00
Colin Cross cfae5a6e2c Use manifest merger in Soong
Move the manifest merger config to Soong, and use it to merge
manifests of static dependencies of android_library and android_app
modules.

Bug: 110848854
Test: m checkbuild
Change-Id: Ib89e1f1a52a8b76157e4e0348baf42800412df0d
2018-07-11 05:52:26 +00:00
Colin Cross 7a5fe2bb7e Merge "Always use OpenJDK9 for building"
am: 5c733856bd

Change-Id: Ica65b1cc467db3bd5223aa1dd017e31728f93ca2
2018-06-21 14:56:43 -07:00
Colin Cross 5711acde4d Merge "Run ErrorProne in OpenJDK9"
am: 8eb0ad15bf

Change-Id: Ia4ceec4cc2fcb4bdd8565230d74bdb0cf972b89a
2018-06-21 13:57:26 -07:00
Colin Cross 997262f506 Always use OpenJDK9 for building
Remove support for compiling with javac from OpenJDK8.
We still target 1.8 by default, and OpenJDK8 prebuilts are still
required for the bootclasspath and running robolectric.

Bug: 38418220
Test: m java
Change-Id: I5686deb0ae4f9927192a039d08adc0117b2605dd
2018-06-21 12:25:50 -07:00
Colin Cross 6654810f37 Run ErrorProne in OpenJDK9
Use the OpenJDK9 javac to run ErrorProne by adding it to
-processorpath and using -Xplugin:ErrorProne.

Bug: 69485063
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I0496006b71b70766ef16d57753cbcf037897799c
2018-06-20 21:03:16 -07:00
Colin Cross 3b20009ae0 Merge "Add a script to inject values into manifests"
am: f269dbee54

Change-Id: I4bd044917c098d15c8b394c3e7413004c003261b
2018-06-15 22:42:49 -07:00
Colin Cross 8bb10e8f8a Add a script to inject values into manifests
Add a script that can inject a <uses-sdk minSdkVersion=""> into
AndroidManifest.xml files.  This will help with merging
LOCAL_STATIC_ANDROID_LIBRARIES, because ManifestMerger treats
a missing minSdkVersion as minSdkVersion=1 and throws errors
if libraries use a larger minSdkVersion.  It will also help
with cases where an app has a manifest that specifies an old
minSdkVersion, but the build system is compiling the app in
a way that is not compatibile with old devices, for example
using a newer dex format.

Bug: 110167203
Test: m java
Test: build/soong/scripts/manifest_fixer_test.py
Change-Id: I528d71a225feb86464c530e11b223babb0ea9edf
2018-06-14 14:54:27 -07:00
Colin Cross 7a72575d6d Merge "Revert "Revert "Remove desugar support""" am: 38462a6881
am: 216c4c8a7a

Change-Id: I4f148400379525f68e9f116ddcdb4b4ee36910a1
2018-06-07 15:49:11 -07:00
Andreas Gampe 331efc81ca Merge "Soong: Update for explicit warning change" am: 8a9f5da905
am: 24de8d76cd

Change-Id: I33918e5766d798a56c77b236a3e18041e231d0b7
2018-06-07 15:36:57 -07:00
Treehugger Robot 38462a6881 Merge "Revert "Revert "Remove desugar support""" 2018-06-07 20:31:22 +00:00
Treehugger Robot 8a9f5da905 Merge "Soong: Update for explicit warning change" 2018-06-07 19:55:54 +00:00
Andreas Gampe 05f08543d3 Soong: Update for explicit warning change
Add ErrorProneChecksWarning.

Bug: 72971960
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I92169ed4aa8e7dc52b84ddb005cd07e2bf6dcbe2
2018-06-06 16:38:45 -07:00
Colin Cross 0b16af4039 Merge "Revert "Remove desugar support"" am: 7302905413
am: ecf35d00ea

Change-Id: Ib829111904db2eeb3ec19b2d59c0c7bfe331b505
2018-06-06 16:26:14 -07:00
Colin Cross d4bf7d9f89 Merge "Remove desugar support" am: 0d39cb1179
am: 406aa5fa90

Change-Id: I9555559eacb92cf0e7e89bf787b15967f748e327
2018-06-06 15:24:46 -07:00
Colin Cross bafb897de7 Revert "Revert "Remove desugar support""
This reverts commit 7576916efc.

Reason for revert: includes art veridex fix this time

Change-Id: Ia8da00b5ec8ed3dc3ce2a2521f0a7b2b2b131960
2018-06-06 21:46:32 +00:00
Colin Cross 7576916efc Revert "Remove desugar support"
This reverts commit 000280bb0e.

Reason for revert: broke art veridex build

Change-Id: I9f7d7cdbe8e34671614687ac0b34c0338ef240e7
2018-06-06 21:42:39 +00:00
Colin Cross 000280bb0e Remove desugar support
Desugaring is always handled by d8 now.

Test: m checkbuild
Change-Id: I29e8f68e51b194a4090866acc63f19f0605e318d
2018-06-06 10:05:06 -07:00
Nan Zhang 7a9601ca8a Merge "Integrate Metalava to Soong Build" am: f181bc9733
am: ca96388e60

Change-Id: I97d233a78706c2a0964f125c4978a262642b9048
2018-06-06 01:16:41 -07:00
Nan Zhang 79614d1c14 Integrate Metalava to Soong Build
Test: Manually checked-in prebuilt metalava.jar to my local src tree and
      compare the doclava based api file and metalava based api file.
Bug: b/78245848

Change-Id: Ib434f1e15403a78a0ccf89d9aacb70a6f8b05b2b
2018-06-05 14:44:43 -07:00
Colin Cross fca70ee9af Add core-lambda-stubs to classpath am: 86a60ae6fa
am: d4ef9dd148

Change-Id: I30d8fe073e9956725d91b239138016adc52d4f0a
2018-05-30 16:00:01 -07:00
Colin Cross 86a60ae6fa Add core-lambda-stubs to classpath
Add core-lambda-stubs to the bootclasspath for modules with no
sdk_version or with sdk_version: "current", and to the classpath
for modules that specify a specific sdk_version number.  Use the
prebuilt sdk-core-lambda-stubs when using a prebuilt SDK.

Fixes compiling modules with lambdas against the SDK.

This reapplies I5e700f2dd86f1a6b84b7a55dd9bfe21a448d3fb6 with fixes
and tests for unbundled builds.

Bug: 80428539
Test: java_test.go
Change-Id: Ib7aaeebb93137270d7336a7293a08ed7064a3184
2018-05-30 16:47:00 +00:00
Colin Cross 7588ddcfca Merge "Revert "Add core-lambda-stubs to classpath"" am: 6c2e97364e
am: 0668619db7

Change-Id: I95d37c8cc23d5079e4348d176c2206c38773de57
2018-05-30 00:35:23 -07:00
Colin Cross 7cdc22edb9 Revert "Add core-lambda-stubs to classpath"
This reverts commit d9d7be0617.

Reason for revert: Broke unbundled builds.

Bug: 80428539
Change-Id: I2279dbd2b11a2f63e70ad89d0b3bc42bca2b676b
2018-05-30 05:45:09 +00:00
Colin Cross 9781882d24 Add core-lambda-stubs to classpath am: d9d7be0617
am: 417824868d

Change-Id: Ia01d156c82c29042b160e844b34e70a4450de071
2018-05-29 20:30:26 -07:00
Colin Cross d9d7be0617 Add core-lambda-stubs to classpath
Add core-lambda-stubs to the bootclasspath for modules with no
sdk_version or with sdk_version: "current", and to the classpath
for modules that specify a specific sdk_version number.

Fixes compiling modules with lambdas against the SDK.

Bug: 80428539
Test: java_test.go
Change-Id: I5e700f2dd86f1a6b84b7a55dd9bfe21a448d3fb6
2018-05-29 23:47:50 +00:00
android-build-prod (mdb) 2d8ea6cd06 Merge "Apicheck Support in Soong" am: 3a621d3a86
am: 2658508416

Change-Id: I9f93d174a97cbeb23bfaa451c3e6f830e69fb74a
2018-05-08 23:09:49 -07:00
Nan Zhang 61819cef14 Apicheck Support in Soong
didn't remove the props: api_filename, removed_api_filename yet since
these two currently are used by java_sdk_library.

Bug: b/78034256
Test: m clean && m checkapi

Change-Id: Iebd014ef227487717b5b3819c80d630c34559983
2018-05-08 16:24:07 -07:00
Colin Cross 33dce942f2 Merge "Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES" am: 93b4818201
am: c368d6196c

Change-Id: Iea1fb5b38ec54ed28b6f8b3c31aba3b43ec05b98
2018-05-02 15:03:20 -07:00
Colin Cross 66f78820e1 Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES
If a static android library lib1 has static_libs: ["lib2"] then the
R.class files for packages in lib2 will be merged into the jar for
lib1.  If an app has lib1 in its static_libs it will get the R.class
files from lib2 through lib1, instead of regenerating the R.java
files with numbering that matches the resource table of the app.

Pass transtive static android library dependencies on the aapt2
command line so that aapt2 will always regenerate the R.java
constants for those packages.

Also extract the packages that have R.java files after each aapt2
invocation.  This is not necessary for Soong, but is passed to
make to let it force regenerating the packages using
--extra-packages.

Bug: 78300023
Test: m checkbuild
Change-Id: I0f3444af44d2a9f370d1f156c908972f8cc3a1ee
2018-05-02 13:11:01 -07:00
Colin Cross 01801b3f50 Merge "Replace extract-srcjars.sh with zipsync tool" am: 21f8080d86
am: c48f545d17

Change-Id: Ia3f9cfd8f5d2e9ec11e64c8ef3cd63d1d5742ff2
2018-03-19 21:01:57 +00:00
Colin Cross 436b76564d Replace extract-srcjars.sh with zipsync tool
extract_srcjars.sh uses zipinfo and unzip, which fail with an
error on an empty zip file.  Instead of trying to hack around
this (which is hard to make guarantees for since they are
non-hermetic host tools), replace them with a go tool to unzip
a set of zip files into a directory.

Bug: 73885582
Test: m checkbuild
Change-Id: I151fed347ed5196726e36866ffc27bc831799afb
2018-03-15 16:42:43 -07:00
Dan Willemsen 74edf2fdbe Switch PackageContext functions to take a ctx am: 54daaf0371
am: f34acc112e

Change-Id: I11d13250bbe1b40179b764799ca607b2bacc607b
2018-03-14 00:33:31 +00:00
Dan Willemsen 54daaf0371 Switch PackageContext functions to take a ctx
So that the Path and similar functions can be used directly, without
manually adding something like configErrorWrapper (it just uses it all
the time now).

Test: out/soong/build.ninja is identical
Change-Id: I8cb524b09a84d0b8357d7c3501c71270af411e17
2018-03-12 15:48:26 -07:00
Nan Zhang bfef411697 Droiddoc Support in Soong am: 581fd21e91 am: 2ea76706b3
am: a400bb400c

Change-Id: I5c317052e5b1cba68e04720db75cb07cdd7ca0f7
2018-02-22 23:25:14 +00:00
Nan Zhang 581fd21e91 Droiddoc Support in Soong
Support Droiddoc to Soong based on core/droiddoc.mk. The non-std doclet
based droiddoc compilation output is a "real" stubs.jar instead of a
directory of java files and a timestamp file.

The std doclet based javadoc compilation output is a "empty" stubs.jar
instead of a timestamp file.

The stubs.jar will be exported to
out/target/common/obj/JAVA_LIBRARIES/$(LOCAL_MODULE)_intermediates/classes.jar
and out/target/common/docs/$(LOCAL_MODULE)-stubs.jar

A $(LOCAL_MODULE).zip file will be generated also, and is exported to
out/target/common/docs/$(LOCAL_MODULE)-docs.zip if property: installable is not set
to false.

Bug: b/70351683
Test: unittest + convert libcore docs Android.mk to Soong manually.

Change-Id: I1cffddd138a5d9d445f86a3d4a3fd4de88a2bc0f
(cherry picked from commit 78188ec622cb1ee24171455867fc58ffab91562e)
2018-02-22 11:14:13 -08:00
Przemyslaw Szczepaniak 23c743abcc Add rsp and srcjar support to kotlinc build rule am: 4b5fe9d1b4 am: dae5bb8f25
am: 73d1deeea4

Change-Id: I1e065377fe78a39bb942a5dbcc781687490509c8
2018-02-15 12:03:46 +00:00
Przemyslaw Szczepaniak 4b5fe9d1b4 Add rsp and srcjar support to kotlinc build rule
Rsp files are supported through helper script (gen-kotlin-build-file.sh)
that generates the kotlinc module/build xml file.

Since rsp files are supported, I've added ExtractSrcJarsCmd step
to handle srcjars extraction.

Minor reorderings to make sure that TransformKotlinToClasses
recives only .java and .kt files when called from Module.compile.

Bug: 73281388
Test: make -j hidl-doc
Change-Id: I5a40b914569018dc529903a7f2864a5aeae838e5
2018-02-14 20:47:17 +00:00