Skip to content

Commit 164b734

Browse files
nathanmittlerejona86
authored andcommitted
Adding gradle build for Java grpc
------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=82152044
1 parent 66ce667 commit 164b734

File tree

10 files changed

+139
-0
lines changed

10 files changed

+139
-0
lines changed

all/build.gradle

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
description = "Stubby: All"
2+
3+
// Make sure that no transitive dependencies are included.
4+
configurations.compile.transitive = false
5+
6+
dependencies {
7+
compile project(':stubby-core'),
8+
project(':stubby-stub'),
9+
project(':stubby-auth'),
10+
project(':stubby-netty'),
11+
project(':stubby-okhttp')
12+
}
13+
14+
// Create a fat jar containing only the direct dependencies
15+
jar {
16+
from {
17+
configurations.compile.collect {
18+
it.isDirectory() ? it : zipTree(it)
19+
}
20+
}
21+
}
22+

auth/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description = "Stubby: Auth"
2+
dependencies {
3+
compile project(':stubby-core'),
4+
libraries.oauth_client,
5+
libraries.javaee_api
6+
}

build.gradle

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
subprojects {
2+
apply plugin: "java"
3+
apply plugin: "maven"
4+
5+
group = "com.google.net.stubby"
6+
version = "0.1.0-SNAPSHOT"
7+
8+
sourceCompatibility = 1.6
9+
targetCompatibility = 1.6
10+
11+
repositories {
12+
mavenCentral()
13+
mavenLocal()
14+
}
15+
16+
// External dependency management
17+
ext.libraries = [
18+
protobuf: 'com.google.protobuf:protobuf-java:2.6.1',
19+
guava: 'com.google.guava:guava:18.0',
20+
jsr305: 'com.google.code.findbugs:jsr305:3.0.0',
21+
oauth_client: 'com.google.oauth-client:google-oauth-client:1.18.0-rc',
22+
javaee_api: 'javax:javaee-api:7.0',
23+
okio: 'com.squareup.okio:okio:1.0.1',
24+
hpack: 'com.twitter:hpack:0.9.1',
25+
protobuf_plugin: 'ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1',
26+
27+
// TODO: Unreleased dependencies.
28+
// These must already be installed in the local maven repository.
29+
netty: 'io.netty:netty-codec-http2:5.0.0.Alpha2-SNAPSHOT',
30+
okhttp: 'com.squareup.okhttp:okhttp:2.2.0-SNAPSHOT',
31+
32+
// Test dependencies.
33+
junit: 'junit:junit:4.11',
34+
mockito: 'org.mockito:mockito-core:1.10.8'
35+
]
36+
37+
dependencies {
38+
testCompile libraries.junit,
39+
libraries.mockito
40+
}
41+
}

core/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description = 'Stubby: Core'
2+
dependencies {
3+
compile libraries.protobuf,
4+
libraries.guava,
5+
libraries.jsr305
6+
}

integration-testing/build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apply plugin: 'protobuf'
2+
3+
description = "Stubby: Integration Testing"
4+
5+
// Add dependency on the protobuf plugin
6+
buildscript {
7+
repositories {
8+
mavenCentral()
9+
}
10+
dependencies {
11+
classpath libraries.protobuf_plugin
12+
}
13+
}
14+
15+
dependencies {
16+
compile project(':stubby-core'),
17+
project(':stubby-netty'),
18+
project(':stubby-okhttp'),
19+
project(':stubby-stub'),
20+
project(':stubby-testing'),
21+
libraries.junit,
22+
files("../lib/libtest_proto_grpc.jar")
23+
}

netty/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
description = "Stubby: Netty"
2+
dependencies {
3+
compile project(':stubby-core'),
4+
libraries.hpack,
5+
libraries.netty
6+
7+
// Tests depend on base class defined by core module.
8+
testCompile project(':stubby-core').sourceSets.test.output
9+
}

okhttp/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description = "Stubby: OkHttp"
2+
dependencies {
3+
compile project(':stubby-core'),
4+
libraries.okio,
5+
libraries.okhttp
6+
}

settings.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
rootProject.name = "stubby"
2+
include ":stubby-core"
3+
include ":stubby-stub"
4+
include ":stubby-auth"
5+
include ":stubby-okhttp"
6+
include ":stubby-netty"
7+
include ":stubby-testing"
8+
include ":stubby-integration-testing"
9+
include ":stubby-all"
10+
11+
project(':stubby-core').projectDir = "$rootDir/core" as File
12+
project(':stubby-stub').projectDir = "$rootDir/stub" as File
13+
project(':stubby-auth').projectDir = "$rootDir/auth" as File
14+
project(':stubby-okhttp').projectDir = "$rootDir/okhttp" as File
15+
project(':stubby-netty').projectDir = "$rootDir/netty" as File
16+
project(':stubby-testing').projectDir = "$rootDir/testing" as File
17+
project(':stubby-integration-testing').projectDir = "$rootDir/integration-testing" as File
18+
project(':stubby-all').projectDir = "$rootDir/all" as File

stub/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
description = "Stubby: Stub"
2+
dependencies {
3+
compile project(':stubby-core')
4+
}

testing/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
description = "Stubby: Testing"
2+
dependencies {
3+
compile project(':stubby-core')
4+
}

0 commit comments

Comments
 (0)