Use the java resources jar as the dex jar when building apps that
have no code.
Also remove maybeStrippedDexJar, the dex jar is never stripped now.
Fixes: 176305357
Test: TestAppJavaResources
Change-Id: Ic8b1165bd35d71237d307e7f5f895764e203a10d
m <modulename> is handled by Make and installs the Make copy of a host
java binary in out/host/linux-x86/bin, and doesn't depend on the Soong
copy in out/soong/host/linux-x86/bin. That can leave a stale binary
in the Soong directory, and since the Soong directory is first in the
path set up by envsetup.sh, can result in confusing behavior to end
users.
cc_binary already has the Make binary depend on the Soong binary
so that they are both updated. Do the same for java_binary.
Fixes: 180405155
Test: m metalava
Change-Id: Ic84a131a2851cc4a18ce3725da3c4067137d6120
Add a ctx parameter to AndroidMkExtraEntriesFunc to allow them to
access providers.
Test: m checkbuild
Change-Id: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
Merged-In: Id6becc1e425c3c3d8519248f8c0ce80777fac7cc
By enabling an android_app_import module to supply the
special framework-res module, it becomes possible to
create a split build that excludes the source of over
10,000 files under frameworks/base/core/res, replacing
this source with a prebuilt. However, since other parts
of a monolithic build use the source of framework-res,
this scheme works only if your split build manifest
excludes modules that depend on framework-res source.
Bug: 176851898
Test: lunch aosp_arm64-userdebug && m nothing
Test: new TestAndroidAppImportExportPackageResources
Test: local build without prebuilt framework-res
Test: local build with prebuilt framework-res
Change-Id: If00d9dbc656c8406c038448d09f93f767c1e06d1
This is needed for Java libraries that are <uses-library> dependencies
of Java libraries and apps defined as Make modules. Each dexpreopted
module in Make generates a dexpreopt.config file, which incorporates
information from its dependencies' dexpreopt.config files. For
dependencies that are Make modules their dexpreopt.config files are
generated by Make, and for Soong modules they are generated by Soong.
Since Soong doesn't know which libraries are used by Make, it generates
build rules for a superset of the necessary libraries.
Bug: 132357300
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I325b1037658736ee3c02450b08c00eca1a175962
Without LOCAL_SOONG_DEX_JAR, ninja fails with a missing
dependency error.
Test: m nothing
Test: new TestImportSoongDexJar
Bug: 173705556
Change-Id: I54a4c6ea93877667a3fb97f8b2621c42e431f577
I added in case anyone needs to access AndroidMkEntries to generate
footer lines, but nobody uses it, and it only confuses people.
Test: m nothing, TreeHugger
Change-Id: Ic8a450e3c306d9228c1fdec212c7441bd6aaee03
MTS is introducing partial MTS test suites that are per-module, with
names of the format: mts-${MODULE}. By centralizing the code for test
suites, we can automatically add "mts" test suite when an
"mts-${MODULE}" test suite is specified, reducing duplication.
Test: m mts
Bug: 170318013
Change-Id: I8ce9d3c252fcc0a937bb5f2826d21cb6c6932d82
Instead of setting DistFiles to use the api stub (if present) as the
default dist file this simply makes OutputFiles(tag) return the api
stub file for the DefaultDistTag.
Test: m nothing
m dist sdk - before and after this change, compare result to
make sure that there are no significant differences.
Bug: 174226317
Change-Id: I39d615c5bf8d20d59db7eeb98d942210ec0aa8ba
A previous change handles dist properties automatically for all module
types and as a result has made the java.Library setting of DistFiles
redundant so this change removes that and the tests that duplicate
tests of the general mechanism.
Test: m nothing
m dist sdk - before and after this change, compare result to
make sure that there are no significant differences.
Bug: 174226317
Change-Id: Ib79a3bdd46897efd84a9c456c37c374bd6036303
This change allows a test (native, java, rust or python) to be included
in host-unit-tests suite when test option `unit_test` is set to true.
Bug: 172006742
Test: m host-unit-tests
Change-Id: I69d3eb5b51198c549e2e6914ceac3a4fc33c3cf2
The old representation consisted of a list of libraries (UsesLibraries),
a list of optional libraries (OptionalUsesLibraries) and a mapping from
library name to its build/install paths (LibraryPaths). The separation
into lists and map was necessary because of special handling of
compatibility libraries, which is now unified with normal libraries.
The new representation is a mapping from target SDK version to a tree
structure ClassLoaderContext. Each node of the tree represents a library
and contains library name, build/install paths and a slice of
subcontexts for dependencies. The same library may occur in the tree
multiple times in case it is a dependency of multiple libraries. The
order in which libraries are added matters (the resulting tree shape may
be different).
Test results have to be updated, as the resulting <uses-library> list is
reodered (previously it was a sorted list of map keys, and now it is
formed by a depth-first preorder traversal of the class loader tree).
Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Bug: 168686456
Change-Id: I11be8cd2967f004fd58753d7c5fb99fed179cd63
Adds a singleton that traverses the module variants finding the ones
that are in the list (updatable and non-updatable) of boot jars and
add a ninja rule to ensure that they only contain packages from an
allowed list.
Replaces a hack that ignored any prebuilt boot jars supplied as dex
file with an equivalent one to ensure that they are still ignored.
A follow up change that switches to checking dex jars will allow the
hack to be removed.
The boot jars check can be strict or lax. If strict then all the boot
jars listed in the configuration must be found, otherwise it will only
check the ones it finds. It is strict by default unless
TARGET_BUILD_UNBUNDLED=true or ALLOW_MISSING_DEPENDENCIES=true.
Moves the script and data file from build/make.
Test: m check-boot-jars - for failing and passing cases
SKIP_BOOT_JARS_CHECK=true - no check-boot-jars target created
ALLOW_MISSING_DEPENDENCIES=true - not strict
TARGET_BUILD_UNBUNDLED=true - not strict
verified manually that apart from path differences the same
files (same check sum) were checked in both old make checks and
the new Soong ones
EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m check-boot-jars
Bug: 171479578
Change-Id: I9d81d6650ba64fc0d48d2dab4ba5a3ba8dd03dec
A global variant was used to store the global mapping between
modules and APEXes. Replace it with storing pointers to APEX
contents inside each module so that they can query the contents
of any APEXes they belong to.
Bug: 146393795
Test: all Soong tests
Test: single line change to build.ninja host install dependency ordering
Test: no Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: Id2d7b73ea27f8c3b41d30820bdd86b65c539bfa4
This reverts commit 3666c7023f.
Reason for revert: This was originally reverted because it caused a breakage (b/167405890) in a branch that is no longer relevant.
Change-Id: I81063cd47b816b5b3c0ab8427432730d6b881a3f
This reverts commit 3a55c91f9d.
Reason for revert: build failed. Guess this is the cause but needs to confirm. Creating a revert per instructions
Change-Id: I30f1c8cd63e5ab84dba5d21ed354a42695c24ec4
This allows setting the prebuilt sdk's generated java_imports
sdk_version to "none".
Test: go tests
Test: m
Bug: 160455085
Change-Id: Id24aca811f0f09692971e63418da6685d8351737
Add a new helper SortedIntKeys similar to SortedStringKeys.
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I08a43ec2cae7d1a82531295aca1a0658e3a0dd6f
Use the -printusage flag in R8 to output a list of the unused
methods. Some of the files can be large (2MB for DocumentsUI,
87MB for all of AOSP), so immediately zip them and remove the
originals. The zipped files will be merged and disted.
Bug: 151857441
Test: m TARGET_BUILD_APPS=DocumentsUI dist
Change-Id: I780e84e80eba7fe4d4fa15fec0f461890afd900b
Previously only the names were collected, and later used in the
manifest_fixer to add missing <uses-library> entries to the manifest.
Now we also need to collect build-time and on-device paths, to be used
in class loader context for dexpreopt. This commit only collects paths,
but does not pass them to dexpreopt yet.
Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I34b229ee68f16ba215ba03770feadb4d890ec2bf
We want to support a compile_dex property for java_import. This splits
dex-related properties into a dexer struct which can be embedded in
relevant modules.
Test: m
Test: soong tests
Bug: 160455085
Change-Id: If56a51dac43f630d49483a36db29cd50e9ccd529
Update android_app_set to use word install rather than master for
android_app_sets, this better matches the phrasing used for apex_set.
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 161896447
Test: m nothing
Change-Id: I429e7f8b16c42c10ad4d9543110f5ce814a893b1
When WITHOUT_CHECK_API=true, the droidstubs apiFile can be nil. Fix this
by defensively checking for nil paths when making the TaggedDistFiles,
and also in android.MakeDefaultDistFiles.
The error message reported in r.android.com/1335521 was:
"internal error: panic in GenerateBuildActions for singleton androidmk
Dist file should not be nil for the default tag in
android.net.ipsec.ike.stubs.source in translateAndroidMkModule for
module android.net.ipsec.ike.stubs.source variant android_common"
Test: WITHOUT_CHECK_API=true m droid dist
Bug: 152834186
Signed-off-by: Jingwen Chen <jingwen@google.com>
Change-Id: I1b1f7c0b7a0e1c0ed5e15957d0162c47fd3ec197
Add a rule to build a zip containing the lint reports from transitive
dependencies for apps, and pass it to Make.
Bug: 153485543
Test: m TARGET_BUILD_APPS=Gallery2 lint-check
Change-Id: I523c09016251377ff89d76084769be7401b95425
Pass a list of unstripped JNI libraries to Make so that they can be
installed into the symbols directory.
Bug: 159726429
Test: forrest
Change-Id: Ieb4bffbb3d0a09f476da011399c5b8b1611929d7
Soong and Make have no ways to figure out what splits will be outputted
from a given android_app_set, so it's impossible for them to provide
full PACKAGES.$(LOCAL_MODULE).CERTIFICATE entries, which are required to
build a final apkcerts.txt. This change makes extract_apks produce
apkcerts.txt files for each input modules instead. The Make-side
counterpart of this change merges all local apkcerts.txt into a final
one.
Fixes: 160119159
Test: main_test.go
Test: m apkcerts-list
Merged-In: I321e80fd636a955213761f56a3ac64bfe7f7f7c0
Change-Id: I321e80fd636a955213761f56a3ac64bfe7f7f7c0
This CL adds "dists" to the base property struct to support multiple
dist file configurations, and generic tag support to dist tagged outputs
of modules.
Fixes: b/152834186
Test: soong tests and `m sdk dist`
Change-Id: I80c86bc9b7b09e671f640a4480c45d438bdd9a2a
Signed-off-by: Jingwen Chen <jingwen@google.com>
This reverts commit 91206d9ed1.
Reason for revert: package-check.sh doesn't work on mac
Bug: 158081251
Bug: 157649935
Change-Id: I50af71d54d5f1f8b516bfcf1efbcf6217e89c83a
Previously, the package check was only run when building checkbuild or
the phony target created for a specific module. It would not run when
building a module that depended upon a library with the
permitted_packages property. That was because the package check was
only run when the package-check.stamp file was built and that was only
added to the phony and checkbuild targets.
Instead of touching a separate package-check.stamp file to indicate
that the check has been performed this change copies the input jar file
to the package check to a separate ../package-check/<jar> file which is
then treated as the output of the library and is the input for any dex
processing. So, any modules that depend on this library will
transitively depend on the output file produced by the package check
command and so will ensure that the package check is always run.
Test: Removed "android.net" from the permitted_packages for
"framework-tethering", build "framework-tethering" which
triggered and failed the package check and
"com.android.tethering" which did not.
Made this change.
Built "com.android.tethering" which triggered and then failed the
package check.
Removed change to "framework-tethering"
Bug: 157649935
Change-Id: Ib01aa09e13f80282218049270eb7a58ec5f9f605
Package checks were not being run for java libraries that were in an
APEX and not on the platform. This change fixes that and updates the
script to report all failing classes to make it easier to update the
list of packages.
Test: m java
Bug: 157633658
Change-Id: I28044e08d3a40e9f3464bb2158ef6a28d57264d1
Since the metalava invocations have been merged into a single one,
and checkapi already requires the other timestamp, this has no effect.
Bug: 151160048
Test: m checkapi
Change-Id: I560058f0f4cdeaedaf247cd35119da2cf0b86ea0
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.
Now, android_library supports AEPX variants.
Due to this change, the whilelist for apex_available got bigger.
Exempt-From-Owner-Approval: cherry-pick from internal
Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
(cherry picked from commit bd133b1bdc)