No description
Find a file
Jiyong Park e3c278844d Limit System SDK to 34 for Java modules in the vendor partition
This change disallows Java modules in the vendor partition to use System
SDK that is newer than API level 34; 34 is the latest allowed.

Background 1: with Trunk Stable, the system/vendor interface is released
at Q2 whereas the system/app interface is released at Q3. In other
words, at Q2, the APIs which will be added to the system SDK at Q3 are
not available. Since the system/vendor interface (which is fronzen at
Q2) is what the modules in the vendor partition will be building
against, they can't and shouldn't use those new APIs that will be added
in the future (Q3). Using those APIs is risky because there's a chance
that those APIs get removed or changed between Q2 and Q3. For example,
2024 Q2 is technically still Android U, not Android V.

Background 2: The use of Java APIs in the vendor partition had many
issues. Most significantly, those "vendor" Java apps are categorized as
part of the system partition because all Java app processes require
access to platform internal libraries that are prohibited to vendor
processes. Furthermore, since the Project Treble, the vendor partition
was re-purposed to a partition to host SoC-dependent bits - usually
HALs. Implementing HALs in Java has never been officially supported and
has had many loop holes.

We'd like to use both background 1 and 2 as a chance to disallow any
Java code in the vendor partition. However, since there are already some
Java modules in the partition, we can't suddenly ban it. The deprecation
will be made gradually, and this CL is the start.

This CL implements the "Make" part of the restriction. The "Soong" part
will follow.

Note that LOCAL_SDK_VERSION := current or LOCAL_SDK_VERSION :=
system_current is automatically overridden into 34 or system_34. This is
to prevent sudden breakage of vendor modules that have been targetting
the latest (i.e. current) API level. They will however fail if they use
APIs newer than API level 34.

Bug: 314011075
Test: The following Android.mk module fails as expected.
some/Android.mk:

include $(CLEAR_VARS)
LOCAL_MODULE := example_module
LOCAL_VENDOR_MODULE := true
LOCAL_SDK_VERSION := system_35
LOCAL_SRC_FILES := Foo.java
include $(BUILD_JAVA_LIBRARY)

FAILED:
some/Android.mk: error: example_module: Incompatible
LOCAL_SDK_VERSION 'system_35'. System SDK version '35' is not supported.
Supported versions are: 28 29 30 31 32 33 34

Change-Id: I44c29c6dc45b91a9a30b8a21cd2baae685fa27fb
2024-01-03 16:35:08 +09:00
common math.mk supports larger number comparison 2023-10-30 10:58:25 +09:00
core Limit System SDK to 34 for Java modules in the vendor partition 2024-01-03 16:35:08 +09:00
packaging Trace time spent in cp rules for dist targets. 2023-06-26 23:31:30 +00:00
target Merge "Revert "Allow to override fastboot-info.txt for specific board"" into main 2023-12-13 19:19:16 +00:00
tests Add test for b failing 2023-07-05 12:26:55 -07:00
tools Merge "dist-one flag should be a boolean, not a string" into main 2024-01-03 01:31:49 +00:00
.gitignore ignore .iml files (IntelliJ) 2022-06-17 12:17:53 -04:00
banchanHelp.sh Allow selecting a different product in banchan. 2021-04-19 18:32:00 +01:00
buildspec.mk.default Add TARGET_PLATFORM_VERSION to lunch 2017-03-23 09:44:08 -07:00
Changes.md Revert^2 "Enable genrule sandboxing by default" 2023-10-18 22:50:28 +00:00
CleanSpec.mk Clean out old rustc compiler intermediates 2023-10-03 10:35:32 -07:00
cogsetup.sh Copy reclient binaries into the out directory itself 2023-09-28 17:46:59 +00:00
Deprecation.md Obsolete unused module types 2020-04-18 21:00:18 -07:00
envsetup.sh Quote the backslash in the hmm output. 2023-12-22 13:32:42 +00:00
help.sh Add sync to m help 2022-09-22 02:26:10 +00:00
METADATA Move comment to license_note 2022-03-03 14:57:46 -08:00
navbar.md Mark envsetup.sh vars as deprecated in makefiles 2017-11-28 14:19:50 -08:00
OWNERS Remove lberki@google.com from OWNERS 2023-11-30 16:41:22 +00:00
PREUPLOAD.cfg Disallow use of error-prone merge-strategies 2021-02-23 15:07:02 +00:00
rbesetup.sh fix RE for metalava actions 2023-11-15 20:39:45 +00:00
README.md Mark envsetup.sh vars as deprecated in makefiles 2017-11-28 14:19:50 -08:00
shell_utils.sh Pull common methods into shell_utils.sh, which can be included by scripts. 2023-01-03 14:12:43 -08:00
tapasHelp.sh Add a keys argument to tapas 2022-02-07 18:50:22 +00:00
Usage.txt Remove the PRODUCT-* goal 2019-07-29 14:27:04 -07:00

Android Make Build System

This is the Makefile-based portion of the Android Build System.

For documentation on how to run a build, see Usage.txt

For a list of behavioral changes useful for Android.mk writers see Changes.md

For an outdated reference on Android.mk files, see build-system.html. Our Android.mk files look similar, but are entirely different from the Android.mk files used by the NDK build system. When searching for documentation elsewhere, ensure that it is for the platform build system -- most are not.

This Makefile-based system is in the process of being replaced with Soong, a new build system written in Go. During the transition, all of these makefiles are read by Kati, and generate a ninja file instead of being executed directly. That's combined with a ninja file read by Soong so that the build graph of the two systems can be combined and run as one.