Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
102 lines (91 loc) · 3.32 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
102 lines (91 loc) · 3.32 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import com.vanniktech.maven.publish.Checksum
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
plugins {
alias(libs.plugins.kotlin.jvm) apply false
// Declared here, not only in :react, so AGP lands on the root build's classpath: it must share a
// classloader with the Kotlin Gradle plugin (its built-in Kotlin drives KGP's compile task) and
// with the publish plugin, which detects the AGP version.
alias(libs.plugins.android.library) apply false
alias(libs.plugins.vanniktech.mavenPublish) apply false
base
}
val expoModulesV2Version: String = libs.versions.expo.modules.v2.get()
allprojects {
group = "io.github.expo"
version = expoModulesV2Version
}
subprojects {
configureJavaCompatibility()
configureCentralPublishing()
}
// One command for the two artifacts a consumer resolves rather than builds.
val publishToolchainToMavenLocal by tasks.registering {
group = "publishing"
description = "Publishes :compiler-plugin and :gradle-plugin to the local Maven repository."
dependsOn(":compiler-plugin:publishToMavenLocal", ":gradle-plugin:publishToMavenLocal")
}
val publishToolchainToMavenCentral by tasks.registering {
group = "publishing"
description = "Publishes :compiler-plugin and :gradle-plugin to Maven Central."
dependsOn(":compiler-plugin:publishToMavenCentral", ":gradle-plugin:publishToMavenCentral")
}
fun Project.configureJavaCompatibility() {
plugins.withId("org.jetbrains.kotlin.jvm") {
extensions.configure<KotlinJvmProjectExtension> {
jvmToolchain(17)
compilerOptions {
jvmTarget = JvmTarget.JVM_11
}
}
tasks.withType<JavaCompile>().configureEach {
options.release = 11
}
}
}
fun Project.configureCentralPublishing() {
plugins.withId("com.vanniktech.maven.publish") {
extensions.configure<MavenPublishBaseExtension> {
publishToMavenCentral(automaticRelease = true)
// Only sign when signing credentials are available (CI environment).
if (project.findProperty("signingInMemoryKey") != null) {
signAllPublications()
}
pom {
name = project.name
inceptionYear = "2026"
url = "https://github.com/expo/expo-modules-v2-android"
licenses {
license {
name = "The MIT License"
url = "https://opensource.org/license/mit"
distribution = "https://opensource.org/license/mit"
}
}
developers {
developer {
id = "expo"
name = "Expo"
url = "https://github.com/expo"
}
}
scm {
url = "https://github.com/expo/expo-modules-v2-android"
connection = "scm:git:git://github.com/expo/expo-modules-v2-android.git"
developerConnection = "scm:git:ssh://github.com/expo/expo-modules-v2-android.git"
}
}
}
// A local repository that CI fills with signed artifacts from every job, and then uploads to
// Maven Central as one deployment (see scripts/publish-to-maven-central.sh).
extensions.configure<PublishingExtension> {
repositories {
maven {
name = "centralBundle"
url = uri(rootProject.layout.buildDirectory.dir("central-bundle"))
}
}
}
}
}