-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
59 lines (49 loc) · 1.53 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 org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.ajoberstar.grgit.Commit
plugins {
kotlin("jvm")
`maven-publish`
id("org.ajoberstar.grgit") version "4.0.2"
id("com.utopia-rise.godot-publish")
}
group = "com.utopia-rise"
val baseVersion = "0.1.2"
val currentCommit: Commit = grgit.head()
// check if the current commit is tagged
var tagOnCurrentCommit = grgit.tag.list().firstOrNull { tag -> tag.commit.id == currentCommit.id }
var releaseMode = tagOnCurrentCommit != null
version = if (!releaseMode) {
"$baseVersion-${DependenciesVersions.godotVersion}-${currentCommit.abbreviatedId}-SNAPSHOT"
} else {
requireNotNull(tagOnCurrentCommit).name
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib"))
implementation("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.10")
implementation("com.squareup:kotlinpoet:${DependenciesVersions.kotlinPoetVersion}")
}
tasks {
build {
finalizedBy(publishToMavenLocal)
}
withType<KotlinCompile>().all {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalStdlibApi"
}
}
publishing {
publications {
val godotEntryGenerator by creating(MavenPublication::class) {
pom {
name.set(project.name)
description.set("Godot Kotlin entry code generator.")
}
artifactId = project.name
description = "Godot Kotlin entry code generator."
from(components.getByName("java"))
}
}
}