| apply plugin: 'com.android.library' |
| |
| group = "io.grpc" |
| version = "1.27.0-SNAPSHOT" // CURRENT_GRPC_VERSION |
| description = "gRPC: Cronet Android" |
| |
| buildscript { |
| repositories { |
| google() |
| jcenter() |
| mavenCentral() |
| maven { url "https://plugins.gradle.org/m2/" } |
| } |
| dependencies { |
| classpath 'com.android.tools.build:gradle:3.3.0' |
| classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.8.1' |
| classpath 'digital.wup:android-maven-publish:3.6.2' |
| } |
| } |
| |
| apply plugin: "maven-publish" |
| apply plugin: "net.ltgt.errorprone" |
| apply plugin: "digital.wup.android-maven-publish" |
| apply plugin: "signing" |
| |
| repositories { |
| google() |
| jcenter() |
| mavenCentral() |
| mavenLocal() |
| } |
| |
| android { |
| compileSdkVersion 27 |
| defaultConfig { |
| minSdkVersion 16 |
| targetSdkVersion 27 |
| versionCode 1 |
| versionName "1.0" |
| testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| } |
| buildTypes { |
| debug { minifyEnabled false } |
| release { |
| minifyEnabled false |
| consumerProguardFiles 'proguard-rules.pro' |
| } |
| } |
| testOptions { unitTests { includeAndroidResources = true } } |
| lintOptions { disable 'InvalidPackage' } |
| } |
| |
| dependencies { |
| errorprone 'com.google.errorprone:error_prone_core:2.3.3' |
| errorproneJavac 'com.google.errorprone:javac:9+181-r4173-1' |
| |
| implementation 'io.grpc:grpc-core:1.27.0-SNAPSHOT' // CURRENT_GRPC_VERSION |
| testImplementation 'io.grpc:grpc-testing:1.27.0-SNAPSHOT' // CURRENT_GRPC_VERSION |
| |
| implementation 'org.chromium.net:cronet-api:76.3809.111' |
| testImplementation 'org.chromium.net:cronet-embedded:66.3359.158' |
| |
| testImplementation 'junit:junit:4.12' |
| testImplementation 'org.mockito:mockito-core:2.28.2' |
| testImplementation "org.robolectric:robolectric:3.5.1" |
| } |
| |
| task javadocs(type: Javadoc) { |
| source = android.sourceSets.main.java.srcDirs |
| classpath += files(android.getBootClasspath()) |
| classpath += files({ |
| android.libraryVariants.collect { variant -> |
| variant.javaCompileProvider.get().classpath |
| } |
| }) |
| options { |
| // Disable JavaDoc doclint on Java 8. |
| if (JavaVersion.current().isJava8Compatible()) { |
| addStringOption('Xdoclint:none', '-quiet') |
| } |
| } |
| exclude 'io/grpc/cronet/Internal*' |
| } |
| |
| task javadocJar(type: Jar, dependsOn: javadocs) { |
| classifier = 'javadoc' |
| from javadocs.destinationDir |
| } |
| |
| task sourcesJar(type: Jar) { |
| classifier = 'sources' |
| from android.sourceSets.main.java.srcDirs |
| } |
| |
| publishing { |
| publications { |
| maven(MavenPublication) { |
| from components.android |
| |
| artifact javadocJar |
| artifact sourcesJar |
| |
| pom { |
| name = project.group + ":" + project.name |
| url = 'https://github.com/grpc/grpc-java' |
| afterEvaluate { |
| // description is not available until evaluated. |
| description = project.description |
| } |
| |
| scm { |
| connection = 'scm:git:https://github.com/grpc/grpc-java.git' |
| developerConnection = 'scm:git:[email protected]:grpc/grpc-java.git' |
| url = 'https://github.com/grpc/grpc-java' |
| } |
| |
| licenses { |
| license { |
| name = 'Apache 2.0' |
| url = 'https://opensource.org/licenses/Apache-2.0' |
| } |
| } |
| |
| developers { |
| developer { |
| id = "grpc.io" |
| name = "gRPC Contributors" |
| email = "[email protected]" |
| url = "https://grpc.io/" |
| organization = "gRPC Authors" |
| organizationUrl = "https://www.google.com" |
| } |
| } |
| |
| withXml { |
| asNode().dependencies.'*'.findAll() { dep -> |
| dep.artifactId.text() in ['grpc-api', 'grpc-core'] |
| }.each() { core -> |
| core.version*.value = "[" + core.version.text() + "]" |
| } |
| } |
| } |
| } |
| } |
| repositories { |
| maven { |
| if (rootProject.hasProperty('repositoryDir')) { |
| url = new File(rootProject.repositoryDir).toURI() |
| } else { |
| String stagingUrl |
| if (rootProject.hasProperty('repositoryId')) { |
| stagingUrl = 'https://oss.sonatype.org/service/local/staging/deployByRepositoryId/' + |
| rootProject.repositoryId |
| } else { |
| stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/' |
| } |
| credentials { |
| if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) { |
| username = rootProject.ossrhUsername |
| password = rootProject.ossrhPassword |
| } |
| } |
| def releaseUrl = stagingUrl |
| def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/' |
| url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl |
| } |
| } |
| } |
| } |
| |
| signing { |
| required false |
| sign publishing.publications.maven |
| } |