Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Gradle 6.+ #349

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cache:
- $HOME/.gradle

jdk:
- oraclejdk8
- openjdk8

script:
- ./gradlew ci --stacktrace
Expand Down
13 changes: 6 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ group = 'com.moowork.gradle'

apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'java-gradle-plugin'
apply from: "$rootDir/gradle/additional-artifacts.gradle"
Expand All @@ -23,15 +22,15 @@ repositories {
}

configurations {
integTestCompile.extendsFrom testCompile
integTestRuntime.extendsFrom testRuntime
integTestCompile.extendsFrom testCompileClasspath
integTestRuntime.extendsFrom testRuntimeClasspath
}

dependencies {
compile gradleApi()
testCompile 'cglib:cglib-nodep:3.2.4'
testCompile 'org.apache.commons:commons-io:1.3.2'
testCompile( 'org.spockframework:spock-core:1.0-groovy-2.4' ) {
implementation gradleApi()
testImplementation 'cglib:cglib-nodep:3.2.4'
testImplementation 'org.apache.commons:commons-io:1.3.2'
testImplementation( 'org.spockframework:spock-core:1.0-groovy-2.4' ) {
exclude group: 'org.codehaus.groovy'
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/buildscript.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ repositories {

dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.0'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.9.9'
}
1 change: 0 additions & 1 deletion gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'com.jfrog.bintray'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class NpmSetupTask

private NodeExtension config

@Internal
protected List<?> args = []

private ExecResult result
Expand Down Expand Up @@ -81,7 +82,6 @@ class NpmSetupTask
return this.args
}

@Internal
void setArgs( final Iterable<?> value )
{
this.args = value.toList()
Expand Down
27 changes: 22 additions & 5 deletions src/main/groovy/com/moowork/gradle/node/task/SetupTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.util.GradleVersion

import java.nio.file.Files
import java.nio.file.Path
Expand Down Expand Up @@ -177,11 +178,27 @@ class SetupTask
this.project.repositories.clear()

def distUrl = this.config.distBaseUrl
this.repo = this.project.repositories.ivy {
url distUrl
layout 'pattern', {
artifact 'v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
ivy 'v[revision]/ivy.xml'
if(GradleVersion.current().baseVersion >= GradleVersion.version('5.0').baseVersion) {
this.repo = this.project.repositories.ivy {
url distUrl
patternLayout {
artifact 'v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
ivy 'v[revision]/ivy.xml'
}
metadataSources {
artifact()
}
}
} else {
this.repo = this.project.repositories.ivy {
url distUrl
layout 'pattern', {
artifact 'v[revision]/[artifact](-v[revision]-[classifier]).[ext]'
ivy 'v[revision]/ivy.xml'
}
metadataSources {
artifact()
}
}
}
}
Expand Down