-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (66 loc) · 1.8 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
plugins {
id 'application'
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.7.20'
id "com.diffplug.spotless" version "6.12.0"
}
final MAIN_CLASS = 'io.starlight.inspector.MainKt'
application.mainClass.set(MAIN_CLASS)
repositories {
mavenLocal()
mavenCentral()
maven { url 'https://jitpack.io' }
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions.freeCompilerArgs += "-Xcontext-receivers"
}
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1'
implementation 'com.github.Starlight220:ActionsKtLib:v2.2'
testImplementation 'org.jetbrains.kotlin:kotlin-test'
}
test {
useJUnitPlatform()
}
boolean isCI() {
return (project.hasProperty("CI"))
}
if (!isCI()) {
task runLocal() {
doFirst {
println "Setting local path!"
environment 'INSPECTOR_CONFIG', '.github/workflows/inspector.json'
}
dependsOn 'run'
}
}
spotless {
enforceCheck !isCI()
kotlin {
ktfmt('0.25').kotlinlangStyle()
endWithNewline()
}
}
task cleanup(type: Delete) {
if (project.hasProperty("CI") && project.property("CI") == true) {
return
}
delete 'outputs.inspect_rli.json'
delete 'report.md'
delete 'new.tmp'
delete 'old.tmp'
tasks.named('run').get() dependsOn 'cleanup'
}
tasks.jar {
manifest.attributes["Main-Class"] = MAIN_CLASS
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
duplicatesStrategy = 'EXCLUDE'
}
if (!isCI()) {
tasks.run {
environment "INSPECTOR_CONFIG", ".github\\workflows\\inspector.json"
environment "INPUT_ROOT", "C:\\Users\\yotam\\Documents\\dev\\frc-docs"
}
}