|
1 | 1 | apply plugin: 'maven-publish' |
2 | 2 | apply plugin: 'signing' |
3 | | -apply from: "$rootDir/gradle/sonatype-central.gradle" |
4 | 3 |
|
5 | | -java { |
6 | | - withSourcesJar() |
7 | | - withJavadocJar() |
| 4 | +android { |
| 5 | + // Explicitly set the NDK release to ensure we use the latest stable, as |
| 6 | + // opposed to the default NDK tied to the AGP version. |
| 7 | + ndkVersion = '28.1.13356709' |
| 8 | + defaultConfig { |
| 9 | + ndk { |
| 10 | + // Explicitly enable the 'riscv64' ABI with 'abiFilters' as it is |
| 11 | + // not part of the default ABI set today. |
| 12 | + abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', 'riscv64' |
| 13 | + } |
| 14 | + } |
| 15 | + publishing { |
| 16 | + singleVariant("release") { |
| 17 | + withSourcesJar() |
| 18 | + withJavadocJar() |
| 19 | + } |
| 20 | + } |
8 | 21 | } |
9 | 22 |
|
10 | 23 | // Task to publish to local repository for bundle creation |
11 | 24 | tasks.register("publishToLocalMaven", Task) { |
12 | 25 | dependsOn "publishMavenPublicationToLocalRepository" |
13 | 26 | } |
14 | 27 |
|
15 | | -publishing { |
16 | | - publications { |
17 | | - maven(MavenPublication) { |
18 | | - from components.java |
19 | 28 |
|
20 | | - pom { |
21 | | - name = 'Dexmaker' |
22 | | - description = project.description |
23 | | - url = 'https://github.com/linkedin/dexmaker' |
24 | | - licenses { |
25 | | - license { |
26 | | - name = 'The Apache Software License, Version 2.0' |
27 | | - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 29 | +// AGP creates the components in afterEvaluate, so we need to use it too |
| 30 | +// https://developer.android.com/studio/build/maven-publish-plugin |
| 31 | +afterEvaluate { |
| 32 | + apply from: "$rootDir/gradle/sonatype-central.gradle" |
| 33 | + |
| 34 | + publishing { |
| 35 | + publications { |
| 36 | + maven(MavenPublication) { |
| 37 | + from components.release |
| 38 | + |
| 39 | + pom { |
| 40 | + name = 'Dexmaker' |
| 41 | + description = project.description |
| 42 | + url = 'https://github.com/linkedin/dexmaker' |
| 43 | + licenses { |
| 44 | + license { |
| 45 | + name = 'The Apache Software License, Version 2.0' |
| 46 | + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 47 | + } |
28 | 48 | } |
29 | | - } |
30 | | - developers { |
31 | | - developer { |
32 | | - id = 'com.linkedin' |
33 | | - name = 'LinkedIn Corp' |
| 49 | + developers { |
| 50 | + developer { |
| 51 | + id = 'com.linkedin' |
| 52 | + name = 'LinkedIn Corp' |
| 53 | + } |
| 54 | + } |
| 55 | + scm { |
| 56 | + connection = 'scm:git:git://github.com/linkedin/dexmaker.git' |
| 57 | + developerConnection = 'scm:git:ssh://github.com:linkedin/dexmaker.git' |
| 58 | + url = 'https://github.com/linkedin/dexmaker/tree/main' |
34 | 59 | } |
35 | 60 | } |
36 | | - scm { |
37 | | - connection = 'scm:git:git://github.com/linkedin/dexmaker.git' |
38 | | - developerConnection = 'scm:git:ssh://github.com:linkedin/dexmaker.git' |
39 | | - url = 'https://github.com/linkedin/dexmaker/tree/main' |
40 | | - } |
41 | | - } |
42 | 61 |
|
43 | | - repositories { |
44 | | - def sonatypeUsername = System.getenv("SONATYPE_USER") |
45 | | - def sonatypePassword = System.getenv("SONATYPE_PASSWORD") |
| 62 | + repositories { |
| 63 | + def sonatypeUsername = System.getenv("SONATYPE_USER") |
| 64 | + def sonatypePassword = System.getenv("SONATYPE_PASSWORD") |
46 | 65 |
|
47 | | - // Local Maven repository for local development |
48 | | - mavenLocal() |
| 66 | + // Local Maven repository for local development |
| 67 | + mavenLocal() |
49 | 68 |
|
50 | | - // Note: Sonatype Central Portal snapshots are published via API, not Maven repository |
51 | | - // The publishSnapshotToCentral task handles the API-based upload |
| 69 | + // Note: Sonatype Central Portal snapshots are published via API, not Maven repository |
| 70 | + // The publishSnapshotToCentral task handles the API-based upload |
| 71 | + } |
52 | 72 | } |
53 | 73 | } |
54 | 74 | } |
55 | | -} |
56 | 75 |
|
57 | | -// DEXMAKER_GPG_PRIVATE_KEY should contain the armoured private key that |
58 | | -// starts with -----BEGIN PGP PRIVATE KEY BLOCK----- |
59 | | -// It can be obtained with gpg --armour --export-secret-keys KEY_ID |
60 | | -def signingKey = System.getenv("DEXMAKER_GPG_PRIVATE_KEY") |
61 | | -def signingPassword = System.getenv("DEXMAKER_GPG_PRIVATE_KEY_PASSWORD") |
62 | | -signing { |
63 | | - required { signingKey != null && signingPassword != null } |
64 | | - useInMemoryPgpKeys(signingKey, signingPassword) |
65 | | - sign publishing.publications.maven |
| 76 | + // DEXMAKER_GPG_PRIVATE_KEY should contain the armoured private key that |
| 77 | + // starts with -----BEGIN PGP PRIVATE KEY BLOCK----- |
| 78 | + // It can be obtained with gpg --armour --export-secret-keys KEY_ID |
| 79 | + def signingKey = System.getenv("DEXMAKER_GPG_PRIVATE_KEY") |
| 80 | + def signingPassword = System.getenv("DEXMAKER_GPG_PRIVATE_KEY_PASSWORD") |
| 81 | + signing { |
| 82 | + required { signingKey != null && signingPassword != null } |
| 83 | + useInMemoryPgpKeys(signingKey, signingPassword) |
| 84 | + sign publishing.publications.maven |
| 85 | + } |
66 | 86 | } |
0 commit comments