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) { task unpackNodeJSLib(type: Sync, dependsOn: verifyNodeJS) {
from(zipTree(verifyNodeJS.src)) { from(zipTree(verifyNodeJS.src)) {
eachFile { eachFile {
if (it.relativePath.pathString.startsWith('nodejs-node-0a604e9/lib/')) { if (relativePath.pathString.startsWith('nodejs-node-0a604e9/lib/')) {
def renamedRelative = new RelativePath(!it.directory, 'core-modules', it.relativePath.lastName) def renamedRelative = new RelativePath(!directory, 'core-modules', relativePath.lastName)
it.relativePath = renamedRelative relativePath = renamedRelative
} else } else
it.exclude() exclude()
} }
} }

View File

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