Commit graph

3955 commits

Author SHA1 Message Date
Colin Cross
af9c55b780 Correctly add dependencies to java_resource_dirs files
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
2017-10-04 17:19:43 -07:00
Colin Cross
2372923fe0 Honor resource exclusions in java_resources properties
Honor the default resource exclusions in java_resources properties
including *.java.

Test: m -j checkbuild
Change-Id: Ia117a000680161b54c189758926ddb2068a2a2c3
2017-10-04 17:19:43 -07:00
Colin Cross
7db5d6332f Get dex jar resources from classpath jar
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
2017-10-04 17:19:43 -07:00
Colin Cross
0cf45cdc1e Add -stripFile argument to merge_zips
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
2017-10-04 17:19:43 -07:00
Colin Cross
bddcf13555 Change default jar time to match ziptime
Ziptime uses Jan 01 2008, use the same in soong_zip and merge_zips.

Test: manual
Change-Id: Ie79a2e7864a5ed5a74833caec0a50c25a451859e
2017-10-04 17:19:43 -07:00
Jeff Gaston
60e38b613f Merge "Revert "Some clarifications in preparation to automatically order linker dependencies"" 2017-10-04 21:09:29 +00:00
Jeff Gaston
7b6118be6b Revert "Some clarifications in preparation to automatically order linker dependencies"
This reverts commit 2370af0e23.

Reason for revert: New Build Breakage: aosp-master/aosp_arm64_ab-userdebug @ 4376965

Change-Id: Ibe4b819c4292457c454bf42e6d94fba3071ec04b
2017-10-04 21:07:42 +00:00
Jeff Gaston
2ade0243ae Merge "Some clarifications in preparation to automatically order linker dependencies" 2017-10-04 17:45:40 +00:00
Colin Cross
c157a8d0e5 Allow libraries with no sources to be installed
Libraries with no source files but static lib dependencies should
still be installable.

Test: m -j checkbuild
Change-Id: Ibc91aa3153241092ce86888dbf90e99b66069ff2
2017-10-04 15:00:27 +00:00
Colin Cross
8b30a5599d Merge "Fix bootclasspath for host variants of java_library modules" 2017-10-04 14:43:10 +00:00
Pirama Arumuga Nainar
c144b86014 Merge "Pass -Wno-backend-plugin when using profiles" 2017-10-04 05:55:14 +00:00
Colin Cross
965714f139 Fix bootclasspath for host variants of java_library modules
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
2017-10-04 05:50:00 +00:00
Jeff Gaston
2370af0e23 Some clarifications in preparation to automatically order linker dependencies
Test: Browse the code and determine whether it's easier to understand
Bug: 66260943
Change-Id: Ia3fdb8f38e83ad8225a72c8de2804db23a90ef9b
2017-10-03 17:18:01 -07:00
Colin Cross
19ab372dd8 Merge "Add support for .proto files in java modules" 2017-10-03 23:02:51 +00:00
Pirama Arumuga Nainar
f4c0baf317 Pass -Wno-backend-plugin when using profiles
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
2017-10-03 14:35:18 -07:00
Dan Willemsen
5746bd481e Remove target.linux
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
2017-10-03 19:44:54 +00:00
Colin Cross
6af17aa022 Add support for .proto files in java modules
Test: m -j checkbuild
Change-Id: Ia03429948baebff85164a91a34507866c97a08ef
2017-10-03 10:25:15 -07:00
Colin Cross
47ff2521c6 Relax SDK checks for unbundled builds
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
2017-10-02 23:18:32 -07:00
Colin Cross
d5934c8bb7 Fix arch specific properties for java modules
Arch specific properties were not being applied to modules
with OS set to Common.

Test: java_test.go
Change-Id: I8f1b49ca51b0cf96f78006dfcd121672e581d9c5
2017-10-02 23:18:19 -07:00
Colin Cross
a60ead85fc Make java_library_static uninstallable by default
Static libraries are not dexed and are not installable on a
device.

Test: m -j checkbuild
Change-Id: Iea01df381e6c8cf2439fdb87200895db6aac99e2
2017-10-02 23:01:02 -07:00
Treehugger Robot
e81315b3b8 Merge "Fix excluding resource directories" 2017-10-03 04:15:27 +00:00
Dan Willemsen
9bc52012c1 Merge changes from topic "linux_glibc"
* changes:
  Change androidmk to use linux_glibc instead of linux
  Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
2017-10-03 02:30:07 +00:00
Colin Cross
0532fb0d4c Fix excluding resource directories
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
2017-10-03 02:13:16 +00:00
Treehugger Robot
5a727dfa11 Merge "Add no_framework_libs property" 2017-10-03 01:39:13 +00:00
Treehugger Robot
3dfd4aaf7f Merge "Use python2.7 instead of python2" 2017-10-02 21:17:54 +00:00
Dan Willemsen
dece58146f Change androidmk to use linux_glibc instead of linux
Test: m blueprint_tools
Test: androidmk system/core/fastboot/Android.mk
Change-Id: I7003b86f16a522f01c826092b8e45603270aa391
2017-10-02 10:55:22 -07:00
Dan Willemsen
9d6c6722a7 Rename target.linux[_x86[_64]] to target.linux_glibc[_x86[_64]]
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
2017-10-02 10:44:42 -07:00
Colin Cross
fa5eb23df6 Add no_framework_libs property
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
2017-10-01 20:34:35 -07:00
Treehugger Robot
b93479bed6 Merge "Allow modules with empty sdk_version in unbundled builds" 2017-09-30 04:15:28 +00:00
Treehugger Robot
00be2b997a Merge "Correctly set date and mode fields for MANIFEST.MF" 2017-09-30 03:16:51 +00:00
Colin Cross
8b9d37b40a Allow modules with empty sdk_version in unbundled builds
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
2017-09-30 02:41:25 +00:00
Colin Cross
2825cb3f8d Correctly set date and mode fields for MANIFEST.MF
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
2017-09-29 21:52:58 +00:00
Colin Cross
0f37af0c15 Add java file resources and flag to include sources
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
2017-09-29 14:02:22 -07:00
Colin Cross
8649b2653c Use pre-desugar classes in classpath
Follow the make change in I87aee34940937dbde33a977f55d1faf2c8054561
to use classes before desugar in the classpath.

Test: java_test.go
Change-Id: I1054f4aea1eb349b6f687e1af0adb92a944fd8c5
2017-09-29 14:02:22 -07:00
Colin Cross
59f1bb66ea Only desugar/dx installable libraries
Don't waste time running dx on libraries that will never end up
on the device.

Test: m -j checkbuild
Change-Id: Iad1750823d3261cd6ad6eb6aa00c74d45b9737a3
2017-09-29 14:02:22 -07:00
Colin Cross
40a3671416 Remove jarSpec structure
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
2017-09-29 14:02:22 -07:00
Colin Cross
d689143f1d Move errorprone dependency to compiled classes jar
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
2017-09-29 14:02:22 -07:00
Colin Cross
86a63ff366 Rename resource_dirs to java_resource_dirs
For consistency with make, rename java resources to
java_resource_dirs and android resources to resource_dirs.

Test: m -j checkbuild
Change-Id: Ie9aac50fef40f6a9093b4b98759e79cd086bb797
2017-09-27 23:21:36 -07:00
Dan Willemsen
bd42549743 Don't use the platform copy of libz
We'll always provide our own.

Test: m nothing
Change-Id: I4749c0fc3ec0922e975fc5f60976bee964ed3d5e
2017-09-27 15:35:29 -07:00
Dan Willemsen
c2992232ca Merge "Add target.linux_glibc and target.bionic" 2017-09-27 22:03:02 +00:00
Dan Willemsen
866b563d4c Add target.linux_glibc and target.bionic
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
2017-09-26 22:41:37 -07:00
Dan Willemsen
27991b7652 Add -lm to the default libs for Linux & Darwin
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
2017-09-26 20:25:09 -07:00
jdesprez
1596e6ee11 Allow to build Android.bp in tradefed project
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
2017-09-26 16:10:49 -07:00
Treehugger Robot
3bea186bc5 Merge "Remove duplication of bootclasspath in DefaultLibraries" 2017-09-26 01:12:30 +00:00
Treehugger Robot
fdb573147e Merge "Add 10.13 Mac SDK to whitelist" 2017-09-26 00:37:55 +00:00
Dan Willemsen
652b383a3f Expose host AvailableLibraries to Make
Test: Check out/soong/make_vars-aosp_arm64_ab.mk
Change-Id: I8410942698f3c142b03a2e1e447c880184ab82bf
2017-09-25 22:00:41 +00:00
Dan Willemsen
7d1681a174 Use python2.7 instead of python2
Ubuntu has both aliases, but Mac only declares python2.7, not python2.

Test: `m sepolicy_tests` on internal master
Change-Id: Ia2b5d2d95195f307befbc1893a465752f14b8a7b
2017-09-25 21:48:34 +00:00
Nathan Harold
01abb0948b Add 10.13 Mac SDK to whitelist
Add the latest Mac SDK to the version
whitelist.

Test: compilation
Change-Id: I86fcbf2bb100a0af6a2cfea62f524a17ba1a67b9
2017-09-24 01:51:26 -07:00
Colin Cross
cb2c92961c Remove duplication of bootclasspath in DefaultLibraries
Don't add bootclasspath libraries as classpath dependencies too.

Test: m -j checkbuild
Change-Id: Icb45e45536ce3babab73f67d281ca593edd4ab7f
2017-09-23 22:36:16 -07:00
Treehugger Robot
968df27a9c Merge changes I28a15bcc,I86cccefc
* changes:
  Add (host|host-cross|target)[-<OS>] phony targets when not using make
  Fix mma/mmma when soong is not embedded in make
2017-09-22 19:33:08 +00:00