Unpack node.js in the same place that Maven unpacks it

This gets rid of some Eclipse warnings that stem from Buildship being
confused about what it should treat as a source directory if Maven and
Gradle are both being used in the same tree.
This commit is contained in:
Ben Liblit 2018-01-25 16:17:14 -06:00
parent 4809a365de
commit 48fe74cba7
1 changed files with 11 additions and 8 deletions

View File

@ -21,22 +21,25 @@ task verifyNodeJS(type: VerifyWithStamp, dependsOn: downloadNodeJS) {
checksum '33c5ba7a5d45644e70d268d8ad3e57df'
}
task unpackNodeJSLib(type: Sync, dependsOn: verifyNodeJS) {
task unpackNodeJSLib(type: Copy, dependsOn: verifyNodeJS) {
from(zipTree(verifyNodeJS.src)) {
include 'nodejs-node-0a604e9/lib/*'
include 'nodejs-node-0a604e9/lib/*.js'
eachFile {
relativePath new RelativePath(!directory, 'core-modules', relativePath.lastName)
relativePath new RelativePath(!directory, relativePath.lastName)
}
}
into temporaryDir
into 'dat/core-modules'
includeEmptyDirs false
}
task cleanUnpackNodeJSLib(type: Delete) {
delete fileTree(dir: 'dat/core-modules', include: '*.js')
}
processResources.dependsOn unpackNodeJSLib
sourceSets.main {
java.srcDirs = ['src']
resources.srcDirs = [
'dat',
unpackNodeJSLib
]
resources.srcDirs = ['dat']
}