Specify minSdkVersion, targetSdkVersion, packageName in GN rather than in AndroidManifest.xml |
|
Issue descriptionSpecifying these three values in Gradle files is common practice. There are a couple spots in our build pipeline that would benefit from knowing minSdkVeriosion in GN: * When dexing, * When proguarding (with r8) Additionally specifying targetSdkVersion and packageName in GN would allow us to stop using jinja templates for several simple AndroidManfest.xml files. E.g.: * https://cs.chromium.org/chromium/src/chrome/android/javatests/AndroidManifest.xml * https://cs.chromium.org/chromium/src/chrome/android/modules/vr/AndroidManifest.xml * https://cs.chromium.org/chromium/src/testing/android/empty_apk/AndroidManifest.xml List of all manifests that are templates (~1/4 of them are "simple"): https://cs.chromium.org/search/?q=file:androidmanifest.xml+%5C%7B%5C%7B&sq=package:chromium&type=cs minSdkVersion in GN is being added here: https://chromium-review.googlesource.com/c/chromium/src/+/1258059 Note that "aapt2 link" supports setting these values in the manifest via: --min-sdk-version --target-sdk-version --rename-manifest-package --rename-instrumentation-target-package When going ahead with this, we should set a build-wide default minSdkVersion and targetSdkVersion so that these values are always present for targets. It should be an error for an AndroidManifest.xml to have a <uses-sdk> tag in it, so that we don't need to enforce that it matches the GN value.
,
Jan 14
|
|
►
Sign in to add a comment |
|
Comment 1 by agrieve@chromium.org
, Jan 14