Skip to content

Commit

Permalink
fix: set buildName on dynamic GradleBuild when using gradle 6.x or hi…
Browse files Browse the repository at this point in the history
…gher (#28)

fixes #27 

Co-authored-by: Nathan Alderson <nathan@nathanalderson.com>
Co-authored-by: tomas.mccandless <tomas.mccandless@workday.com>
  • Loading branch information
3 people committed Aug 27, 2020
1 parent 0c06be6 commit d0cbf45
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/groovy/com/adtran/ScalaMultiVersionPlugin.groovy
Expand Up @@ -31,6 +31,8 @@ import org.gradle.api.tasks.GradleBuild
import org.gradle.api.tasks.Upload
import org.gradle.api.tasks.bundling.Jar

import java.util.regex.Pattern

class ScalaMultiVersionPlugin implements Plugin<Project> {
private Project project
private List<String> defaultRunOnceTasks = ["clean"]
Expand Down Expand Up @@ -130,6 +132,11 @@ class ScalaMultiVersionPlugin implements Plugin<Project> {
startParameter.projectProperties["recursed"] = true
startParameter.excludedTaskNames += getRunOnceTasks()
tasks = project.gradle.startParameter.taskNames
// workaround name clash issue in Gradle 6+. See:
// https://github.com/ADTRAN/gradle-scala-multiversion-plugin/issues/27.
if (6 <= project.gradle.gradleVersion.split(Pattern.quote('.'))[0].toInteger() ){
buildName = project.name
}
}
}
def tasksToAdd = buildVersionTasks.collect { it.path }
Expand Down

0 comments on commit d0cbf45

Please sign in to comment.