Eric Anderson | b938ba5 | 2015-02-28 09:59:25 -0800 | [diff] [blame] | 1 | import org.apache.tools.ant.taskdefs.condition.Os |
| 2 | |
nathanmittler | 164b734 | 2014-12-15 09:58:05 -0800 | [diff] [blame] | 3 | subprojects { |
| 4 | apply plugin: "java" |
| 5 | apply plugin: "maven" |
nmittler | 52f4220 | 2015-01-21 14:30:14 -0800 | [diff] [blame] | 6 | apply plugin: "idea" |
Eric Anderson | 192144e | 2015-03-02 13:31:14 -0800 | [diff] [blame] | 7 | apply plugin: "signing" |
nathanmittler | 164b734 | 2014-12-15 09:58:05 -0800 | [diff] [blame] | 8 | |
nmittler | f831458 | 2015-01-27 10:25:39 -0800 | [diff] [blame] | 9 | group = "io.grpc" |
nathanmittler | 164b734 | 2014-12-15 09:58:05 -0800 | [diff] [blame] | 10 | version = "0.1.0-SNAPSHOT" |
| 11 | |
| 12 | sourceCompatibility = 1.6 |
| 13 | targetCompatibility = 1.6 |
| 14 | |
| 15 | repositories { |
| 16 | mavenCentral() |
| 17 | mavenLocal() |
| 18 | } |
| 19 | |
nmittler | 02c953e | 2015-01-26 14:03:11 -0800 | [diff] [blame] | 20 | compileJava { |
Eric Anderson | e26608f | 2015-02-13 16:39:54 -0800 | [diff] [blame] | 21 | options.compilerArgs << "-Xlint:unchecked" |
Eric Anderson | 61179ab | 2015-02-24 22:59:32 +0000 | [diff] [blame] | 22 | options.encoding = "UTF-8" |
nmittler | 02c953e | 2015-01-26 14:03:11 -0800 | [diff] [blame] | 23 | } |
| 24 | |
Eric Anderson | 14444a9 | 2015-03-11 16:44:38 -0700 | [diff] [blame] | 25 | javadoc.options.encoding = "UTF-8" |
| 26 | |
Jakob Buchgraber | 7ddcdfd | 2015-02-13 16:21:53 -0800 | [diff] [blame] | 27 | ext { |
| 28 | libraries = [ |
Jakob Buchgraber | 7ddcdfd | 2015-02-13 16:21:53 -0800 | [diff] [blame] | 29 | guava: 'com.google.guava:guava:18.0', |
Jakob Buchgraber | 7ddcdfd | 2015-02-13 16:21:53 -0800 | [diff] [blame] | 30 | // used to collect benchmark results |
| 31 | hdrhistogram: 'org.hdrhistogram:HdrHistogram:2.1.4', |
Jeff Pinner | b1cc7cc | 2015-02-25 10:17:23 -0800 | [diff] [blame] | 32 | hpack: 'com.twitter:hpack:0.10.1', |
nmittler | b897a89 | 2015-02-23 12:03:59 -0800 | [diff] [blame] | 33 | javaee_api: 'javax:javaee-api:7.0', |
| 34 | jsonp: 'org.glassfish:javax.json:1.0.4', |
| 35 | jsr305: 'com.google.code.findbugs:jsr305:3.0.0', |
Louis Ryan | 767a12c | 2015-03-02 15:05:09 -0800 | [diff] [blame] | 36 | oauth_client: 'com.google.auth:google-auth-library-oauth2-http:0.1.0', |
nmittler | b897a89 | 2015-02-23 12:03:59 -0800 | [diff] [blame] | 37 | okhttp: 'com.squareup.okhttp:okhttp:2.2.0', |
Eric Anderson | a6f5fff | 2015-02-26 07:53:17 -0800 | [diff] [blame] | 38 | protobuf: 'com.google.protobuf:protobuf-java:3.0.0-alpha-2', |
| 39 | protobuf_nano: 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2', |
nmittler | b897a89 | 2015-02-23 12:03:59 -0800 | [diff] [blame] | 40 | protobuf_plugin: 'ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1', |
nathanmittler | 164b734 | 2014-12-15 09:58:05 -0800 | [diff] [blame] | 41 | |
Jakob Buchgraber | 7ddcdfd | 2015-02-13 16:21:53 -0800 | [diff] [blame] | 42 | // TODO: Unreleased dependencies. |
| 43 | // These must already be installed in the local maven repository. |
nmittler | 2a42509 | 2015-03-11 12:15:30 -0700 | [diff] [blame] | 44 | netty: 'io.netty:netty-codec-http2:4.1.0.Beta5-SNAPSHOT', |
nathanmittler | 164b734 | 2014-12-15 09:58:05 -0800 | [diff] [blame] | 45 | |
Jakob Buchgraber | 7ddcdfd | 2015-02-13 16:21:53 -0800 | [diff] [blame] | 46 | // Test dependencies. |
| 47 | junit: 'junit:junit:4.11', |
Eric Anderson | 192144e | 2015-03-02 13:31:14 -0800 | [diff] [blame] | 48 | mockito: 'org.mockito:mockito-core:1.10.19' |
Jakob Buchgraber | 7ddcdfd | 2015-02-13 16:21:53 -0800 | [diff] [blame] | 49 | ] |
| 50 | |
| 51 | // Determine the correct version of Jetty ALPN boot to use based |
| 52 | // on the Java version. |
| 53 | def alpnboot_version = '8.1.2.v20141202' |
| 54 | if (JavaVersion.current().ordinal() < JavaVersion.VERSION_1_8.ordinal()) { |
| 55 | alpnboot_version = '7.1.2.v20141202' |
| 56 | } |
| 57 | |
| 58 | alpnboot_package_name = 'org.mortbay.jetty.alpn:alpn-boot:' + alpnboot_version |
Eric Anderson | b938ba5 | 2015-02-28 09:59:25 -0800 | [diff] [blame] | 59 | |
| 60 | def exeSuffix = Os.isFamily(Os.FAMILY_WINDOWS) ? ".exe" : "" |
| 61 | // The split is to workaround everything after the colon in C:\ being |
| 62 | // removed due to a bug in the protobuf plugin. |
| 63 | // https://github.com/aantono/gradle-plugin-protobuf/issues/23 |
| 64 | def splitRootDir = rootDir |
| 65 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { |
| 66 | splitRootDir = splitRootDir.getPath().split(":", 2)[1] |
| 67 | } |
| 68 | javaPluginPath = "$splitRootDir/compiler/build/binaries/java_pluginExecutable/java_plugin$exeSuffix" |
Jakob Buchgraber | 7ddcdfd | 2015-02-13 16:21:53 -0800 | [diff] [blame] | 69 | } |
nathanmittler | 164b734 | 2014-12-15 09:58:05 -0800 | [diff] [blame] | 70 | |
| 71 | dependencies { |
| 72 | testCompile libraries.junit, |
| 73 | libraries.mockito |
| 74 | } |
Eric Anderson | 192144e | 2015-03-02 13:31:14 -0800 | [diff] [blame] | 75 | |
| 76 | signing { |
| 77 | required false |
| 78 | sign configurations.archives |
| 79 | } |
| 80 | |
nmittler | 732cfc0 | 2015-03-03 07:59:13 -0800 | [diff] [blame] | 81 | // Disable JavaDoc doclint on Java 8. It's annoying. |
| 82 | if (JavaVersion.current().isJava8Compatible()) { |
| 83 | allprojects { |
| 84 | tasks.withType(Javadoc) { |
| 85 | options.addStringOption('Xdoclint:none', '-quiet') |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
Eric Anderson | 192144e | 2015-03-02 13:31:14 -0800 | [diff] [blame] | 90 | task javadocJar(type: Jar) { |
| 91 | classifier = 'javadoc' |
| 92 | from javadoc |
| 93 | } |
| 94 | |
| 95 | task sourcesJar(type: Jar) { |
| 96 | classifier = 'sources' |
| 97 | from sourceSets.main.allSource |
| 98 | } |
| 99 | |
| 100 | artifacts { |
| 101 | archives javadocJar, sourcesJar |
| 102 | } |
| 103 | |
| 104 | uploadArchives.repositories.mavenDeployer { |
| 105 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } |
| 106 | |
| 107 | repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") { |
| 108 | if (rootProject.hasProperty("ossrhUsername") |
| 109 | && rootProject.hasProperty("ossrhPassword")) { |
| 110 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") { |
| 115 | if (rootProject.hasProperty("ossrhUsername") |
| 116 | && rootProject.hasProperty("ossrhPassword")) { |
| 117 | authentication(userName: ossrhUsername, password: ossrhPassword) |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | [ |
| 123 | install.repositories.mavenInstaller, |
| 124 | uploadArchives.repositories.mavenDeployer, |
| 125 | ]*.pom*.whenConfigured { pom -> |
| 126 | pom.project { |
Eric Anderson | 7e8a02c | 2015-03-12 17:03:01 -0700 | [diff] [blame^] | 127 | name "$project.group:$project.name" |
Eric Anderson | 192144e | 2015-03-02 13:31:14 -0800 | [diff] [blame] | 128 | description project.description |
| 129 | url 'https://github.com/grpc/grpc-java' |
| 130 | |
| 131 | scm { |
| 132 | connection 'scm:svn:https://github.com/grpc/grpc-java.git' |
| 133 | developerConnection 'scm:svn:git@github.com:grpc/grpc-java.git' |
| 134 | url 'https://github.com/grpc/grpc-java' |
| 135 | } |
| 136 | |
| 137 | licenses { |
| 138 | license { |
| 139 | name 'BSD 3-Clause' |
| 140 | url 'http://opensource.org/licenses/BSD-3-Clause' |
| 141 | } |
| 142 | } |
Eric Anderson | 7e8a02c | 2015-03-12 17:03:01 -0700 | [diff] [blame^] | 143 | |
| 144 | developers { |
| 145 | developer { |
| 146 | id "grpc.io" |
| 147 | name "gRPC Contributors" |
| 148 | email "grpc-io@googlegroups.com" |
| 149 | url "http://grpc.io/" |
| 150 | // https://issues.gradle.org/browse/GRADLE-2719 |
| 151 | organization = "Google, Inc." |
| 152 | organizationUrl "https://www.google.com" |
| 153 | } |
| 154 | } |
Eric Anderson | 192144e | 2015-03-02 13:31:14 -0800 | [diff] [blame] | 155 | } |
| 156 | } |
nathanmittler | 164b734 | 2014-12-15 09:58:05 -0800 | [diff] [blame] | 157 | } |