Commit Graph

38 Commits

Author SHA1 Message Date
Dan Willemsen 2ec3e4a257 Remove Java PATH check, deprecate using PATH in Kati
The Java PATH fixup is now handled within soong_ui, along with the
values of ANDROID_JAVA_HOME based on OVERRIDE_ANDROID_JAVA_HOME /
EXPERIMENTAL_USE_OPENJDK9.

Mark PATH as deprecated, so that any reads/writes will cause warnings.
This will be switched to obsolete once it's verified that there are no
more users.

Using PATH within Kati means that we've got to rebuild the ninja files
whenever your PATH changes, which is not ideal, especially since some of
the envsetup functions can change your PATH. In most cases you only need
to use PATH within the bash portions of the build rules ($${PATH}), which
isn't treated as a make variable, so won't produce an error.

I'm also planning on replacing PATH in a future change with our own
directory that has placeholders for everything in your PATH. This will
let us remove tools that shouldn't be used from the build.

Test: m nothing
Test: build/soong/build_test.bash on AOSP and internal master
Change-Id: I18d8d19cfba313ff9176345bf73ac34e8dbebfbb
2017-11-08 00:24:35 -08:00
Colin Cross d7b99409ce Use prebuilts/jdk/jdk9 if EXPERIMENTAL_USE_OPENJDK9 is set
Bug: 62123342
Test: m -j EXPRIMENTAL_USE_OPENJDK9=1.8 checkbuild
Change-Id: I8be331c422412d6416d92184a2eba093f27fc0fb
2017-10-05 16:47:54 -07:00
Colin Cross 6684528a6d Disable jack completely
Always set ANDROID_COMPILE_WITH_JACK=false.

Bug: 65302138
Test: m -j checkbuild
Change-Id: I98dfdca27b4338048d50e016a79fbf4e3d86a020
2017-09-27 13:17:59 -07:00
Colin Cross 355de0a00d Merge "Switch from jack to javac for unbundled builds" 2017-09-27 03:26:13 +00:00
Colin Cross 5601842176 Disable turbine for unbundled builds
We don't yet have a turbine prebuilt, so disable turbine for
unbundled builds for now.

Test: none
Change-Id: I06179fca1764a86e387c8bd154ae052e2669d15b
2017-09-26 17:39:01 -07:00
Colin Cross 210e530342 Switch from jack to javac for unbundled builds
Default to ANDROID_COMPILE_WITH_JACK=false when TARGET_BUILD_APPS
is set.

Test: m -j TARGET_BUILD_APPS=Gallery2
Change-Id: Ibd2bdac6c7e2c4e2c6107fd35bd049fc8cb8dafe
2017-09-25 16:15:11 -07:00
Colin Cross 2c69277218 Use java variables from soong
Use TARGET_JAVAC and HOST_JAVAC exported from soong.

Test: m -j checkbuild
Merged-In: Ic094174149ea304c0b06ddc023417acf3602d5a3
Change-Id: Ic094174149ea304c0b06ddc023417acf3602d5a3
(cherry picked from commit 204dd14a2c)
2017-08-29 13:02:07 -07:00
Colin Cross 75b50421af Compile with javac by default
javac is replacing jack as the default compiler for platform builds.
Leave it on for unbundled builds, we don't have a solution for lambdas
in unbundled builds yet (b/62038127).

Temporarily allow products to continue to default to jack by setting
PRODUCT_COMPILE_WITH_JACK=true.

This reapplies I1c3857f64eafa445ad1b9dd94eff85bef05f4649.

Bug: 36902714
Test: m -j checkbuild
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L50600000086240009&nodeType=Trybot
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L68900000086676531&nodeType=Trybot
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L37200000086753998&nodeType=Trybot
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L74600000087054271&nodeType=Trybot
Test: sailfish-userdebug boots and basic interactions work
Test: art tests pass
Test: libcore tests pass
Change-Id: Icd1b549cd8a010758a6e5d98b39569fcd1825f60
2017-07-28 13:01:32 -07:00
Tobias Thierer 1b53ea0908 Allow builds with costum toolchains.
Android bundles an OpenJDK-derived toolchain to avoid issues with
unsupported toolchains. For development / experiment purposes, this
CL the toolchain to be overridden via OVERRIDE_ANDROID_JAVA_HOME.

It is an error for OVERRIDE_ANDROID_JAVA_HOME to be set but not
point to a valid toolchain, but this error is not explicitly
checked for.

Bug: 38177295
Test: Treehugger

Change-Id: I72f641f560501e498f9c86a4380f19941fca11ad
2017-07-26 17:54:11 +01:00
Colin Cross 3a1544ab1a Make JAVA_HOME absolute inside build
Export JAVA_HOME as an absolute path to commands running inside
a build.

Should fix errors invoking gradle from inside a build:
ERROR: JAVA_HOME is set to an invalid directory: prebuilts/jdk/jdk8/linux-x86
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

Test: treehugger
Change-Id: I16e4482b2d74ede0843715be3b08c65ce33cf403
2017-07-24 19:27:31 -07:00
Colin Cross e97e69359a Use java prebuilts
Point the make java variables at JDK prebuilts in
prebuilts/jdk/jdk8, add them to the path, and clean up
some old overrides.

Reapplies Ibbeb30fab96e45aedd5bb6d710d1170f85789982 after updating
some more manifests to include the prebuilts.

Bug: 62956999
Test: m -j checkbuild
Change-Id: I9e27aa5cb04d1ed09e43b798e5d654843afc000f
(cherry picked from commit 1931750940)
2017-07-20 15:14:26 +00:00
Colin Cross 02112900cc Revert "Use java prebuilts"
This reverts commit 1931750940.

Change-Id: I7a99fd6c53d35a2a674f2d60b113a727f3c453ce
2017-07-19 22:42:46 +00:00
Colin Cross 1931750940 Use java prebuilts
Point the make java variables at JDK prebuilts in
prebuilts/jdk/jdk8, add them to the path, and clean up
some old overrides.

Bug: 62956999
Test: m -j checkbuild
Change-Id: Ibbeb30fab96e45aedd5bb6d710d1170f85789982
2017-07-14 14:18:53 -07:00
Colin Cross a12d38a721 Increase max heap size for javac to 2GB.
Compiling Dialer requires increasing the javac heap size above
1GB, probably due to the extensive use of annotation processors.
Increase it to 2GB.

Test: m -j ANDROID_COMPILE_WITH_JACK=false
Change-Id: I4dd3759a98ea915469e69f563dc49be8a25d518e
Merged-In: I4dd3759a98ea915469e69f563dc49be8a25d518e
(cherry picked from commit 0e785c79b8)
2017-07-06 16:13:00 -07:00
Colin Cross 0851df8c82 Provide make variables for java binaries
Replace java -> $(JAVA), etc. to prepare for moving java binaries
out of the path and using full paths to them.

Test: builds
Bug: 62956999
Change-Id: I5dfcd0d4e855ecde69cd127169e9545e59723d12
2017-07-01 01:03:14 +00:00
Colin Cross 79e2f73b6c Re-enable dx support
This is a partial revert of commits:
858657366f Remove support of disabling Jack.
3ae7861252 Remove javac support in host dex rules.
22313f2b2a Remove rules for building dex with dx

Test: builds
Change-Id: Ie12d743cbe978bdeb030910848b67f5945a4fec8
2017-02-16 14:08:45 -08:00
Ying Wang 858657366f Remove support of disabling Jack.
We removed code and variables related to running dx on classes.jar in
this change. Also removed target emma rules (but kept the emma rules for
host java libraries), for it's now done by Jack.
We still support to build classes.jar (and javalib.jar for static Java
libraries) using javac, because tools like javadoc need class files as
input.
Removed the obsolete install-dex-debug.

Bug: 27400061
Change-Id: If0bcdfe62cb181a98754fb0dbe1c12c92e38d3e8
2016-03-30 14:03:12 -07:00
Neil Fuller 2428bfeb88 Allow java targets to support 1.8 source / target
This change enables build rules to specify:

LOCAL_JAVA_LANGUAGE_VERSION := 1.8

to enable -source 1.8 -target 1.8 for javac and
equivalent flags for Jack.

Bug: 26753820
(cherry-picked from commit cdfbe4a852)

Change-Id: I361c99dd599e7b4a041f02c9562e461da2b0502e
2016-02-03 17:08:39 +00:00
Ying Wang 119cec9a4a am 4e2f1903: Merge "Clean up Javac a little bit."
* commit '4e2f190315759b4270ab414b9ff1e24a19521521':
  Clean up Javac a little bit.
2015-09-02 21:18:38 +00:00
Ying Wang 447d69678e Clean up Javac a little bit.
- Added GLOBAL_JAVAC_DEBUG_FLAGS and merge it to
  PRIVATE_JAVACFLAGS/PRIVATE_JACK_FLAGS to get rid of
  PRIVATE_JAVAC_DEBUG_FLAGS/PRIVATE_JACK_DEBUG_FLAGS.
- With Java rules out of base_rules.mk we can get rid
  of java_alternative_checked_module now.

Change-Id: I1a14716c785e3d49330a75044107662ce96a9307
2015-09-02 10:04:18 -07:00
Dan Willemsen 1b14846717 am 48d95e75: am 05d97fe7: Merge "Remove legacy windows platform build support"
* commit '48d95e752536dc7a81c141e435e8a90b7929cf02':
  Remove legacy windows platform build support
2015-08-18 04:43:04 +00:00
Dan Willemsen 145ae32069 Remove legacy windows platform build support
We still support HOST_OS=windows for the SDK host tools cross-builds, but
that's only when USE_MINGW is set when running under linux.

Change-Id: I37da87dc9fbbd69ba10ce4d7f2668ab3f6482d92
2015-08-17 12:35:04 -07:00
Yohann Roussel a96cc59ab5 Use Jack by default
Change-Id: Ifc66fd863e3bfde780698f7bb4578927bcab4ff4
2015-03-02 22:23:03 +01:00
Neil Fuller 46e00ea4ba Remove Java 6 build support
Change-Id: I9754844af58e3f81d7eb9dae286128d17a2cb56c
2014-10-22 10:53:59 +01:00
Primiano Tucci 994c84fb40 Introduce CC/CXX/JAVAC_WRAPPER to wrap the calls to the compiler.
This is to make it possible to wrap the compiler invocations with
custom wrappers (e.g., distcc/goma) by setting the CC_WRAPPER,
CXX_WRAPPER, JAVAC_WRAPPER variables in the build environment (without
having to know in advance the path to the compiler)

Change-Id: Ide800c24f0c2ebbb1cfb358bd8f99ec8a9d41253
2014-06-02 20:12:57 +01:00
Nick Reuter c43ab6edc2 javac: rename common_flags to avoid conflictions
* Currently the flag conflicts with one seen in hardware/qcom
   rename to avoid issues.

Change-Id: I876fcd6a254f349dc5260509bcddb0367a7d49d8
Signed-off-by: Nick Reuter <nreuter85@gmail.com>
2014-05-08 22:15:35 -05:00
Ying Wang d81d71a020 Increase the maximum javac heap size again.
Change-Id: Ic3422650ea22977f3dcfd74505cb287ff6543c2d
2014-04-09 14:27:29 -07:00
Narayan Kamath c84889b80a Build with java7 by default.
All introduce a flag LEGACY_USE_JAVA6 to force java6 builds.
This is an unsupported configuration, and provided temporarily
to iron out regressions and compare build output (if required.).

- Increment the version check sequence number.
- Move a more specific check (OpenJDK vs non OpenJDK) after
  the more general version check.
- Update the link in the version check error message to the
  "initializing" page instead of the "download" page. The latter
  talks about repo, mainly.

bug: 8992787

Change-Id: I313e17b1911768d4f3bc318c4162c53dec6eaf0d

Conflicts:
	core/main.mk
2014-04-04 18:44:47 -07:00
Ying Wang 01f11b2aa9 Increase the maximum javac heap size.
Java 7 needs more memory when you run some annotation tools.

Change-Id: Ia8b423244b9ce164500b24867fe2b3d10a5089ff
2014-03-26 19:23:46 -07:00
Brian Carlstrom b6dcef8777 Add support for ALTERNATE_JAVAC
Bug: 12476356
Change-Id: Idd013031dc32a560bca76cca295bedcad55982b4
2014-01-09 15:33:23 -08:00
Narayan Kamath e2d27887be A few more Java7 related clean ups.
- Separate SDK checking from version checking and
  make messages clearer.
- Add explicit source & target versions for javac to
  make things clearer.
- Rename flag from EXPERIMENTAL_USE_JAVA7_OPENJDK to
  EXPERIMENTAL_USE_JAVA7.
- Allow Oracle JDK 1.7 to be used on Mac OS, since there's
  no official OpenJDK support for that platform.

Change-Id: I454d2c917ed78f03ec7559a99659fefe7e7d50f3
2013-12-05 13:23:06 +00:00
Ying Wang ad69099131 Add experimental flag to support OpenJDK builds.
bug: 8992787

(cherry picked from commit d1dbe7f5a2)

Change-Id: Ie977d4f26ae8d3eee9d7b9cf2c0c270bee5b54b3
2013-11-26 10:30:14 +00:00
Raphael 63c8af9aaf Fix the build: properly detect the BUILD OS version of Java, not the host one.
This matters when building Windows under Linux.

Change-Id: I1eaa4eeda4df359313f16d52605a1b8298765269
2010-06-12 11:44:48 -07:00
The Android Open Source Project 88b607994a auto import from //depot/cupcake/@135843 2009-03-03 19:28:42 -08:00
The Android Open Source Project 05806d7af6 auto import from //depot/cupcake/@135843 2009-03-03 18:28:14 -08:00
The Android Open Source Project 4f85cc54b3 auto import from //branches/cupcake/...@125939 2009-01-09 17:50:54 -08:00
The Android Open Source Project dcc08f073b Code drop from //branches/cupcake/...@124589 2008-12-17 18:03:49 -08:00
The Android Open Source Project b6c1cf6de7 Initial Contribution 2008-10-21 07:00:00 -07:00