forked from AutoParams/AutoParams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
143 lines (126 loc) · 4.15 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
import com.github.spotbugs.snom.SpotBugsTask
plugins {
id 'java'
id 'maven-publish'
id 'signing'
id 'org.ec4j.editorconfig' version '0.0.3'
id 'checkstyle'
id 'com.github.spotbugs' version '4.7.0'
}
allprojects {
repositories {
mavenCentral()
jcenter()
}
group = 'io.github.autoparams'
}
subprojects {
apply plugin: 'java'
apply plugin: 'org.ec4j.editorconfig'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
apply plugin: 'maven-publish'
apply plugin: 'signing'
version = artifactVersion
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
editorconfig {
excludes = ["build"]
}
check.dependsOn editorconfigCheck
checkstyle {
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
configProperties = ["suppressionFile": "${project.rootDir}/config/checkstyle/checkstyle-suppressions.xml"]
toolVersion = "8.40"
ignoreFailures = false
maxErrors = 0
maxWarnings = 0
}
spotbugs {
ignoreFailures = false
reportLevel = "high"
spotbugsTest.enabled = false
}
tasks.withType(SpotBugsTask) {
reports {
text.enabled = true
xml.enabled = false
html.enabled = false
}
}
tasks.register("printSpotbugsMain") {
doLast {
File mainResult = file("${buildDir}/reports/spotbugs/main.txt")
if (mainResult.exists()) {
mainResult.readLines().forEach {
println(it)
}
}
}
}
tasks.getByPath("spotbugsMain").finalizedBy("printSpotbugsMain")
jar {
manifest {
attributes(
'Specification-Title': artifactName,
'Specification-Version': artifactVersion,
'Specification-Vendor': 'io.github.autoparams',
'Implementation-Title': artifactName,
'Implementation-Version': artifactVersion,
'Implementation-Vendor': 'io.github.autoparams'
)
}
}
publishing {
repositories {
maven {
name "OSSRH"
url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username System.getenv("MAVEN_USERNAME")
password System.getenv("MAVEN_PASSWORD")
}
}
}
publications {
maven(MavenPublication) {
artifactId artifactId
from components.java
pom {
name = artifactName
description = artifactDescription
url = "https://github.com/AutoParams/AutoParams"
licenses {
license {
name = "MIT License"
url = "https://github.com/AutoParams/AutoParams/blob/main/LICENSE"
}
}
developers {
developer {
id = "gyuwon"
name = "Gyuwon Yi"
email = "gyuwon@live.com"
}
developer {
id = "mhyeon.lee"
name = "Myeonghyeon Lee"
email = "mhyeon.lee@navercorp.com"
}
}
scm {
connection = "https://github.com/AutoParams/AutoParams.git"
developerConnection = "https://github.com/AutoParams/AutoParams.git"
url = "https://github.com/AutoParams/AutoParams"
}
}
}
}
}
signing {
def signingKey = System.getenv("SIGNING_KEY")
def signingPassword = System.getenv("SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.maven
}
}