-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
72 lines (56 loc) · 1.22 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.11"
application
}
application{
mainClassName = "MainKt"
}
dependencies{
compile(kotlin("stdlib"))
}
repositories{
mavenCentral()
jcenter()
}
task("getsrcname",{
// 增量更新
inputs.dir("src") // 输入 会检查这个文件目录 有无变化
outputs.dir("one.txt") // 输出 会检查这个文件是否有输出变化
doFirst{
var srcDir = fileTree("src")
var oneWrite = File("one.txt")
oneWrite.writeText("")
srcDir.forEach{
if(it.isFile){
oneWrite.appendText(it.absolutePath)
oneWrite.appendText("\t\n")
}
}
}
})
//task("myCopy",Copy::class){
// doFirst{
// from("src/main")
// into("backup")
// }
//}
//task("myDelete",Delete::class,{
// setDelete("backup/main")
//})
task("myCopy",Copy::class,{
from("src")
println("from...")
into("backup")
})
group = "org.liu.huan"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
compile(kotlin("stdlib-jdk8"))
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}