diff --git a/kotlin-native/samples/README.md b/kotlin-native/samples/README.md index 9e2a53a1da4..2b79247281b 100644 --- a/kotlin-native/samples/README.md +++ b/kotlin-native/samples/README.md @@ -4,9 +4,14 @@ This directory contains a set of samples demonstrating how one can work with Kot built using Gradle build tool. See `README.md` in sample directories to learn more about specific samples and the building process. +The following Kotlin Multiplatform Mobile samples used to be located in this directory, but were superseded: +* `calculator` - see https://github.com/Kotlin/kmm-basic-sample instead. +* `cocoapods` - see https://github.com/Kotlin/kmm-with-cocoapods-sample instead. + +More Kotlin Multiplatform Mobile samples can be found here: https://kotlinlang.org/docs/kmm-samples.html. + +The samples that are in this directory mostly illustrate the other use cases for Kotlin/Native: * `androidNativeActivity` - Android Native Activity rendering 3D graphics using OpenGLES - * `calculator` - iOS Swift application, using Kotlin/Native code compiled into the framework - * `cocoapods` - A Kotlin/Native application using the `AFNetworking` library from CocoaPods. * `csvparser` - simple CSV file parser and analyzer * `echoServer` - TCP/IP echo server * `gitchurn` - program interoperating with `libgit2` for GIT repository analysis diff --git a/kotlin-native/samples/calculator/.gitignore b/kotlin-native/samples/calculator/.gitignore deleted file mode 100644 index 9bce6af399b..00000000000 --- a/kotlin-native/samples/calculator/.gitignore +++ /dev/null @@ -1 +0,0 @@ -xcuserdata diff --git a/kotlin-native/samples/calculator/README.md b/kotlin-native/samples/calculator/README.md deleted file mode 100644 index 6b14b91f4cf..00000000000 --- a/kotlin-native/samples/calculator/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Calculator sample - -This example shows how to use Kotlin common module (located in [arithmeticParser](arithmeticParser/)) in different environments. -Currently for -* Android (see [androidApp](androidApp/)) -* iOS (see [iosApp](iosApp/)) -* plain JVM (cli) (see [cliApp](cliApp/)) - -## Common - -Common Kotlin module contains arithmetic expressions parser. - -## Android App -The common module may be used in an Android application. - -Please make sure that Android SDK version 28 is installed, using Android SDK manager in Android Studio. -See https://developer.android.com/studio/index.html for more details on Android Studio or -`$ANDROID_HOME/tools/bin/sdkmanager "platforms;android-28" "build-tools;28.0.3"` from command line. - -To build use `ANDROID_HOME= ../gradlew assemble`. - -Run `$ANDROID_HOME/platform-tools/adb install -r androidApp/build/outputs/apk/debug/androidApp-debug.apk` -to deploy the apk on the Android device or emulator. - -Note: If you are importing project to IDEA for the first time, you might need to put `local.properties` file -with the following content: - - sdk.dir= - -## iOS -The iOS project compiles Kotlin module to a framework (see [iosApp](iosApp/)). The framework can be easily included in an existing iOS project (e.g. written in Swift or Objective-C) - -To build and run the iOS sample do the following: - -1. Open `iosApp/calculator.xcodeproj` with Xcode. -2. Open the project's target through project navigator, go to tab 'General'. - In 'Identity' section change the bundle ID to the unique string in - reverse-DNS format. Then select the team in 'Signing' section. - - See the - [Xcode documentation](https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/ConfiguringYourApp/ConfiguringYourApp.html#//apple_ref/doc/uid/TP40012582-CH28-SW2) - for more info. -3. Now build and run the application with Xcode. - -The iOS application is written in Swift. It uses Kotlin module as a library. -Kotlin module is built into Objective-C framework by invoking Gradle -from custom "Run Script" build phase, and this framework is imported into -the Xcode project. - -## Plain JVM -The common module can also be used in JVM application built by Kotlin/JVM compiler with Gradle. -To build and run it, go to [cliApp](cliApp/) directory and use -``` -../gradlew runProgram -``` diff --git a/kotlin-native/samples/calculator/androidApp/build.gradle b/kotlin-native/samples/calculator/androidApp/build.gradle deleted file mode 100644 index 211a555cb9a..00000000000 --- a/kotlin-native/samples/calculator/androidApp/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -apply plugin: 'org.jetbrains.kotlin.multiplatform' -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android-extensions' - -android { - compileSdkVersion 28 - - defaultConfig { - applicationId 'org.konan.calculator' - minSdkVersion 21 - targetSdkVersion 28 - } -} - -dependencies { - api 'com.android.support:appcompat-v7:28.0.0' - api 'com.android.support.constraint:constraint-layout:1.1.3' - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(':arithmeticParser') -} - -kotlin { - android() -} diff --git a/kotlin-native/samples/calculator/androidApp/gradle.properties b/kotlin-native/samples/calculator/androidApp/gradle.properties deleted file mode 100644 index 790a07d5124..00000000000 --- a/kotlin-native/samples/calculator/androidApp/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -kotlin.code.style=official -kotlin.import.noCommonSourceSets=true diff --git a/kotlin-native/samples/calculator/androidApp/src/main/AndroidManifest.xml b/kotlin-native/samples/calculator/androidApp/src/main/AndroidManifest.xml deleted file mode 100644 index a224235bfd7..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/kotlin-native/samples/calculator/androidApp/src/main/kotlin/MainActivity.kt b/kotlin-native/samples/calculator/androidApp/src/main/kotlin/MainActivity.kt deleted file mode 100644 index b21f0de3060..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/kotlin/MainActivity.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the license/LICENSE.txt file. - */ - -package sample.calculator.android - -import android.os.Bundle -import android.support.v7.app.AppCompatActivity -import android.widget.EditText -import android.widget.TextView -import sample.calculator.arithmeticparser.parseAndCompute - -class MainActivity : AppCompatActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - - val resultView = findViewById(R.id.computed_result) - - val input = findViewById(R.id.input) - input.setOnEditorActionListener { input, _, _ -> - val inputText = input.text.toString() - val result = parseAndCompute(inputText).expression - with(resultView) { - text = if (result != null) inputText + " = " + result.toString() else "Unable to parse $inputText" - } - true - } - } - -} \ No newline at end of file diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index c7bd21dbd86..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/drawable/ic_launcher_background.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc538c1..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/layout/activity_main.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/layout/activity_main.xml deleted file mode 100644 index 73b2810335c..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index eca70cfe52e..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index eca70cfe52e..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-hdpi/ic_launcher.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index a2f5908281d..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index 1b523998081..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-mdpi/ic_launcher.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index ff10afd6e18..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 115a4c768a2..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index dcd3cd80833..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 459ca609d3a..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 8ca12fe024b..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index 8e19b410a1b..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index b824ebdd48d..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 4c19a13c239..00000000000 Binary files a/kotlin-native/samples/calculator/androidApp/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/values/colors.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/values/colors.xml deleted file mode 100644 index 3ab3e9cbce0..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - #3F51B5 - #303F9F - #FF4081 - diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/values/strings.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/values/strings.xml deleted file mode 100644 index add2d6a43d2..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/values/strings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - Konan Calculator - Enter mathematical expression: - diff --git a/kotlin-native/samples/calculator/androidApp/src/main/res/values/styles.xml b/kotlin-native/samples/calculator/androidApp/src/main/res/values/styles.xml deleted file mode 100644 index 0eb88fe3350..00000000000 --- a/kotlin-native/samples/calculator/androidApp/src/main/res/values/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/kotlin-native/samples/calculator/arithmeticParser/Info.plist b/kotlin-native/samples/calculator/arithmeticParser/Info.plist deleted file mode 100644 index b5dc715d4fe..00000000000 --- a/kotlin-native/samples/calculator/arithmeticParser/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - - diff --git a/kotlin-native/samples/calculator/arithmeticParser/build.gradle b/kotlin-native/samples/calculator/arithmeticParser/build.gradle deleted file mode 100644 index 8a14ecff1c5..00000000000 --- a/kotlin-native/samples/calculator/arithmeticParser/build.gradle +++ /dev/null @@ -1,81 +0,0 @@ -apply plugin: 'org.jetbrains.kotlin.multiplatform' - -kotlin { - targets { - fromPreset(determineIosPreset(), 'ios') { - binaries { - framework() - } - } - - fromPreset(presets.jvm, 'jvm') - } - - sourceSets { - commonMain { - dependencies { - api 'org.jetbrains.kotlin:kotlin-stdlib-common' - } - } - jvmMain { - dependencies { - api 'org.jetbrains.kotlin:kotlin-stdlib-jdk8' - } - } - } -} - -// Workaround for https://youtrack.jetbrains.com/issue/KT-27170 -configurations { - compileClasspath -} - -// If custom preset specified in 'calculator.preset.name' property, then use it for building. -// Otherwise build for iPhone simulator (by default). -def determineIosPreset() { - String presetName = project.hasProperty('calculator.preset.name') ? project.properties['calculator.preset.name'] : 'iosX64' - def preset = project.kotlin.presets[presetName] - println("$project has been configured for $presetName platform.") - preset -} - -// Special Gradle task that is called from Xcode. -// Two Gradle properties must be specified for this task: -// - calculator.configuration.name=[Release|Debug] -// - calculator.framework.location -task buildFrameworkForXcode { - - if (isCalledFromXcode()) { - dependsOn kotlin.targets.ios.binaries.getFramework(getBuildTypeForXcode()).linkTask - } - - doLast { - if (!isCalledFromXcode()) { - throw new Exception("Please run 'buildFrameworkForXcode' task with all necessary properties!") - } - - def frameworkDir = kotlin.targets.ios.binaries.getFramework(getBuildTypeForXcode()).outputFile - - println("from: ${frameworkDir.parentFile}") - println("into: ${getXcodeConfigurationBuildDir()}") - - copy { - from frameworkDir.parentFile - into getXcodeConfigurationBuildDir() - include "${frameworkDir.name}/**" - include "${frameworkDir.name}.dSYM/**" - } - } -} - -private boolean isCalledFromXcode() { - project.hasProperty('calculator.configuration.name') && project.hasProperty('calculator.framework.location') -} - -private String getBuildTypeForXcode() { - project.properties['calculator.configuration.name'] as String -} - -private String getXcodeConfigurationBuildDir() { - project.properties['calculator.framework.location'] as String -} diff --git a/kotlin-native/samples/calculator/arithmeticParser/gradle.properties b/kotlin-native/samples/calculator/arithmeticParser/gradle.properties deleted file mode 100644 index 7fc6f1ff272..00000000000 --- a/kotlin-native/samples/calculator/arithmeticParser/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -kotlin.code.style=official diff --git a/kotlin-native/samples/calculator/arithmeticParser/src/commonMain/kotlin/Parser.kt b/kotlin-native/samples/calculator/arithmeticParser/src/commonMain/kotlin/Parser.kt deleted file mode 100644 index b44bb7182c8..00000000000 --- a/kotlin-native/samples/calculator/arithmeticParser/src/commonMain/kotlin/Parser.kt +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the license/LICENSE.txt file. - */ - -package sample.calculator.arithmeticparser - -fun parseAndCompute(expression: String): PartialParser.Result = - PartialParser(Calculator(), PartialRenderer()).parseWithPartial(expression) - -class Calculator : ExpressionComposer { - override fun number(value: Double) = value - override fun plus(left: Double, right: Double) = left + right - override fun minus(left: Double, right: Double) = left - right - override fun mult(left: Double, right: Double) = left * right - override fun div(left: Double, right: Double) = left / right -} - -class PartialRenderer : PartialExpressionComposer { - override fun missing() = "..." - - override fun ending(expression: Double) = "$expression ..." - - override fun plus(left: Double, partialRight: String) = "$left + $partialRight" - override fun minus(left: Double, partialRight: String) = "$left - $partialRight" - override fun mult(left: Double, partialRight: String) = "$left * $partialRight" - override fun div(left: Double, partialRight: String) = "$left / $partialRight" - override fun leftParenthesized(partialExpression: String) = "($partialExpression" -} - -interface ExpressionComposer { - fun number(value: Double): E - fun plus(left: E, right: E): E - fun minus(left: E, right: E): E - fun mult(left: E, right: E): E - fun div(left: E, right: E): E -} - -open class Parser(private val composer: ExpressionComposer) { - fun parse(expression: String): E? { - val tokenizer = Tokenizer(expression) - val prefix = parseAsPrefix(tokenizer) - - if (prefix is EndedWithExpression && !tokenizer.hasNext()) { - val reduced = prefix.reduced() - if (reduced.prefix is Empty) { - return reduced.expression - } - } - - return null - } - - internal fun parseAsPrefix(tokenizer: Tokenizer): ExpressionPrefix = - generateSequence>(Empty) { - it.tryExtend(tokenizer) - }.last() - - private fun ExpressionPrefix.tryExtend(tokenizer: Tokenizer): ExpressionPrefix? = when (this) { - is ContinuableWithExpression -> { - val number = tokenizer.tryReadNumber() - when { - number != null -> this.with(composer.number(number)) - tokenizer.tryReadLeftParenthesis() -> this.withLeftParenthesis() - else -> null - } - } - - is EndedWithExpression -> { - val operator = tokenizer.tryReadBinaryOperator() - if (operator != null) { - this.extendedWithOperator(operator) - } else { - val reduced = this.reduced() - if (reduced.prefix is EndedWithLeftParenthesis && tokenizer.tryReadRightParenthesis()) { - // Drop parens: - reduced.prefix.prefix.with(reduced.expression) - } else { - null - } - } - } - } - - private tailrec fun EndedWithExpression.extendedWithOperator(operator: BinaryOperator): EndedWithOperator = - if (this.prefix is EndedWithOperator && this.prefix.operator.precedence >= operator.precedence) { - // Apply the operator - this.prefix - .withOperatorApplied(this.expression) - .extendedWithOperator(operator) - } else { - EndedWithOperator(this.prefix, this.expression, operator) - } - - internal tailrec fun EndedWithExpression.reduced(): EndedWithExpression = when (this.prefix) { - Empty, is EndedWithLeftParenthesis -> this - - is EndedWithOperator -> - this.prefix - .withOperatorApplied(this.expression) - .reduced() - } - - private fun EndedWithOperator.withOperatorApplied(rightOperand: E) = - this.prefix.with(composer.compose(this.operator, this.leftOperand, rightOperand)) - - private fun ExpressionComposer.compose( - binaryOperator: BinaryOperator, left: E, right: E - ): E = when (binaryOperator) { - BinaryOperator.PLUS -> plus(left, right) - BinaryOperator.MINUS -> minus(left, right) - BinaryOperator.MULT -> mult(left, right) - BinaryOperator.DIV -> div(left, right) - } - -} - -interface PartialExpressionComposer { - fun missing(): PE - fun ending(expression: E): PE - - fun plus(left: E, partialRight: PE): PE - fun minus(left: E, partialRight: PE): PE - fun mult(left: E, partialRight: PE): PE - fun div(left: E, partialRight: PE): PE - - fun leftParenthesized(partialExpression: PE): PE -} - -class PartialParser( - composer: ExpressionComposer, - private val partialComposer: PartialExpressionComposer -) : Parser(composer) { - - data class Result(val expression: E?, val partialExpression: PE, val remainder: String?) - - fun parseWithPartial(expression: String): Result { - val tokenizer = Tokenizer(expression) - val prefix = parseAsPrefix(tokenizer) - - val remainder = tokenizer.getRemainder() - - return Result( - if (remainder != null) null else tryReduce(prefix), - prefix.toPartialExpression(), - remainder - ) - } - - private fun tryReduce(prefix: ExpressionPrefix): E? { - if (prefix is EndedWithExpression) { - val reduced = prefix.reduced() - if (reduced.prefix is Empty) { - return reduced.expression - } - } - - return null - } - - private fun ExpressionPrefix.toPartialExpression(): PE = when (this) { - is EndedWithExpression -> this.prefix.toPartialExpressionWith( - ending = partialComposer.ending(this.expression) - ) - is ContinuableWithExpression -> this.toPartialExpressionWith(ending = partialComposer.missing()) - } - - private tailrec fun ContinuableWithExpression.toPartialExpressionWith( - ending: PE - ): PE = when (this) { - Empty -> ending - - is EndedWithLeftParenthesis -> this.prefix.toPartialExpressionWith( - ending = partialComposer.leftParenthesized(ending) - ) - - is EndedWithOperator -> this.prefix.toPartialExpressionWith( - ending = partialComposer.compose(this.operator, this.leftOperand, ending) - ) - } - - private fun PartialExpressionComposer.compose( - binaryOperator: BinaryOperator, - left: E, - right: PE - ): PE = when (binaryOperator) { - BinaryOperator.PLUS -> plus(left, right) - BinaryOperator.MINUS -> minus(left, right) - BinaryOperator.MULT -> mult(left, right) - BinaryOperator.DIV -> div(left, right) - } -} - -/** - * Immutable prefix of expression partially parsed to combination of abstractly represented expressions. - * The prefix representation can be thought as "almost AST", i.e. AST with unfinished rightmost leaf - * (referenced by this object), and its nodes contain links to parent and (if needed) left child. - * - * @param E abstract representation of expression, e.g. its value, AST etc. - */ -internal sealed class ExpressionPrefix - -internal data class EndedWithExpression( - val prefix: ContinuableWithExpression, - val expression: E -) : ExpressionPrefix() - -internal sealed class ContinuableWithExpression : ExpressionPrefix() - -private fun ContinuableWithExpression.with(expression: E) = - EndedWithExpression(this, expression) - -private object Empty : ContinuableWithExpression() - -private data class EndedWithLeftParenthesis( - val prefix: ContinuableWithExpression -) : ContinuableWithExpression() - -private fun ContinuableWithExpression.withLeftParenthesis() = - EndedWithLeftParenthesis(this) - -private data class EndedWithOperator( - val prefix: ContinuableWithExpression, - val leftOperand: E, - val operator: BinaryOperator -) : ContinuableWithExpression() - -internal enum class BinaryOperator(val sign: Char, val precedence: Int) { - PLUS('+', 2), - MINUS('-', 2), - MULT('*', 3), - DIV('/', 3) -} - -internal class Tokenizer(private val expression: String) { - private var index = 0 - - init { - skipSpaces() - } - - fun hasNext(): Boolean = (index < expression.length) - - fun getRemainder(): String? = if (this.hasNext()) { - expression.substring(index) - } else { - null - } - - fun tryReadNumber(): Double? { - var endIndex = index - while (expression.getOrNull(endIndex)?.isNumberChar() == true) { - ++endIndex - } - - return expression.substring(index, endIndex).toDoubleOrNull()?.also { - index = endIndex - skipSpaces() - } - } - - private fun Char.isNumberChar(): Boolean = this in '0'..'9' || this == '.' - - fun tryReadBinaryOperator(): BinaryOperator? = BinaryOperator.values().firstOrNull { tryRead(it.sign) } - - fun tryReadLeftParenthesis(): Boolean = tryRead('(') - - fun tryReadRightParenthesis(): Boolean = tryRead(')') - - - private fun tryRead(char: Char): Boolean = if (hasNext() && expression[index] == char) { - ++index - skipSpaces() - true - } else { - false - } - - private fun skipSpaces() { - while (expression.getOrNull(index)?.isWhitespace() == true) { - ++index - } - } -} diff --git a/kotlin-native/samples/calculator/build.gradle b/kotlin-native/samples/calculator/build.gradle deleted file mode 100644 index 9bb4a4c0b9c..00000000000 --- a/kotlin-native/samples/calculator/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -buildscript { - repositories { - google() - jcenter() - mavenCentral() - if (project.hasProperty("kotlinCompilerRepo")) { - maven { setUrl(project.property("kotlinCompilerRepo")) } - } - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath 'com.android.tools.build:gradle:3.5.0' - } -} - -allprojects { - repositories { - google() - jcenter() - mavenCentral() - if (project.hasProperty("kotlinCompilerRepo")) { - maven { setUrl(project.property("kotlinCompilerRepo")) } - } - } -} diff --git a/kotlin-native/samples/calculator/build.sh b/kotlin-native/samples/calculator/build.sh deleted file mode 100755 index a26f890f026..00000000000 --- a/kotlin-native/samples/calculator/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) - -$DIR/../gradlew -p $DIR assemble diff --git a/kotlin-native/samples/calculator/cliApp/build.gradle b/kotlin-native/samples/calculator/cliApp/build.gradle deleted file mode 100644 index cbd2cd14391..00000000000 --- a/kotlin-native/samples/calculator/cliApp/build.gradle +++ /dev/null @@ -1,22 +0,0 @@ -apply plugin: 'org.jetbrains.kotlin.multiplatform' - -kotlin { - targets { - jvm() - } - - sourceSets { - jvmMain { - dependencies { - implementation project(':arithmeticParser') - } - } - } -} - -task runProgram(type: JavaExec) { - dependsOn assemble - main = 'sample.calculator.jvm.JvmCli' - classpath = files(kotlin.targets.jvm.compilations.main.output) + kotlin.targets.jvm.compilations.main.runtimeDependencyFiles - args '2 + 3' -} diff --git a/kotlin-native/samples/calculator/cliApp/gradle.properties b/kotlin-native/samples/calculator/cliApp/gradle.properties deleted file mode 100644 index 790a07d5124..00000000000 --- a/kotlin-native/samples/calculator/cliApp/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -kotlin.code.style=official -kotlin.import.noCommonSourceSets=true diff --git a/kotlin-native/samples/calculator/cliApp/src/jvmMain/kotlin/JvmCli.kt b/kotlin-native/samples/calculator/cliApp/src/jvmMain/kotlin/JvmCli.kt deleted file mode 100644 index f3554b27666..00000000000 --- a/kotlin-native/samples/calculator/cliApp/src/jvmMain/kotlin/JvmCli.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the license/LICENSE.txt file. - */ -@file:JvmName("JvmCli") - -package sample.calculator.jvm - -import sample.calculator.arithmeticparser.parseAndCompute - -fun main(args: Array) { - val expression = if (args.isNotEmpty()) { - args.first().also { - print(it) - } - } else { - println("Enter an expression:") - readLine()!! - } - - val result = parseAndCompute(expression) - val computed = result.expression - if (computed != null) { - println(" = $computed") - } else { - println(" = ${result.partialExpression}") - result.remainder?.let { - println("Unable to parse suffix: $it") - } - } -} diff --git a/kotlin-native/samples/calculator/gradle.properties b/kotlin-native/samples/calculator/gradle.properties deleted file mode 100644 index 5f52c353bc0..00000000000 --- a/kotlin-native/samples/calculator/gradle.properties +++ /dev/null @@ -1,18 +0,0 @@ -kotlin.code.style=official - -# Run parallel builds in Gradle: -org.gradle.parallel=true -org.gradle.workers.max=4 - -# Pin Kotlin version: -# CHANGE_VERSION_WITH_RELEASE -kotlin_version=1.5.10 - -# Sets maven path for the kotlin version other than release -#kotlinCompilerRepo= - -# Use custom Kotlin/Native home: -kotlin.native.home=../../../dist - -# Increase memory for in-process compiler execution. -org.gradle.jvmargs=-Xmx3g diff --git a/kotlin-native/samples/calculator/gradle/wrapper/gradle-wrapper.jar b/kotlin-native/samples/calculator/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c023e..00000000000 Binary files a/kotlin-native/samples/calculator/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/kotlin-native/samples/calculator/gradle/wrapper/gradle-wrapper.properties b/kotlin-native/samples/calculator/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index be52383ef49..00000000000 --- a/kotlin-native/samples/calculator/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/kotlin-native/samples/calculator/gradlew b/kotlin-native/samples/calculator/gradlew deleted file mode 100755 index 4f906e0c811..00000000000 --- a/kotlin-native/samples/calculator/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/kotlin-native/samples/calculator/gradlew.bat b/kotlin-native/samples/calculator/gradlew.bat deleted file mode 100644 index ac1b06f9382..00000000000 --- a/kotlin-native/samples/calculator/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.pbxproj b/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.pbxproj deleted file mode 100644 index 7f85ccaa88e..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.pbxproj +++ /dev/null @@ -1,519 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - 2C3F38451FD1738300151601 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3F38441FD1738300151601 /* AppDelegate.swift */; }; - 2C3F38471FD1738300151601 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3F38461FD1738300151601 /* ViewController.swift */; }; - 2C3F384A1FD1738300151601 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C3F38481FD1738300151601 /* Main.storyboard */; }; - 2C3F384C1FD1738300151601 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C3F384B1FD1738300151601 /* Assets.xcassets */; }; - 2C3F384F1FD1738300151601 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C3F384D1FD1738300151601 /* LaunchScreen.storyboard */; }; - 7FE128BF205854BA0064CE74 /* arithmeticParser.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 7FF94AD92058464C00590D0D /* arithmeticParser.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 7FF94AE32058483900590D0D /* arithmeticParser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7FF94AD92058464C00590D0D /* arithmeticParser.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 2C10D2172521E5AA001EB717 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 2C3F38391FD1738300151601 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 7FF94AD82058464C00590D0D; - remoteInfo = arithmeticParser; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 7FE128BE2058549E0064CE74 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 7FE128BF205854BA0064CE74 /* arithmeticParser.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 2C3F38411FD1738300151601 /* KotlinCalculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KotlinCalculator.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 2C3F38441FD1738300151601 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 2C3F38461FD1738300151601 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 2C3F38491FD1738300151601 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 2C3F384B1FD1738300151601 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 2C3F384E1FD1738300151601 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 2C3F38501FD1738300151601 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 7FF94AD92058464C00590D0D /* arithmeticParser.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = arithmeticParser.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 7FF94AEA2058485300590D0D /* Parser.kt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Parser.kt; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 2C3F383E1FD1738300151601 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7FF94AE32058483900590D0D /* arithmeticParser.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 2C3F38381FD1738300151601 = { - isa = PBXGroup; - children = ( - 2C3F38431FD1738300151601 /* calculator */, - 7FF94ADA2058464C00590D0D /* arithmeticParser */, - 2C3F38421FD1738300151601 /* Products */, - 7FF94AE22058483900590D0D /* Frameworks */, - ); - sourceTree = ""; - }; - 2C3F38421FD1738300151601 /* Products */ = { - isa = PBXGroup; - children = ( - 2C3F38411FD1738300151601 /* KotlinCalculator.app */, - 7FF94AD92058464C00590D0D /* arithmeticParser.framework */, - ); - name = Products; - sourceTree = ""; - }; - 2C3F38431FD1738300151601 /* calculator */ = { - isa = PBXGroup; - children = ( - 2C3F38441FD1738300151601 /* AppDelegate.swift */, - 2C3F38461FD1738300151601 /* ViewController.swift */, - 2C3F38481FD1738300151601 /* Main.storyboard */, - 2C3F384B1FD1738300151601 /* Assets.xcassets */, - 2C3F384D1FD1738300151601 /* LaunchScreen.storyboard */, - 2C3F38501FD1738300151601 /* Info.plist */, - ); - path = calculator; - sourceTree = ""; - }; - 7FF94ADA2058464C00590D0D /* arithmeticParser */ = { - isa = PBXGroup; - children = ( - 7FF94AE42058485300590D0D /* src */, - ); - name = arithmeticParser; - sourceTree = ""; - }; - 7FF94AE22058483900590D0D /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; - 7FF94AE42058485300590D0D /* src */ = { - isa = PBXGroup; - children = ( - 7FF94AE52058485300590D0D /* commonMain */, - ); - name = src; - path = ../arithmeticParser/src; - sourceTree = SOURCE_ROOT; - }; - 7FF94AE52058485300590D0D /* commonMain */ = { - isa = PBXGroup; - children = ( - 7FF94AE62058485300590D0D /* kotlin */, - ); - path = commonMain; - sourceTree = ""; - }; - 7FF94AE62058485300590D0D /* kotlin */ = { - isa = PBXGroup; - children = ( - 7FF94AEA2058485300590D0D /* Parser.kt */, - ); - path = kotlin; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 2C3F38401FD1738300151601 /* KotlinCalculator */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2C3F38531FD1738300151601 /* Build configuration list for PBXNativeTarget "KotlinCalculator" */; - buildPhases = ( - 2C3F383D1FD1738300151601 /* Sources */, - 2C3F383E1FD1738300151601 /* Frameworks */, - 2C3F383F1FD1738300151601 /* Resources */, - 7FE128BE2058549E0064CE74 /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 2C10D2182521E5AA001EB717 /* PBXTargetDependency */, - ); - name = KotlinCalculator; - productName = calculator; - productReference = 2C3F38411FD1738300151601 /* KotlinCalculator.app */; - productType = "com.apple.product-type.application"; - }; - 7FF94AD82058464C00590D0D /* arithmeticParser */ = { - isa = PBXNativeTarget; - buildConfigurationList = 7FF94ADE2058464C00590D0D /* Build configuration list for PBXNativeTarget "arithmeticParser" */; - buildPhases = ( - 7FF94AE12058466D00590D0D /* Compile Kotlin/Native */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = arithmeticParser; - productName = arithmeticParser; - productReference = 7FF94AD92058464C00590D0D /* arithmeticParser.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 2C3F38391FD1738300151601 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0900; - ORGANIZATIONNAME = JetBrains; - TargetAttributes = { - 2C3F38401FD1738300151601 = { - CreatedOnToolsVersion = 9.0; - ProvisioningStyle = Automatic; - }; - 7FF94AD82058464C00590D0D = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = 2C3F383C1FD1738300151601 /* Build configuration list for PBXProject "calculator" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 2C3F38381FD1738300151601; - productRefGroup = 2C3F38421FD1738300151601 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 2C3F38401FD1738300151601 /* KotlinCalculator */, - 7FF94AD82058464C00590D0D /* arithmeticParser */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 2C3F383F1FD1738300151601 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2C3F384F1FD1738300151601 /* LaunchScreen.storyboard in Resources */, - 2C3F384C1FD1738300151601 /* Assets.xcassets in Resources */, - 2C3F384A1FD1738300151601 /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 7FF94AE12058466D00590D0D /* Compile Kotlin/Native */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Compile Kotlin/Native"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$SRCROOT/../gradlew\" -p \"$SRCROOT/..\" buildFrameworkForXcode \\\n-Pcalculator.preset.name=\"$KOTLIN_NATIVE_PRESET\" \\\n-Pcalculator.configuration.name=\"$CONFIGURATION\" \\\n-Pcalculator.framework.location=\"$CONFIGURATION_BUILD_DIR\"\n"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 2C3F383D1FD1738300151601 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2C3F38471FD1738300151601 /* ViewController.swift in Sources */, - 2C3F38451FD1738300151601 /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 2C10D2182521E5AA001EB717 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 7FF94AD82058464C00590D0D /* arithmeticParser */; - targetProxy = 2C10D2172521E5AA001EB717 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 2C3F38481FD1738300151601 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2C3F38491FD1738300151601 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 2C3F384D1FD1738300151601 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2C3F384E1FD1738300151601 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 2C3F38511FD1738300151601 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 2C3F38521FD1738300151601 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 2C3F38541FD1738300151601 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = $BUILT_PRODUCTS_DIR; - INFOPLIST_FILE = calculator/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.jetbrains.konan.calculator; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 2C3F38551FD1738300151601 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = $BUILT_PRODUCTS_DIR; - INFOPLIST_FILE = calculator/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = org.jetbrains.konan.calculator; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 7FF94ADF2058464C00590D0D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/../arithmeticParser/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; - "KOTLIN_NATIVE_PRESET[sdk=iphoneos*]" = iosArm64; - "KOTLIN_NATIVE_PRESET[sdk=iphonesimulator*]" = iosX64; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = JetBrains.arithmeticParser; - PRODUCT_MODULE_NAME = "_$(PRODUCT_NAME:c99extidentifier)"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = arm64; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - 7FF94AE02058464C00590D0D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/../arithmeticParser/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; - "KOTLIN_NATIVE_PRESET[sdk=iphoneos*]" = iosArm64; - "KOTLIN_NATIVE_PRESET[sdk=iphonesimulator*]" = iosX64; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = JetBrains.arithmeticParser; - PRODUCT_MODULE_NAME = "_$(PRODUCT_NAME:c99extidentifier)"; - PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VALID_ARCHS = arm64; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 2C3F383C1FD1738300151601 /* Build configuration list for PBXProject "calculator" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2C3F38511FD1738300151601 /* Debug */, - 2C3F38521FD1738300151601 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2C3F38531FD1738300151601 /* Build configuration list for PBXNativeTarget "KotlinCalculator" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2C3F38541FD1738300151601 /* Debug */, - 2C3F38551FD1738300151601 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 7FF94ADE2058464C00590D0D /* Build configuration list for PBXNativeTarget "arithmeticParser" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 7FF94ADF2058464C00590D0D /* Debug */, - 7FF94AE02058464C00590D0D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 2C3F38391FD1738300151601 /* Project object */; -} diff --git a/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7527b6e65d4..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d6..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/kotlin-native/samples/calculator/iosApp/calculator/AppDelegate.swift b/kotlin-native/samples/calculator/iosApp/calculator/AppDelegate.swift deleted file mode 100644 index b813994f762..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator/AppDelegate.swift +++ /dev/null @@ -1,43 +0,0 @@ -// -// Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license -// that can be found in the license/LICENSE.txt file. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/kotlin-native/samples/calculator/iosApp/calculator/Assets.xcassets/AppIcon.appiconset/Contents.json b/kotlin-native/samples/calculator/iosApp/calculator/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65fd7..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/kotlin-native/samples/calculator/iosApp/calculator/Base.lproj/LaunchScreen.storyboard b/kotlin-native/samples/calculator/iosApp/calculator/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd5810..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kotlin-native/samples/calculator/iosApp/calculator/Base.lproj/Main.storyboard b/kotlin-native/samples/calculator/iosApp/calculator/Base.lproj/Main.storyboard deleted file mode 100644 index b06d278fdd1..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator/Base.lproj/Main.storyboard +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kotlin-native/samples/calculator/iosApp/calculator/Info.plist b/kotlin-native/samples/calculator/iosApp/calculator/Info.plist deleted file mode 100644 index 88282c39cb6..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - KotlinCalc - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/kotlin-native/samples/calculator/iosApp/calculator/ViewController.swift b/kotlin-native/samples/calculator/iosApp/calculator/ViewController.swift deleted file mode 100644 index 8e15fbfc2cf..00000000000 --- a/kotlin-native/samples/calculator/iosApp/calculator/ViewController.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license -// that can be found in the license/LICENSE.txt file. -// - -import UIKit -import arithmeticParser - -class ViewController: UIViewController, UITextViewDelegate, UICollectionViewDataSource { - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - numpad.dataSource = self - self.input.delegate = self - inputDidChange() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - // Dispose of any resources that can be recreated. - } - - @IBOutlet var partialResult: UILabel! - @IBOutlet var result: UILabel! - @IBOutlet var input: UITextView! - @IBOutlet var numpad: UICollectionView! - - private let parser = PartialParser( - composer: Calculator(), - partialComposer: PartialRenderer() - ) - - @IBAction func numpadButtonPressed(_ sender: UIButton) { - let title = sender.currentTitle! - if title == "" { - return - } - - if title == "⌫" { - if !input.text.isEmpty { - input.text.removeLast() - } - } else { - input.text.append(title) - } - - inputDidChange() - } - - func textViewDidChange(_ textView: UITextView) { - if textView === input { - inputDidChange() - } - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - self.input.endEditing(true) - } - - private func inputDidChange() { - let parsed = parser.parseWithPartial(expression: input.text) - if let resultValue = parsed.expression { - result.text = "= \(resultValue)" - } else { - result.text = "" - } - - let attributedText = parsed.partialExpression - - if let remainder = parsed.remainder { - partialResult.attributedText = attributedText + - NSAttributedString(string: " ") + - NSAttributedString(string: remainder, attributes: - [.foregroundColor: UIColor.red, - .font: UIFont.boldSystemFont(ofSize: partialResult.font.pointSize)]) - } else { - partialResult.attributedText = attributedText - } - } - - private let buttons = [ - "7", "8", "9", "/", - "4", "5", "6", "*", - "1", "2", "3", "-", - ".", "0", "", "+", - "(", ")", "", "⌫" - ] - - func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { - return buttons.count - } - - func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "buttonCell", for: indexPath) - - (cell.viewWithTag(1) as! UIButton).setTitle(buttons[indexPath.item],for: .normal) - - return cell - } -} - -private func +(left: NSAttributedString, right: NSAttributedString) -> NSAttributedString { - let result = NSMutableAttributedString(attributedString: left) - result.append(right) - return result -} - -private extension String { - func toAttributed() -> NSAttributedString { - return NSAttributedString(string: self) - } -} - -private class PartialRenderer: NSObject, PartialExpressionComposer { - func missing() -> Any { - return "... ".toAttributed() - } - - func ending(expression: Any) -> Any { - return "\(formatDouble(expression))... ".toAttributed() - } - - func plus(left: Any, partialRight: Any) -> Any { - return compose("+", left, partialRight) - } - - func minus(left: Any, partialRight: Any) -> Any { - return compose("-", left, partialRight) - } - - func mult(left: Any, partialRight: Any) -> Any { - return compose("*", left, partialRight) - } - - func div(left: Any, partialRight: Any) -> Any { - return compose("/", left, partialRight) - } - - func leftParenthesized(partialExpression: Any) -> Any { - let suffix = NSAttributedString(string: ")", attributes: [.foregroundColor: UIColor.lightGray]) - return "(".toAttributed() + (partialExpression as! NSAttributedString) + suffix - } - - private func formatDouble(_ value: Any) -> String { - let rounded = round(1000 * (value as! Double)) / 1000 - return "\(rounded as NSNumber)" - } - - private func compose(_ op: String, _ left: Any, _ partialRight: Any) -> Any { - return "\(formatDouble(left)) \(op) ".toAttributed() + (partialRight as! NSAttributedString) - } - -} diff --git a/kotlin-native/samples/calculator/settings.gradle b/kotlin-native/samples/calculator/settings.gradle deleted file mode 100644 index fe07c42cef4..00000000000 --- a/kotlin-native/samples/calculator/settings.gradle +++ /dev/null @@ -1,16 +0,0 @@ -include ':arithmeticParser' -include ':cliApp' - -boolean sdkDirPropertySpecified = false -File localPropertiesFile = file("${rootProject.projectDir}/local.properties") -if (localPropertiesFile.isFile()) { - Properties properties = new Properties() - localPropertiesFile.withInputStream { inputStream -> properties.load(inputStream) } - sdkDirPropertySpecified = properties.containsKey('sdk.dir') -} - - -// Don't create Android tasks if a user has no Android SDK. -if (sdkDirPropertySpecified || System.getenv('ANDROID_HOME') != null) { - include ':androidApp' -} diff --git a/kotlin-native/samples/cocoapods/.gitignore b/kotlin-native/samples/cocoapods/.gitignore deleted file mode 100644 index 6492779ad8b..00000000000 --- a/kotlin-native/samples/cocoapods/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -ios-app/Pods -Podfile.lock -kotlin-library/kotlin_library.podspec -ios-app/ios-app.xcodeproj/xcuserdata -ios-app/ios-app.xcworkspace/xcuserdata -ios-app/ios-app.xcodeproj/project.xcworkspace/xcuserdata -ios-app/ios-app.xcworkspace/contents.xcworkspacedata -ios-app/ios-app.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ No newline at end of file diff --git a/kotlin-native/samples/cocoapods/README.md b/kotlin-native/samples/cocoapods/README.md deleted file mode 100644 index f69aa1c894f..00000000000 --- a/kotlin-native/samples/cocoapods/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Using CocoaPods - -This sample demonstrates how to use a CocoaPods library from Kotlin/Native. It uses the the -[AFNetworking](https://cocoapods.org/pods/AFNetworking) library to retrieve a web-page by a -given URL. - -## Configuring the project -1. [Install](https://guides.cocoapods.org/using/getting-started.html#installation) CocoaPods. - It's recommended to use CocoaPods 1.6.1 or higher. - -2. Navigate to the [kotlin-library](kotlin-library) directory and run - ``` - ./gradlew podspec - ``` - A [podspec](https://guides.cocoapods.org/syntax/podspec.html#specification) file for the - Kotlin/Native library will be generated. - -3. Navigate to the [ios-app](ios-app) directory and install the dependencies. The generated - podspec is already added to the Podfile, so just run - ``` - pod install - ``` - -4. Open [ios-app.xcworkspace](ios-app/ios-app.xcworkspace) in Xcode and run the build. \ No newline at end of file diff --git a/kotlin-native/samples/cocoapods/build.sh b/kotlin-native/samples/cocoapods/build.sh deleted file mode 100755 index b45ef89fac5..00000000000 --- a/kotlin-native/samples/cocoapods/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd ) - -KOTLIN_DIR="$DIR/kotlin-library" -IOS_DIR="$DIR/ios-app" - -#Check CocoaPods version. -REQUIRED_POD_VERSION="1.6.1" -POD_VERSION=`pod --version` -EARLIER_VERSION=`echo "$POD_VERSION $REQUIRED_POD_VERSION" | tr " " "\n" | sort -V | head -1` - -if [ "$EARLIER_VERSION" != "$REQUIRED_POD_VERSION" ]; then - echo "ERROR: This version of CocoaPods is unsupported. Current version is $POD_VERSION. Minimal required version is $REQUIRED_POD_VERSION." - echo "See update instructions at https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods" - exit 1 -fi - -# Prepare Kotlin/Native project to be consumed by CocoaPods. -"$KOTLIN_DIR/gradlew" -p "$KOTLIN_DIR" podspec - -# Run CocoaPods to configure the Xcode project. -pod --project-directory="$IOS_DIR" install - -# Run Xcode to build the app. -xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -workspace "$IOS_DIR/ios-app.xcworkspace" -scheme ios-app diff --git a/kotlin-native/samples/cocoapods/ios-app/Podfile b/kotlin-native/samples/cocoapods/ios-app/Podfile deleted file mode 100644 index 5e3e6081186..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/Podfile +++ /dev/null @@ -1,8 +0,0 @@ -# Either use_frameworks! or use_modular_headers! must be specified. -use_frameworks! - -platform :ios, '9.0' - -target 'ios-app' do - pod 'kotlin_library', :path => '../kotlin-library' -end \ No newline at end of file diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.pbxproj b/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.pbxproj deleted file mode 100644 index fb3aa55d900..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.pbxproj +++ /dev/null @@ -1,419 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 50; - objects = { - -/* Begin PBXBuildFile section */ - 2C11BACF224B4DCB00D1CC3C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C11BACE224B4DCB00D1CC3C /* AppDelegate.swift */; }; - 2C11BAD1224B4DCB00D1CC3C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C11BAD0224B4DCB00D1CC3C /* ViewController.swift */; }; - 2C11BAD4224B4DCB00D1CC3C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C11BAD2224B4DCB00D1CC3C /* Main.storyboard */; }; - 2C11BAD6224B4DCD00D1CC3C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C11BAD5224B4DCD00D1CC3C /* Assets.xcassets */; }; - 2C11BAD9224B4DCD00D1CC3C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C11BAD7224B4DCD00D1CC3C /* LaunchScreen.storyboard */; }; - 7AEB35573DF5ECC0B96C877C /* Pods_ios_app.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 06FDB564DA981DADB5693C07 /* Pods_ios_app.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - 06FDB564DA981DADB5693C07 /* Pods_ios_app.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ios_app.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 2C11BACB224B4DCB00D1CC3C /* ios-app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "ios-app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2C11BACE224B4DCB00D1CC3C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 2C11BAD0224B4DCB00D1CC3C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 2C11BAD3224B4DCB00D1CC3C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 2C11BAD5224B4DCD00D1CC3C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 2C11BAD8224B4DCD00D1CC3C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 2C11BADA224B4DCD00D1CC3C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 2C11BAE0224B65DE00D1CC3C /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; - 44888DA7148EA4EB17DF765D /* Pods-ios-app.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios-app.debug.xcconfig"; path = "Target Support Files/Pods-ios-app/Pods-ios-app.debug.xcconfig"; sourceTree = ""; }; - A063F818143EBBCD07EA19D4 /* Pods-ios-app.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ios-app.release.xcconfig"; path = "Target Support Files/Pods-ios-app/Pods-ios-app.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 2C11BAC8224B4DCB00D1CC3C /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 7AEB35573DF5ECC0B96C877C /* Pods_ios_app.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 2C11BAC2224B4DCB00D1CC3C = { - isa = PBXGroup; - children = ( - 2C11BACD224B4DCB00D1CC3C /* ios-app */, - 2C11BACC224B4DCB00D1CC3C /* Products */, - 9C1A5E5C1B80F794B7154EE0 /* Pods */, - B404E0DEAC80D8DB556F0E49 /* Frameworks */, - ); - sourceTree = ""; - }; - 2C11BACC224B4DCB00D1CC3C /* Products */ = { - isa = PBXGroup; - children = ( - 2C11BACB224B4DCB00D1CC3C /* ios-app.app */, - ); - name = Products; - sourceTree = ""; - }; - 2C11BACD224B4DCB00D1CC3C /* ios-app */ = { - isa = PBXGroup; - children = ( - 2C11BACE224B4DCB00D1CC3C /* AppDelegate.swift */, - 2C11BAD0224B4DCB00D1CC3C /* ViewController.swift */, - 2C11BAD2224B4DCB00D1CC3C /* Main.storyboard */, - 2C11BAD5224B4DCD00D1CC3C /* Assets.xcassets */, - 2C11BAD7224B4DCD00D1CC3C /* LaunchScreen.storyboard */, - 2C11BADA224B4DCD00D1CC3C /* Info.plist */, - ); - path = "ios-app"; - sourceTree = ""; - }; - 9C1A5E5C1B80F794B7154EE0 /* Pods */ = { - isa = PBXGroup; - children = ( - 44888DA7148EA4EB17DF765D /* Pods-ios-app.debug.xcconfig */, - A063F818143EBBCD07EA19D4 /* Pods-ios-app.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - B404E0DEAC80D8DB556F0E49 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 2C11BAE0224B65DE00D1CC3C /* WebKit.framework */, - 06FDB564DA981DADB5693C07 /* Pods_ios_app.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 2C11BACA224B4DCB00D1CC3C /* ios-app */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2C11BADD224B4DCD00D1CC3C /* Build configuration list for PBXNativeTarget "ios-app" */; - buildPhases = ( - F305A4DC70C8B21755898707 /* [CP] Check Pods Manifest.lock */, - 2C11BAC7224B4DCB00D1CC3C /* Sources */, - 2C11BAC8224B4DCB00D1CC3C /* Frameworks */, - 2C11BAC9224B4DCB00D1CC3C /* Resources */, - 042B85E17AFECF20FF11D591 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "ios-app"; - productName = "ios-app"; - productReference = 2C11BACB224B4DCB00D1CC3C /* ios-app.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 2C11BAC3224B4DCB00D1CC3C /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 1010; - LastUpgradeCheck = 1010; - TargetAttributes = { - 2C11BACA224B4DCB00D1CC3C = { - CreatedOnToolsVersion = 10.1; - }; - }; - }; - buildConfigurationList = 2C11BAC6224B4DCB00D1CC3C /* Build configuration list for PBXProject "ios-app" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 2C11BAC2224B4DCB00D1CC3C; - productRefGroup = 2C11BACC224B4DCB00D1CC3C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 2C11BACA224B4DCB00D1CC3C /* ios-app */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 2C11BAC9224B4DCB00D1CC3C /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2C11BAD9224B4DCD00D1CC3C /* LaunchScreen.storyboard in Resources */, - 2C11BAD6224B4DCD00D1CC3C /* Assets.xcassets in Resources */, - 2C11BAD4224B4DCB00D1CC3C /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 042B85E17AFECF20FF11D591 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ios-app/Pods-ios-app-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - ); - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ios-app/Pods-ios-app-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - F305A4DC70C8B21755898707 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-ios-app-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 2C11BAC7224B4DCB00D1CC3C /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 2C11BAD1224B4DCB00D1CC3C /* ViewController.swift in Sources */, - 2C11BACF224B4DCB00D1CC3C /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 2C11BAD2224B4DCB00D1CC3C /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2C11BAD3224B4DCB00D1CC3C /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 2C11BAD7224B4DCD00D1CC3C /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2C11BAD8224B4DCD00D1CC3C /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 2C11BADB224B4DCD00D1CC3C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 2C11BADC224B4DCD00D1CC3C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - MTL_FAST_MATH = YES; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 2C11BADE224B4DCD00D1CC3C /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 44888DA7148EA4EB17DF765D /* Pods-ios-app.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "ios-app/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.konan.ios-app"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 2C11BADF224B4DCD00D1CC3C /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = A063F818143EBBCD07EA19D4 /* Pods-ios-app.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = "ios-app/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.jetbrains.konan.ios-app"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.2; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 2C11BAC6224B4DCB00D1CC3C /* Build configuration list for PBXProject "ios-app" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2C11BADB224B4DCD00D1CC3C /* Debug */, - 2C11BADC224B4DCD00D1CC3C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 2C11BADD224B4DCD00D1CC3C /* Build configuration list for PBXNativeTarget "ios-app" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2C11BADE224B4DCD00D1CC3C /* Debug */, - 2C11BADF224B4DCD00D1CC3C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 2C11BAC3224B4DCB00D1CC3C /* Project object */; -} diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 136ada05267..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d6..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app/AppDelegate.swift b/kotlin-native/samples/cocoapods/ios-app/ios-app/AppDelegate.swift deleted file mode 100644 index 849f883d23e..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app/AppDelegate.swift +++ /dev/null @@ -1,38 +0,0 @@ -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app/Assets.xcassets/AppIcon.appiconset/Contents.json b/kotlin-native/samples/cocoapods/ios-app/ios-app/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d8db8d65fd7..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app/Assets.xcassets/Contents.json b/kotlin-native/samples/cocoapods/ios-app/ios-app/Assets.xcassets/Contents.json deleted file mode 100644 index da4a164c918..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app/Assets.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app/Base.lproj/LaunchScreen.storyboard b/kotlin-native/samples/cocoapods/ios-app/ios-app/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129419..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app/Base.lproj/Main.storyboard b/kotlin-native/samples/cocoapods/ios-app/ios-app/Base.lproj/Main.storyboard deleted file mode 100644 index 29d14b9fb3a..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app/Base.lproj/Main.storyboard +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app/Info.plist b/kotlin-native/samples/cocoapods/ios-app/ios-app/Info.plist deleted file mode 100644 index 16be3b68112..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app/Info.plist +++ /dev/null @@ -1,45 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/kotlin-native/samples/cocoapods/ios-app/ios-app/ViewController.swift b/kotlin-native/samples/cocoapods/ios-app/ios-app/ViewController.swift deleted file mode 100644 index 7325dd25b40..00000000000 --- a/kotlin-native/samples/cocoapods/ios-app/ios-app/ViewController.swift +++ /dev/null @@ -1,21 +0,0 @@ -import UIKit -import kotlin_library - -class ViewController: UIViewController { - - @IBOutlet weak var goButton: UIButton! - @IBOutlet weak var urlField: UITextField! - @IBOutlet weak var contentTextView: UITextView! - - - override func viewDidLoad() { - super.viewDidLoad() - // Do any additional setup after loading the view, typically from a nib. - } - - @IBAction func onGoTouch(_ sender: Any) { - let url = urlField.text! - KotlinLibKt.getAndShow(url: url, contentView: contentTextView) - } -} - diff --git a/kotlin-native/samples/cocoapods/kotlin-library/build.gradle.kts b/kotlin-native/samples/cocoapods/kotlin-library/build.gradle.kts deleted file mode 100644 index dc3e8d786bb..00000000000 --- a/kotlin-native/samples/cocoapods/kotlin-library/build.gradle.kts +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id("org.jetbrains.kotlin.multiplatform") - id("org.jetbrains.kotlin.native.cocoapods") -} - -repositories { - jcenter() -} - -group = "org.jetbrains.kotlin.sample.native" -version = "1.0" - -kotlin { - // Add a platform switching to have an IDE support. - val buildForDevice = project.findProperty("kotlin.native.cocoapods.target") == "ios_arm" - if (buildForDevice) { - iosArm64("iOS64") - iosArm32("iOS32") - - val iOSMain by sourceSets.creating - sourceSets["iOS64Main"].dependsOn(iOSMain) - sourceSets["iOS32Main"].dependsOn(iOSMain) - } else { - iosX64("iOS") - } - - cocoapods { - // Configure fields required by CocoaPods. - summary = "Working with AFNetworking from Kotlin/Native using CocoaPods" - homepage = "https://github.com/JetBrains/kotlin-native" - - // Configure a dependency on AFNetworking. It will be added in all macOS and iOS targets. - pod("AFNetworking", "~> 3.2.0") - } -} diff --git a/kotlin-native/samples/cocoapods/kotlin-library/gradle.properties b/kotlin-native/samples/cocoapods/kotlin-library/gradle.properties deleted file mode 100644 index be7ee0457fd..00000000000 --- a/kotlin-native/samples/cocoapods/kotlin-library/gradle.properties +++ /dev/null @@ -1,15 +0,0 @@ -kotlin.code.style=official - -# Run parallel builds in Gradle: -org.gradle.parallel=true -org.gradle.workers.max=4 - -# Pin Kotlin version: -# CHANGE_VERSION_WITH_RELEASE -kotlin_version=1.5.10 - -# Use custom Kotlin/Native home: -kotlin.native.home=../../../dist - -# Increase memory for in-process compiler execution. -org.gradle.jvmargs=-Xmx3g diff --git a/kotlin-native/samples/cocoapods/kotlin-library/gradle/wrapper/gradle-wrapper.jar b/kotlin-native/samples/cocoapods/kotlin-library/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c023e..00000000000 Binary files a/kotlin-native/samples/cocoapods/kotlin-library/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/kotlin-native/samples/cocoapods/kotlin-library/gradle/wrapper/gradle-wrapper.properties b/kotlin-native/samples/cocoapods/kotlin-library/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index be52383ef49..00000000000 --- a/kotlin-native/samples/cocoapods/kotlin-library/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/kotlin-native/samples/cocoapods/kotlin-library/gradlew b/kotlin-native/samples/cocoapods/kotlin-library/gradlew deleted file mode 100755 index 4f906e0c811..00000000000 --- a/kotlin-native/samples/cocoapods/kotlin-library/gradlew +++ /dev/null @@ -1,185 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/kotlin-native/samples/cocoapods/kotlin-library/gradlew.bat b/kotlin-native/samples/cocoapods/kotlin-library/gradlew.bat deleted file mode 100644 index ac1b06f9382..00000000000 --- a/kotlin-native/samples/cocoapods/kotlin-library/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/kotlin-native/samples/cocoapods/kotlin-library/settings.gradle.kts b/kotlin-native/samples/cocoapods/kotlin-library/settings.gradle.kts deleted file mode 100644 index 5a626778d67..00000000000 --- a/kotlin-native/samples/cocoapods/kotlin-library/settings.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -pluginManagement { - resolutionStrategy { - val kotlin_version: String by settings - eachPlugin { - when { - requested.id.id == "org.jetbrains.kotlin.native.cocoapods" || - requested.id.id == "kotlin-native-cocoapods" -> - useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") - requested.id.id.startsWith("org.jetbrains.kotlin") -> - useVersion(kotlin_version) - } - } - } -} \ No newline at end of file diff --git a/kotlin-native/samples/cocoapods/kotlin-library/src/iOSMain/kotlin/KotlinLib.kt b/kotlin-native/samples/cocoapods/kotlin-library/src/iOSMain/kotlin/KotlinLib.kt deleted file mode 100644 index 3c35250e9b9..00000000000 --- a/kotlin-native/samples/cocoapods/kotlin-library/src/iOSMain/kotlin/KotlinLib.kt +++ /dev/null @@ -1,34 +0,0 @@ -import cocoapods.AFNetworking.AFHTTPResponseSerializer -import cocoapods.AFNetworking.AFHTTPSessionManager -import platform.Foundation.* -import platform.UIKit.NSDocumentTypeDocumentAttribute -import platform.UIKit.NSHTMLTextDocumentType -import platform.UIKit.UITextView -import platform.UIKit.create -import kotlin.Any -import kotlin.String -import kotlin.to -import kotlin.toString - -/** - * Retrieves the content by the given URL and shows it at the given WebKitView - */ -fun getAndShow(url: String, contentView: UITextView) { - val manager = AFHTTPSessionManager() - manager.responseSerializer = AFHTTPResponseSerializer() - val onSuccess = { _: NSURLSessionDataTask?, response: Any? -> - val html = NSAttributedString.create( - data = response as NSData, - options = mapOf(NSDocumentTypeDocumentAttribute as Any? to NSHTMLTextDocumentType), - documentAttributes = null, - error = null - )!! - contentView.attributedText = html - } - val onError = { _: NSURLSessionDataTask?, error: NSError? -> - NSLog("Cannot get ${url}.") - NSLog(error.toString()) - } - - manager.GET(url, null, onSuccess, onError) -} \ No newline at end of file