Skip to content

Commit 7c3ce15

Browse files
committed
[ gradle ] Remove laji codes
1 parent f4c7bef commit 7c3ce15

File tree

1 file changed

+10
-48
lines changed

1 file changed

+10
-48
lines changed

build.gradle.kts

Lines changed: 10 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,38 @@
1-
import org.gradle.api.internal.HasConvention
21
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
32
import java.io.*
43
import java.nio.file.*
54
import java.util.concurrent.*
65
import java.util.stream.Collectors
76

8-
val commitHash by lazy {
9-
val process: Process = Runtime.getRuntime().exec("git rev-parse --short HEAD")
10-
process.waitFor()
11-
val output = process.inputStream.use {
12-
it.bufferedReader().use(BufferedReader::readText)
13-
}
14-
process.destroy()
15-
output.trim()
16-
}
17-
18-
val isCI = !System.getenv("CI").isNullOrBlank()
19-
20-
val shortVersion = "1.0"
21-
val packageName = "org.covscript.devkt.lang"
22-
val kotlinVersion: String by extra
23-
val pluginCalculatedVersion = if (isCI) "$shortVersion-$commitHash" else shortVersion
24-
25-
group = packageName
26-
version = pluginCalculatedVersion
7+
val kotlinVersion = "1.2.31"
278

28-
buildscript {
29-
var kotlinVersion: String by extra
30-
kotlinVersion = "1.2.31"
31-
32-
repositories {
33-
mavenCentral()
34-
}
35-
36-
dependencies {
37-
classpath(kotlin("gradle-plugin", kotlinVersion))
38-
}
39-
}
40-
41-
tasks.withType<Jar> {
42-
manifest {
43-
attributes(mapOf("Main-Class" to "org.ice1000.devkt.Main",
44-
"SplashScreen-Image" to "splash.png"))
45-
}
46-
}
9+
group = "org.covscript.devkt.lang"
10+
version = "v1.0-SNAPSHOT"
4711

4812
plugins {
4913
java
5014
kotlin("jvm") version "1.2.31"
5115
}
5216

53-
apply {
54-
plugin("kotlin")
55-
}
56-
5717
java {
5818
sourceCompatibility = JavaVersion.VERSION_1_8
5919
targetCompatibility = JavaVersion.VERSION_1_8
6020
}
6121

62-
val SourceSet.kotlin
63-
get() = (this as HasConvention).convention.getPlugin(KotlinSourceSet::class.java).kotlin
64-
6522
java.sourceSets {
6623
"main" {
6724
java.setSrcDirs(listOf("src"))
68-
kotlin.setSrcDirs(listOf("src"))
25+
withConvention(KotlinSourceSet::class) {
26+
kotlin.setSrcDirs(listOf("src"))
27+
}
6928
resources.setSrcDirs(listOf("res"))
7029
}
7130

7231
"test" {
7332
java.setSrcDirs(emptyList<Any>())
74-
kotlin.setSrcDirs(emptyList<Any>())
33+
withConvention(KotlinSourceSet::class) {
34+
kotlin.setSrcDirs(emptyList<Any>())
35+
}
7536
resources.setSrcDirs(emptyList<Any>())
7637
}
7738
}
@@ -86,3 +47,4 @@ dependencies {
8647
compileOnly(kotlin("compiler-embeddable", kotlinVersion))
8748
compileOnly(files(*File("lib").listFiles()))
8849
}
50+

0 commit comments

Comments
 (0)