-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
157 lines (134 loc) · 4.57 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
* Copyright 2016, Lars Winderling
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id "com.jfrog.bintray" version "1.7.1" apply false
}
group 'com.github.kahalemakai'
version '0.5.0-rc1'
apply plugin: 'idea'
idea {
project {
languageLevel = '1.8'
vcs = 'Git'
ipr {
withXml { provider ->
// Get XML as groovy.util.Node to work with.
def projectXml = provider.asNode()
// Find compiler configuration component.
def compilerConfiguration = projectXml.component.find { component ->
component.'@name' == 'CompilerConfiguration'
}
// Replace current annotationProcessing
// that is part of the compiler configuration.
def currentAnnotationProcessing = compilerConfiguration.annotationProcessing
currentAnnotationProcessing.replaceNode {
annotationProcessing {
profile(name: 'Default', default: true, enabled: true) {
processorPath(useClasspath: true)
}
}
}
}
}
}
module {
jdkName = '1.8'
downloadJavadoc = true
downloadSources = false
}
}
subprojects {
def fullName = "${rootProject.name}.${project.name}".replace("_", ".")
def delombokedDir = "${buildDir}/${fullName}/src-delomboked"
def logbackVersion = "1.1.7"
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.bintray"
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceSets {
main {
resources {
srcDirs = ["src/main/resources", "${rootProject.rootDir}/common/main/resources"]
}
}
test {
resources {
srcDirs = ["src/test/resources", "${rootProject.rootDir}/common/test/resources"]
}
}
}
repositories {
jcenter()
maven { url "file://${System.getProperty("user.home")}/.m2/repository" }
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repository.jboss.org/nexus/content/groups/public" }
}
dependencies {
compile "org.slf4j:slf4j-api:1.7.20"
compile "org.projectlombok:lombok:1.16.10"
compile "ch.qos.logback:logback-core:${logbackVersion}"
compile "ch.qos.logback:logback-classic:${logbackVersion}"
testCompile group: 'junit', name: 'junit', version: '4.12'
}
configurations.compile.transitive = true
task delombok << {
description 'Delomboks the source code'
ant.taskdef(classname: 'lombok.delombok.ant.Tasks$Delombok', classpath: configurations.compile.asPath, name: 'delombok')
ant.mkdir(dir: delombokedDir)
ant.delombok(verbose: 'true', encoding: 'UTF-8', to: delombokedDir, from: 'src/main/java')
}
task javadocDelux(type: Javadoc, group: "documentation") {
dependsOn delombok
source delombokedDir
}
jacocoTestReport {
dependsOn delombok
additionalSourceDirs = files(delombokedDir)
reports {
xml.enabled true
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadocDelux
dependsOn javadocDelux
}
task sourcesJar(type: Jar) {
dependsOn classes
classifier = 'sources'
from sourceSets.main.allSource
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" << "-Xdiags:verbose"
}
}
task cleanTests(group: "verification") {
dependsOn cleanTest
}
defaultTasks 'clean', 'build', 'test', 'javadocDelux', 'jacocoTestReport'
test {
useJUnit {
excludeCategories "com.github.kahalemakai.opencsv.categories.PerformanceTests"
}
}
}
task wrapper(type: Wrapper) {
gradleVersion = '3.2'
}