-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
160 lines (138 loc) · 4.3 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
// -*- coding: utf-8; mode: groovy -*-
buildscript {
repositories {
mavenCentral()
maven { url "http://repo.spring.io/plugins-release" }
}
dependencies {
classpath "com.diffplug.spotless:spotless-plugin-gradle:4.5.1"
classpath "de.thetaphi:forbiddenapis:3.0"
classpath "de.aaschmid:gradle-cpd-plugin:1.0"
classpath "io.spring.gradle:dependency-management-plugin:1.0.4.RELEASE"
classpath "jp.classmethod.aws:gradle-aws-plugin:0.41"
}
}
plugins {
id "com.jfrog.bintray" version "1.8.5"
}
// custom configuration
apply from: 'gradle/version.gradle'
apply from: 'gradle/resolveDependencies.gradle'
bintrayUpload.enabled = false
ext.githubProjectName = rootProject.name // Change if github project name is not the same as the root project's name
defaultTasks "clean", "build"
allprojects {
repositories {
mavenCentral()
}
group = "jp.xet.${githubProjectName}"
version = rootProject.version
}
description "Support library for Spring framework, AWS Java SDK and the others."
subprojects {
apply plugin: "java"
apply plugin: "io.spring.dependency-management"
apply plugin: "maven"
apply plugin: "maven-publish"
apply plugin: "com.jfrog.bintray"
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:$springBootVersion"
}
}
sourceCompatibility = targetCompatibility = 1.8
// ======== code quality ========
apply plugin: "checkstyle"
apply plugin: "findbugs"
apply plugin: "pmd"
apply plugin: "cpd"
apply plugin: "jacoco"
apply plugin: "de.thetaphi.forbiddenapis"
apply plugin: "com.diffplug.gradle.spotless"
// code quality configuration
apply from: "${rootProject.projectDir}/gradle/quality/checkstyle.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/findbugs.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/pmd.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/cpd.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/jacoco.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/forbiddenapis.gradle"
apply from: "${rootProject.projectDir}/gradle/quality/spotless.gradle"
apply from: "${rootProject.projectDir}/gradle/sourceArtifact.gradle"
apply from: "${rootProject.projectDir}/gradle/bintray.gradle"
// compiler
tasks.withType(AbstractCompile) each {
it.options.encoding = "UTF-8"
}
compileJava {
options.compilerArgs << "-Xlint"
}
configurations {
deployerJars
testCompile.extendsFrom compileOnly
}
repositories {
mavenCentral()
maven { url "http://maven.classmethod.info/snapshot" } // for baseunits
maven { url "http://maven.classmethod.info/release" } // for baseunits
}
dependencies {
compile "org.slf4j:slf4j-api"
compileOnly "org.projectlombok:lombok:$lombokVersion"
testCompile "org.slf4j:jul-to-slf4j"
testCompile "org.slf4j:jcl-over-slf4j"
testCompile "ch.qos.logback:logback-classic"
testCompile "junit:junit:$junitVersion"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.mockito:mockito-core"
}
apply plugin: "jp.classmethod.aws"
aws {
profileName = null
}
// ======== Publishing =======
publishing {
repositories {
maven {
def releasesRepoUrl = "${System.getenv("PUBLISH_REPOSITORY")}/release"
def snapshotsRepoUrl = "${System.getenv("PUBLISH_REPOSITORY")}/snapshot"
url version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
credentials(AwsCredentials) {
def profileName = project.hasProperty("awsProfileForMetropolisRepo") ? project.awsProfileForMetropolisRepo : null
def cred = aws.newCredentialsProvider(profileName).credentials
accessKey cred.getAWSAccessKeyId()
secretKey cred.getAWSSecretKey()
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name project.name
description project.description
inceptionYear "2015"
licenses {
license {
name "The Apache Software License, Version 2.0"
url "http://www.apache.org/license/LICENSE-2.0.txt"
distribution "repo"
}
}
}
}
}
}
}
}
// ======== wrapper ========
wrapper {
gradleVersion = 4.8
}