-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathbuild.gradle
More file actions
49 lines (44 loc) · 1.47 KB
/
build.gradle
File metadata and controls
49 lines (44 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Top-level build file.
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath Libs.AGP
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.30.0'
}
}
allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
gradlePluginPortal()
}
}
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
subprojects {
plugins.withId("com.vanniktech.maven.publish") {
extensions.configure(MavenPublishBaseExtension) { ext ->
// Sonatype Central Portal — replaces the deprecated OSSRH that was
// shut down on 2025-06-30.
ext.publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
// Sign only when a GPG key is configured. Lets ./gradlew
// publishToMavenLocal run on a dev box that has no signing key set
// up, while CI (which exports ORG_GRADLE_PROJECT_signingInMemoryKey)
// still produces signed artifacts for Central.
boolean hasSigningKey = project.findProperty("signingInMemoryKey") != null \
|| System.getenv("ORG_GRADLE_PROJECT_signingInMemoryKey") != null
if (hasSigningKey) {
ext.signAllPublications()
}
}
}
}
tasks.register('clean', Delete) {
delete rootProject.layout.buildDirectory
}