-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
50 lines (46 loc) · 1.45 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.70"
}
version = "0.0.3"
apply(plugin = "kotlin")
group = "org.mechdancer"
repositories {
mavenCentral()
jcenter()
maven("https://maven.aliyun.com/repository/central")
maven("https://maven.aliyun.com/repository/google")
maven("https://maven.aliyun.com/repository/gradle-plugin")
maven("https://maven.aliyun.com/repository/jcenter")
}
dependencies {
// 自动依赖 kotlin 标准库
implementation(kotlin("stdlib-jdk8"))
// 线性代数
implementation("org.mechdancer", "linearalgebra", "+")
// 使用示例中采用协程
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.3.3")
// 支持网络工具
testImplementation("org.mechdancer", "dependency", "+")
testImplementation("org.mechdancer", "remote", "+")
testImplementation("org.slf4j", "slf4j-api", "+")
testImplementation(kotlin("reflect"))
// 单元测试
testImplementation("junit", "junit", "+")
testImplementation(kotlin("test-junit"))
}
tasks.withType<KotlinCompile> {
kotlinOptions { jvmTarget = "1.8" }
}
tasks.withType<JavaCompile> {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
}
// 源码导出任务
val sourceTaskName = "sourcesJar"
task<Jar>(sourceTaskName) {
archiveClassifier.set("sources")
group = "build"
from(sourceSets["main"].allSource)
}
tasks["jar"].dependsOn(sourceTaskName)