This repository has been archived by the owner on May 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
69 lines (55 loc) · 1.7 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
plugins {
id 'checkstyle'
id 'java'
id 'java-gradle-plugin'
id 'maven-publish'
id 'com.github.sherter.google-java-format' version '0.8'
}
group 'com.loosebazooka'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile 'junit:junit:4.12'
}
googleJavaFormat {
toolVersion = '1.6'
}
check.dependsOn verifyGoogleJavaFormat
gradlePlugin {
plugins {
monolith {
id = 'com.loosebazooka.consolidate'
displayName = 'Consolidate'
description = 'Consilidate multiple gradle projects as a single artifact'
implementationClass = 'com.loosebazooka.gradle.consolidate.ConsolidatePlugin'
}
}
}
publishing {
repositories {
mavenLocal()
}
}
checkstyle {
toolVersion = '8.29'
// use google checks from the jar
def googleChecks = resources.text.fromArchiveEntry(configurations.checkstyle[0], 'google_checks.xml').asString()
// set the location of the suppressions file referenced in google_checks.xml
configProperties['org.checkstyle.google.suppressionfilter.config'] = getConfigDirectory().file('checkstyle-suppressions.xml').get().toString()
// add in copyright header check on only java files (replace the last </module> in file)
def copyrightChecks = '''
<module name="RegexpHeader">
<property name="headerFile" value="${config_loc}/copyright-java.header"/>
<property name="fileExtensions" value="java"/>
<property name="id" value="header"/>
</module>
</module>
'''
googleChecks = googleChecks.substring(0, googleChecks.lastIndexOf('</module>')) + copyrightChecks
// this is the actual checkstyle config
config = resources.text.fromString(googleChecks)
maxErrors = 0
maxWarnings = 0
}