Skip to content

Commit e3539eb

Browse files
authored
Gradle (#2)
1 parent 998b998 commit e3539eb

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

build.gradle.kts

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+
plugins {
4+
kotlin("jvm") version "1.5.31"
5+
id("org.jmailen.kotlinter") version "3.6.0"
6+
`java-library`
7+
`maven-publish`
8+
}
9+
10+
repositories {
11+
// Use Maven Central for resolving dependencies.
12+
mavenCentral()
13+
}
14+
15+
val githubRepo = project.property("github.repo") as String
16+
17+
tasks.withType<KotlinCompile> {
18+
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
19+
targetCompatibility = JavaVersion.VERSION_1_8.toString()
20+
kotlinOptions.jvmTarget = JavaVersion.VERSION_1_8.toString()
21+
}
22+
23+
tasks.withType<JavaCompile> {
24+
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
25+
targetCompatibility = JavaVersion.VERSION_1_8.toString()
26+
}
27+
28+
dependencies {
29+
// Align versions of all Kotlin components
30+
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
31+
32+
// Use the Kotlin JDK 8 standard library.
33+
implementation(group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8")
34+
35+
// Use the Kotlin test library.
36+
testImplementation(group = "org.jetbrains.kotlin", name = "kotlin-test")
37+
38+
// Use the Kotlin JUnit integration.
39+
testImplementation(group = "org.jetbrains.kotlin", name = "kotlin-test-junit")
40+
}
41+
42+
val sourcesJar by tasks.registering(Jar::class) {
43+
from(sourceSets["main"].allSource)
44+
archiveClassifier.set("sources")
45+
}

0 commit comments

Comments
 (0)