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
Export jar-args.sh in JAR_ARGS so that make doesn't have to
duplicate the sed scripts.
Test: m -j checkbuild
Bug: 64634025
Change-Id: Ia5d0a303f23b32b8ff672fc882d51d5e99316ffa
soong_zip produces jar files that are not compatible with java's
ZipInputStream. Switch to jar using ugly sed scripts to munge
file lists into the alternating -C and file arguments required
by jar.
Bug: 64536066
Test: m -j checkbuild
Test: build/soong/scripts/jar_args.sh --test
Change-Id: Ifcc4bdab25e7d02342720eb246c673ff9a58bddb
Convert java_binary modules into two make modules, one for the
underlying java_library and one for the wrapper prebuilt.
Test: m -j checkbuild
Change-Id: I5ddf74f24f1e41fc1f39b3e8d254b7e191dbd47a
It's never anything except nil, and it unnecessarily complicates
the implementations.
Test: m -j checkbuild
Change-Id: I3e3b7251f32ffa84dbdfd0448faf248c306ca808
It's never anything except nil, and it unnecessarily complicates
the implementations.
Test: m -j checkbuild
Change-Id: I8a117a86aa39aeb07d9d8d0686ef869c52784f19
Make the javac arguments match what is used by make, and export them
back to make. A future change will switch make to use the the
exported ones.
This makes a dx.jar compiled with soong have identical class files
as one compiled with make.
Test: manual
Change-Id: Ia5196f1f42bc564e99de22e32e72fd2930e9fbae
And make it work like bazel's java_import, using a "jars" property
instead of "srcs", and allowing multiple jars to be listed.
Test: soong tests
Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
The java prebuilt tests weren't registering the prebuilts mutators,
which hid an issue where prebuilts modules weren't getting renamed
to avoid collisions with source modules of the same name, which
ended up causing the prebuilt module to try to add a dependency
on itself.
Test: java_test.go
Change-Id: I3327d27533591cb08a4b8b8b5e1668a6f72be8df
Prefixing names in the java package with "java" is redundant, inside
the java package it is clear that they refer to something java
related, and outside the package they will be referred to with a
java. prefix.
Test: java_test.go
Change-Id: I9eb8eecb7ac5f6fbf8e87f5c219b3f50dbd18c87
Java modules have been unused for a few years, add a few very basic
tests to exercise the modules as they are brought up to date.
Test: java_test.go
Change-Id: Ib23fc065674a61308333130ff1a992525b92e705
Converting java to use Path objects incorrectly used PathForModuleSrc
for a path that might not exist, use ExistentPathForSource instead.
Test: java_test.go
Change-Id: I50e4e315a10ab08c4e72065094ae29844874f5e4
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.
Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
Add a java/config package to hold config information, and share
it with make through makevars.
Test: builds
Change-Id: I46c088bda0fe97a1823bfdd80fa692d0bf61da1b
Remove inheritance implemented with the bad "superclass calls
subclass through interface" pattern, and replace it with composition.
Test: builds
Change-Id: If323f89360455b3f98b40777edaaaa265bb3b5fc
To run javac with AndroidGomaStaticRule, let me make JAVAC_WRAPPER
also show up to javac/builder.go.
Test: USE_GOMA=true JAVAC_WRAPPER=gomacc m -j32
Bug: b/62334576
Change-Id: I19e1e4315f71d8706800da810b5212f5964171a4
Descriptions currently look like:
[ 0% 4/29328] cc out-soong/.intermediates/external/clang/lib/Sema/libclangSema/android_arm_armv7-a-neon_denver_static_core/obj/external/clang/lib/Sema/SemaCodeComplete.o
This is not very helpful - most of the characters are used to show the
output path, which contains useful information like target architecture,
but also contains most of the path to the source files twice, and less
useful information like the exact variant name used by soong.
Make the descriptions look like:
[ 0% 3/29329] //external/clang/lib/Sema:libclangSema clang++ SemaTemplateInstantiate.cpp
This is //path/to/module:modulename tool relative/path/to/source/file
Test: builds, looks pretty
Change-Id: I3087aa7d4eb1860ef6239d77407b8b35445616d7