java_resource_dirs was using a file list file that was generated
at ninja time to get the list of files to include, which meant
there were no dependencies on the files to cause res.jar to get
rebuilt. Switch to using a glob at soong time instead. This
is substantially similar to a glob in java_resources, except that
java_resource_dirs strips the listed directories off the paths
that end up in the jar.
Test: TestResources in java_test.go
Change-Id: I4b9b38f7b6b38a013cbb4e211187e7282a6795c0
Honor the default resource exclusions in java_resources properties
including *.java.
Test: m -j checkbuild
Change-Id: Ia117a000680161b54c189758926ddb2068a2a2c3
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
Putting resources in dex jars is going to need to pull files from
classpath jars that do not match *.class.
Test: m -j checkbuild
Change-Id: Ia37b8b9387e5f5636769afc6937b9aa3c9ec1ced
This reverts commit 2370af0e23.
Reason for revert: New Build Breakage: aosp-master/aosp_arm64_ab-userdebug @ 4376965
Change-Id: Ibe4b819c4292457c454bf42e6d94fba3071ec04b
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
Bug: http://b/63768402
Wno-backend-plugin warnings are generated by IR-based PGO when sources
evolve and the profiles become stale. Disable these warnings when
profiles are passed to the compiler.
Test: Build a module with a PGO property when profiles are used.
Change-Id: I462bbf55aafd8770a90c2c23462bf71607ac9108
Once this is submitted and we don't have any more references to
target.linux, it can be added back as a common target for all
linux-kernel based targets.
Test: m nothing
Change-Id: Iae5e82eaed65f58950115f21530ae04afd0602b9
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
In the future, target.linux will apply to all targets running a linux kernel
(android, linux_glibc, linux_bionic). So move all current users to the specific
linux_glibc.
There will be another cleanup pass later that will move some instances back to
target.linux if the properties should be shared with target.android and
target.linux_bionic, but target.linux needs to be removed first.
Test: out/soong/build.ninja identical before/after
Change-Id: I04e4f984781e60feb355de7adf80c54300e0d1f5
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
The file header returned by jar.ManifestFileContents had unset
date and mode fields. The unset date field resulted in the
"Last Mod Time" field in the zip file being set to 0, which
OpenJDK 9's jar implementation treats as an error:
java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 0
Bug: 67095392
Test: zipdetails out/host/linux-x86/framework/tradefed.jar
Change-Id: I0a818d57420f5e5de57e8ff57791951c1b538443
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
target.linux_glibc will apply to host builds with glibc, which is
identical to the current target.linux. In a future change, target.linux
will change to affect all targets using the Linux kernel (android,
linux_bionic, and linux_glibc).
target.bionic will apply to all OS variants using Bionic.
Bug: 31559095
Test: Add target.linux_glibc, target.bionic sections to an Android.bp, build
Test: m host
Change-Id: I677a67c22fba148fec264132311e355283f9d88d
libm is a default library for device builds, so default it for host
builds as well.
Also removes duplicate additions of -ldl, -lpthread, -lm and -lrt.
Test: m host
Change-Id: I8f7e799d48a1f427e48dcfb1d0ccba93c5f9780b
We want to start using some Soong Android.bp in tradefed so
enabling our project to be seen too.
Test: build a Android.bp target in tradefed
Bug: 66908811
Change-Id: Ia4543fc27d124442912e3a05d7bd3fd2f9850a1f
Ubuntu has both aliases, but Mac only declares python2.7, not python2.
Test: `m sepolicy_tests` on internal master
Change-Id: Ia2b5d2d95195f307befbc1893a465752f14b8a7b