-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
195 lines (159 loc) · 5.82 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
buildscript {
repositories {
if (hasProperty("additionalMavenUrl") && !additionalMavenUrl.isEmpty()) {
maven { url additionalMavenUrl }
}
maven {
url "https://plugins.gradle.org/m2/" // for gradle-lombok plugin
}
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// for firebase
classpath 'com.google.gms:google-services:4.0.1'
// gradle-lombok plugin
classpath "io.franzbecker:gradle-lombok:2.2"
}
}
plugins {
id 'java'
// gradle-lombok plugin
// 1.12-1.14は正常動作しないため、1.11 に固定
// https://github.com/franzbecker/gradle-lombok/issues/53
// id 'io.franzbecker.gradle-lombok' version '1.11'
// dependency management plugin
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
// for dependency update check
// 'gradle dependencyUpdates' で dependency 更新チェック可能
id 'com.github.ben-manes.versions' version '0.20.0'
// android library の maven publish を行なうための plugin
// see: https://github.com/dcendents/android-maven-gradle-plugin
id 'com.github.dcendents.android-maven' version '2.1'
}
// 共通設定
// http://tools.android.com/tech-docs/new-build-sydostem/tips
ext {
minSdkVersion = 16
compileSdkVersion = 27
targetSdkVersion = 27
buildToolsVersion = "28.0.3"
versionCode = 10
versionName = "7.5.1"
// dependency versions
ssepushClientVersion = "7.5.0"
// core dependencies
jerseyVersion = "2.25.1" //jersey 2.26 は Java8 必要なため一旦 2.25.1 で留め置く
jacksonVersion = "2.9.8"
okhttpVersion = "3.12.1"
commonsCodecVersion = "1.11"
// android dependencies
supportLibsVersion = "25.3.1"
playServicesGcmVersion = "15.0.1"
firebaseMessagingVersion = "17.0.0"
// build time only
lombokVersion = "1.18.6"
// test dependencies
assertjVersion = "2.9.1"
mockitoVersion = "2.23.4"
guavaVersion = "27.0.1"
}
// 全サブプロジェクトの共通設定
allprojects {
group = 'com.nec.baas'
version = '7.5.1'
repositories {
if (hasProperty("additionalMavenUrl") && !additionalMavenUrl.isEmpty()) {
maven { url additionalMavenUrl }
}
mavenLocal()
maven { url 'https://maven.google.com' }
jcenter()
google()
}
tasks.withType(JavaCompile) {
it.options.encoding = 'UTF-8'
}
tasks.withType(Javadoc) {
it.options.addStringOption('Xdoclint:none', '-quiet')
}
configurations {
runtimeClasspath
compileClasspath
debugCompileClasspath // for android
// Maven の 'provided' scope をエミュレート
// (コンパイル時のみクラスパス追加。lombok用。)
provided
}
}
subprojects {
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
dependencies {
// jackson
dependency "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
// okhttp3
dependency "com.squareup.okhttp3:okhttp:${okhttpVersion}"
// commons-codec
dependency "commons-codec:commons-codec:${commonsCodecVersion}"
// for SSE Push Client
dependency("org.glassfish.jersey.core:jersey-client:${jerseyVersion}") {
exclude "org.glassfish.hk2.external:javax.inject"
}
dependency("org.glassfish.jersey.media:jersey-media-sse:${jerseyVersion}") {
exclude "org.glassfish.jersey.core:jersey-server"
}
}
}
// 依存ライブラリをコピー(fortify リリース向け)
task copyDeps(type: Copy) {
// fcmTest は不要
if (!project.name.equals("fcmTest")) {
// #10439 コード検証(v7.5)
// configurations.api, configurations.implementation は参照できず、
// runtimeClasspath, compileClasspath を使うらしい。
// -> https://discuss.gradle.org/t/copy-all-dependencies-of-implementation-configuration-fails/26666
// from (configurations.api + configurations.implementation)
from (configurations.runtimeClasspath + configurations.compileClasspath + configurations.debugCompileClasspath)
into "build/deps"
}
}
}
def delombokOut = 'build/src_delombok'
// Delombok: getter/setter の javadoc を生成するために使用
import io.franzbecker.gradle.lombok.task.DelombokTask
task delombok(type: DelombokTask) {
ext.outputDir = file(delombokOut)
outputs.dir(outputDir)
def srcDirs = ['core/src/main/java', 'android/src/main/java']
srcDirs.each {
inputs.dir(it)
args(it, "-d", outputDir)
}
}
// javadoc (agggregate)
task alljavadoc(type: Javadoc, dependsOn: [':core:assemble', ':android:assemble', delombok]) {
source = [delombokOut]
destinationDir = file("${buildDir}/java-android_reference")
title = 'モバイルバックエンド基盤 Java / Android SDK リファレンス'
failOnError = false
classpath = files('core/build/classes/main') + files('android/build/classes/main')
// 除外するディレクトリを指定 (利用者に見せない)
exclude '**/internal/**', '**/http/*', '**/util/*', '**/sde4sd/*'
options {
//footer = 'Copyright (C) 2013-2016, NEC Corporation.'
encoding 'UTF-8'
docEncoding 'UTF-8'
charSet 'UTF-8'
showFromPublic() // show only public fields.
}
}
task javadocJar(dependsOn: [':core:javadocJar', ':android:javadocJar']) {}
task sourcesJar(dependsOn: [':core:sourcesJar', ':android:sourcesJar']) {}
task copyDeps(dependsOn:
[':core:copyDeps',
':android:copyDeps']) {
}
// SDK生成タスク
apply from: 'mksdk.gradle'