Skip to content

Commit 1c9e5b0

Browse files
authored
Defaulting to root's build directory when used from includedBuilds (#904)
1 parent 0630f3b commit 1c9e5b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/groovy/pl/allegro/tech/build/axion/release/ReleasePlugin.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ package pl.allegro.tech.build.axion.release
22

33
import org.gradle.api.Plugin
44
import org.gradle.api.Project
5+
import org.gradle.api.invocation.Gradle
56
import org.gradle.api.provider.Provider
67
import pl.allegro.tech.build.axion.release.domain.SnapshotDependenciesChecker
78
import pl.allegro.tech.build.axion.release.domain.VersionConfig
89
import pl.allegro.tech.build.axion.release.infrastructure.di.VersionResolutionContext
910
import pl.allegro.tech.build.axion.release.infrastructure.github.GithubService
1011
import pl.allegro.tech.build.axion.release.util.FileLoader
1112

13+
import java.util.stream.Stream
14+
1215
abstract class ReleasePlugin implements Plugin<Project> {
1316

1417
public static final String VERSION_EXTENSION = 'scmVersion'
@@ -26,7 +29,10 @@ abstract class ReleasePlugin implements Plugin<Project> {
2629
Provider<GithubService> githubService = project.gradle.sharedServices
2730
.registerIfAbsent("github", GithubService) {}
2831

29-
VersionConfig versionConfig = project.extensions.create(VERSION_EXTENSION, VersionConfig, project.rootProject.layout.projectDirectory)
32+
Gradle rootGradle = project.gradle
33+
while(rootGradle.parent != null) { rootGradle = rootGradle.parent }
34+
35+
VersionConfig versionConfig = project.extensions.create(VERSION_EXTENSION, VersionConfig, rootGradle.rootProject.layout.projectDirectory)
3036

3137
project.tasks.withType(BaseAxionTask).configureEach({
3238
it.versionConfig = versionConfig

0 commit comments

Comments
 (0)