Skip to content

Commit

Permalink
GEODE-4053: Create module for Protobuf messages
Browse files Browse the repository at this point in the history
  • Loading branch information
PivotalSarge authored and upthewaterspout committed Dec 6, 2017
1 parent 5063aca commit d6c978a
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 43 deletions.
6 changes: 5 additions & 1 deletion geode-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dependencies {
archives project(':geode-lucene')
archives project(':geode-old-client-support')
archives project(':geode-protobuf')
archives project(':geode-protobuf-messages')
archives project(':geode-web')
archives project(':geode-web-api')
archives project(':geode-wan')
Expand Down Expand Up @@ -371,6 +372,9 @@ distributions {
from project(":geode-protobuf").configurations.runtime
from project(":geode-protobuf").configurations.archives.allArtifacts.files

from project(":geode-protobuf-messages").configurations.runtime
from project(":geode-protobuf-messages").configurations.archives.allArtifacts.files

from project(":geode-client-protocol").configurations.runtime
from project(":geode-client-protocol").configurations.archives.allArtifacts.files

Expand Down Expand Up @@ -401,7 +405,7 @@ distributions {
}

into('tools/ClientProtocol') {
from {project(":geode-protobuf").zip.outputs.files}
from {project(":geode-protobuf-messages").zip.outputs.files}
}

into ('javadoc') {
Expand Down
62 changes: 62 additions & 0 deletions geode-protobuf-messages/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* 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 plugin: 'com.google.protobuf'
apply plugin: 'idea'

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:' + project.'protobuf-gradle-plugin.version'
}
}

dependencies {
compile 'com.google.protobuf:protobuf-java:' + project.'protobuf-java.version'
}

protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = 'com.google.protobuf:protoc:' + project.'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'
44 changes: 2 additions & 42 deletions geode-protobuf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,11 @@
* limitations under the License.
*/

apply plugin: 'com.google.protobuf'
apply plugin: 'idea'

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:' + project.'protobuf-gradle-plugin.version'
}
}

dependencies {
provided project(':geode-client-protocol')
provided project(':geode-core')
compile project(':geode-protobuf-messages')

testCompile project(':geode-junit')
testCompile files(project(':geode-core').sourceSets.test.output)

Expand All @@ -39,33 +29,3 @@ dependencies {

compile 'com.google.protobuf:protobuf-java:' + project.'protobuf-java.version'
}

protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = 'com.google.protobuf:protoc:' + project.'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'
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ include 'extensions/geode-modules-session-internal'
include 'extensions/geode-modules-session'
include 'extensions/geode-modules-assembly'
include 'geode-protobuf'
include 'geode-protobuf-messages'
include 'extensions/session-testing-war'
include 'geode-concurrency-test'

Expand Down

0 comments on commit d6c978a

Please sign in to comment.