-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
102 lines (85 loc) · 2.77 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.config.KotlinCompilerVersion
//import org.jetbrains.kotlin.gradle.tasks.*
//import org.gradle.jvm.tasks.Jar
//to run the code (manually test it),
//call ./gradlew jsRun
//to compile the code into a single JS file (including all dependencies),
//call ./gradlew jsBrowserWebpack
//to make a pair of js files (kotlin.js, and our code) which are much smaller than the webpack,
//call ./gradlew runDceJsKotlin
plugins {
kotlin("multiplatform") version "1.3.72"
id("kotlin-dce-js") version "1.3.72"
//java
id ("org.jetbrains.dokka") version "0.10.1"
id("com.github.johnrengelman.shadow") version "5.2.0"
id("com.github.ben-manes.versions") version "0.28.0"
}
group ="com.github.medavox"
version = "0.1"
repositories {
mavenCentral()
jcenter()
maven ("https://jitpack.io" )
}
kotlin {
jvm {
withJava()
val main by compilations.getting {
kotlinOptions {
// Setup the Kotlin compiler options for the 'main' compilation:
jvmTarget = "1.8"
}
}
}
js {
browser()
}
}
java {
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
}
kotlin.sourceSets["jvmMain"].dependencies {
implementation(kotlin("stdlib", KotlinCompilerVersion.VERSION))
//implementation("commons-cli:commons-cli:1.4")
//implementation("info.picocli:picocli:4.2.0")
implementation("com.github.ajalt:clikt:2.6.0")
}
kotlin.sourceSets["jsMain"].dependencies {
implementation(kotlin("stdlib-js"))
//implementation("org.jetbrains.kotlinx:kotlinx-html-js:0.6.12")
}
kotlin.sourceSets["commonMain"].dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-html-common:0.7.1")
implementation("com.github.medavox:transcribers:v0.12")
}
kotlin.sourceSets["jvmTest"].dependencies {
implementation("junit:junit:4.13")
//for getting the most up-to-date list of names for unicode characters
implementation("org.jsoup:jsoup:1.13.1")
}
//kotlin.sourceSets["androidMain"]
val run by tasks.creating(JavaExec::class) {
group = "application"
main = "com.jetbrains.handson.introMpp.MainKt"
kotlin {
val main = targets["jvm"].compilations["main"]
dependsOn(main.compileAllTaskName)
classpath(
{ main.output.allOutputs.files },
{ configurations["jvmRuntimeClasspath"] }
)
}
///disable app icon on macOS
systemProperty("java.awt.headless", "true")
}
tasks.withType<ShadowJar> {
minimize()
manifest {
attributes["Implementation-Version"] = version
attributes["Main-Class"] = "com.github.medavox.pytokot.MainKt"
}
}