-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
158 lines (134 loc) · 4.67 KB
/
build.gradle.kts
File metadata and controls
158 lines (134 loc) · 4.67 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import io.gitlab.arturbosch.detekt.Detekt
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentOperatingSystem
import org.gradle.nativeplatform.platform.internal.DefaultOperatingSystem
import org.jreleaser.model.Active
import org.jreleaser.model.Distribution.DistributionType
import java.nio.file.Paths
plugins {
kotlin("jvm") version "2.2.0"
kotlin("plugin.serialization") version "2.2.0"
id("io.gitlab.arturbosch.detekt") version "1.23.8"
id("org.jlleitschuh.gradle.ktlint") version "14.2.0"
id("org.graalvm.buildtools.native") version "1.0.0"
id("org.jreleaser") version "1.23.0"
application
}
group = "com.soprasteria"
version = "0.2-RC1"
val jdkVersion = 21
val currentOperatingSystem: DefaultOperatingSystem = getCurrentOperatingSystem()
val currentOperatingSystemName: String =
when {
currentOperatingSystem.isWindows -> "windows"
currentOperatingSystem.isLinux -> "linux"
currentOperatingSystem.isMacOsX -> "osx"
else -> "unknown"
}
application {
mainClass.set("com.soprasteria.migration.MainKt")
}
kotlin {
jvmToolchain(jdkVersion)
}
detekt {
config.setFrom(files("$projectDir/config/detekt/detekt.yml"))
}
graalvmNative {
binaries {
named("main") {
imageName.set("github-migration")
debug.set(false)
verbose.set(false)
buildArgs.add("--initialize-at-build-time=kotlin.DeprecationLevel")
}
}
metadataRepository {
enabled.set(true)
}
}
jreleaser {
distributions {
create("github-migration") {
distributionType.set(DistributionType.BINARY)
artifact {
path.set(Paths.get("build/distributions/{{distributionName}}-{{projectVersion}}-linux.zip").toFile())
platform.set("linux-x86_64")
}
artifact {
path.set(Paths.get("build/distributions/{{distributionName}}-{{projectVersion}}-osx.zip").toFile())
platform.set("osx-aarch_64")
}
artifact {
path.set(Paths.get("build/distributions/{{distributionName}}-{{projectVersion}}-windows.zip").toFile())
platform.set("windows-x86_64")
}
}
}
project {
description.set("CLI to migrate all repositories, teams and members from one organization to another")
copyright.set("2023 Ordina NV")
license.set("GNU General Public License v3.0")
authors.add("Donovan de Kuiper")
links {
homepage.set("https://github.com/Ordina-Group/github-migration")
documentation.set("https://github.com/Ordina-Group/github-migration")
}
inceptionYear.set("2023")
}
release {
github {
enabled.set(true)
overwrite.set(true)
prerelease {
pattern.set(".*-RC\\d*")
}
changelog {
formatted.set(Active.ALWAYS)
preset.set("conventional-commits")
contributors {
enabled.set(false)
}
}
}
}
}
dependencies {
implementation("com.soprasteria:github-kotlin-client:1.0.0")
implementation("com.github.ajalt.clikt:clikt:4.2.0")
implementation("com.github.ajalt.mordant:mordant:2.1.0")
implementation(platform("io.arrow-kt:arrow-stack:1.2.1"))
implementation("io.arrow-kt:arrow-core")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
testImplementation(platform("io.kotest:kotest-bom:5.8.0"))
testImplementation("io.kotest:kotest-runner-junit5")
testImplementation("io.kotest:kotest-assertions-core")
testImplementation("io.kotest:kotest-property")
testImplementation("io.mockk:mockk:1.13.8")
}
tasks.test {
useJUnitPlatform()
}
// detekt 1.23.x does not support jvmTarget 21; cap it at 20 until detekt 2.x is stable
tasks.withType<Detekt>().configureEach {
jvmTarget = "20"
}
repositories {
mavenCentral()
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/Ordina-Group/github-kotlin-client")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
}
}
}
tasks.register<Zip>("package") {
dependsOn(tasks.nativeCompile)
archiveFileName.set("github-migration-${archiveVersion.get()}-$currentOperatingSystemName.zip")
from(layout.buildDirectory.dir("native/nativeCompile"))
}
tasks.named("assemble") {
dependsOn(tasks.named("package"))
}