blob: 7f75fd5f45882a42f088e94b830c91fcef7633fa [file] [log] [blame]
Alexander Dorokhineeb39d4d2020-04-06 16:10:36 -07001/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17buildscript {
18 boolean unbundleBuild = (new File('unbundled-build')).exists()
19 repositories {
20 maven { url '../../../prebuilts/androidx/external' }
21 if (unbundleBuild) {
22 jcenter()
23 }
24 }
25 dependencies {
26 classpath('gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.8')
27 }
28}
29
30apply plugin: 'java-library'
31apply plugin: 'com.google.protobuf'
32apply plugin: 'idea'
33
34sourceSets {
35 main {
36 proto {
37 srcDir '..'
38 include '**/*.proto'
39 }
40 }
41}
42
43dependencies {
44 api('com.google.protobuf:protobuf-javalite:3.10.0')
45}
46
47protobuf {
48 protoc {
49 artifact = 'com.google.protobuf:protoc:3.10.0'
50 }
51
52 generateProtoTasks {
53 all().each { task ->
54 task.builtins {
55 java {
56 option 'lite'
57 }
58 }
59 }
60 }
61}