-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
128 lines (112 loc) · 3.19 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
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/5.6.1/userguide/java_library_plugin.html
*/
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
id 'eclipse'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'maven-publish'
id 'checkstyle'
id 'pmd'
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
maven {url 'https://jitpack.io'}
}
dependencyManagement {
imports {
mavenBom 'com.github.JhonnyBravo:java-se-template-bom:master-SNAPSHOT'
}
}
dependencies {
api group: 'com.opencsv', name: 'opencsv', version: '5.4'
api group: 'org.mybatis', name: 'mybatis', version: '3.5.7'
api 'com.github.JhonnyBravo:java-itamae-connection:master-SNAPSHOT'
// Use JUnit test framework
testImplementation 'junit:junit'
}
group='com.github.JhonnyBravo'
version='master-SNAPSHOT'
sourceCompatibility=1.8
targetCompatibility=1.8
task sourcesJar(type: Jar, dependsOn: classes){
classifier='sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc){
classifier='javadoc'
from javadoc.destinationDir
}
artifacts{
archives sourcesJar
archives javadocJar
}
java{
withJavadocJar()
withSourcesJar()
}
publishing{
publications{
mavenJava(MavenPublication){
artifactId='zip-code-db-cli'
from components.java
versionMapping{
usage('java-api'){
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime'){
fromResolutionResult()
}
}
pom{
name='zip-code-db-cli'
description='郵便番号データの一括登録 / 削除をコマンドライン上で実行する為の Java ライブラリ'
url='https://github.com/JhonnyBravo/zip-code-db-cli'
}
}
}
repositories{
maven{
def releasesRepoUrl=layout.buildDirectory.dir('repos/releases')
def snapshotsRepoUrl=layout.buildDirectory.dir('repos/snapshots')
url=version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}
javadoc{
options.charSet='UTF-8'
options.encoding='UTF-8'
}
checkstyle {
toolVersion='8.41.1'
}
pmd {
toolVersion='6.33.0'
ignoreFailures=true
ruleSetFiles=files("config/pmd/custom-java.xml")
ruleSets=[]
}
tasks.withType(JavaCompile){
options.encoding='UTF-8'
}
afterEvaluate{
jar{
manifest{
attributes 'Main-Class': getProperty('jar.manifest.attributes.Main-Class')
attributes 'Class-Path': configurations.runtimeClasspath.collect{it.name}.join(' ')
}
doLast{
copy{
from configurations.runtimeClasspath
into destinationDirectory
}
}
}
}