-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
72 lines (61 loc) · 1.93 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
import java.text.SimpleDateFormat
import java.util.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.kotlinx.serialization) apply false
}
buildscript {
// extra[""]
repositories {
gradlePluginPortal()
}
dependencies {
}
}
allprojects {
tasks.withType(KotlinCompile::class).all {
kotlinOptions {
freeCompilerArgs += "-Xexpect-actual-classes"
}
}
group = "uninit"
extra["root-maven-url"] = "https://repo.uninit.dev/"
val ci = System.getenv("CI") != null
val isRelease = System.getenv("GITHUB_EVENT_NAME") == "release"
var repo = "releases"
version = "0.0.1"
if (ci && !isRelease) {
repo = "snapshots"
version = "${version}-${SimpleDateFormat("YYYYMMdd").format(Date(System.currentTimeMillis()))}-${System.getenv("GITHUB_SHA").slice(0..6)}" // todo: add date
}
if (!ci) {
repo = "local"
version = "${version}-${System.currentTimeMillis()}#${InetAddress.getLocalHost().hostName}"
}
/*
* If SNAPSHOT:
* version = "VERSION-YYYYMMdd-HASH"
* If not CI:
* version = "VERSION-TIMESTAMP#HOSTNAME"
* If RELEASE:
* version = "VERSION"
*/
val mavenRepo: PublishingExtension.() -> Unit = {
repositories {
maven {
name = "uninit"
url = uri("${extra["root-maven-url"]}$repo")
credentials {
username = "admin"
password = System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
extra["maven-repository"] = mavenRepo
}
true // Needed to make the Suppress annotation work for the plugins block