-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
105 lines (85 loc) · 3.33 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
93
94
95
96
97
98
99
100
101
102
103
104
105
plugins {
id "net.ltgt.apt" version "0.9"
id "nebula.project" version "3.3.0"
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'maven'
apply plugin: 'groovy'
group = 'com.github.sycyhy'
version = '0.0.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
}
ext {
logbackVersion = '1.1.7'
lombokVersion = '1.16.14'
}
dependencies {
apt group: 'org.projectlombok', name: 'lombok', version: '1.16.14'
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.16.14'
// annotationsShit
apt group: 'com.google.auto.value', name: 'auto-value', version: '1.3'
compileOnly group: 'com.google.auto.value', name: 'auto-value', version: '1.3'
testCompile "org.codehaus.groovy:groovy-all:2.4.1"
testCompile group: 'org.codehaus.groovy.modules.http-builder', name: 'http-builder', version: '0.7.1'
testCompile "org.spockframework:spock-core:1.1-groovy-2.4-rc-3"
testCompile group: 'net.bytebuddy', name: 'byte-buddy', version: '1.4.26'
}
test {
testLogging {
events "started", "passed", "skipped", "failed"
showExceptions true
exceptionFormat "full"
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
}
}
idea {
project {
ipr {
withXml {
File ideaCompilerXml = project.file('.idea/compiler.xml')
Node parsedXml;
if (ideaCompilerXml.isFile()) {
parsedXml = new XmlParser().parse(ideaCompilerXml)
} else {
def writer = new StringWriter()
writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
def xml = new groovy.xml.MarkupBuilder(writer).project(version:"4") {
component(name:"CompilerConfiguration") {
annotationProcessing() {}
}
}
parsedXml = new XmlParser().parseText(writer.toString())
println parsedXml
}
Node compilerConfiguration = parsedXml.component.find {
component -> component.'@name' == 'CompilerConfiguration'
}
def annotationProcessingNode = compilerConfiguration.annotationProcessing.replaceNode {
annotationProcessing {
profile(default: 'true', name: 'Default', enabled: 'true') {
sourceOutputDir(name: 'build/generated/source/apt/main')
sourceTestOutputDir(name: 'build/generated/source/apt/test')
outputRelativeToContentRoot(value: 'true')
processorPath(useClasspath: 'true')
}
}
}
def writer = new FileWriter(ideaCompilerXml)
new XmlNodePrinter(new PrintWriter(writer)).print(parsedXml)
}
}
}
}