Commit graph

757 commits

Author SHA1 Message Date
Jaewoong Jung
38e4fb2ce6 Add buildDir to java patch-module paths.
This solves a problem where javac fails to find patch-module targets
when a build diretory is not under the project root.

Bug: 117770838
Test: java_test.go + manual build
Change-Id: If70d0d388a3f6c87b3f78a927df2063616d50c8a
2019-01-04 15:37:20 +00:00
Nan Zhang
e7968b192c Merge "Pass --merge-qualifier-annotations to check-api" 2019-01-04 00:53:45 +00:00
Nan Zhang
dee152bfa3 Pass --merge-qualifier-annotations to check-api
As tnorbye@ mentioned, the check-API comptibility needs the annotations
that were merged in so that the behavior will be consistent with
signature file.

Test: check the ninja file.
Bug: N/A
Change-Id: I0c06c838cf7ddfd43f583fc8c1b1ad999a4cc066
2019-01-03 11:28:47 -08:00
Victor Hsieh
a2c16c1aa0 manifest_fixer: rename to --prefer-code-integrity
During code review, the name change was suggested.

Test: local CTS passed
Bug: 112037137
Change-Id: I7eb25210afb45c7477b0d606574048a15c9c721d
2019-01-03 09:51:11 -08:00
Treehugger Robot
186c771cb4 Merge "In java.go, add implement check for both Dependency and IDE relevant interfaces" 2018-12-28 01:41:25 +00:00
Dan Willemsen
d56097dc27 Remove incorrect file comments
Test: none
Change-Id: Ia2889ee29c2c0bf18adf5d90e506cfce4b14fdcc
2018-12-27 12:26:30 -08:00
albaltai
36ff7dcbf4 In java.go, add implement check for both Dependency and IDE relevant interfaces
1. Add var _ to declare the struct Import implement IDEInfo and
   IDECustomizedModuleName interfaces
2. Modify var _, a typo case for struct Module implement Dependency interface
3. Add nil checking for Dependency interface implementation
4. Add more comment for developer

Bug: 121985695

Test: 1. m aidegen
      2. $ANDROID_HOST_OUT/bin/aidegen framework
      3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
	 denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

Change-Id: Ia2d2d65b83a52d35ccb3927a36bcf686d5223e20
2018-12-25 14:56:20 +08:00
shinwang
9e4c07a92f In java/java.go, enhance the checking logic for Dependency interface implementation
Add nil checking for Dependency interface implementation

Bug: 121985695

Test: 1. m aidegen
      2. $ANDROID_HOST_OUT/bin/aidegen framework
      3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
	 denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

Change-Id: Ibac280ce3de2537f453c4ca7e8f79f55667f1fa0
2018-12-25 03:36:37 +00:00
Treehugger Robot
fce523979c Merge "Modify jar dependencies collection from dexpreopt to jar with resource" 2018-12-22 03:34:10 +00:00
shinwang
7f1b38fa83 Modify jar dependencies collection from dexpreopt to jar with resource
Soong build system modify the jar installed path to dexpreopt, however, the jar only contains dex without java information. This patch modify the jar collection from installed path to ImplementationJars.

Bug: 121231786

Test: 1. m aidegen
      2. $ANDROID_HOST_OUT/bin/aidegen framework
      3. check import static android.Manifest.permission.BIND_VOICE_INTERACTION;
	 denpendency should be resolved in frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java

Change-Id: I8f24f3a3476e125d3fd808e0047db425e15046ac
2018-12-21 10:37:03 +00:00
Colin Cross
a044a686c5 Merge "Add a flag to allow unbundled builds to build SDKs from source" 2018-12-20 00:35:59 +00:00
Colin Cross
1f367bfe8b Add a flag to allow unbundled builds to build SDKs from source
Mainline modules are tightly coupled to the platform, and should
build against the current SDK from source and not prebuilts. Add
a flag UNBUNDLED_BUILD_SDKS_FROM_SOURCE to specify that a
TARGET_BUILD_APPS build should build the current SDK instead of
using the prebuilts.

Bug: 121194841
Bug: 121231426
Test: no change to out/build-aosp_sailfish.ninja
Test: forrest unbundled build
Test: forrest master apps build
Test: forrest mainline modules build
Change-Id: I45a40a335483dae2fe192721df9b31bdbab97ee5
2018-12-18 22:46:24 -08:00
Nicolas Geoffray
64d7f87c56 Add an owners file for dexpreopt files.
Test: N/A
Change-Id: I3d14a3cb6f0f5f8f5c0a7266285d4b8917922240
2018-12-18 20:28:06 +00:00
Colin Cross
43f08db29e Dexpreopt soong modules inside soong
Port the dexpreopt logic from Make to the dexpreopt package in Soong,
and use it to dexpreopt Soong modules.  The same package is also
compiled into the dexpreopt_gen binary to generate dexpreopt scripts
for Make modules.

This relands Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb and
I462182638bd57b1367b5bfb0718e975c11ae66f7, along with multiple fixes
to depsfile generation in dexpreopt_gen that caused .odex files for
modules in defined make to be missing dependencies on boot.art, and
a fix to not dexpreopt and strip tests.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Test: OUT_DIR=$PWD/out m
Test: NINJA_ARGS="-t deps out/target/product/sailfish/obj/APPS/Contacts_intermediates/dexpreopt.zip" m
Change-Id: I6bb2c971cee65d2338839753aa0d84939f335b1b
2018-12-15 19:07:54 -08:00
Colin Cross
4ff85ebeb7 Revert "Dexpreopt soong modules inside soong"
This reverts commit 29ff88741e.

Test: none
Bug: 119412419
2018-12-14 11:49:58 -08:00
Colin Cross
29ff88741e Dexpreopt soong modules inside soong
Port the dexpreopt logic from Make to the dexpreopt package in Soong,
and use it to dexpreopt Soong modules.  The same package is also
compiled into the dexpreopt_gen binary to generate dexpreopt scripts
for Make modules.

Bug: 119412419
Bug: 120273280
Test: no differences to dexpreopt outputs on aosp_sailfish system/,
      only expected changes to dexpreopt outputs on system_other
      (.vdex files for privileged Soong modules no longer incorrectly
      contain .dex contents).
Change-Id: Ib67e2febf9ed921f06e8a86b9ec945c80dff35eb
2018-12-13 15:53:54 +00:00
Sundong Ahn
ba49360c51 Remove dependency on framework.jar
Remove dependency on framework.jar to reduce the build time. So sdk
libraries are not checked API whenever frameowkr.jar changes.

Test: m -j
Bug: 119625999
Change-Id: I7435c429b7857de8c3c1834757c54888091753e5
2018-12-07 02:32:40 +00:00
Jaewoong Jung
1d6eb68731 Use debug mode when running R8 for eng builds.
Bug: 119601874
Test: Built for different variants.
Change-Id: I2250587eb3e457ca15265eb9f8359872e9b08363
2018-11-30 15:23:16 +00:00
Nan Zhang
3ffc352545 Change srcjarDir/stubsDirs to a different name.
Otherwise it might have the chance to clobber each other
if the rules ran at the same time.

Test: m -j docs
Bug: b/119671939
Change-Id: Ia57e62f0899e5c61539516833c6e3db88547932e
2018-11-29 10:42:47 -08:00
Colin Cross
b781740240 Merge "Dist the javac-compiled stubs jars" 2018-11-22 19:42:42 +00:00
Colin Cross
ac5027264c Dist the javac-compiled stubs jars
The header jars are compiled with turbine, which produces a jar that
is less compliant to the class file spec than when compiled with
javac.  Since the dist'ed jars may be shipped with the SDK, use
the javac version for maximum compatibility.

Bug: 119841341
Test: forrest SDK build
Change-Id: I745c8dd0305d95ae9ce025a9c23e51a99ebb0a3b
2018-11-21 20:36:17 -08:00
Jiyong Park
bfe64a1a59 Align entries in APEX at 4K boundary
Use -a option of signapk to specify the alignment to 4K. The default is
4.

Test: m apex.test; zipalign -c -v 4096 $(OUT)/system/apex/apex.test.apex
shows ok

Change-Id: I7b1a3d442b69b89838cf09451939cd23d5646bde
2018-11-22 03:09:40 +09:00
Pete Gillin
c382a5602b Add droidstubs support for --validate-nullability-from-list.
This names an input file for the droidstubs rule, so needs to be
handled in soong.

Test: core-current-stubs-nullability-validation-check-nullability-warnings
Bug: 73448108
Change-Id: I092c89f01c8a448ca486e4b57d43a1c3af133114
2018-11-19 17:49:38 +00:00
Treehugger Robot
493637cf1c Merge "Fix resources in unbundled builds without sdk_version set" 2018-11-15 15:48:55 +00:00
Colin Cross
42308aa174 Fix resources in unbundled builds without sdk_version set
Unbundled builds can be performed on modules that don't have
sdk_version set if they are in a platform checkout that has
framework-res.  Don't skip calling decodeSdkDep in unbundled
builds.

Bug: 117295826
Test: tapas PackageInstaller && m
Change-Id: I3de093cea05670e0b65e99820c07592973b90b3d
2018-11-14 21:44:17 -08:00
Zoran Jovanovic
8736ce29e8 Enable kotlinc flags in blueprint files
Add support for adding kotlinc files in the module.

Some flags are unnecessary as they are added by
default (-no-jdk and -no-stdlib), or are not needed
on an Android build (-include-runtime), or may
conflict with the build (-kotlin-home and
-Xintellij-plugin-root), so the error stops the
build if they are added.

Test: part of java/java_test.go
Change-Id: If3b2777062daaa490a20c014e9b1bb4b1cb0a8df
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sony.com>
2018-11-14 15:02:46 +00:00
Jiyong Park
8fd6192480 APEX can be flattened
When TARGET_FLATTEN_APEX is set to true, APEXes are flattened, which
means files in an APEX is not packaged into the mini file system image,
but instead directly copied to the system partition.

This option is for devices where kernel does not support loopback
devices or the maximum number of loopback devices is too small (though
the threshold is TBD as of now).

This CL also fixes a bug that jars having bytecode are installed instead
of those having dex.

Bug: 118485880
Test: TARGET_FLATTEN_APEX=true m apex.test; tree
out/target/product/.../system/apex/apex.test shows list of files in it.

Test; m apex.test, then a file out/target/product/.../system/apex/apex
.test.apex exists.

Change-Id: I5a3d62d392d05f2779c4925388afe4f6e460059b
2018-11-14 13:41:54 +09:00
Colin Cross
37a07b1784 Revert "Use protoc-gen-javalite for java lite protos"
This reverts commit 5a5aca0568.

Change-Id: Iadbc2ec7fbc45d888383e0e6f569cbfc5ef6a996
2018-11-04 17:23:48 -08:00
Colin Cross
87dc8b7138 Merge "Use protoc-gen-javalite for java lite protos" 2018-11-05 01:13:14 +00:00
Colin Cross
5a5aca0568 Use protoc-gen-javalite for java lite protos
Protobuf 3.5.2 does not natively support lite protos, instead they
are generated by the protoc-gen-javalite plugin compiled from
external/protobuf-javalite.

Bug: 117607748
Test: m checkbuild
Change-Id: I95c2d873f19d4c00e9dc312d7fdbe98cae250a8b
2018-11-03 00:05:58 +00:00
Colin Cross
fd94c40f6f Include java resources in app bundles
The java resources are merged into the dex jar, split them back
out into the root/ directory for merging into the bundle.
Also avoid running zip2zip when dexJarFile is nil by splitting
each munge step out into its own rule.

Bug: 117295826
Test: tapas RecoveryLocalizer && m dist
Change-Id: Ia22c8768bf2c3c6884792e923caf7624b4f76664
2018-11-02 15:51:48 -07:00
Pete Gillin
581d608468 Add check_nullability_warnings support to droidstubs.
This takes the warnings file written by metalava and diffs it against
the expected (checked-in) file, in a manner similar to the checking
and updating of the signature files. This makes it possible for a
developer adding a large API surface (e.g. by moving to a new version
of upstream sources for ojluni) to do so without being blocked on
adding the annotations, while ensuring that at all times there is an
up-to-date record of the API surface which is missing annotations.

Bug: 73448108
Test: See the other change in this topic.
Change-Id: If9ed470ef3355a0d713bb556b5561fb255e4e277
2018-11-01 15:28:04 +00:00
Dan Willemsen
419290aba9 Support setting target_sdk_version separately from sdk_version
Before this change, if targetSdkVersion wasn't set in the
AndroidManifest.xml, we'd set it to the sdk_version from the Android.bp.

But there are cases where you want to compile against a later SDK, but
target an earlier one (especially if you depend on libraries that need
to be compiled against more recent SDKs, like androidx).

Test: build APK with different target_sdk_version.
Change-Id: Iaed36b522955a374a049ef331158cc8fc5798ad2
2018-10-31 21:37:34 -07:00
Colin Cross
a54974c806 Pass AAR to make
Pass the output AAR file to make, where it will be copied to the
dist directory if requested by an unbundled build.

Test: m checkbuild
Change-Id: I126a81bd4b8ad0eeade99638ce9c2aa4579935bb
2018-10-31 14:39:47 +00:00
Colin Cross
f623721c08 Create bundle modules suitable for bundletool
Create a bundle module in addition to creating an APK, which can
then optionally be merged with bundle modules from builds for
other architectures and then be passed to bundletool to create an
app bundle.

Bug: 117295826
Test: tapas RecoveryLocalizer && m dist
Change-Id: I98a17d7407dc56823ece9ec88c087780185a6555
2018-10-31 14:39:16 +00:00
Jiyong Park
c00cbd9e7b APEXs are signed with apk signer
The entire APEX (which is a zip file) is signed with the apk signer.
Certificate can be specified via the 'certificate' property just like
ordinary apps. Note: multiple additional certificates are not supported.

Bug: 115721587
Test: m apex.test
Test: jarsigner -verify -verbose -certs .../apex.test.apex shows the
certificate info

Change-Id: Ia4c898d3427779a3809fdc683b85d7661ca65137
2018-10-31 10:13:54 +09:00
Dan Willemsen
72be5901eb Add aapt_include_all_resources
The equivalent of Make's LOCAL_AAPT_INCLUDE_ALL_RESOURCES.

Test: build LatinIME with Soong
Change-Id: Ib76bea5f28e365b59fa9477b9bceabb84012ff8e
2018-10-29 23:49:46 +00:00
Treehugger Robot
000b4d1abf Merge "Don't strip soong APKs" 2018-10-29 23:44:41 +00:00
Colin Cross
762fbfb746 Don't strip soong APKs
APKs that are preopted to system_other should not be stripped.
For now, don't strip any APKs.

Bug: 118592830
Test: m PrintSpooler; zipinfo $OUT/system/app/PrintSpooler.apk | grep classes.dex
Change-Id: Ife8a5fe4ff90e5e00ec24f43e089d9b3aa552fc0
2018-10-29 12:58:06 -07:00
Pete Gillin
67df651c3a Merge "Add support for nullability validation to droidstubs." 2018-10-29 11:46:13 +00:00
Neil Fuller
401eeba29f Remove sdk_version: "core_platform_current"
This (effectively) reverts commit 3c979c3348.

core_platform_current is the new default when no_framework_libs: true
so doesn't need to be specified anywhere.

Bug: 113148576
Test: build
Change-Id: I6bb6c1a0ea24437c8253dc5d8fabd37edabc9d3e
2018-10-26 09:11:22 +00:00
Pete Gillin
a262c05904 Add support for nullability validation to droidstubs.
This detects whether this is enabled, makes sure the other necessary
flag is set to provide a suitable location, and suppresses the
requirement for a previous_api.

Test: making a new libcore target using this
Bug: 73448108
Change-Id: Ifea3a060011a58e3288050c6c5d98b205abe25fc
2018-10-25 19:20:08 +01:00
Colin Cross
5a0dcd5acf Store dex files uncompressed and unstripped in privileged APKs
Privileged APKs need to store their dex files uncompressed so they
can be verified and mapped directly out of the APK.

Also track whether the module will be dexpreopted or not in order
to determine if the dex file should be stripped before signing.

Test: SystemUI.apk contains an uncompressed dex file
Change-Id: I4dca86c7f8778595882405b34adcf2a7bae03c67
2018-10-25 17:47:12 +00:00
Neil Fuller
840c411f96 Merge "Add annotation-related args to check api" 2018-10-24 18:43:32 +00:00
Treehugger Robot
9bce14bab6 Merge "Don't check the link type from stubs libs." 2018-10-24 01:42:17 +00:00
Neil Fuller
b2f14ecfef Add annotation-related args to check api
Without the annotation args the check API fails for
APIs that use visibility annotation args.

Bug: 117936519
Bug: 113148576
Test: build
Change-Id: Ie9d2116c7f255634de72de9a448f5c378c11c457
2018-10-23 20:34:34 +01:00
Treehugger Robot
5429ed0f20 Merge "Add support for sysprop description files to Java" 2018-10-23 03:45:07 +00:00
Jiyong Park
46f78fb4c6 Don't check the link type from stubs libs.
getLinkType also tells whether the module in question is a stubs lib or
not. If it is a stubs lib, link type from it isn't checked beause
dependency from the stubs lib doesn't matter; the stubs lib is
build-time only artifact.

In addition, core-lambda-stubs is added to the list of stubs libs.

Bug: 117964170
Test: m with https://android-review.googlesource.com/c/platform/libcore/+/793518/4
Change-Id: Ibd63484a1cc48dfd0afed6e6de098b7a38db5e61
2018-10-22 09:29:32 +09:00
Treehugger Robot
1b4aa43303 Merge changes from topic "soong_instrumentation_for"
* changes:
  Fix instrumentation_for to match LOCAL_INSTRUMENTATION_FOR
  Fix incremental build issue in aapt2
  Support main_class property in java_binary modules
  Always allow duplicates with identical CRC32 and size
2018-10-19 07:47:13 +00:00
Colin Cross
4b964c00a6 Fix instrumentation_for to match LOCAL_INSTRUMENTATION_FOR
The value from instrumentation_for should not go to
aapt2 link --rename-instrumentation-target-package, that should
be the equivalent of LOCAL_MANIFEST_INSTRUMENTATION_FOR.  That
property is never used in Make, so it is left unimplemented in
Soong.

Add the module listed in instrumentation_for as a shared library
for javac, but don't import its resources.

Bug: 117804211
Test: m checkbuild
Change-Id: I7f035dc0ecb964a3ca391ae1ca2b87cb0f6a7cec
2018-10-18 23:54:38 +00:00