This repository has been archived by the owner on Jul 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
188 lines (152 loc) · 4.68 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
/**
* Copyright (C) 2017 Ardika Rommy Sanjaya
*/
buildscript {
apply from: "${rootDir}/gradle/configure.gradle"
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id "java"
id "signing"
id "maven"
id "jacoco"
id "checkstyle"
id "pmd"
id "org.springframework.boot" version "2.0.4.RELEASE" apply false
id "com.jfrog.bintray" version "1.7.3" apply false
id "com.github.spotbugs" version "1.6.2" apply false
id "com.github.kt3k.coveralls" version "2.8.2" apply false
id "co.riiid.gradle" version "0.4.2" apply false
}
apply plugin: 'java'
group = "${GROUP}"
version = "${VERSION}"
subprojects {
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
group = rootProject.group
version = rootProject.version
sourceCompatibility = "${JAVA_VERSION}"
targetCompatibility = "${JAVA_VERSION}"
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
mavenCentral()
jcenter()
maven {
url 'https://dl.bintray.com/ardikars/maven'
}
}
dependencyManagement {
imports { mavenBom("com.ardikars.common:common:${COMMON_VERSION}") }
}
dependencies {
implementation ("com.ardikars.common:common-net")
implementation ("com.ardikars.common:common-util")
implementation ("com.ardikars.common:common-memory")
testImplementation ('junit:junit:4.12')
}
configurations.archives.artifacts.with { archives ->
def jarArtifact
archives.each {
if (it.file =~ 'jar' && project.name == "${rootProject.name}") {
jarArtifact = it
}
}
remove(jarArtifact)
}
evaluationDependsOn(project.path)
jar {
manifest {
attributes 'Implementation-Title': 'Jxnet',
'Implementation-Version': version
}
}
javadoc {
def currentYear = Calendar.getInstance().get Calendar.YEAR
options.with {
locale 'en_US'
encoding 'UTF-8'
charSet 'UTF-8'
author true
windowTitle "${NAME} ${project.version}"
header "${NAME} ${project.version}"
docTitle "${NAME} ${project.version} API Documentation"
footer 'https://github.com/jxnet/Jxpacket'
bottom "Copyright © 2017 - ${currentYear} ardikars.com. All rights reserved."
showFromProtected()
addStringOption 'Xdoclint:all,-reference', '-quiet'
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
tasks.withType(JavaCompile) {
//options.compilerArgs << "-Xlint:unchecked" << "-Werror"
}
jacoco {
toolVersion = "${JACOCO_VERSION}"
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.destination file("${buildDir}/jacocoHtml")
}
}
test {
testLogging {
showStandardStreams = true
}
jacoco {
append = false
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpDir = file("$buildDir/jacoco/classpathdumps")
}
}
clean {
file("${rootDir}/${project.name}/obj").deleteDir()
file("${rootDir}/${project.name}/out").deleteDir()
}
/**
* Upload converage report
*/
tasks.coveralls {
dependsOn 'check'
}
}
if (gradle.startParameter.taskNames.contains('github') ||
gradle.startParameter.taskNames.contains('githubRelease')) {
apply from: 'gradle/githubRelease.gradle'
}
if (gradle.startParameter.taskNames.contains('github') ||
gradle.startParameter.taskNames.contains('githubRelease')) {
apply from: 'gradle/githubRelease.gradle'
}
if (gradle.startParameter.taskNames.contains("install")) {
apply from: 'gradle/artifactInstall.gradle'
}
if (gradle.startParameter.taskNames.contains("dist")) {
apply from: 'gradle/artifactDistribute.gradle'
}
if (gradle.startParameter.taskNames.contains("build")) {
apply from: 'gradle/codeAnalysis.gradle'
}
if (gradle.startParameter.taskNames.contains("bintrayUpload") ||
gradle.startParameter.taskNames.contains("uploadArchives")) {
apply from: 'gradle/artifactRelease.gradle'
}
task wrapper(type: Wrapper) {
distributionUrl = "https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip"
}