diff --git a/android/.gitignore b/android/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/android/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index fffa703..0000000 --- a/android/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-platform-android' - -android { - compileSdkVersion 26 - - - - defaultConfig { - applicationId "software.jonasfranz.android" - minSdkVersion 15 - targetSdkVersion 26 - versionCode 1 - versionName "1.0" - - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - -} - -repositories { - google() -} - -dependencies { - expectedBy project(":common") - implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.android.support.constraint:constraint-layout:1.0.2' -} diff --git a/android/proguard-rules.pro b/android/proguard-rules.pro deleted file mode 100644 index f1b4245..0000000 --- a/android/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml deleted file mode 100644 index 82403e4..0000000 --- a/android/src/main/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/src/main/java/software/jonasfranz/android/MainActivity.kt b/android/src/main/java/software/jonasfranz/android/MainActivity.kt deleted file mode 100644 index 5126265..0000000 --- a/android/src/main/java/software/jonasfranz/android/MainActivity.kt +++ /dev/null @@ -1,14 +0,0 @@ -package software.jonasfranz.android - -import android.support.v7.app.AppCompatActivity -import android.os.Bundle -import software.jonasfranz.common.Common - -class MainActivity : AppCompatActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - println(Common().platform()) - } -} diff --git a/android/src/main/java/software/jonasfranz/common/ExceptPlatform.kt b/android/src/main/java/software/jonasfranz/common/ExceptPlatform.kt deleted file mode 100644 index fb26962..0000000 --- a/android/src/main/java/software/jonasfranz/common/ExceptPlatform.kt +++ /dev/null @@ -1,5 +0,0 @@ -package software.jonasfranz.common - -actual class Platform actual constructor() { - actual fun platform(): String = "platform-android" -} \ No newline at end of file diff --git a/android/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index c7bd21d..0000000 --- a/android/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/android/src/main/res/drawable/ic_launcher_background.xml b/android/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc5..0000000 --- a/android/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/src/main/res/layout/activity_main.xml b/android/src/main/res/layout/activity_main.xml deleted file mode 100644 index 84f1951..0000000 --- a/android/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index eca70cf..0000000 --- a/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index eca70cf..0000000 --- a/android/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/android/src/main/res/mipmap-hdpi/ic_launcher.png b/android/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index a2f5908..0000000 Binary files a/android/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/mipmap-hdpi/ic_launcher_round.png b/android/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index 1b52399..0000000 Binary files a/android/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/src/main/res/mipmap-mdpi/ic_launcher.png b/android/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index ff10afd..0000000 Binary files a/android/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/mipmap-mdpi/ic_launcher_round.png b/android/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 115a4c7..0000000 Binary files a/android/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index dcd3cd8..0000000 Binary files a/android/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index 459ca60..0000000 Binary files a/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 8ca12fe..0000000 Binary files a/android/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index 8e19b41..0000000 Binary files a/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index b824ebd..0000000 Binary files a/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 4c19a13..0000000 Binary files a/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/android/src/main/res/values/colors.xml b/android/src/main/res/values/colors.xml deleted file mode 100644 index 3ab3e9c..0000000 --- a/android/src/main/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - #3F51B5 - #303F9F - #FF4081 - diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml deleted file mode 100644 index 64fad88..0000000 --- a/android/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - android - diff --git a/android/src/main/res/values/styles.xml b/android/src/main/res/values/styles.xml deleted file mode 100644 index 5885930..0000000 --- a/android/src/main/res/values/styles.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/android/src/test/java/software/jonasfranz/android/ExampleUnitTest.kt b/android/src/test/java/software/jonasfranz/android/ExampleUnitTest.kt deleted file mode 100644 index ff2ca95..0000000 --- a/android/src/test/java/software/jonasfranz/android/ExampleUnitTest.kt +++ /dev/null @@ -1,17 +0,0 @@ -package software.jonasfranz.android - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} diff --git a/build.gradle b/build.gradle index 9cc82b7..335ad48 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,6 @@ buildscript { - repositories { jcenter() - google() maven { url "http://kotlin.bintray.com/kotlinx" } maven { url "https://plugins.gradle.org/m2/" } maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" } @@ -11,7 +9,6 @@ buildscript { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.moowork.gradle:gradle-node-plugin:$gradle_node_version" classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:$kotlin_native_version" - classpath 'com.android.tools.build:gradle:3.1.0' } } diff --git a/common/src/main/kotlin/Common.kt b/common/src/main/kotlin/Common.kt new file mode 100644 index 0000000..97e8daf --- /dev/null +++ b/common/src/main/kotlin/Common.kt @@ -0,0 +1,6 @@ + +// This code is common across all backends +class Common { + fun common(): String = "common" + fun platform(): String = Platform().platform() // delegates to platform-specific +} \ No newline at end of file diff --git a/common/src/main/kotlin/software/jonasfranz/common/ExpectPlatform.kt b/common/src/main/kotlin/ExpectPlatform.kt similarity index 75% rename from common/src/main/kotlin/software/jonasfranz/common/ExpectPlatform.kt rename to common/src/main/kotlin/ExpectPlatform.kt index d6ac17f..4e446ae 100644 --- a/common/src/main/kotlin/software/jonasfranz/common/ExpectPlatform.kt +++ b/common/src/main/kotlin/ExpectPlatform.kt @@ -1,4 +1,4 @@ -package software.jonasfranz.common + // This class is expected to have platform-specific impl expect class Platform() { fun platform(): String diff --git a/common/src/test/kotlin/CommonTest.kt b/common/src/test/kotlin/CommonTest.kt index 7c8ed5a..3089c01 100644 --- a/common/src/test/kotlin/CommonTest.kt +++ b/common/src/test/kotlin/CommonTest.kt @@ -1,4 +1,4 @@ -import software.jonasfranz.common.Common +import kotlin.test.* class CommonTest { @Test diff --git a/gradle.properties b/gradle.properties index 8b48d62..bfdc630 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -kotlin_version = 1.2.31 +kotlin_version = 1.2.20 gradle_node_version = 1.2.0 node_version = 8.9.3 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b666f9a..9cd4350 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Apr 02 22:09:09 CEST 2018 +#Wed Jan 24 17:11:50 MSK 2018 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip diff --git a/js/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt b/js/src/main/kotlin/ActualPlatform.kt similarity index 73% rename from js/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt rename to js/src/main/kotlin/ActualPlatform.kt index a70a70d..5086ed4 100644 --- a/js/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt +++ b/js/src/main/kotlin/ActualPlatform.kt @@ -1,4 +1,4 @@ -package software.jonasfranz.common + actual class Platform actual constructor() { actual fun platform(): String = "platform-js" } diff --git a/js/src/test/kotlin/ActualPlatformTest.kt b/js/src/test/kotlin/ActualPlatformTest.kt index c704a01..35f0cd9 100644 --- a/js/src/test/kotlin/ActualPlatformTest.kt +++ b/js/src/test/kotlin/ActualPlatformTest.kt @@ -1,4 +1,4 @@ -import software.jonasfranz.common.Platform +import kotlin.test.* class ActualPlatformTest { @Test diff --git a/jvm/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt b/jvm/src/main/kotlin/ActualPlatform.kt similarity index 72% rename from jvm/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt rename to jvm/src/main/kotlin/ActualPlatform.kt index 170db0b..5633817 100644 --- a/jvm/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt +++ b/jvm/src/main/kotlin/ActualPlatform.kt @@ -1,4 +1,4 @@ -package software.jonasfranz.common + actual class Platform actual constructor() { actual fun platform(): String = "platform-jvm" -} \ No newline at end of file +} diff --git a/jvm/src/test/kotlin/ActualPlatformTest.kt b/jvm/src/test/kotlin/ActualPlatformTest.kt index 50231f7..5c50ecb 100644 --- a/jvm/src/test/kotlin/ActualPlatformTest.kt +++ b/jvm/src/test/kotlin/ActualPlatformTest.kt @@ -1,4 +1,3 @@ -import software.jonasfranz.common.Platform import kotlin.test.* class ActualPlatformTest { diff --git a/native/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt b/native/src/main/kotlin/ActualPlatform.kt similarity index 74% rename from native/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt rename to native/src/main/kotlin/ActualPlatform.kt index 5c80fef..8479c82 100644 --- a/native/src/main/kotlin/software/jonasfranz/common/ActualPlatform.kt +++ b/native/src/main/kotlin/ActualPlatform.kt @@ -1,4 +1,3 @@ -package software.jonasfranz.common actual class Platform actual constructor() { actual fun platform(): String = "platform-native" diff --git a/settings.gradle b/settings.gradle index c7b4692..7c0d897 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,8 +1,6 @@ -include ':android' rootProject.name = 'KotlinMultiplatformPlayground' include 'common' include 'jvm' include 'js' include 'native' -