From 1063d134cd29c56f8bc27b256e8883191b961da0 Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Fri, 31 Mar 2017 20:54:19 +0700 Subject: [PATCH] samples: Fix iphone gradle project --- samples/tetris/README.md | 2 +- samples/tetris/build.gradle | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/samples/tetris/README.md b/samples/tetris/README.md index efdbaf585df..7d425934cef 100644 --- a/samples/tetris/README.md +++ b/samples/tetris/README.md @@ -15,7 +15,7 @@ To build Tetris application for your host platform use ./build.sh -You also may use gradle to build this sample: `../gradlew buildMacbook` or `../gradlew buildLinux`. +You also may use gradle to build this sample: `../gradlew build`. Note that SDL2 must be installed on the host. For cross-compilation to iOS (on Mac host) use diff --git a/samples/tetris/build.gradle b/samples/tetris/build.gradle index d7f97caca14..836ce13b184 100644 --- a/samples/tetris/build.gradle +++ b/samples/tetris/build.gradle @@ -68,8 +68,8 @@ konanArtifacts { inputFiles project.file('Tetris.kt') useInterop 'sdlIphone' - linkerOpts '-framework SDL2 -framework AVFoundation -framework CoreGraphics -framework CoreMotion' + - '-framework Foundation -framework GameController -framework AudioToolbox -framework OpenGLES' + + linkerOpts '-framework SDL2 -framework AVFoundation -framework CoreGraphics -framework CoreMotion ' + + '-framework Foundation -framework GameController -framework AudioToolbox -framework OpenGLES ' + '-framework QuartzCore -framework UIKit' noMain() target 'iphone' @@ -85,10 +85,15 @@ konanArtifacts { } -tasks.matching { it.name.startsWith("compileKonan") }.asList().forEach { compileTask -> - task ("build${compileTask.name - "compileKonanTetris"}", type: Copy) { - dependsOn(compileTask) - from compileTask.artifactPath - destinationDir projectDir +build { + doLast { + getTaskDependencies().getDependencies().forEach() { task -> + if (task.name.startsWith("compileKonan")) { + copy { + from task.artifactPath + into projectDir.canonicalPath + } + } + } } } \ No newline at end of file