/
build.gradle
86 lines (71 loc) · 1.71 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
plugins {
id 'java'
id 'maven-publish'
id "io.freefair.lombok" version "6.6.1"
}
sourceCompatibility = 8
targetCompatibility = 8
group = "de.phoenixmitx"
archivesBaseName = "LombokExtensions"
version = "1.0.9"
description = "A library for lomboks ExtensionMethods"
sourceSets {
codegen {
java {
srcDir 'src/codegen/java'
}
}
}
repositories {
mavenCentral()
}
dependencies {
// codegen
codegenImplementation 'org.javassist:javassist:3.29.2-GA'
// test
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
}
lombok { version = "1.18.26" }
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task codegenJar (type: Jar) {
dependsOn compileCodegenJava
from { configurations.codegenRuntimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
archiveFileName = "LombokExtensions-${project.version}-codegen.jar"
}
task recompileJava(type: JavaExec) {
dependsOn codegenJar, compileJava
classpath = sourceSets.main.output + sourceSets.codegen.output + sourceSets.codegen.compileClasspath
mainClass = "de.phoenixmitx.lombokextensions.codegen.Codegen"
systemProperties = [
"java.util.logging.SimpleFormatter.format": "[%1\$tF %1\$tT] [%4\$-7s] %5\$s %n"
]
}
compileJava {
// TODO find a way to not need to clean the compileJava task for the codegen to work
dependsOn compileCodegenJava, cleanCompileJava
finalizedBy recompileJava
classpath += sourceSets.codegen.output
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
testLogging {
exceptionFormat = 'full'
}
}
artifacts {
archives sourcesJar
}
publishing {
publications {
testing(MavenPublication) {
from components.java
artifact sourcesJar
}
}
}