File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
src/main/groovy/com/moowork/gradle/node Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -178,9 +178,16 @@ class SetupTask
178178 def distUrl = this . config. distBaseUrl
179179 this . repo = this . project. repositories. ivy {
180180 url distUrl
181- layout ' pattern' , {
182- artifact ' v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
183- ivy ' v[revision]/ivy.xml'
181+ if (BackwardsCompat . usePatternLayout()) {
182+ patternLayout {
183+ artifact ' v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
184+ ivy ' v[revision]/ivy.xml'
185+ }
186+ } else {
187+ layout ' pattern' , {
188+ artifact ' v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
189+ ivy ' v[revision]/ivy.xml'
190+ }
184191 }
185192 if (BackwardsCompat . useMetadataSourcesRepository()) {
186193 metadataSources {
Original file line number Diff line number Diff line change @@ -3,9 +3,14 @@ package com.moowork.gradle.node.util;
33import org.gradle.util.GradleVersion ;
44
55class BackwardsCompat {
6- private static boolean IS_GRADLE_MIN_45 = GradleVersion . current(). compareTo(GradleVersion . version(" 4.5" ))>= 0 ;
6+ private static boolean IS_GRADLE_MIN_45 = GradleVersion . current(). compareTo(GradleVersion . version(" 4.5" ))>= 0 ;
7+ private static boolean IS_GRADLE_MIN_50 = GradleVersion . current(). compareTo(GradleVersion . version(" 5.0" ))>= 0 ;
78
89 static boolean useMetadataSourcesRepository () {
910 return IS_GRADLE_MIN_45
1011 }
12+
13+ static boolean usePatternLayout () {
14+ return IS_GRADLE_MIN_50
15+ }
1116}
You can’t perform that action at this time.
0 commit comments