-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
157 lines (129 loc) · 3.18 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
plugins {
id 'java'
id 'java-library'
id 'eclipse'
id 'idea'
id 'maven'
id 'maven-publish'
id 'jacoco'
id "com.jfrog.bintray" version "1.8.4"
}
ext {
// バージョン定義
versionMajor = 0
versionMinor = 0
versionPatch = 3
// アーティファクト関連
group 'com.zomu_t'
version "${versionMajor}.${versionMinor}.${versionPatch}"
// Document
siteUrl = 'https://github.com/takashno/lib-java-generate'
// SCM(GitHub)
githubUrl = 'https://github.com/takashno/lib-java-generate'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
api group: 'com.github.spullara.mustache.java', name: 'compiler', version: '0.8.18'
api group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
api group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
api group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
// ソースコードフォーマッター
api 'com.google.googlejavaformat:google-java-format:1.3'
// For Develop
compileOnly 'org.projectlombok:lombok:1.18.6'
annotationProcessor 'org.projectlombok:lombok:1.18.6'
}
// JavaDoc
tasks.withType(Javadoc) {
options.charSet = 'UTF-8'
options.encoding = 'UTF-8'
options.addBooleanOption('Xdoclint:none', true)
}
// Java
tasks.withType(JavaCompile) {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
it.options.encoding = 'UTF-8'
}
// JavaDoc Jar packaging
task packageJavadoc(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier = 'javadoc'
}
// Source Jar Packaging
task packageSources(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier = 'source'
}
artifacts {
archives packageJavadoc
archives packageSources
}
// CodeCov
task codeCoverageReport(type: JacocoReport) {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
subprojects.each {
sourceSets it.sourceSets.main
}
reports {
xml.enabled true
xml.destination project.file("${buildDir}/reports/jacoco/report.xml")
html.enabled false
csv.enabled false
}
}
codeCoverageReport.dependsOn {
subprojects*.test
}
// Library Publish
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY')
configurations = ['archives']
pkg {
repo = 'takashno_maven_repo'
name = project.name
userOrg = 'takashno'
licenses = ['Apache-2.0']
websiteUrl = siteUrl
issueTrackerUrl = githubUrl + '/blob/master/LICENSE'
vcsUrl = githubUrl + '.git'
issueTrackerUrl = githubUrl + '/issues'
publicDownloadNumbers = true
version {
name = project.version
}
}
}
install {
repositories.mavenInstaller {
pom.project {
name project.name
url siteUrl
packaging 'jar'
groupId project.group
artifactId project.name
version project.version
licenses {
license {
name 'Apache License 2.0'
url 'http://www.apache.org/licenses/'
distribution 'repo'
}
}
scm {
connection githubUrl + '.git'
url githubUrl
}
}
}
}
task publishJavaDoc(type: Copy) {
from ('build/docs/javadoc') {
include '**/*.*'
}
into 'docs'
}