-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
59 lines (54 loc) · 2.1 KB
/
build.gradle.kts
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
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.multiplatform).apply(false)
alias(libs.plugins.kotlinx.serialization).apply(false)
alias(libs.plugins.sqlDelight).apply(false)
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.maven.publish).apply(false)
}
group = findProperty("GROUP").toString()
version = System.getenv("RELEASE_VERSION")?.takeIf { it.isNotBlank() }
?: findProperty("VERSION_NAME").toString()
allprojects {
group = rootProject.group
version = rootProject.version
}
subprojects {
plugins.withId("com.vanniktech.maven.publish") {
extensions.configure<MavenPublishBaseExtension> {
logger.lifecycle("Configuring Maven Publishing for ${name}:${version}")
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, automaticRelease = true)
signAllPublications()
}
extensions.configure<PublishingExtension> {
logger.lifecycle("Publishing ${project.name}:${version}")
publications.withType<MavenPublication>().configureEach {
this.version = project.version.toString()
}
repositories {
// GitHub Packages
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/MercuryTechnologies/sqkon")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
tasks.register("version") {
inputs.property("version", project.version)
doLast {
inputs.properties["version"]?.let { println("Version: $it") }
}
}