aboutsummaryrefslogtreecommitdiff
path: root/buildSrc
diff options
context:
space:
mode:
authorChristian Williams <christianw@google.com>2017-01-09 12:01:37 -0800
committerChristian Williams <christianw@google.com>2017-01-26 18:12:39 -0800
commitb7dcac850845ae78126cc31fe8c91f524a0d42ed (patch)
tree070e834e065ed4c9ba38238c83897c91eef26f6f /buildSrc
parenta553d0fc6bb263e162df7be1e7c8c08e0d6fa759 (diff)
downloadrobolectric-shadows-b7dcac850845ae78126cc31fe8c91f524a0d42ed.tar.gz
Gradle maven artifact name gen refactor.
Diffstat (limited to 'buildSrc')
-rw-r--r--buildSrc/src/main/groovy/ProvideBuildClasspathTask.groovy2
-rw-r--r--buildSrc/src/main/groovy/RoboJavaModulePlugin.groovy7
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."