Skip to content

Commit

Permalink
Safer access to runTask in samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbogolepov authored and ilmat192 committed Jun 5, 2019
1 parent 16a8fdc commit e89fefc
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion samples/csvparser/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kotlin {
binaries {
executable() {
entryPoint = 'sample.csvparser.main'
runTask.args './European_Mammals_Red_List_Nov_2009.csv', 4, 100
runTask?.args './European_Mammals_Red_List_Nov_2009.csv', 4, 100
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions samples/curl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ kotlin {
if (presets.mingwX64 == hostPreset) {
// Add lib path to `libcurl` and its dependencies:
linkerOpts += ["-L${MPPTools.mingwPath()}/lib".toString()]
runTask.environment('PATH': "${MPPTools.mingwPath()}/bin".toString())
runTask?.environment('PATH': "${MPPTools.mingwPath()}/bin".toString())
}
runTask.args('https://www.jetbrains.com/')
runTask?.args('https://www.jetbrains.com/')
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion samples/echoServer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kotlin {
binaries {
executable() {
entryPoint = 'sample.echoserver.main'
runTask.args(3000)
runTask?.args(3000)
}
}

Expand Down
4 changes: 2 additions & 2 deletions samples/gitchurn/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ kotlin {
entryPoint = 'sample.gitchurn.main'
if (presets.mingwX64 == hostPreset) {
linkerOpts = ["-L${MPPTools.mingwPath()}/lib".toString()]
runTask.environment('PATH', "${MPPTools.mingwPath()}/bin".toString())
runTask?.environment('PATH', "${MPPTools.mingwPath()}/bin".toString())
}
runTask.args(project.getRootProject().getRootDir().toString() + '/..')
runTask?.args(project.getRootProject().getRootDir().toString() + '/..')
}
}
compilations.main.cinterops {
Expand Down
2 changes: 1 addition & 1 deletion samples/gtk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ kotlin {
entryPoint = 'sample.gtk.main'
if (presets.mingwX64 == hostPreset) {
linkerOpts += ["-L${MPPTools.mingwPath()}/lib".toString()]
runTask.environment('PATH', "${MPPTools.mingwPath()}/bin".toString())
runTask?.environment('PATH', "${MPPTools.mingwPath()}/bin".toString())
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion samples/nonBlockingEchoServer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ kotlin {
binaries {
executable() {
entryPoint = 'sample.nbechoserver.main'
runTask.args(3000)
runTask?.args(3000)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions samples/tensorflow/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ kotlin {
executable() {
entryPoint = 'sample.tensorflow.main'
linkerOpts += ["-L$tensorflowHome/lib".toString(), '-ltensorflow']
runTask.environment('LD_LIBRARY_PATH', "$tensorflowHome/lib".toString())
runTask.environment('DYLD_LIBRARY_PATH', "$tensorflowHome/lib".toString())
runTask?.environment('LD_LIBRARY_PATH', "$tensorflowHome/lib".toString())
runTask?.environment('DYLD_LIBRARY_PATH', "$tensorflowHome/lib".toString())
}
}
compilations.main.cinterops {
Expand Down
2 changes: 1 addition & 1 deletion samples/tetris/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ kotlin {
linkerOpts += ['-lSDL2']
break
}
runTask.workingDir(project.provider {
runTask?.workingDir(project.provider {
kotlin.targets.tetris.binaries.getExecutable(buildType).outputDirectory
})
}
Expand Down
6 changes: 3 additions & 3 deletions samples/torch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ kotlin {
executable() {
entryPoint = 'sample.torch.main'
linkerOpts += ["-L$torchHome/lib".toString(), '-lATen']
runTask.dependsOn 'downloadMNIST'
runTask.environment('LD_LIBRARY_PATH', "$torchHome/lib".toString())
runTask.environment('DYLD_LIBRARY_PATH', "$torchHome/lib".toString())
runTask?.dependsOn 'downloadMNIST'
runTask?.environment('LD_LIBRARY_PATH', "$torchHome/lib".toString())
runTask?.environment('DYLD_LIBRARY_PATH', "$torchHome/lib".toString())
}
}
compilations.main.cinterops {
Expand Down

0 comments on commit e89fefc

Please sign in to comment.