This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle.kts
104 lines (93 loc) · 2.81 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
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
103
104
import java.io.ByteArrayOutputStream
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.konan.target.HostManager
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
plugins {
kotlin("multiplatform") version("1.3.61") apply false
id("de.undercouch.download") version("4.0.4") apply false
}
val useSingleTarget: Boolean by extra(System.getProperty("idea.active") == "true")
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--tags")
standardOutput = stdout
}
group = "com.github.dominaezzz"
version = stdout.toString().trim()
subprojects {
group = rootProject.group
version = rootProject.version
repositories {
mavenCentral()
}
afterEvaluate {
configure<KotlinMultiplatformExtension> {
sourceSets.all {
languageSettings.apply {
enableLanguageFeature("InlineClasses")
useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
}
}
}
configure<PublishingExtension> {
val vcs: String by project
val bintrayOrg: String by project
val bintrayRepository: String by project
val bintrayPackage: String by project
repositories {
maven("https://api.bintray.com/maven/$bintrayOrg/$bintrayRepository/$bintrayPackage/;publish=0;override=0") {
name = "bintray"
credentials {
username = System.getenv("BINTRAY_USER")
password = System.getenv("BINTRAY_API_KEY")
}
}
}
publications.withType<MavenPublication> {
artifactId = "kotlin-sqlite-$artifactId"
pom {
name.set(project.name)
description.set(project.description)
url.set(vcs)
licenses {
license {
name.set("The Apache Software License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("Dominaezzz")
name.set("Dominic Fischer")
}
}
scm {
connection.set("$vcs.git")
developerConnection.set("$vcs.git")
url.set(vcs)
}
}
}
}
val publishTasks = tasks.withType<PublishToMavenRepository>()
.matching {
when {
HostManager.hostIsMingw -> it.name.startsWith("publishMingw") || it.name.startsWith("publishJvmMingw")
HostManager.hostIsMac -> it.name.startsWith("publishMacos") ||
it.name.startsWith("publishIos") ||
it.name.startsWith("publishJvmMacos")
HostManager.hostIsLinux -> it.name.startsWith("publishLinux") ||
it.name.startsWith("publishJs") ||
it.name.startsWith("publishJvmPublication") ||
it.name.startsWith("publishJvmLinux") ||
it.name.startsWith("publishMetadata") ||
it.name.startsWith("publishKotlinMultiplatform")
else -> TODO("Unknown host")
}
}
tasks.register("smartPublish") {
dependsOn(publishTasks)
}
}
}