forked from square/wire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (145 loc) · 5.4 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
buildscript {
ext.versions = [
'android': '4.1.1.4',
'coroutines': '1.3.2',
'errorprone': '2.0.21',
'grpc': '1.22.1',
'gson': '2.8.1',
'guava': '20.0',
'javapoet': '1.11.1',
'kotlinpoet': '1.4.0',
'jsr305': '3.0.2',
'kotlin': '1.3.50',
'okio': '2.4.1',
'okhttp': '4.2.2',
'moshi': '1.6.0',
'protobuf': '0.8.10',
'protoc': '3.0.0',
'junit': '4.12',
'assertj': '3.11.0',
'jimfs': '1.0',
'animalSniffer': '1.16',
'animalSnifferGradle': '1.5.0',
'mavenPublish': '0.8.0',
'releasedWire': '3.0.0-alpha01'
]
ext.deps = [
plugins: [
kotlin: "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
shadow: 'com.github.jengelman.gradle.plugins:shadow:4.0.1',
releasedWire: "com.squareup.wire:wire-gradle-plugin:${versions.releasedWire}",
japicmp: 'me.champeau.gradle:japicmp-gradle-plugin:0.2.8',
mavenPublish: "com.vanniktech:gradle-maven-publish-plugin:${versions.mavenPublish}"
],
'android': "com.google.android:android:${versions.android}",
'androidx': [
annotations: "androidx.annotation:annotation:1.1.0",
],
'guava': "com.google.guava:guava:${versions.guava}",
'okio': [
'jvm': "com.squareup.okio:okio:${versions.okio}",
'multiplatform': "com.squareup.okio:okio-multiplatform:${versions.okio}",
],
'jsr305': "com.google.code.findbugs:jsr305:${versions.jsr305}",
'grpc': [
"genJava": "io.grpc:protoc-gen-grpc-java:${versions.grpc}",
"netty": "io.grpc:grpc-netty:${versions.grpc}",
"protobuf": "io.grpc:grpc-protobuf:${versions.grpc}",
"stub": "io.grpc:grpc-stub:${versions.grpc}",
],
'gson': "com.google.code.gson:gson:${versions.gson}",
'javapoet': "com.squareup:javapoet:${versions.javapoet}",
'kotlinpoet': "com.squareup:kotlinpoet:${versions.kotlinpoet}",
'okhttp': "com.squareup.okhttp3:okhttp:${versions.okhttp}",
'kotlin': [
'stdlib': [
'common': "org.jetbrains.kotlin:kotlin-stdlib-common",
'jdk6': "org.jetbrains.kotlin:kotlin-stdlib",
'jdk8': "org.jetbrains.kotlin:kotlin-stdlib-jdk8",
'js': "org.jetbrains.kotlin:kotlin-stdlib-js",
],
'test': [
'common': "org.jetbrains.kotlin:kotlin-test-common",
'annotations': "org.jetbrains.kotlin:kotlin-test-annotations-common",
'junit': "org.jetbrains.kotlin:kotlin-test-junit",
'js': "org.jetbrains.kotlin:kotlin-test-js",
],
'coroutines': [
'core': "org.jetbrains.kotlinx:kotlinx-coroutines-core:${versions.coroutines}"
]
],
'moshi': "com.squareup.moshi:moshi:${versions.moshi}",
'junit': "junit:junit:${versions.junit}",
'assertj': "org.assertj:assertj-core:${versions.assertj}",
'jimfs': "com.google.jimfs:jimfs:${versions.jimfs}",
'animalSniffer': [
'gradle': "ru.vyarus:gradle-animalsniffer-plugin:${versions.animalSnifferGradle}",
'annotations': "org.codehaus.mojo:animal-sniffer-annotations:${versions.animalSniffer}",
],
'protoc': "com.google.protobuf:protoc:${versions.protoc}",
'protobufGradlePlugin': "com.google.protobuf:protobuf-gradle-plugin:${versions.protobuf}",
'releasedWire': [
'runtime': "com.squareup.wire:wire-runtime:${versions.releasedWire}",
],
]
dependencies {
classpath deps.plugins.kotlin
classpath deps.plugins.shadow
classpath deps.plugins.releasedWire
classpath deps.plugins.japicmp
classpath deps.plugins.mavenPublish
classpath deps.animalSniffer.gradle
}
repositories {
mavenCentral()
gradlePluginPortal()
}
}
allprojects {
group = GROUP
version = VERSION_NAME
repositories {
mavenCentral()
google()
}
}
subprojects { project ->
// The `application` plugin internally applies the `distribution` plugin and
// automatically adds tasks to create/publish tar and zip artifacts.
// https://docs.gradle.org/current/userguide/application_plugin.html
// https://docs.gradle.org/current/userguide/distribution_plugin.html#sec:publishing_distributions_upload
plugins.withType(DistributionPlugin) {
distTar.enabled = false
distZip.enabled = false
configurations.archives.artifacts.removeAll { it.file =~ 'tar' || it.file =~ 'zip' }
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
if (project.name != 'wire-runtime' && project.name != 'japicmp' && project.name != 'wire-tests') {
apply plugin: 'com.vanniktech.maven.publish'
} else {
tasks.create('uploadArchives') {
// TODO(egorand): Find out why this became a problem.
// No-op task to prevent Gradle from calling a real uploadArchives task which is added by an
// unknown plugin (or Gradle itself) and fails for multiplatform projects.
}
}
apply plugin: 'checkstyle'
afterEvaluate {
checkstyle {
toolVersion '7.7'
sourceSets = [project.sourceSets.main]
}
}
}
apply from: 'gen-tests.gradle'
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}