blob: 4e9729df5eb6767a88626078d44b3fa9f3ff9db9 [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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.
*/
apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"
apply from: "${rootDir}/${scriptDir}/warnings.gradle"
import org.apache.geode.gradle.plugins.DependencyConstraints
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:' + DependencyConstraints.get('protobuf-gradle-plugin.version')
}
}
apply plugin: 'com.google.protobuf'
apply plugin: 'idea'
apply from: "${project.projectDir}/../gradle/publish-java.gradle"
dependencies {
api(platform(project(':boms:geode-all-bom')))
api('com.google.protobuf:protobuf-java')
}
protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = 'com.google.protobuf:protoc:' + DependencyConstraints.get('protoc.version')
}
generatedFilesBaseDir = "$buildDir/generated-src/proto"
}
sourceSets {
main {
java {
srcDir "$buildDir/generated-src/proto/main/java"
}
}
}
// let IntelliJ know where the generated sources are.
idea {
module {
sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
}
}
task zip(type: Zip) {
from 'src/main/proto'
baseName = "${project.name}-definitions"
destinationDir = file("$buildDir/libs")
}
assemble.dependsOn 'zip'
afterEvaluate {
rootProject.generate.dependsOn(generateProto)
}