blob: 3171b6bc5f840dc06b23f22da311ed6eb12a3d15 [file] [log] [blame] [view]
Aurimas Liutikas3ae82fa2021-09-23 09:19:23 -07001## wrapper/gradle-wrapper.properties
2
3Keeps track of Gradle version used by androidx. When updating the version a new version prebuilt needs to be added to `tools/external/gradle` repository.
4
5## libs.versions.toml
6
7Keeps track of library and plugin dependencies used by androidx. Adding or updating a library there requires running `./development/importMaven/import_maven_artifacts.py -n myartifact:here:1.0.0`
8
9## verification-keyring.keys
10
Aurimas Liutikas2a93f8b2022-01-21 00:12:34 +000011Checked-in [local keyring](https://docs.gradle.org/current/userguide/dependency_verification.html#sec:local-keyring)
12that is used to avoid reaching out to key servers whenever a key is required by Gradle to verify an
13artifact.
Aurimas Liutikas3ae82fa2021-09-23 09:19:23 -070014
Aurimas Liutikas2a93f8b2022-01-21 00:12:34 +000015AndroidX only uses human readable `verification-keyring.keys`. Gradle also generates binary
16`verification-keyring.gpg`, but it is optional, and thus we do not use it.
17
18In order to add a trusted new key, first add it as a trusted-key to `verification-metadata.xml`.
19For example
Aurimas Liutikas3ae82fa2021-09-23 09:19:23 -070020```
Aurimas Liutikas2a93f8b2022-01-21 00:12:34 +000021<trusted-key id="012579464d01c06a" group="org.apache"/>
Aurimas Liutikas3ae82fa2021-09-23 09:19:23 -070022```
23
Aurimas Liutikas2a93f8b2022-01-21 00:12:34 +000024This allows Gradle to trust it, but we also need to store the key in `verification-keyring.keys`
25and to do that we need to run:
26```
27./gradlew -M sha256 --export-keys buildOnServer --dry-run
28```
29
30This will create `gradle/verification-keyring-dryrun.gpg`, `gradle/verification-keyring-dryrun.keys`,
31`gradle/verification-metadata.dryrun.xml`.
32
33Then you will want to run:
34```
35cp gradle/verification-keyring-dryrun.keys gradle/verification-keyring.keys
36```
37
38You can then delete all the `verification-*-dryrun.*` files.
Aurimas Liutikas3ae82fa2021-09-23 09:19:23 -070039
40## verification-metadata.xml
41
42[Configuration file for Gradle dependency verification](https://docs.gradle.org/current/userguide/dependency_verification.html#sub:verification-metadata) used by androidx to make sure dependencies are [signed with trusted signatures](https://docs.gradle.org/current/userguide/dependency_verification.html#sec:signature-verificationn) and that unsigned artifacts have [expected checksums](https://docs.gradle.org/current/userguide/dependency_verification.html#sec:checksum-verification).
43
44When adding a new artifact
45- if it is signed, then follow `verification-keyring.keys` instructions above to add it to trusted-keys
46- if it is not signed, then run the following to add generated checksums to `verification-metadata.xml`:
47
48```
Aurimas Liutikas2a93f8b2022-01-21 00:12:34 +000049./gradlew -M sha256 buildOnServer --dry-run
Aurimas Liutikas3ae82fa2021-09-23 09:19:23 -070050```
Aurimas Liutikas2a93f8b2022-01-21 00:12:34 +000051
52Then you will want to diff `gradle/verification-metadata.dryrun.xml` and
53`gradle/verification-metadata.xml` using your favorite tool (e.g. meld) can copy over the entries
54that are relevant to your new artifacts.
55
56You can then delete all the `verification-*-dryrun.*` files.