Be more concise by omitting implicit "it." in closures

This commit is contained in:
Ben Liblit 2018-01-18 18:09:13 -06:00
parent f12f5faa83
commit d3ddbd6343
2 changed files with 6 additions and 7 deletions

View File

@ -24,11 +24,11 @@ task verifyNodeJS(type: VerifyWithStamp, dependsOn: downloadNodeJS) {
task unpackNodeJSLib(type: Sync, dependsOn: verifyNodeJS) {
from(zipTree(verifyNodeJS.src)) {
eachFile {
if (it.relativePath.pathString.startsWith('nodejs-node-0a604e9/lib/')) {
def renamedRelative = new RelativePath(!it.directory, 'core-modules', it.relativePath.lastName)
it.relativePath = renamedRelative
if (relativePath.pathString.startsWith('nodejs-node-0a604e9/lib/')) {
def renamedRelative = new RelativePath(!directory, 'core-modules', relativePath.lastName)
relativePath = renamedRelative
} else
it.exclude()
exclude()
}
}

View File

@ -16,9 +16,8 @@ task verifyAjaxslt(type: VerifyWithStamp, dependsOn: downloadAjaxslt) {
task unpackAjaxslt(type: Copy, dependsOn: verifyAjaxslt) {
from(tarTree(verifyAjaxslt.src)) {
eachFile {
def newSegments = ['ajaxslt'] + it.relativePath.segments[1 .. -1] as String[]
def newPath = new RelativePath(!it.directory, newSegments)
it.relativePath = newPath
def newSegments = ['ajaxslt'] + relativePath.segments[1 .. -1] as String[]
relativePath = new RelativePath(!directory, newSegments)
}
}
into 'examples-src'