Skip to content

Commit a59a8b5

Browse files
committed
Update release scripts.
1 parent f42cb7f commit a59a8b5

File tree

2 files changed

+54
-66
lines changed

2 files changed

+54
-66
lines changed

gradle/publishing.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ publishing {
4343
repositories {
4444
def sonatypeUsername = System.getenv("SONATYPE_USER")
4545
def sonatypePassword = System.getenv("SONATYPE_PASSWORD")
46+
<<<<<<< HEAD
4647
maven {
4748
name = "centralSnapshot"
4849
url = "https://central.sonatype.com/api/v1/publisher/snapshots"
@@ -51,6 +52,14 @@ publishing {
5152
password = sonatypePassword
5253
}
5354
}
55+
=======
56+
57+
// Local Maven repository for local development
58+
mavenLocal()
59+
60+
// Note: Sonatype Central Portal snapshots are published via API, not Maven repository
61+
// The publishSnapshotToCentral task handles the API-based upload
62+
>>>>>>> 9f7318e (Update release scripts.)
5463
}
5564
}
5665
}

gradle/publishing_aar.gradle

Lines changed: 45 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,86 +2,65 @@ apply plugin: 'maven-publish'
22
apply plugin: 'signing'
33
apply from: "$rootDir/gradle/sonatype-central.gradle"
44

5-
android {
6-
// Explicitly set the NDK release to ensure we use the latest stable, as
7-
// opposed to the default NDK tied to the AGP version.
8-
ndkVersion = '28.1.13356709'
9-
defaultConfig {
10-
ndk {
11-
// Explicitly enable the 'riscv64' ABI with 'abiFilters' as it is
12-
// not part of the default ABI set today.
13-
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64', 'riscv64'
14-
}
15-
}
16-
publishing {
17-
singleVariant("release") {
18-
withSourcesJar()
19-
withJavadocJar()
20-
}
21-
}
5+
java {
6+
withSourcesJar()
7+
withJavadocJar()
228
}
239

2410
// Task to publish to local repository for bundle creation
2511
tasks.register("publishToLocalMaven", Task) {
2612
dependsOn "publishMavenPublicationToLocalRepository"
2713
}
2814

15+
publishing {
16+
publications {
17+
maven(MavenPublication) {
18+
from components.java
2919

30-
// AGP creates the components in afterEvaluate, so we need to use it too
31-
// https://developer.android.com/studio/build/maven-publish-plugin
32-
afterEvaluate {
33-
publishing {
34-
publications {
35-
maven(MavenPublication) {
36-
from components.release
37-
38-
pom {
39-
name = 'Dexmaker'
40-
description = project.description
41-
url = 'https://github.com/linkedin/dexmaker'
42-
licenses {
43-
license {
44-
name = 'The Apache Software License, Version 2.0'
45-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
46-
}
47-
}
48-
developers {
49-
developer {
50-
id = 'com.linkedin'
51-
name = 'LinkedIn Corp'
52-
}
53-
}
54-
scm {
55-
connection = 'scm:git:git://github.com/linkedin/dexmaker.git'
56-
developerConnection = 'scm:git:ssh://github.com:linkedin/dexmaker.git'
57-
url = 'https://github.com/linkedin/dexmaker/tree/main'
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'
5828
}
5929
}
60-
61-
repositories {
62-
def sonatypeUsername = System.getenv("SONATYPE_USER")
63-
def sonatypePassword = System.getenv("SONATYPE_PASSWORD")
64-
maven {
65-
name = "centralSnapshot"
66-
url = "https://central.sonatype.com/api/v1/publisher/snapshots"
67-
credentials {
68-
username = sonatypeUsername
69-
password = sonatypePassword
70-
}
30+
developers {
31+
developer {
32+
id = 'com.linkedin'
33+
name = 'LinkedIn Corp'
7134
}
7235
}
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+
43+
repositories {
44+
def sonatypeUsername = System.getenv("SONATYPE_USER")
45+
def sonatypePassword = System.getenv("SONATYPE_PASSWORD")
46+
47+
// Local Maven repository for local development
48+
mavenLocal()
49+
50+
// Note: Sonatype Central Portal snapshots are published via API, not Maven repository
51+
// The publishSnapshotToCentral task handles the API-based upload
7352
}
7453
}
7554
}
55+
}
7656

77-
// DEXMAKER_GPG_PRIVATE_KEY should contain the armoured private key that
78-
// starts with -----BEGIN PGP PRIVATE KEY BLOCK-----
79-
// It can be obtained with gpg --armour --export-secret-keys KEY_ID
80-
def signingKey = System.getenv("DEXMAKER_GPG_PRIVATE_KEY")
81-
def signingPassword = System.getenv("DEXMAKER_GPG_PRIVATE_KEY_PASSWORD")
82-
signing {
83-
required { signingKey != null && signingPassword != null }
84-
useInMemoryPgpKeys(signingKey, signingPassword)
85-
sign publishing.publications.maven
86-
}
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
8766
}

0 commit comments

Comments
 (0)