Skip to content

Commit e1d2ade

Browse files
committed
Use maven-publish in place of older publishing
- Enables `publishToMavenLocal` - Removes use of should-have-been-deprecated `Upload` task
1 parent 433aff3 commit e1d2ade

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

build.gradle

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import groovy.json.JsonBuilder
22

33
plugins {
4-
id "com.gradle.plugin-publish" version "0.12.0"
54
id 'groovy'
65
id 'java-gradle-plugin'
6+
id 'maven-publish'
77
id 'codenarc'
8+
id "com.gradle.plugin-publish" version "0.12.0"
89
id "org.gradle.test-retry" version "1.2.0"
910
}
1011

@@ -67,41 +68,36 @@ sourceSets {
6768
}
6869
}
6970

70-
pluginBundle {
71-
website = 'https://github.com/gradle/android-cache-fix-gradle-plugin'
72-
vcsUrl = 'https://github.com/gradle/android-cache-fix-gradle-plugin'
73-
74-
description = 'Gradle plugin to fix Android caching problems'
75-
71+
gradlePlugin {
7672
plugins {
7773
androidCacheFixPlugin {
7874
id = 'org.gradle.android.cache-fix'
7975
displayName = 'Gradle Android cache fix plugin'
80-
tags = ['android', 'cache', 'fix']
81-
version = project.version
76+
description = 'Gradle plugin to fix Android caching problems'
77+
implementationClass = 'org.gradle.android.AndroidCacheFixPlugin'
8278
}
8379
}
8480
}
8581

86-
def localRepo = file("$buildDir/local-repo")
82+
pluginBundle {
83+
website = 'https://github.com/gradle/android-cache-fix-gradle-plugin'
84+
vcsUrl = 'https://github.com/gradle/android-cache-fix-gradle-plugin'
8785

88-
artifacts {
89-
runtime jar
86+
tags = ['android', 'cache', 'fix']
9087
}
9188

92-
tasks.register('install', Upload) {
89+
def localRepo = file("$buildDir/local-repo")
90+
91+
publishing {
9392
repositories {
94-
ivy {
93+
maven {
9594
url = localRepo.toURI()
9695
}
9796
}
98-
descriptorDestination = file("$buildDir/ivy/ivy.xml")
99-
uploadDescriptor = true
100-
configuration = configurations.runtime
10197
}
10298

10399
tasks.withType(Test).configureEach {
104-
dependsOn install
100+
dependsOn publish
105101
systemProperty "local.repo", localRepo.toURI()
106102
retry {
107103
maxRetries = 3

src/test/groovy/org/gradle/android/SimpleAndroidApp.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class SimpleAndroidApp {
4848
repositories {
4949
google()
5050
jcenter()
51-
ivy {
51+
maven {
5252
url = "${System.getProperty("local.repo")}"
5353
}
5454
}

0 commit comments

Comments
 (0)