From 9760e0f21ccad88168283bb64d06d13231945a78 Mon Sep 17 00:00:00 2001 From: igotti-google Date: Sat, 27 May 2017 11:26:59 +0300 Subject: [PATCH] Revert "Fix build" This reverts commit bd7c24745ac63025a91c8ee7bd3be7e38e40fb27. --- samples/concurrent/build.sh | 16 ++++++++-------- samples/concurrent/buildCpp.sh | 8 ++++---- samples/csvparser/build.sh | 6 +++--- samples/gitchurn/build.sh | 6 +++--- samples/gtk/build.sh | 4 ++-- samples/libcurl/build.sh | 6 +++--- samples/nonBlockingEchoServer/build.sh | 6 +++--- samples/opengl/build.sh | 6 +++--- samples/socket/build.sh | 6 +++--- samples/tensorflow/build.sh | 6 +++--- samples/tetris/README.md | 2 +- samples/tetris/build.sh | 6 +++--- .../kotlin/gradle/plugin/KonanCompileTask.kt | 2 +- 13 files changed, 40 insertions(+), 40 deletions(-) mode change 100755 => 100644 samples/concurrent/build.sh mode change 100755 => 100644 samples/csvparser/build.sh mode change 100755 => 100644 samples/gitchurn/build.sh mode change 100755 => 100644 samples/gtk/build.sh mode change 100755 => 100644 samples/nonBlockingEchoServer/build.sh mode change 100755 => 100644 samples/opengl/build.sh mode change 100755 => 100644 samples/socket/build.sh mode change 100755 => 100644 samples/tensorflow/build.sh mode change 100755 => 100644 samples/tetris/build.sh diff --git a/samples/concurrent/build.sh b/samples/concurrent/build.sh old mode 100755 new mode 100644 index b0f34ffe533..9f00cc79695 --- a/samples/concurrent/build.sh +++ b/samples/concurrent/build.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH if [ x$TARGET == x ]; then case "$OSTYPE" in @@ -19,12 +19,12 @@ LINKER_ARGS=${!var} var=COMPILER_ARGS_${TARGET} COMPILER_ARGS=${!var} # add -opt for an optimized build. -rm -rf $DIR/build -mkdir $DIR/build -mkdir $DIR/build/c_interop -mkdir $DIR/build/bin +rm -rf $DIR/build/ +mkdir $DIR/build/ +mkdir $DIR/build/c_interop/ +mkdir $DIR/build/bin/ -$DIR/buildCpp.sh +./buildCpp.sh cinterop -def $DIR/src/c_interop/MessageChannel.def -copt "-I$DIR/src/cpp" -target $TARGET \ -o $DIR/build/c_interop/MessageChannel.kt.bc || exit 1 @@ -32,4 +32,4 @@ cinterop -def $DIR/src/c_interop/MessageChannel.def -copt "-I$DIR/src/cpp" -targ konanc $DIR/src/kotlin-native/Concurrent.kt -library $DIR/build/c_interop/MessageChannel.kt.bc \ -nativelibrary $DIR/build/clang/MessageChannel.bc -o $DIR/build/bin/Concurrent.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/Concurrent.kexe" +echo "Artifact path is ./build/bin/Concurrent.kexe" \ No newline at end of file diff --git a/samples/concurrent/buildCpp.sh b/samples/concurrent/buildCpp.sh index 9c055d1bc32..8b8319d26cd 100755 --- a/samples/concurrent/buildCpp.sh +++ b/samples/concurrent/buildCpp.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR=$(dirname "$0") PATH=../../dist/bin:../../bin:$PATH DEPS=$(dirname `type -p konanc`)/../dependencies @@ -18,7 +18,7 @@ CLANG_macbook=$DEPS/clang-llvm-3.9.0-darwin-macos/bin/clang++ var=CLANG_${TARGET} CLANG=${!var} -mkdir -p $DIR/build -mkdir -p $DIR/build/clang +mkdir $DIR/build/ +mkdir $DIR/build/clang/ -$CLANG -std=c++11 -c $DIR/src/cpp/MessageChannel.cpp -o $DIR/build/clang/MessageChannel.bc -emit-llvm || exit 1 +$CLANG -std=c++11 -c $DIR/src/cpp/MessageChannel.cpp -o $DIR/build/clang/MessageChannel.bc -emit-llvm || exit 1 \ No newline at end of file diff --git a/samples/csvparser/build.sh b/samples/csvparser/build.sh old mode 100755 new mode 100644 index aacf5ee8d7b..cef6007f6a7 --- a/samples/csvparser/build.sh +++ b/samples/csvparser/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH if [ x$TARGET == x ]; then case "$OSTYPE" in @@ -28,4 +28,4 @@ cinterop -def $DIR/src/c_interop/stdio.def -copt "$CFLAGS" -target $TARGET -o $D konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/CsvParser.kt -library $DIR/build/c_interop/stdio.kt.bc \ -o $DIR/build/bin/CsvParser.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/CsvParser.kexe" +echo "Artifact path is ./build/bin/CsvParser.kexe" diff --git a/samples/gitchurn/build.sh b/samples/gitchurn/build.sh old mode 100755 new mode 100644 index 4e6ac736dac..5bb81754457 --- a/samples/gitchurn/build.sh +++ b/samples/gitchurn/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH CFLAGS_macbook="-I/opt/local/include -copt -I/usr/local/include" CFLAGS_linux=-I/usr/include @@ -34,4 +34,4 @@ cinterop -copt $CFLAGS -def $DIR/src/c_interop/libgit2.def -target $TARGET \ konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/libgit2.kt.bc -linkerArgs "$LINKER_ARGS" \ -o $DIR/build/bin/GitChurn.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/GitChurn.kexe" +echo "Artifact path is ./build/bin/GitChurn.kexe" diff --git a/samples/gtk/build.sh b/samples/gtk/build.sh old mode 100755 new mode 100644 index d1269839c3f..32deb160975 --- a/samples/gtk/build.sh +++ b/samples/gtk/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" +DIR=$(dirname "$0") PATH=../../dist/bin:../../bin:$PATH IPREFIX_macbook=-I/opt/local/include @@ -38,4 +38,4 @@ cinterop -J-Xmx8g -copt $IPREFIX/atk-1.0 -copt $IPREFIX/gdk-pixbuf-2.0 -copt $IP konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/gtk3.bc -linkerArgs "$LINKER_ARGS" \ -o $DIR/build/bin/Gtk3Demo.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/Gtk3Demo.kexe" +echo "Artifact path is ./build/bin/Gtk3Demo.kexe" \ No newline at end of file diff --git a/samples/libcurl/build.sh b/samples/libcurl/build.sh index 1cd8caf5e65..33e4f74b5f5 100755 --- a/samples/libcurl/build.sh +++ b/samples/libcurl/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH CFLAGS_macbook=-I/opt/local/include CFLAGS_linux=-I/usr/include/x86_64-linux-gnu @@ -34,4 +34,4 @@ cinterop -copt "$CFLAGS" -copt -I$DIR -copt -I/usr/include -def $DIR/src/c_inter konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/libcurl.bc -linkerArgs "$LINKER_ARGS" \ -o $DIR/build/bin/Curl.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/Curl.kexe" +echo "Artifact path is ./build/bin/Curl.kexe" diff --git a/samples/nonBlockingEchoServer/build.sh b/samples/nonBlockingEchoServer/build.sh old mode 100755 new mode 100644 index c2cfc3a65f7..06900482954 --- a/samples/nonBlockingEchoServer/build.sh +++ b/samples/nonBlockingEchoServer/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH if [ x$TARGET == x ]; then case "$OSTYPE" in @@ -29,4 +29,4 @@ cinterop -def $DIR/src/c_interop/sockets.def -copt "$CFLAGS" -target $TARGET \ konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/EchoServer.kt \ -library $DIR/build/c_interop/sockets.kt.bc -o build/bin/EchoServer.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/EchoServer.kexe" +echo "Artifact path is ./build/bin/EchoServer.kexe" \ No newline at end of file diff --git a/samples/opengl/build.sh b/samples/opengl/build.sh old mode 100755 new mode 100644 index 10500ea90d1..aaec67237fb --- a/samples/opengl/build.sh +++ b/samples/opengl/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH LINKER_ARGS_macbook="-framework OpenGL -framework GLUT" LINKER_ARGS_linux="-L/usr/lib/x86_64-linux-gnu -lglut -lGL -lGLU" @@ -32,4 +32,4 @@ cinterop -def $DIR/src/c_interop/opengl.def -target $TARGET \ konanc -target $TARGET $DIR/src/kotlin-native/OpenGlTeapot.kt -library $DIR/build/c_interop/opengl.kt.bc \ -linkerArgs "$LINKER_ARGS" -o $DIR/build/bin/OpenGlTeapot.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/OpenGlTeapot.kexe" +echo "Artifact path is ./build/bin/OpenGlTeapot.kexe" diff --git a/samples/socket/build.sh b/samples/socket/build.sh old mode 100755 new mode 100644 index 12e2f8f103f..af9625e338d --- a/samples/socket/build.sh +++ b/samples/socket/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH if [ x$TARGET == x ]; then case "$OSTYPE" in @@ -30,4 +30,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/EchoServer.kt \ -library $DIR/build/c_interop/sockets.kt.bc \ -o $DIR/build/bin/EchoServer.kexe || exit 1 -echo "Artifact path is $DIR/build/bin/EchoServer.kexe" +echo "Artifact path is ./build/bin/EchoServer.kexe" \ No newline at end of file diff --git a/samples/tensorflow/build.sh b/samples/tensorflow/build.sh old mode 100755 new mode 100644 index 47f7b062a33..c6b81253d1c --- a/samples/tensorflow/build.sh +++ b/samples/tensorflow/build.sh @@ -2,8 +2,8 @@ ./downloadTensorflow.sh -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH TF_TARGET_DIRECTORY="$HOME/.konan/third-party/tensorflow" TF_TYPE="cpu" # Change to "gpu" for GPU support @@ -41,4 +41,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/HelloTensorflow.kt echo "Note: You may need to specify LD_LIBRARY_PATH or DYLD_LIBRARY_PATH env variables to $TF_TARGET_DIRECTORY/lib if the TensorFlow dynamic library cannot be found." -echo "Artifact path is $DIR/build/bin/HelloTensorflow.kexe" +echo "Artifact path is ./build/bin/HelloTensorflow.kexe" diff --git a/samples/tetris/README.md b/samples/tetris/README.md index 3425e989219..03b3191fd2e 100644 --- a/samples/tetris/README.md +++ b/samples/tetris/README.md @@ -21,7 +21,7 @@ To run it on the host use `../gradlew run` Alternatively you can run artifact directly - ./build/bin/Tetris.kexe + ./build/konan/bin/Tetris${target}/Tetris${target}.kexe For cross-compilation to iOS (on Mac host) use gradle property diff --git a/samples/tetris/build.sh b/samples/tetris/build.sh old mode 100755 new mode 100644 index a020b303a98..314f08e4efe --- a/samples/tetris/build.sh +++ b/samples/tetris/build.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )" -PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH +DIR=$(dirname "$0") +PATH=../../dist/bin:../../bin:$PATH DEPS=$(dirname `type -p konanc`)/../dependencies CFLAGS_macbook=-I$HOME/Library/Frameworks/SDL2.framework/Headers @@ -55,4 +55,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/Tetris.kt \ cp -R $DIR/src/resources $DIR/build/bin -echo "Artifact path is $DIR/build/bin/Tetris.kexe" +echo "Artifact path is ./build/bin/Tetris.kexe" diff --git a/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KonanCompileTask.kt b/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KonanCompileTask.kt index 423f6e4a96c..40991acc599 100644 --- a/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KonanCompileTask.kt +++ b/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KonanCompileTask.kt @@ -80,7 +80,7 @@ open class KonanCompileTask: DefaultTask() { // Output artifact -------------------------------------------------------- - lateinit var artifactName: String + protected lateinit var artifactName: String @OutputDirectory lateinit var outputDir: File