Skip to content

Commit d57cb07

Browse files
committed
Merge branch 'release/0.31'
2 parents 4910c35 + b2ce967 commit d57cb07

File tree

21 files changed

+381
-215
lines changed

21 files changed

+381
-215
lines changed

.version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.31

build.gradle

Lines changed: 19 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ buildscript {
1515
}
1616

1717
plugins {
18-
id "com.github.hierynomus.license" version "0.12.1"
18+
id "com.jfrog.bintray" version "1.7.1"
1919
}
2020

21+
apply from: 'gradle/resolveDependencies.gradle'
22+
2123
ext.githubProjectName = rootProject.name // Change if github project name is not the same as the root project's name
2224

2325
defaultTasks "clean", "build"
@@ -37,8 +39,7 @@ subprojects {
3739
apply plugin: "java"
3840
apply plugin: "maven"
3941

40-
sourceCompatibility = 1.8
41-
targetCompatibility = 1.8
42+
sourceCompatibility = targetCompatibility = 1.8
4243

4344
// ======== code quality ========
4445
apply plugin: "checkstyle"
@@ -49,165 +50,26 @@ subprojects {
4950
apply plugin: "de.thetaphi.forbiddenapis"
5051
apply plugin: "com.diffplug.gradle.spotless"
5152

52-
// compiler
53-
compileJava {
54-
options.compilerArgs << "-Xlint"
55-
}
56-
57-
// jacoco
58-
jacocoTestReport {
59-
reports {
60-
xml.enabled false
61-
csv.enabled false
62-
}
63-
}
64-
65-
// checkstyle
66-
checkstyle {
67-
toolVersion = "7.1.2"
68-
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
69-
}
70-
checkstyleTest {
71-
configFile = rootProject.file("config/checkstyle/checkstyle-test.xml")
72-
}
53+
// code quality configuration
54+
apply from: "${rootProject.projectDir}/gradle/quality/checkstyle.gradle"
55+
apply from: "${rootProject.projectDir}/gradle/quality/findbugs.gradle"
56+
apply from: "${rootProject.projectDir}/gradle/quality/pmd.gradle"
57+
apply from: "${rootProject.projectDir}/gradle/quality/cpd.gradle"
58+
apply from: "${rootProject.projectDir}/gradle/quality/jacoco.gradle"
59+
apply from: "${rootProject.projectDir}/gradle/quality/forbiddenapis.gradle"
60+
apply from: "${rootProject.projectDir}/gradle/quality/spotless.gradle"
7361

74-
// workaround: see https://issues.gradle.org/browse/GRADLE-2888
75-
task verifyNoCheckstyleWarningsInMain {
76-
group = "verification"
77-
description = "Fail if checkstyleMain result contains warnings"
78-
doLast {
79-
File warningsFile = file('build/reports/checkstyle/main.xml')
80-
if (warningsFile.exists() && warningsFile.text.contains("<error ")) {
81-
throw new GradleException("There were checkstyle warnings! For more info check $warningsFile")
82-
}
83-
}
84-
}
85-
checkstyleMain.finalizedBy verifyNoCheckstyleWarningsInMain
86-
task verifyNoCheckstyleWarningsInTest {
87-
group = "verification"
88-
description = "Fail if checkstyleTest result contains warnings"
89-
doLast {
90-
File warningsFile = file('build/reports/checkstyle/test.xml')
91-
if (warningsFile.exists() && warningsFile.text.contains("<error ")) {
92-
throw new GradleException("There were checkstyle warnings! For more info check $warningsFile")
93-
}
94-
}
95-
}
96-
checkstyleTest.finalizedBy verifyNoCheckstyleWarningsInTest
97-
98-
// findbugs
99-
findbugs {
100-
effort = "max"
101-
includeFilter = file("../config/findbugs/includeFilter.xml")
102-
excludeFilter = file("../config/findbugs/excludeFilter.xml")
103-
}
104-
tasks.withType(FindBugs) {
105-
reports {
106-
xml.enabled = false
107-
html.enabled = true
108-
}
109-
}
110-
111-
// pmd
112-
pmd {
113-
consoleOutput = true
114-
}
115-
pmdMain {
116-
ruleSetFiles = files("../config/pmd/pmd-settings.xml")
117-
ruleSets = [] // To apply only the custom rules
118-
}
119-
pmdTest {
120-
ruleSetFiles = files("../config/pmd/pmd-settings-test.xml")
121-
ruleSets = [] // To apply only the custom rules
122-
}
123-
cpdCheck {
124-
reports {
125-
text.enabled = true
126-
xml.enabled = false
127-
}
128-
source = sourceSets.main.allJava // only main source
129-
ignoreFailures = true
130-
}
62+
apply from: "${rootProject.projectDir}/gradle/sourceArtifact.gradle"
63+
apply from: "${rootProject.projectDir}/gradle/bintray.gradle"
13164

132-
// forbiddenapis
133-
forbiddenApisMain {
134-
bundledSignatures += [
135-
'jdk-system-out',
136-
'jdk-unsafe-' + project.sourceCompatibility,
137-
'jdk-internal-' + project.sourceCompatibility
138-
]
139-
signaturesFiles = fileTree(dir: "../config/forbiddenapis", include: "*.txt")
140-
ignoreFailures = false
141-
}
142-
forbiddenApisTest {
143-
bundledSignatures += [
144-
'jdk-system-out',
145-
'jdk-internal-' + project.sourceCompatibility
146-
]
147-
ignoreFailures = false
65+
// compiler
66+
tasks.withType(AbstractCompile) each {
67+
it.options.encoding = "UTF-8"
14868
}
149-
150-
// spotless
151-
spotless {
152-
java {
153-
licenseHeaderFile '../config/spotless/spotless.license.java'
154-
importOrderFile '../config/spotless/spotless.importorder'
155-
eclipseFormatFile '../config/spotless/spotless.eclipseformat.xml'
156-
157-
// Eclipse formatter screws up long literals with underscores inside of annotations (see issue #14)
158-
// @Max(value = 9_999_999 L) // what Eclipse does
159-
// @Max(value = 9_999_999L) // what I wish Eclipse did
160-
custom 'Long literal fix', { it.replaceAll('([0-9_]+) [Ll]', '$1L') }
161-
162-
// Eclipse formatter puts excess whitespace after lambda blocks
163-
// funcThatTakesLambdas(x -> {} , y -> {} ) // what Eclipse does
164-
// funcThatTakesLambdas(x -> {}, y -> {}) // what I wish Eclipse did
165-
custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') }
166-
167-
indentWithTabs()
168-
endWithNewline()
169-
170-
customReplaceRegex 'Add space before comment asterisk', '^(\\t*)\\*', '$1 *'
171-
// customReplaceRegex 'Remove indent before line comment', '^\\t*//', '//'
172-
}
173-
174-
// this will create two tasks: spotlessMiscCheck and spotlessMiscApply
175-
format 'misc', {
176-
// target determines which files this format will apply to
177-
// - if you pass a string or a list of strings, they will be treated
178-
// as 'include' parameters to a fileTree in the root directory
179-
// - if you pass a FileCollection, it will pass through untouched
180-
// e.g. project.files('build.gradle', 'settings.gradle')
181-
// - if you pass anything else, it will be sent to project.files(yourArg)
182-
target '**/*.gradle', '**/*.md', '**/.gitignore'
183-
184-
// spotless has built-in rules for the most basic formatting tasks
185-
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
186-
endWithNewline()
187-
}
69+
compileJava {
70+
options.compilerArgs << "-Xlint"
18871
}
18972

190-
191-
// ======== create source and javadoc bundles ========
192-
task sourcesJar(type: Jar, dependsOn: classes) {
193-
classifier = "sources"
194-
from sourceSets.main.allSource
195-
}
196-
197-
task javadocJar(type: Jar, dependsOn: javadoc) {
198-
classifier = "javadoc"
199-
from javadoc.destinationDir
200-
}
201-
202-
javadoc {
203-
failOnError = false
204-
}
205-
206-
artifacts {
207-
archives sourcesJar
208-
archives javadocJar
209-
}
210-
21173
configurations {
21274
deployerJars
21375
}
@@ -228,19 +90,6 @@ subprojects {
22890
}
22991

23092

231-
// ======== License =======
232-
apply plugin: "license"
233-
license {
234-
ext.year = Calendar.getInstance().get(Calendar.YEAR)
235-
header rootProject.file("copyright/HEADER")
236-
strictCheck true
237-
mapping {
238-
java = "SLASHSTAR_STYLE"
239-
}
240-
exclude "**/*.json"
241-
}
242-
243-
24493
// ======== Publishing =======
24594
apply plugin: 'maven-publish'
24695
publishing {
@@ -278,29 +127,8 @@ subprojects {
278127
}
279128
}
280129
}
281-
282-
if (project.hasProperty("bintrayUser") && project.hasProperty("bintrayKey")) {
283-
apply plugin: "com.jfrog.bintray"
284-
bintray {
285-
user = project.bintrayUser
286-
key = project.bintrayKey
287-
publications = ["mavenJava"]
288-
pkg {
289-
repo = "spar-wings"
290-
name = project.name
291-
desc = project.description
292-
websiteUrl = "https://github.com/dai0304/spar-wings"
293-
issueTrackerUrl = "https://github.com/dai0304/spar-wings/issues"
294-
vcsUrl = "https://github.com/dai0304/spar-wings.git"
295-
licenses = ["Apache-2.0"]
296-
labels = ["AWS", "Spring framework"]
297-
}
298-
}
299-
}
300130
}
301131

302-
303-
304132
// ======== wrapper ========
305133
task wrapper(type: Wrapper) {
306134
gradleVersion = "2.12"

circle.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ checkout:
55
dependencies:
66
override:
77
- ./gradlew -v
8-
- ./gradlew testClasses
8+
- ./gradlew resolveDependencies
99

1010
general:
1111
artifacts:
@@ -14,7 +14,6 @@ general:
1414
machine:
1515
environment:
1616
_JAVA_OPTIONS: -Xmx3G
17-
GRADLE_OPTS: -Dorg.gradle.daemon=true
1817
TERM: dumb
1918
java:
2019
version: oraclejdk8

copyright/HEADER

Lines changed: 0 additions & 13 deletions
This file was deleted.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# artifact version
2-
currentVersion = 0.30
2+
currentVersion = 0.31
33

44
# dependency versions
55
springBootVersion = 1.3.3.RELEASE

gradle/bintray.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// -*- coding: utf-8; mode: groovy -*-
2+
3+
if (project.hasProperty("bintrayUser") && project.hasProperty("bintrayKey")) {
4+
bintray {
5+
user = project.bintrayUser
6+
key = project.bintrayKey
7+
publications = ["mavenJava"]
8+
pkg {
9+
repo = "spar-wings"
10+
name = project.name
11+
desc = project.description
12+
websiteUrl = "https://github.com/dai0304/spar-wings"
13+
issueTrackerUrl = "https://github.com/dai0304/spar-wings/issues"
14+
vcsUrl = "https://github.com/dai0304/spar-wings.git"
15+
licenses = ["Apache-2.0"]
16+
labels = ["AWS", "Spring framework"]
17+
}
18+
}
19+
}

gradle/quality/checkstyle.gradle

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
checkstyle {
2+
toolVersion = "7.1.2"
3+
configFile = rootProject.file("${rootProject.projectDir}/config/checkstyle/checkstyle.xml")
4+
}
5+
6+
checkstyleTest {
7+
configFile = file("${rootProject.projectDir}/config/checkstyle/checkstyle-test.xml")
8+
}
9+
10+
// workaround: see https://issues.gradle.org/browse/GRADLE-2888
11+
task verifyNoCheckstyleWarningsInMain {
12+
group = "verification"
13+
description = "Fail if checkstyleMain result contains warnings"
14+
doLast {
15+
File warningsFile = file('build/reports/checkstyle/main.xml')
16+
if (warningsFile.exists() && warningsFile.text.contains("<error ")) {
17+
throw new GradleException("There were checkstyle warnings! For more info check $warningsFile")
18+
}
19+
}
20+
}
21+
checkstyleMain.finalizedBy verifyNoCheckstyleWarningsInMain
22+
task verifyNoCheckstyleWarningsInTest {
23+
group = "verification"
24+
description = "Fail if checkstyleTest result contains warnings"
25+
doLast {
26+
File warningsFile = file('build/reports/checkstyle/test.xml')
27+
if (warningsFile.exists() && warningsFile.text.contains("<error ")) {
28+
throw new GradleException("There were checkstyle warnings! For more info check $warningsFile")
29+
}
30+
}
31+
}
32+
checkstyleTest.finalizedBy verifyNoCheckstyleWarningsInTest

gradle/quality/cpd.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
cpdCheck {
2+
reports {
3+
text.enabled = true
4+
xml.enabled = false
5+
}
6+
source = sourceSets.main.allJava // only main source
7+
ignoreFailures = true
8+
}

gradle/quality/findbugs.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
findbugs {
2+
effort = "max"
3+
includeFilter = file("${rootProject.projectDir}/config/findbugs/includeFilter.xml")
4+
excludeFilter = file("${rootProject.projectDir}/config/findbugs/excludeFilter.xml")
5+
}
6+
7+
tasks.withType(FindBugs) {
8+
reports {
9+
xml.enabled = false
10+
html.enabled = true
11+
}
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
forbiddenApisMain {
2+
bundledSignatures += [
3+
'jdk-system-out',
4+
'jdk-unsafe-' + project.sourceCompatibility,
5+
'jdk-internal-' + project.sourceCompatibility
6+
]
7+
signaturesFiles = fileTree(dir: "${rootProject.projectDir}/config/forbiddenapis", include: "*.txt")
8+
ignoreFailures = false
9+
}
10+
forbiddenApisTest {
11+
bundledSignatures += [
12+
'jdk-system-out',
13+
'jdk-internal-' + project.sourceCompatibility
14+
]
15+
ignoreFailures = false
16+
}

0 commit comments

Comments
 (0)