-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
80 lines (65 loc) · 1.8 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
import org.gradle.api.Task
import org.gradle.script.lang.kotlin.*
import kotlin.properties.ReadOnlyProperty
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
import kotlin.io.print
import kotlin.io.println
buildscript {
repositories {
gradleScriptKotlin()
}
dependencies {
classpath(kotlinModule("gradle-plugin"))
}
}
plugins {
application
}
apply {
plugin("kotlin2js")
}
configure<ApplicationPluginConvention> {
mainClassName = "edu.unh.cs.metronome.MetronomeVisualizerKt"
}
val build = tasks.getByName("build")
build.doLast {
print(configurations.compile)
// build.configurations.compile.each { file ->
// copy {
// includeEmptyDirs = false
//
// from zipTree(file.absolutePath)
// into "${projectDir}/web/js"
// include { fileTreeElement ->
// def path = fileTreeElement.path
// path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
// }
// }
// }
}
val compileKotlin2Js = tasks.getByName("compileKotlin2Js")
//compileKotlin2Js.kotlinOptions.outputFile = "web/js/metronome-visualizer.js"
compileKotlin2Js.apply {
// kotlinOptions.outputFile = "web/js/metronome-visualizer.js"
}
task("nope") {
doLast {
println("hello world ${compileKotlin2Js.outputFile}")
}
}
//val mainSourceSet = sourceSets.getByName("main")!!
//(mainSourceSet as HasConvention).convention.getPlugin<KotlinSourceSet>().apply {
// kotlin.srcDir("src/main/kotlin")
//}
//sourceSets {
// main.kotlin.srcDirs += "src/main/kotlin"
//}
repositories {
gradleScriptKotlin()
mavenCentral()
}
dependencies {
compile(kotlinModule("stdlib"))
compile(kotlinModule("js-library"))
testCompile("junit:junit:4.12")
}