aboutsummaryrefslogtreecommitdiff
path: root/java/java.go
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Fix stem to be propagated to output jar name in java_libraryJihoon Kang2023-07-141-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, java_library.stem property is not correctly reflected in the output jar name in java_library when the module specifies java_resource_dirs property. This change fixes the unexpected behavior so that setting the stem property behaves as expected. Test: go test ./java && m Bug: 285843207 Change-Id: I0941fcea83c92f4c42ae415aa6ad9125da5cf57b
* | | Merge changes from topics "errProne_bp2build_manually_enabled", ↵Alix Espino2023-07-171-16/+26
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | "error_prone_config" into main * changes: Bp2build for errorprone modules that manually enabled/disabled it Make errorprone a configurable attribute for bazel conversion
| * | Bp2build for errorprone modules that manually enabled/disabled itAlix2023-07-131-16/+26
| | | | | | | | | | | | | | | Test: go test ./bp2build Change-Id: Ie60c0959ee9ae8ce86c11a8e85a0bc7592f63df8
* | | Merge "AIDEGen: Collect apt generated sources" into mainVadim Spivak2023-07-121-1/+3
|\ \ \ | |/ / |/| |
| * | AIDEGen: Collect apt generated sourcesVadim Spivak2023-07-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Java compiler may generate sources when processing annotations. These sources are currently not included in the IDE project model, which results in unresolved symbols when using Hilt and other annotation processors. These sources are not passed to the Java compiler for compilation, so they cannot be handled like other Java module sources. This change archives the generated sources and appends them to the existing srcjar list in module_bp_java_deps.json. Test: go test . Test: Verified that module_bp_java_deps.json contained srcjar entry Test: with path/to/android_common/javac/anno.srcjar. Test: Verified that IntelliJ can resolve generated symbols after Test: invoking aidegen. Change-Id: I6a3011f9140fd25f785178baee0cd6074ad94600
* | | Remove metalava --no-banner argumentMårten Kongstad2023-07-121-2/+1
|/ / | | | | | | | | | | | | | | | | metalava no longer prints an ASCII banner, and has removed its --no-banner argument. Update all call sites accordingly. Test: presubmit Bug: 286023667 Change-Id: I61cf5f1125dfbd93496e6a59eb1ea62886b32046
* / Extract class files from dep_api_srcs instead of java filesJihoon Kang2023-06-291-54/+42
|/ | | | | | | | | | | | | | | | | | | | | | Currently, stub java files are extracted from srcjar file provided from dep_api_srcs in java_api_library module generated in java_sdk_library per api scope. However, compiling the java files may lead to difference in the content of the generated class files even if the stub java files are equivalent, as javac may arbitrarily add overridden methods. Thus, create a stub jar file instead of creating a stub srcjar file and compiling it, in order to guarantee stub jar files content equivalence and thus enable hiddenapi during from-text stub build. Note that this change does not fully resolve differences between the full api surface csv and the per sdk_library csv. Instead, it removes the difference caused by methods arbitrarily added by javac. This change also renames dep_api_srcs to full_api_surface_stubs to be more intuitive. Test: rebase on top of aosp/2617274 and `m --build-from-text-stub` Bug: 275570206 Change-Id: I22b6d56624633681f5c3b000370b5782655c7b8d
* Merge "Cleanup remaining android.JavaApiLibraryName() references"Treehugger Robot2023-06-231-1/+1
|\
| * Cleanup remaining android.JavaApiLibraryName() referencesJihoon Kang2023-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the name of the java_library generated from sdk_library per api scope does not depend on the build configuration anymore, all dependency switching "magic" via android.JavaApiLibraryName() can be removed. This change also removes from-text-build-specific test cases, as those test cases depend on build configurations. Test: m nothing && m nothing --build-from-text-stub Bug: 287340610 Change-Id: I3bac35259e0cbaa16432a46cb2b128951c9bc075
* | Use generics for DepSetsColin Cross2023-06-221-2/+2
|/ | | | | | | | Use Go's generics for DepSets so they don't require a type-specific wrapper and reflection. Test: depsets_test.go Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
* Make aconfig flags generate a library instead of a srcjar.Joe Onorato2023-06-091-0/+2
| | | | | | | | Also add unit tests for the rest of device_config Bug: 283475679 Test: m nothing (soong unit tests) Change-Id: Iee18a1f2f2cbb23e8c8d84c54e903b32be29a693
* Update runpath for jni libsSpandan Das2023-06-061-24/+15
| | | | | | | | | | | To support stem, cc libraries will be generated in <pacakge_name>/<label.name>. Update RUNPATH of java binaries so that it can find its jni deps Test: bp2build Test: TH Bug: 240563612 Change-Id: Ia2f70f0424a8526ee35856225c1a8cd1067a8570
* Merge changes from topics "xsd_config_bp2build_cc_rdeps", ↵Spandan Das2023-06-051-1/+16
|\ | | | | | | | | | | | | | | "xsd_config_bp2build_java_rdeps" * changes: bp2build for cc libraries that use xsd_config as gen srcs bp2build for java libraries using xsd_config srcs
| * bp2build for java libraries using xsd_config srcsSpandan Das2023-06-011-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Soong, java libraries can use src files generated from xsd_config. In Bazel, instead of providing srcs, java_xsd_config_library will provide a jar. Update bp2build so that all src references to xsd_config modules in srcs get routed to deps and exports attributes This CL creates an interface in build/soong/android to get around a circular dependency issue. The bp2build logic needs to exist in soong-java, but soong-java does have soong-xsdc in its package path. Use the interface and type assertions to special case xsd_config references Bug: 211678537 Test: bp2build test in sibling CL in system/tools/xsdc Change-Id: Ida924bb20b1fd7eb8beeef950b070d37a9c6f3b5
* | Merge "Support test runnner option in auto generated test configs"Treehugger Robot2023-06-021-0/+5
|\ \
| * | Support test runnner option in auto generated test configsDan Shi2023-05-261-0/+5
| | | | | | | | | | | | | | | | | | | | | Bug: 284179405 Bug: 236980335 Test: unittest Change-Id: Ifae3d556ff79153ca6c3067347fc259b665fb2e1
* | | Merge "Add simple bp2build converter for java_test_host"Zi Wang2023-06-011-8/+76
|\ \ \
| * | | Add simple bp2build converter for java_test_hostZi Wang2023-06-011-8/+76
| | |/ | |/| | | | | | | | | | | | | | | | Bug:281551424 Test: java_test_host_conversion_test.go and presubmits Change-Id: I43ed26df0bacd63ef402de4d9733d19604005c35
* | | Explicitly specify `--api-overloaded-method-order source` for metalavaPaul Duffin2023-06-011-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, `--api-overloaded-method-order source` was the default if that option was not specified but the other change in this topic is switching it to `--api-overloaded-method-order signature` to match the behavior in AndroidX. This change explicitly specifies the option needed by Soong's use of metalava. Bug: 285140653 Test: m checkapi Change-Id: I00e049e0d991e650ab9940a3d495ed2b6e7480f8
* | | Explicitly specify `--api-class-resolution api` for metalavaPaul Duffin2023-06-011-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | Previously, `--api-class-resolution api` was the default if that option was not specified but the other change in this topic is switching it to `--api-class-resolution api:classpath` to match the behavior in AndroidX. This change explicitly specifies the option needed by Soong's use of metalava. Bug: 285140653 Test: m checkapi Change-Id: Ief3c7f9dfdfa946f21cb048a579ec90309fb350f
* | Merge "bp2build java_resources that only contain a filegroup"Alix Espino2023-05-261-1/+14
|\ \
| * | bp2build java_resources that only contain a filegroupAlix2023-05-241-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | supports filegroup that specifies path property Bug: 280860624 Test: built libauto_value_plugin Change-Id: I9ed0b13e055beb92ba8090f6b5e88b9873c9ce61
* | | Merge "Modify error emit condition for checking api files in java_api_library"Jihoon Kang2023-05-251-2/+2
|\ \ \ | |/ / |/| |
| * | Modify error emit condition for checking api files in java_api_libraryJihoon Kang2023-05-251-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | java_api_library currently emits error based when the java_api_contribution module has an empty api file or when the module does not have any api files. This may be problematic in partial manifests where allow missing dependency is set, thus add this condition for error emission. Test: go test ./java Bug: 284212875 Change-Id: I10b4baa5723e7a53d931823b3029ea20ac731911
* / data_native_bins is only available in java_test_host, add java_test_host ↵Kun Niu2023-05-231-0/+1
|/ | | | | | | | properties to java_defaults to make it's available in java_defaults as well. Test: local build Bug: 279622634 Change-Id: Iceaf960d587544ae934424a773a6ae3b17fb443e
* Parallelize singleton executionLaMont Jones2023-05-191-2/+2
| | | | | | Bug: 281536768 Test: manual, presubmits Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
* Merge "Disallow missing api source files for java_api_library module"Jihoon Kang2023-05-191-4/+2
|\
| * Disallow missing api source files for java_api_library moduleJihoon Kang2023-05-171-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | The purpose of this change is to enable filegroups to be taken as inputs for `java_api_library` module `api_files` property. However, since android.MaybeExistentPathForSource() does not support this, it needs to be replaced with android.PathForModuleSrc(), which checks for the files' existence. Bug: 283006953 Test: go test ./java Change-Id: I8a7d7f200f900219cc17243194a4c26071329ee6
* | Fix Soong code, remove dead code, and clean up code for Java fuzzCory Barker2023-05-171-1/+0
|/ | | | | | | (cherry picked from commit fdf043a7b109250447f7c89bbeb29a1726a4d602) Test: built fuzz targets locally and tested them with Jazzer Change-Id: I3ff487ba4e34289e0f53f2077463f524f4bf4f11
* Merge "Delete kotlin/rules.bzl file"Alix Espino2023-05-111-1/+1
|\
| * Delete kotlin/rules.bzl fileAlix2023-05-081-1/+1
| | | | | | | | | | | | Bug: 277800767 Test: treehugger Change-Id: I5cff1e4bbb18b9145335169bc4edb0d569525b35
* | Merge "Delete java/rules.bzl file"Alix Espino2023-05-091-3/+3
|\ \
| * | Delete java/rules.bzl fileAlix2023-05-041-3/+3
| |/ | | | | | | | | | | Bug: 277800767 Test: treehugger Change-Id: Idc80cd51317d167fca8d5543bb53c585adeaddad
* | Merge "Provide a resource_prefix_strip for java_resources in bp2build."Treehugger Robot2023-05-051-0/+5
|\ \ | |/ |/|
| * Provide a resource_prefix_strip for java_resources in bp2build.Romain Jobredeaux2023-05-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Although paths to resource files in a Bazel java_library should be relative to the package, the directory structure in the resulting jar will have resources under the full path from the top-level of the workspace, e.g. if a library in "a/BUILD" has java_resouces as "res/res.txt" then by default the res.txt file would appear under "a/res/res.txt". Fix this by adding a resource_strip_prefix in that case. Test: Unit tests Change-Id: If4325126f5c19a2a8fb83ee09bc3a95a18673fe3
* | Use api_levels_released_versions from starlarkCole Faust2023-05-021-1/+4
|/ | | | | | | | | Instead of exporting it to soong_injection. Bug: 279095899 Test: m nothing Change-Id: I7b93af233b7450848a475512b5f5682ece773c09 Merged-In: I7b93af233b7450848a475512b5f5682ece773c09
* Ignore test apexes from bp2build generated tagsSpandan Das2023-04-271-1/+1
| | | | | | | | | | | | | | Soong does not enforce apex_available on the contents of test apex. To prevent special-casing test apexes in the apex validation aspect in Bazel, drop the test apexes from the tags altogether. ( The core problem I am trying to solve is making sure that stub libraries in Bazel have a single apex available. apex validation happens to be a nice side benefit) Bug: 277651159 Test: go test ./bp2build Change-Id: Ibb3cfedb5c0f2cda0464bf3758c70b67cb5885d1
* Merge "Utilize from text core platform api surface jar in build"Jihoon Kang2023-04-251-1/+3
|\
| * Utilize from text core platform api surface jar in buildJihoon Kang2023-04-061-1/+3
| | | | | | | | | | | | | | | | Use JavaApiLibraryName function to redirect the usage of core platform api stubs from .txt files based on config. Test: m --build-from-text-stub Change-Id: I926a0a455fed301ba4ff9dfa509d4dbbbd076029
* | Merge "Bp2build support for sdk_version and java_version."Romain Jobredeaux2023-04-131-18/+15
|\ \ | |/ |/|
| * Bp2build support for sdk_version and java_version.Romain Jobredeaux2023-04-111-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds java_version and sdk_version support to bp2build converters for - java library - java binary - android library - android binary - android library import Although java import doesn't support java_version and sdk_version, the neverlink java_library wrapper around a java_import must specify a sdk_version when targetting a device. "none" is used by convention. Change-Id: I22a69dea2e351858368df69ed6a703b568d613ea Bug: 215230098 Test: Presubmits
* | Merge "Update java_api_library in testing modules"Jihoon Kang2023-04-051-3/+5
|\ \ | |/ |/|
| * Update java_api_library in testing modulesJihoon Kang2023-04-041-3/+5
| | | | | | | | | | | | | | | | | | | | The full api surface java_api_library modules are currently defined as java_library modules instead of java_api_library modules. This change corrects this and modifies the DepsInfo of java_api_library so that it can be compatible in tests. Test: go ./java Change-Id: I540b5a930f506ce5f7663ab6e07c6df49af15cf9
* | Support arch variants in java's StaticLibs in bp2buildRomain Jobredeaux2023-04-041-5/+12
|/ | | | | | Test: Presubmits Bug: 276901800 Change-Id: I6058a726833ef10a5f470946e2d265b20fa547ce
* Add dep_api_srcs property to java_api_library moduleJihoon Kang2023-04-031-14/+82
| | | | | | | | | | | Users can pass the jar-file creating module via dep_api_srcs property in java_api_library to create the jar file not by compiling the stubs generated from metalava but by extracting and zipping the class files from the jar file of the input module. Test: m android-non-updatable.stubs.from-text Bug: 273381329 Change-Id: Id1b75179111cc7ff45faaff58388db1347bb18e5
* rename aidl/library.bzl to aidl/aidl_library.bzlSam Delmerico2023-03-311-2/+2
| | | | | Test: b test --config=android //build/bazel/... Change-Id: I7e22ee5ffa391ddaf43a3eec17812be78f2d86ab
* Merge "Modify Soong to utilize from-text android.jar in build"Treehugger Robot2023-03-291-1/+18
|\
| * Modify Soong to utilize from-text android.jar in buildJihoon Kang2023-03-281-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context - from-text android.jar files are built using Metalava, and these can be utilized in `decodeSdkDep` so that any modules that depends on APIs can be compiled using from-text android.jars - This change removes dependency on source java files when compiling stub android.jar files Implementation - Modify java_api_library module to create system modules using the generated android.jar - Replace modules in decodeSdkDep to link against java_api_library modules - Add --build-from-text-stub flag to hide the feature behind a flag Test: m --build-from-text-stub Bug: 271154441 Change-Id: I104df595edc65c0006820d5ae5b15f1fb167e190
* | Merge "Compile stubs to .dex"Spandan Das2023-03-281-0/+45
|\ \
| * | Compile stubs to .dexSpandan Das2023-03-231-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although stubs are not installable on device, we need to compile .dex to support hiddenapi metadata generation. Bug: 271443071 Test: Built out/soong/hiddenapi/hiddenapi-stub-flags.txt with aosp/2487266 (There is still some delta due to missing signatures in child classes) (Will address them in a followup CL) Change-Id: Iac1330c449934085a479c487a1489aa1695a75ee Change-Id: I1baa9c0f45eb8fc93f5c3177389ea5a2b7ca0a0b