Dex jars were getting their resources from the res.jar files of
their transitive static dependencies. This accidentally bypassed
jarjar on resources, since the jarjar pass only happened once the
resources jar was combined into the classpath jar. Switch to
getting the resources out of the classpath jar by merging it
with the dex jar while skipping *.class.
Test: m -j checkbuild
Test: compare ext.jar to one generated by make
Change-Id: I5f6f3da738dcb0af56ab9a1bd7174ed5359de2b2
Libraries with no source files but static lib dependencies should
still be installable.
Test: m -j checkbuild
Change-Id: Ibc91aa3153241092ce86888dbf90e99b66069ff2
The partial hostdex support was causing the host variant of
java_library modules to depend on core-oj and core-libart,
which caused the tagsoup jar to use the wrong
java.lang.System.arraycopy signature. Remove the hostdex
code that was causing the problem, and add a test.
Test: java_test.go
Change-Id: I4f7b1f29c99aae328ba19b042538d9d35544aa43
Unbundled builds might not have the prebuilt/sdk files, allow
the build to continue and then fail if the module is actually
built.
Test: m -j checkbuild
Change-Id: I21163778f1cc50945c7a12e57da0e39ba963aa7c
Arch specific properties were not being applied to modules
with OS set to Common.
Test: java_test.go
Change-Id: I8f1b49ca51b0cf96f78006dfcd121672e581d9c5
Using a glob as a path failed the existence check. Append the
glob after converting the path to a string.
Test: TestExcludeResources in java_test.go
Change-Id: Ic1fd40aa283f3b0d59c1c589dbeec411583eddf1
Add a no_framework_libs property similar to no_standard_libs.
The new property will allow modules to continue to link against
the standard bootclasspath libraries that contain java.*, but
not against the framework libraries. This avoids having to
specify the bootclasspath libraries explicitly.
Test: m -j checkbuild
Change-Id: I0be13a45cadca9b90a0fd1797885cd18c5b462e3
The apps build depends modules that have empty sdk_version. Let the
behavior match make for now.
Test: m -j TARGET_BUILD_APPS=Gallery2
Change-Id: Ie5545d2cd6b1268b0b3392dc0af2e4eb3d38a588
Add a properties to allow including files as resources, including
support for filegroups. Also add a flag that causes module sources
to be included in the final jar.
Test: java_test.go TestResources
Change-Id: Ida8ee59b28df9fe66952170f46470d3a09fd5d65
Follow the make change in I87aee34940937dbde33a977f55d1faf2c8054561
to use classes before desugar in the classpath.
Test: java_test.go
Change-Id: I1054f4aea1eb349b6f687e1af0adb92a944fd8c5
Don't waste time running dx on libraries that will never end up
on the device.
Test: m -j checkbuild
Change-Id: Iad1750823d3261cd6ad6eb6aa00c74d45b9737a3
It's not doing anything anymore, and the next patch will need more
complex jar arguments. Just remove it.
Test: m -j checkbuild
Change-Id: I96d15995e86263ec04fd5c13ab0fd54d8b85c788
The resources jar and the combined jar are not always used, so
add the errorprone dependency to the compiled jar.
Test: m -j checkbuild
Change-Id: Iaa10a04347758c676bb704969b86f9442e6c3175
For consistency with make, rename java resources to
java_resource_dirs and android resources to resource_dirs.
Test: m -j checkbuild
Change-Id: Ie9aac50fef40f6a9093b4b98759e79cd086bb797
Hostdex support isn't working yet, and we are accidentally producing
a dex jar for host modules, which confuses soong_java_prebuilt.mk.
Test: m -j checkbuild
Change-Id: Ie2c331fa697f49dab23c380a5c6e0490d67c9f74
Forcing sdk modules to be declared explicitly is unnecessary, just
add the required dependencies on the jar and aidl files.
Test: java_test.go
Change-Id: Ib28bdc1051c5825e7c0efb6adff1f9282675560e
Fix the java module sdk tests, and expand them to cover testing
all classpaths including for the host.
Test: java_test.go
Change-Id: I71be13cc5545f5c4d5b377c4c8de3dccbb09abf9
Java tests will need to test code inside if ctx.Device() blocks,
switch to using TestArchConfig and NewTestArchContext.
Disable TestSdk for now, just registering modules that depend
on the SDK triggers panics because of previously untested code
that is now executed.
Test: java_test.go
Change-Id: Iff2c814af56cc830327db8d951c4350034c00361
First pass at java support for the device. Adds desugar before
dx, and passes javalib.jar to make.
Test: m -j checkbuild
Change-Id: I3138d943bc4867a52c3fce8fbdb597773793988d
Jar always puts default MANIFEST.MF files in if none was specified.
Copying that behavior in soong_zip causes problems with merge_zips,
because it ends up taking the default manifest from the classes.jar
instead of the user's manifest from res.jar. We don't want the
user's manifest in the classes.jar, otherwise a change to the
manifest will cause all the class files to rebuild. Instead,
move the manifest insertion to the final merge_zips stage.
Test: m -j checkbuild
Change-Id: Id6376961dbaf743c2fb92843f9bdf2e44b963be0
Turbine leaves out bridges which can cause javac to unnecessarily insert
them into subclasses. Setting this flag causes our custom javac to
assume that the missing bridges will exist at runtime and not recreate
them in subclasses. If a different javac is used the flag will be
ignored and extra bridges will be inserted, which should be harmless.
The flag is implemented by https://android-review.googlesource.com/c/486427
Test: m -j checkbuild
Test: check core-libart for extra methods
Bug: 65645120
Change-Id: I6e2babe4a5a24cda4903845ae895c369343ec55b
So that we don't get confused when using :<module> in srcs to depend on
a module that could also be a HostBinTool.
Test: m -j
Change-Id: Ia3b1c26826e70f84c6dc5ff78c95dd11d76901b6
A space was missing between flags in the errorprone build rule.
Test: m -j RUN_ERROR_PRONE=true checkbuild
Change-Id: If6f48a700e6f19e318b6cc9734e1d8fd2289491f
Strip module-related javac 9 command line arguments that don't apply
to javac 8.
Test: m -j checkbuild
Change-Id: If44a3d9d7227e923117dc75bbabbddb41026b25d
Trying to use dx.jar for the jar module name and dx for the
wrapper module name leads to the make side installing dx.jar.jar.
The separate names are only needed to make LOCAL_REQUIRED_MODULES
work. Make the names the same again, and use a manual dependency
from the installed location of the wrapper script to the installed
location of the jar to make sure that both get installed and that
the wrapper script timestamp is always as new as the jar.
Test: m -j checkbuild
Change-Id: Ibc8ce9d24ed770e9a270fb8eaa8fe1b427a382a7
Instead of trying to squeeze soong jars through prebuilt_internal.mk,
make a separate soong_java_prebuilt.mk.
Test: m -j checkbuild
Change-Id: Idadef3c21a6f618d573110f04c80d7db3db92031
Make javac rules output a jar file instead of a classes.list.
Combine the output jar, static jar dependencies, and resources
into the final jar using a separate rule. For now, use a shell
command with unzip and soong_zip to create the final jar,
eventually it will be done with a zip2zip-style jar combiner.
Bug: 64691570
Test: java_test.go
Change-Id: Id8e6313e0097b78947d88e86e47b56ad08caca1a
The error_prone config will likely need to be updated at the same
time as the error_prone prebuilts, so move the config into the same
project. This requires jumping through some hoops because
external/error_prone may not be present in all manifests.
Bug: 64489631
Test: m -j RUN_ERROR_PRONE=true
Change-Id: I2c59df1148134ffedac0e00d32ac7082a9fb5330
Some java libraries will never be installed, support an
installable: false property and export it back to make as
LOCAL_UNINSTALLABLE_MODULE := true.
Test: m -j checkbuild, manually inspect out/soong/Android*.mk
Change-Id: I825ec897648c82fb7323da7df3539c9aaa6bcfce
Also clear the bootclasspath for device builds so javac doesn't
fall back to the default rt.jar bootclasspath.
Test: java_test.go
Change-Id: Ia21f55c7d45db560e2f44be81b2f46587d9026f2
Pass the sdk_version property, the platform sdk version, or 10000
to dx as --min-sdk-version.
Test: m -j checkbuild
Change-Id: I5fae03f44153dc2d6244c33f4c055e746980aefe
For consistency with libs and static_libs. And make it a *bool
so that it can be overriden when used in java_defaults modules.
Test: java_test.go
Change-Id: If0eaf5d5571dc6e565056d273b0addd960d6b33f
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file. Also remove InstallFile and rename
InstallFileName to InstallFile.
Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
jlink and jmod are new commands added in OpenJDK 9.
The new commands are exported only when the environment
variable EXPERIMENTAL_USE_OPENJDK9 is set to true.
Control of toolchain commands moved to soong in commit
2aad9c2882
Bug: 38177569
Test: Treehugger
Change-Id: I52d81b95357162e31a2017080b27ef076a470b14
Export TARGET_JAVAC and HOST_JAVAC to make. This moves control
of the javac command line flags into soong.
Test: m -j checkbuild
Merged-In: Ifa3e35be0abd2778741680216427403ba58a0a3b
Change-Id: Ifa3e35be0abd2778741680216427403ba58a0a3b
(cherry picked from commit 2478d8b885)
Pass CommonJdkFlags to errorprone builds, which is required for
frameworks/base/layoutlib/create to work correctly. Unfortunately,
javac and errorprone cannot use the same syntax for the heap size,
javac needs -J-Xmx and errorprone needs -Xmx, so split the heap size
flag out into a separate variable.
Test: m -j RUN_ERROR_PRONE=true javac-check
Change-Id: Icd7f8cf627534fb089ec83e462c060572dd2d20c