forked from TencentBlueKing/ci-checkout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
92 lines (76 loc) · 2.28 KB
/
build.gradle
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
buildscript {
repositories {
mavenLocal()
jcenter()
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://mirrors.tencent.com/nexus/repository/maven-public" }
mavenCentral()
}
dependencies {
classpath "com.github.jengelman.gradle.plugins:shadow:5.2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
classpath "org.jetbrains.kotlin:kotlin-allopen:1.3.72"
}
}
configurations.all {
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
configurations {
ktlint
}
apply plugin: "kotlin"
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "application"
group 'com.tencent.bk.devops.git'
repositories {
mavenLocal()
jcenter()
maven { url "https://repo.maven.apache.org/maven2" }
maven { url "https://mirrors.tencent.com/nexus/repository/maven-public" }
mavenCentral()
}
dependencies {
ktlint "com.github.shyiko:ktlint:0.34.2"
api(project(":ci-git-checkout:git-checkout-core"))
// compile "com.tencent.bk.devops.git:git-checkout-core:1.0.27-RELEASE"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
// 固定入口类 不要改
mainClassName = "com.tencent.bk.devops.atom.AtomRunner"
shadowJar {
// baseName为插件默认打包名+".jar",bkdevops-plugin.jar
// 如果修改,则要一同修改插件task.json中的target启动命令
// 为了省事,建议不用修改
archiveBaseName.set("checkout")
classifier(null)
zip64 true
}
task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "src/**/*.kt"
}
check.dependsOn ktlint
task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
classpath = configurations.ktlint
main = "com.pinterest.ktlint.Main"
args "-F", "src/**/*.kt"
}
task buildZip(type: Zip, dependsOn: shadowJar) {
from "build/libs", "./task.json"
into "${project.name}"
from("images/checkout.png") {
into("file")
}
from("./README.md") {
into("file")
}
}