diff options
author | Christian Williams <christianw@google.com> | 2017-01-09 12:01:37 -0800 |
---|---|---|
committer | Christian Williams <christianw@google.com> | 2017-01-26 18:12:39 -0800 |
commit | b7dcac850845ae78126cc31fe8c91f524a0d42ed (patch) | |
tree | 070e834e065ed4c9ba38238c83897c91eef26f6f /buildSrc | |
parent | a553d0fc6bb263e162df7be1e7c8c08e0d6fa759 (diff) | |
download | robolectric-shadows-b7dcac850845ae78126cc31fe8c91f524a0d42ed.tar.gz |
Gradle maven artifact name gen refactor.
Diffstat (limited to 'buildSrc')
-rw-r--r-- | buildSrc/src/main/groovy/ProvideBuildClasspathTask.groovy | 2 | ||||
-rw-r--r-- | buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/buildSrc/src/main/groovy/ProvideBuildClasspathTask.groovy b/buildSrc/src/main/groovy/ProvideBuildClasspathTask.groovy index c329f0d64..81e21d4b5 100644 --- a/buildSrc/src/main/groovy/ProvideBuildClasspathTask.groovy +++ b/buildSrc/src/main/groovy/ProvideBuildClasspathTask.groovy @@ -12,7 +12,7 @@ class ProvideBuildClasspathTask extends DefaultTask { project.rootProject.allprojects.each { Project otherProject -> def match = otherProject.name =~ /robolectric-shadows\/(.*)/ if (match.matches()) { - def artifactName = "${otherProject.group}:${otherProject.mavenArtifactName()}:${otherProject.version}" + def artifactName = "${otherProject.group}:${otherProject.mavenArtifactName}:${otherProject.version}" File classesDir = otherProject.sourceSets['main'].output.classesDir File resourcesDir = otherProject.sourceSets['main'].output.resourcesDir paths << "${artifactName.replaceAll(/:/, '\\\\:')}: ${classesDir}:${resourcesDir}" diff --git a/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy b/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy index d379e82ce..8ac61b4f9 100644 --- a/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy +++ b/buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy @@ -33,7 +33,7 @@ class RoboJavaModulePlugin implements Plugin<Project> { test.compileClasspath += project.configurations.compileOnly } - ext.mavenArtifactName = { + def mavenArtifactName = { def projNameParts = project.name.split(/\//) as List if (projNameParts[0] == "robolectric-shadows") { projNameParts = projNameParts.drop(1) @@ -41,7 +41,8 @@ class RoboJavaModulePlugin implements Plugin<Project> { } else { return project.name } - } + }() + ext.mavenArtifactName = mavenArtifactName task('provideBuildClasspath', type: ProvideBuildClasspathTask) { File outDir = project.sourceSets['test'].output.resourcesDir @@ -109,7 +110,7 @@ class RoboJavaModulePlugin implements Plugin<Project> { uploadArchives { repositories { mavenDeployer { - pom.artifactId = mavenArtifactName() + pom.artifactId = mavenArtifactName pom.project { name project.name description = "An alternative Android testing framework." |