forked from derive4j/derive4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
206 lines (161 loc) · 5.06 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
defaultTasks 'build'
ext {
}
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.github.ben-manes:gradle-versions-plugin:0.21.0"
classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.7"
classpath "com.diffplug.spotless:spotless-plugin-gradle:3.23.1"
}
wrapper {
gradleVersion = "5.5"
distributionType = Wrapper.DistributionType.ALL
}
}
allprojects {
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'jacoco'
apply plugin: 'idea'
defaultTasks "build"
ext {
isSnapshot = true
d4jBaseVersion = "1.2.0"
snapshotAppendix = "-SNAPSHOT"
d4jVersion = d4jBaseVersion + (isSnapshot ? snapshotAppendix : "")
projectTitle = "Derive4J"
projectName = "derive4j"
pomProjectName = projectTitle
pomOrganisation = "Derive4J contributors"
projectDescription = "Annotation processor and framework for deriving algebraic data types constructors, morphisms, optics and typeclasses"
projectUrl = "https://github.com/derive4j/derive4j"
scmUrl = "git:https://github.com/derive4j/derive4j.git"
scmGitFile = "scm:[email protected]:derive4j/derive4j.git"
primaryEmail = "[email protected]"
dependencyJavaPoet = "com.squareup:javapoet:1.11.1"
dependencyPreviousDerive4J = "org.derive4j:derive4j:1.1.0"
dependencyJunit = "junit:junit:4.12"
dependencyAutoService = "com.google.auto.service:auto-service:1.0-rc5"
gplLicenseName = "The GNU General Public License"
lgplLicenseName = "The GNU Lesser General Public License"
bsd3LicenseName = "The BSD3 License"
displayCompilerWarnings = true
}
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
version = d4jVersion
group = "org.derive4j"
}
artifactoryPublish.skip = true
subprojects {
apply from: "$rootDir/lib.gradle"
apply plugin: "java"
apply plugin: "com.github.ben-manes.versions"
apply plugin: "com.github.hierynomus.license"
apply plugin: "com.diffplug.gradle.spotless"
spotless {
java {
eclipse("4.7.2").configFile "$rootDir/etc/eclipse-format.xml"
indentWithSpaces(2)
trimTrailingWhitespace()
removeUnusedImports()
endWithNewline()
}
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
if (displayCompilerWarnings) {
tasks.withType(JavaCompile) {
options.compilerArgs += ["-Xlint:all"]
}
}
license {
header file('etc/HEADER.txt')
strictCheck true
ignoreFailures true
mapping {
java = 'SLASHSTAR_STYLE'
}
}
}
configure(subprojects) {
apply plugin: "maven"
sourceCompatibility = "1.8"
task javadocJar(type: Jar, dependsOn: "javadoc") {
archiveClassifier = 'javadoc'
from "build/docs/javadoc"
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
jar {
archiveVersion = project.d4jVersion
}
artifactoryPublish {
dependsOn sourcesJar, javadocJar
}
}
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
classDirectories.setFrom(files(subprojects.findAll {subproject -> subproject.name != "examples"} .sourceSets.main.output))
sourceDirectories.setFrom(files(subprojects.findAll {subproject -> subproject.name != "examples"} .sourceSets.main.allSource.srcDirs))
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination new File("${buildDir}/reports/jacoco/report.xml")
html.enabled false
csv.enabled false
}
}
codeCoverageReport.dependsOn {
subprojects*.test
}
artifactory {
contextUrl = 'https://oss.jfrog.org/artifactory' //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
// The Artifactory repository key to publish to :
if (isSnapshot) {
repoKey = 'oss-snapshot-local'
} else {
repoKey = 'oss-release-local'
}
username = jfrogUsername //The publisher user name
password = jfrogPassword //The publisher password
}
defaults {
publishConfigs('archives')
publishIvy = false
}
}
resolve {
repository {
repoKey = 'libs-releases' //The Artifactory (preferably virtual) repository key to resolve from
}
}
}
task env doLast {
println System.getenv()
}