-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
76 lines (65 loc) · 1.75 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.71"
`maven-publish`
}
group = "org.mechdancer"
version = "0.4.0"
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
// 矩阵运算
implementation("org.mechdancer", "linearalgebra", "0.2.8-snapshot-3")
testImplementation("junit", "junit", "+")
testImplementation(kotlin("test-junit"))
// 支持网络工具
testImplementation(kotlin("reflect"))
testImplementation("org.mechdancer", "dependency", "+")
testImplementation("org.mechdancer", "remote", "+")
testImplementation("org.slf4j", "slf4j-api", "+")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}
// 源码导出任务
val sourceTaskName = "sourcesJar"
task<Jar>(sourceTaskName) {
archiveClassifier.set("sources")
group = "build"
from(sourceSets["main"].allSource)
}
tasks["jar"].dependsOn(sourceTaskName)
// 默认内联类
val compileKotlin: KotlinCompile by tasks
compileKotlin.kotlinOptions {
freeCompilerArgs = listOf("-Xinline-classes")
}
val compileTestKotlin: KotlinCompile by tasks
compileTestKotlin.kotlinOptions {
freeCompilerArgs = listOf("-Xinline-classes")
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/MechDancer/symbolcalculator")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
publications {
create<MavenPublication>("library") {
from(components["kotlin"])
}
}
}