Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ abstract class ExecRunner

if ( this.execOverrides != null )
{
this.execOverrides.setDelegate( getDelegate() )
this.execOverrides( it )
}
} )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.moowork.gradle.node.exec

import com.moowork.gradle.node.NodeExtension
import org.gradle.api.Project
import org.gradle.process.ExecResult

Expand All @@ -24,7 +25,11 @@ class NodeExecRunner
nodeEnvironment << System.getenv()
}

def nodeBinDirPath = this.variant.nodeBinDir.getAbsolutePath()
String nodeModulesBinPath =
project.extensions.findByType(NodeExtension).nodeModulesDir.absolutePath + '/node_modules/.bin'

String nodeBinDirPath =
this.variant.nodeBinDir.getAbsolutePath() + File.pathSeparator + nodeModulesBinPath

// Take care of Windows environments that may contain "Path" OR "PATH" - both existing
// possibly (but not in parallel as of now)
Expand Down
8 changes: 8 additions & 0 deletions src/main/groovy/com/moowork/gradle/node/task/NodeTask.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.moowork.gradle.node.task

import com.moowork.gradle.node.NodeExtension
import com.moowork.gradle.node.exec.NodeExecRunner
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
Expand Down Expand Up @@ -27,6 +28,13 @@ class NodeTask
this.script = value
}

void setExecutable( final String execName )
{
File modulesDir = project.extensions.findByType(NodeExtension).nodeModulesDir
setScript(new File(modulesDir, 'node_modules/.bin/' + execName))
dependsOn( NpmInstallTask.NAME )
}

void setArgs( final Iterable<?> value )
{
this.args = value
Expand Down