Safer access to runTask in samples.

This commit is contained in:
Sergey Bogolepov
2019-05-28 15:39:27 +03:00
committed by Ilya Matveev
parent 16a8fdcf4e
commit e89fefca8c
9 changed files with 14 additions and 14 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ kotlin {
binaries { binaries {
executable() { executable() {
entryPoint = 'sample.csvparser.main' 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
} }
} }
} }
+2 -2
View File
@@ -19,9 +19,9 @@ kotlin {
if (presets.mingwX64 == hostPreset) { if (presets.mingwX64 == hostPreset) {
// Add lib path to `libcurl` and its dependencies: // Add lib path to `libcurl` and its dependencies:
linkerOpts += ["-L${MPPTools.mingwPath()}/lib".toString()] 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/')
} }
} }
} }
+1 -1
View File
@@ -13,7 +13,7 @@ kotlin {
binaries { binaries {
executable() { executable() {
entryPoint = 'sample.echoserver.main' entryPoint = 'sample.echoserver.main'
runTask.args(3000) runTask?.args(3000)
} }
} }
+2 -2
View File
@@ -12,9 +12,9 @@ kotlin {
entryPoint = 'sample.gitchurn.main' entryPoint = 'sample.gitchurn.main'
if (presets.mingwX64 == hostPreset) { if (presets.mingwX64 == hostPreset) {
linkerOpts = ["-L${MPPTools.mingwPath()}/lib".toString()] 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 { compilations.main.cinterops {
+1 -1
View File
@@ -12,7 +12,7 @@ kotlin {
entryPoint = 'sample.gtk.main' entryPoint = 'sample.gtk.main'
if (presets.mingwX64 == hostPreset) { if (presets.mingwX64 == hostPreset) {
linkerOpts += ["-L${MPPTools.mingwPath()}/lib".toString()] linkerOpts += ["-L${MPPTools.mingwPath()}/lib".toString()]
runTask.environment('PATH', "${MPPTools.mingwPath()}/bin".toString()) runTask?.environment('PATH', "${MPPTools.mingwPath()}/bin".toString())
} }
} }
} }
+1 -1
View File
@@ -10,7 +10,7 @@ kotlin {
binaries { binaries {
executable() { executable() {
entryPoint = 'sample.nbechoserver.main' entryPoint = 'sample.nbechoserver.main'
runTask.args(3000) runTask?.args(3000)
} }
} }
} }
+2 -2
View File
@@ -13,8 +13,8 @@ kotlin {
executable() { executable() {
entryPoint = 'sample.tensorflow.main' entryPoint = 'sample.tensorflow.main'
linkerOpts += ["-L$tensorflowHome/lib".toString(), '-ltensorflow'] linkerOpts += ["-L$tensorflowHome/lib".toString(), '-ltensorflow']
runTask.environment('LD_LIBRARY_PATH', "$tensorflowHome/lib".toString()) runTask?.environment('LD_LIBRARY_PATH', "$tensorflowHome/lib".toString())
runTask.environment('DYLD_LIBRARY_PATH', "$tensorflowHome/lib".toString()) runTask?.environment('DYLD_LIBRARY_PATH', "$tensorflowHome/lib".toString())
} }
} }
compilations.main.cinterops { compilations.main.cinterops {
+1 -1
View File
@@ -37,7 +37,7 @@ kotlin {
linkerOpts += ['-lSDL2'] linkerOpts += ['-lSDL2']
break break
} }
runTask.workingDir(project.provider { runTask?.workingDir(project.provider {
kotlin.targets.tetris.binaries.getExecutable(buildType).outputDirectory kotlin.targets.tetris.binaries.getExecutable(buildType).outputDirectory
}) })
} }
+3 -3
View File
@@ -13,9 +13,9 @@ kotlin {
executable() { executable() {
entryPoint = 'sample.torch.main' entryPoint = 'sample.torch.main'
linkerOpts += ["-L$torchHome/lib".toString(), '-lATen'] linkerOpts += ["-L$torchHome/lib".toString(), '-lATen']
runTask.dependsOn 'downloadMNIST' runTask?.dependsOn 'downloadMNIST'
runTask.environment('LD_LIBRARY_PATH', "$torchHome/lib".toString()) runTask?.environment('LD_LIBRARY_PATH', "$torchHome/lib".toString())
runTask.environment('DYLD_LIBRARY_PATH', "$torchHome/lib".toString()) runTask?.environment('DYLD_LIBRARY_PATH', "$torchHome/lib".toString())
} }
} }
compilations.main.cinterops { compilations.main.cinterops {