-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
86 lines (72 loc) · 2.27 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.tasks.bundling.Jar
plugins {
base
kotlin("jvm") version "1.6.10" apply false
id("co.uzzu.dotenv.gradle") version "2.0.0"
`maven-publish`
}
buildscript {
extra["ktor_version"] = "1.6.8"
}
val ktorVersion = "1.6.8"
val exKtorVersion = project.findProperty("version").let {
if (it is String && it != "unspecified") {
it
} else {
val tag = System.getenv("RELEASE_VERSION")
if (tag.isNullOrEmpty()) ktorVersion else tag
}
}
group = "net.paslavsky"
version = exKtorVersion
val Project.sourceSets: SourceSetContainer get() =
(this as ExtensionAware).extensions.getByName("sourceSets") as SourceSetContainer
subprojects {
apply {
plugin("kotlin")
plugin("org.gradle.maven-publish")
}
group = "net.paslavsky"
version = exKtorVersion
repositories {
mavenCentral()
jcenter()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
dependencies {
fun implementation(dependencyNotation: Any) = this.add("implementation", dependencyNotation)
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
implementation("io.ktor:ktor-server-core:$ktorVersion")
}
val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
val project = this
publishing {
repositories {
maven {
name = "besttera-core"
url = uri("https://maven.pkg.github.com/paslavsky/exktor")
credentials {
username = (project.findProperty("gpr.user") ?: env.fetchOrNull("GH_USERNAME")).toString()
password = (project.findProperty("gpr.key") ?: env.fetchOrNull("GH_TOKEN")).toString()
}
}
}
publications {
create<MavenPublication>("gpr") {
from(components["kotlin"])
artifact(sourcesJar.get())
groupId = project.group.toString()
artifactId = project.name
version = exKtorVersion
}
}
}
}