Skip to content

Commit b522711

Browse files
authored
Move to more modern gradle publish plugin, add comment of how to build for publish (#100)
1 parent 42d4d6a commit b522711

8 files changed

Lines changed: 37 additions & 265 deletions

File tree

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ subprojects {
1717
classpath dep.groovyPlugin
1818
classpath dep.kotlinPlugin
1919
classpath dep.okreplayPlugin
20+
classpath dep.gradleMavenPublishPlugin
2021
}
2122
}
2223

gradle/dependencies.gradle

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,40 @@ ext {
1010
isCi = "true" == System.getenv('CI')
1111

1212
dep = [
13-
androidPlugin : 'com.android.tools.build:gradle:3.5.0',
14-
groovyPlugin : 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0',
15-
nexusPlugin : 'com.bmuschko:gradle-nexus-plugin:2.3.1',
16-
appcompat : "androidx.appcompat:appcompat:$versions.appCompatVersion",
17-
androidXAnnotations : "androidx.annotation:annotation:1.0.1",
18-
groovy : "org.codehaus.groovy:groovy-all:2.4.5:indy",
19-
guava : "com.google.guava:guava:25.0-android",
20-
guava_jre : "com.google.guava:guava:25.0-jre",
21-
ddmlib : 'com.android.tools.ddms:ddmlib:25.3.0',
22-
junit : "junit:junit:4.12",
23-
cglib : "cglib:cglib-nodep:2.2.2",
24-
jsr305 : "com.google.code.findbugs:jsr305:3.0.2",
25-
mockito : 'org.mockito:mockito-core:2.7.13',
26-
okio : 'com.squareup.okio:okio:1.17.2',
27-
okhttp : "com.squareup.okhttp3:okhttp:$versions.okhttpVersion",
28-
mockWebServer : "com.squareup.okhttp3:mockwebserver:$versions.okhttpVersion",
29-
snakeYaml : "org.yaml:snakeyaml:1.16",
30-
kotlinStdLib : "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion",
31-
okreplayPlugin : "com.airbnb.okreplay:gradle-plugin:latest.release",
32-
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlinVersion",
33-
truth : 'com.google.truth:truth:0.40',
34-
robolectric : "org.robolectric:robolectric:3.3.2",
35-
spock : dependencies.create("org.spockframework:spock-core:1.0-groovy-2.4", {
13+
// Build and upload with:
14+
// ./gradlew clean assemble sourcesJar androidSourcesJar javadocsJar androidJavadocsJar uploadArchives --no-daemon --no-parallel
15+
// Need to use snapshot version and explicitly include javadoc/sources tasks until
16+
// https://github.com/vanniktech/gradle-maven-publish-plugin/issues/54 is fixed.
17+
gradleMavenPublishPlugin : 'com.vanniktech:gradle-maven-publish-plugin:0.9.0-SNAPSHOT',
18+
androidPlugin : 'com.android.tools.build:gradle:3.5.0',
19+
groovyPlugin : 'org.codehaus.groovy:groovy-android-gradle-plugin:1.1.0',
20+
nexusPlugin : 'com.bmuschko:gradle-nexus-plugin:2.3.1',
21+
appcompat : "androidx.appcompat:appcompat:$versions.appCompatVersion",
22+
androidXAnnotations : "androidx.annotation:annotation:1.0.1",
23+
groovy : "org.codehaus.groovy:groovy-all:2.4.5:indy",
24+
guava : "com.google.guava:guava:25.0-android",
25+
guava_jre : "com.google.guava:guava:25.0-jre",
26+
ddmlib : 'com.android.tools.ddms:ddmlib:25.3.0',
27+
junit : "junit:junit:4.12",
28+
cglib : "cglib:cglib-nodep:2.2.2",
29+
jsr305 : "com.google.code.findbugs:jsr305:3.0.2",
30+
mockito : 'org.mockito:mockito-core:2.7.13',
31+
okio : 'com.squareup.okio:okio:1.17.2',
32+
okhttp : "com.squareup.okhttp3:okhttp:$versions.okhttpVersion",
33+
mockWebServer : "com.squareup.okhttp3:mockwebserver:$versions.okhttpVersion",
34+
snakeYaml : "org.yaml:snakeyaml:1.16",
35+
kotlinStdLib : "org.jetbrains.kotlin:kotlin-stdlib:$versions.kotlinVersion",
36+
okreplayPlugin : "com.airbnb.okreplay:gradle-plugin:latest.release",
37+
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:$versions.kotlinVersion",
38+
truth : 'com.google.truth:truth:0.40',
39+
robolectric : "org.robolectric:robolectric:3.3.2",
40+
spock : dependencies.create("org.spockframework:spock-core:1.0-groovy-2.4", {
3641
exclude module: "groovy-all"
3742
exclude module: "junit"
3843
}),
39-
espresso : 'androidx.test.espresso:espresso-core:3.1.0',
40-
androidXTestRunner: 'androidx.test:runner:1.2.0',
41-
androidXTestRules : 'androidx.test:rules:1.1.1'
44+
espresso : 'androidx.test.espresso:espresso-core:3.1.0',
45+
androidXTestRunner : 'androidx.test:runner:1.2.0',
46+
androidXTestRules : 'androidx.test:rules:1.1.1'
4247
]
4348

4449
androidConfig = [

gradle/gradle-mvn-push.gradle

Lines changed: 0 additions & 229 deletions
This file was deleted.

okreplay-core/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apply plugin: 'java-library'
22
apply plugin: 'org.jetbrains.kotlin.jvm'
3+
apply plugin: 'com.vanniktech.maven.publish'
34

45
project.group = GROUP
56
project.version = VERSION_NAME
@@ -13,5 +14,3 @@ dependencies {
1314
implementation dep.okhttp
1415
implementation dep.jsr305
1516
}
16-
17-
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

okreplay-espresso/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3+
apply plugin: 'com.vanniktech.maven.publish'
34

45
android {
56
compileSdkVersion androidConfig.compileSdkVersion
@@ -31,5 +32,3 @@ dependencies {
3132
testImplementation dep.truth
3233
testImplementation dep.mockito
3334
}
34-
35-
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

okreplay-gradle-plugin/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apply plugin: 'org.jetbrains.kotlin.jvm'
22
apply plugin: 'java-gradle-plugin'
3+
apply plugin: 'com.vanniktech.maven.publish'
34

45
sourceCompatibility = JavaVersion.VERSION_1_8
56
targetCompatibility = JavaVersion.VERSION_1_8
@@ -25,5 +26,3 @@ test {
2526
validateTaskProperties {
2627
failOnWarning = true
2728
}
28-
29-
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

okreplay-junit/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
apply plugin: 'java-library'
22
apply plugin: 'org.jetbrains.kotlin.jvm'
3+
apply plugin: 'com.vanniktech.maven.publish'
34

45
dependencies {
56
api project(":okreplay-core")
@@ -10,5 +11,3 @@ dependencies {
1011

1112
sourceCompatibility = "1.7"
1213
targetCompatibility = "1.7"
13-
14-
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

okreplay-noop/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'java'
2+
apply plugin: 'com.vanniktech.maven.publish'
23

34
project.group = GROUP
45
project.version = VERSION_NAME
@@ -9,5 +10,3 @@ targetCompatibility = "1.7"
910
dependencies {
1011
implementation dep.okhttp
1112
}
12-
13-
apply from: rootProject.file('gradle/gradle-mvn-push.gradle')

0 commit comments

Comments
 (0)