- Register a singleton and implement GenerateBuildActions func in java/jdeps.go.
- Declare a interface and a struct to collect info in android/module.go.
- Implement IDEInfo for Library & Import module in java/jdeps.go.
- Implement IDEInfo for Genrule module in genrule/genrule.go.
- Implement IDEInfo for fileGroup module in android/filegroup.go.
- Test codes for jdeps.go in java/jdeps_test.go.
Bug: 111044346
Test: export SOONG_COLLECT_JAVA_DEPS=1;mmm packages/apps/Settings
out/soong/module_bp_java_deps.json will be generated
Change-Id: If61da77b4d7614c2c5da438b6af4c725ceccc5c3
android_test modules should have Instrument = true like android_app
modules so that they get instrumented when EMMA_INSTRUMENT=true.
Bug: 115929955
Test: m EMMA_INSTRUMENT=true
Change-Id: I2c0e8ab95d2cdc47fc28af9c7264ab544d0e7a28
The dist file path is changed from apistubs/{api_scope}/*.jar to
apistubs/{owner}/{api_scope}/*.jar. it makes easy to get stub files
when updating prebuilts/sdk by making it possible to distinguish
between Android libraries and Google libraries.
And Onwer() function is added to ModuleBase for getting onwer info.
Test: make -j40 PRODUCT-sdk_phone_armv7-sdk dist sdk_repo
Change-Id: I50069aff6664901e6c9129d69643a414ee5e41d0
The change https://r8-review.googlesource.com/c/r8/+/26482 made R8
process data resources by default. This is not expected for the
Android Platform build
Test: m -j PRODUCT-aosp_x86-userdebug core-oj
Change-Id: Idb17e39dae524dacf4b258c9f27be86e3179667f
The icu resource directories contain filenames that have '$'
characters.
Allow paths returned by the Glob functions to contain '$', on the
assumption that real paths on disk are unlikely to contain strings
that are valid ninja variables. Fix the Build rules to escape any
paths that are passed as Path arguments. Fix the resource rules to
manually escape the paths that are passed as strings.
Test: m checkbuild
Change-Id: Ie631bc6d96259e592adb280491a365c0df7ed0e2
Add a new sdk_version "core_platform_current"
value to java_library.
This adds the ability to compile system code against the
core platform API stubs. These stubs will contain the public SDK
API _and_ a selection of extra methods just intended
for use by system code (e.g. framework .jar) and
which must be preserved if "core" is modularized to
retain source and binary compatibility. Methods
outside of the core platform API must not be relied upon.
Future changes will adding methods to the core platform API and
switch targets over to use the stubs.
As soon as feasible, (hopefully) the default for when
unspecified will be changed to be the same as specifying
core_platform_current and build rules will have to explicitly
specify when they want to compile against the core library
implementation directly.
Bug: 113148576
Test: mmm libcore/mmodules/core_platform_api_client_demo
Change-Id: I72a03f28a4c38b4232e513a088c2d4e962c98868
Originally when metalava sees arg: "--generate-documentation", it will
create a seperate process to invoke javadoc/dokka.
Now this is handled by our build system. Basically metalava target will
only generate a .srcjar file. Any other droiddoc target which generates
docs can depend on this metalava target.
By doing this, if multiple doc targets depending on the same metalava
sources. The metalava won't need to be re-run by multiple times which
could cause quite some timing overhead.
Test: m clean && m -j core-docs and
compare the results using md5sum between the old and new content.
also m clean && m -j core-current-stubs-gen-docs and
compare the results using md5sum between the old and new content.
Bug: b/78245848
Change-Id: If7deef0da738645efe7d3a8376ff2bb3dec92c01
Some logic in java.go was conditional on TargetOpenJDK9(), which in
turn relies on a global build flag (EXPERIMENTAL_USE_OPENJDK9=true).
This CL changes the logic in collectBuilderFlags() to check for
javaVersion greater or equal "1.9" instead, which is true when either
EXPERIMENTAL_USE_OPENJDK9=true (global) or javaVersion "1.9" (a
per-build target attribute).
Because the value of flags.javaVersion isn't available there,
TargetOpenJDK9()-dependent logic in Module.deps() was changed to
be unconditional; as far as I understand, this means that system
modules deps will be built regardless of whether they're needed
later in the build. This will probably slow down the build
unnecessarily until the first user of these system modules appears
(expected soon), but probably not by much.
There is some TargetOpenJDK9() related logic remaining in droiddoc.go,
but this doesn't seem to break the build of Java 9 language sources
and is probably no longer needed now that metalava is used for
generating the stubs (thanks to Nan!), and those do not contain any
Java 9 language features.
Bug: 112443425
Test: Checked that Java 9 language support works on AOSP after
this CL without a need for EXPERIMENTAL_USE_OPENJDK9=true,
ie. after also patching CL http://r.android.com/646840 ,
"make docs droid cts" completes, the device boots and
Java9LanguageFeaturesTest passes.
Change-Id: I393b97a7b3bb4c1c3d06580c639e94ff6cf916ff
targetSdkVersion should stay as "current" when min_sdk_version
is set but sdk_version is not.
Bug: 112438448
Test: atest CtsTelecomTestCases
Change-Id: I11dc27eccd31200d1ce27c7e332106bb825651b4
kotlinc-build.xml was ending up in the final jar because it was
being created in the directory where the classes were written.
Rename the variable containing the classes directory from outDir
to classesDir to discourage putting other files in there, and
move kotlinc-build.xml up a directory.
Bug: 114524493
Test: m checkbuild
Change-Id: Id2e2af0a6543499bd25b8fbd642bc59b14bd241f
I'm adding a annotation processor to the framework target that does not
run as part of the main build, but only for a parallel build target
framework-annotation-proc, which is identical to framework except that it
also runs an annotation processor. Update build rules to be aware of this
target so that it builds successfully.
Test: m framework-annotation-proc
Bug: 113853502
Change-Id: I8b20758dc8bd0e8cb2542414d7a45a2cd7d2e158
ctx.AddDependency will succeed if the named dependency only has a
single variant, even if that variant is the wrong architecture.
Use ctx.AddVariationDependency(nil, ...) instead, which requires
that all variations of the calling module match the dependency.
Bug: 112707915
Test: no change to out/soong/build.ninja
Test: using a device dependency in a host java module is an error
Change-Id: I70b661a57d4412eb63b8c9841febfb756e9e025d
This allow Metalava to generate public-dex file when user specify
dex_api_filename.
This blocks how we try java9 for droiddoc since "hiddenapi-lists-docs"
targets depends on libcore sources.
Test: m -j hiddenapi-lists-docs
Bug: b/78245848
Change-Id: Ic847c1123b14afb599dbf2a588885fd36e56b2cc
Merged-In: Ic847c1123b14afb599dbf2a588885fd36e56b2cc
library manifests were just being dropped on the ground.
Bug: 112467584
Test: build
Change-Id: I61c2efca37aa3fdb9c944260f4a276d1d3c26f6c
Merged-In: I61c2efca37aa3fdb9c944260f4a276d1d3c26f6c
(cherry picked from commit b7c147efec)
If a module has kotlin sources the compiled kotlin clsases must be put
in the header jar for anything that depends on the module to use.
Bug: 113153312
Test: m checkbuild
Change-Id: Ibc44e9a97655937315b03b05e51e09c2954d7008
R8 no longer outputs an empty map file when minification
(obfuscation) is turned off.
Test: m -j PRODUCT-aosp_x86-eng
Change-Id: I317e703597368dc8c16751bcc8d0e43f985614fa
This reverts commit ec716b4151.
Reason for revert:
This is second attempt for Make Metalava checkapi a seperate run.
The first attept didn't work since Metalava also need sources,
classpath, and etc, not like how old Doclava apicheck works.
Test: cherry-pick go/ag/4832335 in internal master, and do 'm clean && m
-j checkapi', it failed with erros which is expected.
Bug: b/113126618, b/113131828
Change-Id: I664b7838d15615905a2e798b1df832218031dfe7
This reverts commit ed0a39dba7.
Reason for revert:
it seems checkapi can be passed successfully even if we didn't do update-api for new changes. roll-back for now and do more investigation.
Change-Id: Idd54ea8919671d54aa6401233156d6c0bcf5325f
We should not squeeze all the args to one Metalava run, especially for
checkapi.
Bug: b/113126618
Test: m -j checkapi, and check out dir api-stubs-docs.
Change-Id: I8d0c75745c7861b6de9070ef69f8e9284473a5d7
Due to various bugs hidden deeply within Doclava, running with
"-source 1.9" is always failed for it.
So switch to "-source 1.8" for now. This includes the case of running the
combination of Metalava + Doclava. Once we have new documentation tool
in system, we can full deprecate Doclava.
Test: USE_R8=true EXPERIMENTAL_USE_OPENJDK9=true m -j core-docs
Bug: b/70351683
Change-Id: I9553f88d0dd9bc263a249c49075c0b931b5d4927
android_app and android_test modules weren't getting
InitDefaultableModule called on them. Call InitJavaModule
which does both InitAndroidArchModule and InitDefaultableModule.
Test: m checkbuild
Change-Id: I26f3c04ea8bdfcacb59dcdbc63d6db5604c2598a
"--previous-api" option was not recommended after Metalava was
changed on how to consume the api file args.
Test: m -j api-stubs-docs
Bug: b/78245848
Change-Id: I1054173e11b4d47942dda0b95193277758aa8193
R8 complains when it gets dex files in the input jar, but some tests
use dex files or dex jars as resources. Keep resources separate
from classes until after r8 has been run.
Test: java_test.go
Test: m checkbuild
Change-Id: I1d9164d60d6b054ebb138648da07d80ee769177f
A few tests that have classes in the java.base module need to pass
--patch-module=java.base=<classpath> to javac.
Test: m checkbuild
Change-Id: I246bad92dcde976969b064aace5e2856e2bac971
Make :module on a java_library provide the output file, which is
normally the implementation jar. For java_library modules with
installable: true or compile_dex: true this will be the dexjar
instead. For android_app modules this will be the apk.
Bug: 80144045
Test: no change to out/soong/build.ninja
Change-Id: I739674aee60a38bfccb859369e4414b46f293d82
There is more variety of java tests than I expected, don't
default to including junit, that's just going to lead to
unexpected junit classes for module authors that don't know
to set junit: false. All existing uses of java_test are
already not using junit or setting static_libs: ["junit"],
and all test in Make are already specifying junit.
Bug: 70770641
Test: m checkbuild
Change-Id: I4393b70d87dd2b6e3bb719fdb758915053bee0c7
Files in the data property will be passed to
LOCAL_COMPATIBILITY_SUPPORT_FILES in Make.
Test: m checkbuild
Change-Id: Ifc074317f957aba8f55daa30abc5b9737d1eceac
Move autogenerating the test config for Soong modules into Soong
for java_test and android_test modules.
Bug: 70770641
Test: m checkbuild
Test: atest CtsUiRenderingTestCases
Change-Id: I02593add0407ef694b91c14cf27411a4f3cc4745
We were not passing the proguard_flags_files files as -include
arguments to R8.
Bug: 112462307
Test: m checkbuild
Change-Id: I8f3b10fc338aa4b15c0fb220ee2891efbb0b020f
Metalava is supposed to treat all the args after
"--generate-documentation" as either Javadoc or Dokka commands, and it starts
seperate process to invoke javadoc or java -jar dokka...
Dokka doesn't support --bootclasspath in its args, so treat all the
bootclasspath as classpath.
Also continue to refactor code to seperate Dokka runs from Javadoc or
Metalava.
Test: m -j metalava-dokka-core-docs
Bug: b/72394196
Change-Id: I0f0f3dd80cb2dbb53f19da8fa11ae0b1d92ac5d7
Soong droiddoc modules were using soong_java_prebuilt.mk, but they
don't need any of the java logic from it, and it includes
base_rules.mk which was not included by droiddoc.mk. Use
soong_droiddoc_prebuilt.mk that just installs the droiddoc
outputs without including base_rules.mk.
Fixes building docs modules in mm, mma, and m checkbuild.
Bug: 112388925
Test: m docs
Change-Id: I8ccbcd34adf268a830ee1a203270b955ea696701
We don't have API exported to glob any dir outside of current module.
Any files deps outside of current module should be either a
filegroup/filegroup or a customized module.
We already have similar customized module to track droiddoc-template, so
rename it to be more generic so that it can be used by
merge_annotations_dir also.
Bug: b/111916275, b/70351683
Test: touch manual/android/support/design/widget/annotations.xml, and m
-j metalava-api-stubs-docs, and check the built output srcjar.
Change-Id: I75420ddba69785e46bea75b6dd3f189be7cfe5ad
The GenerateAndroidBuildActions() is too big to be maintained and added-in new
features.
Since the GenerateAndroidBuildActions() is a giant code block having build flags
setting and workflow logic mixed in it. So seperate these two main
stuff to only keep workflow logic in the function, and create other
indipendent flags setting functions to increase the modularity.
Test: m -j api-stubs-docs && m -j metalava-api-stubs-docs, and check
build.ninja file
Bug: b/70351683
Change-Id: I4230d353756aeb4b24640f641b8f8bab6b21204d
Droiddoc_options is added, since all sdk libraries don't builds with the
same argument. We provide basic droiddoc argument and options can be
added like "stubsourceonly" by this property.
When building stubs, soong don't make dex files, but some module uses
dex files from stubs. So Complie_dex is added for compiling dex
regardless of installable.
Srcs_lib_whitelist_pkgs property is added for using other whitelist
pkgs instead of "android.annotation".
Bug: 77577799
Test: m -j
Change-Id: Ic2fb7bc9c49a825550dbebe3e9132ad9a735322f
bundle files related to sdk dev tool(activity_actions.txt, and etc.) to the
final -docs.zip file since sdk.atree needs to copy these files from
$(OUT_DOCS)/offline-sdk dir.
Test: m -j out/target/common/docs/offline-sdk-timestamp
Bug: b/70351683
Change-Id: I3bfb3c56570dd6728dec272d38c6046e0d44c40f
Merged-In: I3bfb3c56570dd6728dec272d38c6046e0d44c40f
As it turns out, AIDL originally passed and returned success
when it was asked to compile an unstructured parcelable even
though no output files were created.
The build system currently can't handle this because it is
expecting outputs here, so I am adding this argument here
which will cause the compiler to exit and error earlier as
expected.
Notice also that the make implementation of the AIDL build
system also passes in this argument.
Test: m framework (which invokes this many times)
Bug: N/A
Change-Id: Ia9b5280dc3593756784035a523399545c9947d80
If targetSdkVersion is not set in the manifest, set it to the
value it was implicitly using before changing minSdkVersion.
Requires passing --library to manifest_fixer.py to distinguish
between apps, where the implicit value was set by aapt2 to
current, or libraries where the implicit value was 1.
Fixes cases where the manifest does not specify targetSdkVersion
and was inheriting the minSdkVersion value until manifest merger
started merging a lower targetSdkVersion value from a library.
Bug: 111347801
Test: manifest_fixer_test.py
Change-Id: I8fcf0c5f452707565ba1808f6fe552ffed055c47
API txt files from a java_sdk_library are automatically registered as
dist artifacts for sdk and win_sdk targets.
They are installed under $(DIST_DIR)/apistubs/<apiscope>/api/<name>.txt
where <apiscope> can be public, system and test.
Bug: 77577799
Test: m -j
Change-Id: I38cd8ee000445ce843ac01ead38001e509228738
This change replaces droiddoc's metalava_merge_annotations_dir
parameter (which takes a single value) with
metalava_merge_annotations_dirs (which takes a list). This will makes
it possible to merge libcore annotations in from a separate directory
under ojluni, instead of adding them in a preprocessing step.
It is implemented by passing the --merge-annotations argument to
metalava multiple times, which is already supported by metalava's
command line parsing.
Test: `make metalava-api-stubs-docs` with a local change to add a second directory in //frameworks/base/Android.bp
Bug: 111639530
Change-Id: I53d31f1dd45c13405b4511c2b44cbeb7f0e439d1
Define LOCAL_DROIDDOC_ANNOTATIONS_ZIP to export zip file.
Test: m out/target/common/obj/PACKAGING/metalava-api-stubs-docs_annotations.zip
Bug: b/78245848
Change-Id: I66ca2a50adc095cc8a8a1a10620427a91480a9bc
Since currently android.jar compile against to it.
Test: m -j metalava_android_stubs_current
Bug: b/78245848
Change-Id: Id5812f69125085821182295e577849b5f2c4bead
When the module type is SdkLibraryDependency, the classpath has been
gotten from headerJar
Becuase droiddoc uses src files when it builds, we should change to use
ImplementationJars instead of headerJar.
Bug: 77577799
Test: make -j
Change-Id: I1a072be69d7edff5636ea80af700be7796c3b0fc
Add a flag to be able to generate the Binder#getTransactionName method
Test: manual
Bug: 111200705
Change-Id: I3e8106261df5c63cdc005d07c9d8efcc6732db70
These are in the AndroidTest struct, and being exported by the AndroidMk
functions, but aren't in the list given to blueprint.
Test: add test_suites to an android_test, check Android-*.mk
Change-Id: I1e46638755cbb579f28ed14638baad43fde5cb96
merge_zips -stripFile was only considering the name of the file and
ignoring the path. Make it more useful by supporting blueprint style
globs. The previous behavior can be recreated by prefixing with **/.
Bug: 111389216
Test: m checkbuild
Change-Id: I25760fe3f1f77704dd9da9d107d9a38a415d681f