| apply plugin: 'maven' |
| /* |
| * Copyright (C) 2019 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| // Only present so gets released in 'release' mode. |
| apply plugin: 'signing' |
| |
| apply plugin: 'java' |
| apply plugin: 'com.google.protobuf' |
| |
| dependencies { |
| compile libs.protobuf |
| } |
| |
| protobuf { |
| protoc { |
| artifact = libs.proto_compiler |
| } |
| } |
| |
| sourceSets { |
| main.proto.srcDir rootProject.file('../prebuilts/tools/common/aapt/protos') |
| } |
| |
| File aaptVersionPropertiesFile = rootProject.file('../prebuilts/tools/common/aapt/aapt2_version.properties') |
| Properties aaptVersionProperties = new Properties() |
| aaptVersionPropertiesFile.withReader { aaptVersionProperties.load(it) } |
| |
| group = 'com.android.tools.build' |
| archivesBaseName = 'aapt2-proto' |
| version = rootProject.ext.buildVersion + '-' + aaptVersionProperties.getProperty("aapt2Version") |
| project.ext.pomName = 'AAPT2 proto' |
| project.ext.pomDesc = 'Android Asset Packaging Tool 2. Protocol Buffer Files' |
| |
| apply from: "$rootDir/buildSrc/base/publish.gradle" |
| |
| // Add extra settings on top of the ones in the task definitions. |
| sourcesJar.from new File(project.buildDir, "generated/source/proto/main/java/") |
| jar.dependsOn compileJava |
| |
| // Make sure before we jar anything we wait for the proto tasks to finish. |
| protobuf { |
| generateProtoTasks { |
| all().each { task -> |
| sourcesJar.dependsOn task |
| jar.dependsOn task |
| } |
| } |
| } |