-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
89 lines (75 loc) · 2.24 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
version '0.5.9'
buildscript {
ext.kotlin_version = '1.9.25'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'kotlin'
apply plugin: 'application'
apply plugin: 'jacoco'
application {
mainClass.set("me.nallen.modularcodegeneration.AppKt")
}
defaultTasks 'run'
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
testImplementation 'junit:junit:4.13.2'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testImplementation 'io.kotlintest:kotlintest:2.0.7'
implementation "com.fasterxml.jackson.core:jackson-databind:2.18.2"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.18.2"
implementation "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.18.2"
implementation "com.xenomachina:kotlin-argparser:2.0.7"
implementation "com.hubspot.jinjava:jinjava:2.7.4"
implementation "org.slf4j:slf4j-simple:1.7.36"
}
kotlin {
jvmToolchain(17)
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
jacocoTestReport {
reports {
xml.required = true
html.required = true
}
}
test {
testLogging {
events = ["standard_out", "passed", "failed", "skipped"]
}
}
def generatedVersionDir = "${buildDir}/generated-version"
sourceSets {
main {
output.dir(generatedVersionDir, builtBy: 'generateVersionProperties')
}
}
task generateVersionProperties {
doLast {
def propertiesFile = file "$generatedVersionDir/version.properties"
propertiesFile.parentFile.mkdirs()
def properties = new Properties()
properties.setProperty("version", rootProject.version.toString())
propertiesFile.withWriter { properties.store(it, null) }
}
}
processResources.dependsOn generateVersionProperties
jar {
manifest {
attributes 'Main-Class': 'me.nallen.modularcodegeneration.CliKt'
}
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
}