Skip to content

Commit

Permalink
Move to more modern gradle publish plugin, add comment of how to buil…
Browse files Browse the repository at this point in the history
…d for publish (#100)
  • Loading branch information
rossbacher authored Jan 27, 2020
1 parent 42d4d6a commit b522711
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 265 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ subprojects {
classpath dep.groovyPlugin
classpath dep.kotlinPlugin
classpath dep.okreplayPlugin
classpath dep.gradleMavenPublishPlugin
}
}

Expand Down
57 changes: 31 additions & 26 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,40 @@ ext {
isCi = "true" == System.getenv('CI')

dep = [
androidPlugin : 'com.android.tools.build:gradle:3.5.0',
groovyPlugin : 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0',
nexusPlugin : 'com.bmuschko:gradle-nexus-plugin:2.3.1',
appcompat : "androidx.appcompat:appcompat:$versions.appCompatVersion",
androidXAnnotations : "androidx.annotation:annotation:1.0.1",
groovy : "org.codehaus.groovy:groovy-all:2.4.5:indy",
guava : "com.google.guava:guava:25.0-android",
guava_jre : "com.google.guava:guava:25.0-jre",
ddmlib : 'com.android.tools.ddms:ddmlib:25.3.0',
junit : "junit:junit:4.12",
cglib : "cglib:cglib-nodep:2.2.2",
jsr305 : "com.google.code.findbugs:jsr305:3.0.2",
mockito : 'org.mockito:mockito-core:2.7.13',
okio : 'com.squareup.okio:okio:1.17.2',
okhttp : "com.squareup.okhttp3:okhttp:$versions.okhttpVersion",
mockWebServer : "com.squareup.okhttp3:mockwebserver:$versions.okhttpVersion",
snakeYaml : "org.yaml:snakeyaml:1.16",
kotlinStdLib : "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion",
okreplayPlugin : "com.airbnb.okreplay:gradle-plugin:latest.release",
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlinVersion",
truth : 'com.google.truth:truth:0.40',
robolectric : "org.robolectric:robolectric:3.3.2",
spock : dependencies.create("org.spockframework:spock-core:1.0-groovy-2.4", {
// Build and upload with:
// ./gradlew clean assemble sourcesJar androidSourcesJar javadocsJar androidJavadocsJar uploadArchives --no-daemon --no-parallel
// Need to use snapshot version and explicitly include javadoc/sources tasks until
// https://github.com/vanniktech/gradle-maven-publish-plugin/issues/54 is fixed.
gradleMavenPublishPlugin : 'com.vanniktech:gradle-maven-publish-plugin:0.9.0-SNAPSHOT',
androidPlugin : 'com.android.tools.build:gradle:3.5.0',
groovyPlugin : 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0',
nexusPlugin : 'com.bmuschko:gradle-nexus-plugin:2.3.1',
appcompat : "androidx.appcompat:appcompat:$versions.appCompatVersion",
androidXAnnotations : "androidx.annotation:annotation:1.0.1",
groovy : "org.codehaus.groovy:groovy-all:2.4.5:indy",
guava : "com.google.guava:guava:25.0-android",
guava_jre : "com.google.guava:guava:25.0-jre",
ddmlib : 'com.android.tools.ddms:ddmlib:25.3.0',
junit : "junit:junit:4.12",
cglib : "cglib:cglib-nodep:2.2.2",
jsr305 : "com.google.code.findbugs:jsr305:3.0.2",
mockito : 'org.mockito:mockito-core:2.7.13',
okio : 'com.squareup.okio:okio:1.17.2',
okhttp : "com.squareup.okhttp3:okhttp:$versions.okhttpVersion",
mockWebServer : "com.squareup.okhttp3:mockwebserver:$versions.okhttpVersion",
snakeYaml : "org.yaml:snakeyaml:1.16",
kotlinStdLib : "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion",
okreplayPlugin : "com.airbnb.okreplay:gradle-plugin:latest.release",
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlinVersion",
truth : 'com.google.truth:truth:0.40',
robolectric : "org.robolectric:robolectric:3.3.2",
spock : dependencies.create("org.spockframework:spock-core:1.0-groovy-2.4", {
exclude module: "groovy-all"
exclude module: "junit"
}),
espresso : 'androidx.test.espresso:espresso-core:3.1.0',
androidXTestRunner: 'androidx.test:runner:1.2.0',
androidXTestRules : 'androidx.test:rules:1.1.1'
espresso : 'androidx.test.espresso:espresso-core:3.1.0',
androidXTestRunner : 'androidx.test:runner:1.2.0',
androidXTestRules : 'androidx.test:rules:1.1.1'
]

androidConfig = [
Expand Down
229 changes: 0 additions & 229 deletions gradle/gradle-mvn-push.gradle

This file was deleted.

3 changes: 1 addition & 2 deletions okreplay-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'java-library'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'com.vanniktech.maven.publish'

project.group = GROUP
project.version = VERSION_NAME
Expand All @@ -13,5 +14,3 @@ dependencies {
implementation dep.okhttp
implementation dep.jsr305
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 1 addition & 2 deletions okreplay-espresso/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'com.vanniktech.maven.publish'

android {
compileSdkVersion androidConfig.compileSdkVersion
Expand Down Expand Up @@ -31,5 +32,3 @@ dependencies {
testImplementation dep.truth
testImplementation dep.mockito
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 1 addition & 2 deletions okreplay-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'java-gradle-plugin'
apply plugin: 'com.vanniktech.maven.publish'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
Expand All @@ -25,5 +26,3 @@ test {
validateTaskProperties {
failOnWarning = true
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 1 addition & 2 deletions okreplay-junit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: 'java-library'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'com.vanniktech.maven.publish'

dependencies {
api project(":okreplay-core")
Expand All @@ -10,5 +11,3 @@ dependencies {

sourceCompatibility = "1.7"
targetCompatibility = "1.7"

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
3 changes: 1 addition & 2 deletions okreplay-noop/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: 'java'
apply plugin: 'com.vanniktech.maven.publish'

project.group = GROUP
project.version = VERSION_NAME
Expand All @@ -9,5 +10,3 @@ targetCompatibility = "1.7"
dependencies {
implementation dep.okhttp
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

0 comments on commit b522711

Please sign in to comment.