├── .gitignore ├── .idea ├── artifacts │ └── SharedCode_android.xml ├── codeStyles │ └── Project.xml ├── compiler.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── SharedCode ├── build.gradle ├── build │ ├── classes │ │ └── kotlin │ │ │ └── android │ │ │ └── main │ │ │ ├── META-INF │ │ │ └── SharedCode.kotlin_module │ │ │ └── org │ │ │ └── kotlin │ │ │ └── mpp │ │ │ └── mobile │ │ │ └── CommonKt.class │ ├── kotlin │ │ └── compileKotlinAndroid │ │ │ ├── build-history.bin │ │ │ ├── caches-jvm │ │ │ ├── inputs │ │ │ │ ├── source-to-output.tab │ │ │ │ ├── source-to-output.tab.keystream │ │ │ │ ├── source-to-output.tab.keystream.len │ │ │ │ ├── source-to-output.tab.len │ │ │ │ ├── source-to-output.tab.values.at │ │ │ │ ├── source-to-output.tab_i │ │ │ │ └── source-to-output.tab_i.len │ │ │ ├── jvm │ │ │ │ └── kotlin │ │ │ │ │ ├── class-fq-name-to-source.tab │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream │ │ │ │ │ ├── class-fq-name-to-source.tab.keystream.len │ │ │ │ │ ├── class-fq-name-to-source.tab.len │ │ │ │ │ ├── class-fq-name-to-source.tab.values.at │ │ │ │ │ ├── class-fq-name-to-source.tab_i │ │ │ │ │ ├── class-fq-name-to-source.tab_i.len │ │ │ │ │ ├── complementary-files.tab │ │ │ │ │ ├── complementary-files.tab.keystream │ │ │ │ │ ├── complementary-files.tab.keystream.len │ │ │ │ │ ├── complementary-files.tab.len │ │ │ │ │ ├── complementary-files.tab.values.at │ │ │ │ │ ├── complementary-files.tab_i │ │ │ │ │ ├── complementary-files.tab_i.len │ │ │ │ │ ├── internal-name-to-source.tab │ │ │ │ │ ├── internal-name-to-source.tab.keystream │ │ │ │ │ ├── internal-name-to-source.tab.keystream.len │ │ │ │ │ ├── internal-name-to-source.tab.len │ │ │ │ │ ├── internal-name-to-source.tab.values.at │ │ │ │ │ ├── internal-name-to-source.tab_i │ │ │ │ │ ├── internal-name-to-source.tab_i.len │ │ │ │ │ ├── package-parts.tab │ │ │ │ │ ├── package-parts.tab.keystream │ │ │ │ │ ├── package-parts.tab.keystream.len │ │ │ │ │ ├── package-parts.tab.len │ │ │ │ │ ├── package-parts.tab.values.at │ │ │ │ │ ├── package-parts.tab_i │ │ │ │ │ ├── package-parts.tab_i.len │ │ │ │ │ ├── proto.tab │ │ │ │ │ ├── proto.tab.keystream │ │ │ │ │ ├── proto.tab.keystream.len │ │ │ │ │ ├── proto.tab.len │ │ │ │ │ ├── proto.tab.values.at │ │ │ │ │ ├── proto.tab_i │ │ │ │ │ ├── proto.tab_i.len │ │ │ │ │ ├── source-to-classes.tab │ │ │ │ │ ├── source-to-classes.tab.keystream │ │ │ │ │ ├── source-to-classes.tab.keystream.len │ │ │ │ │ ├── source-to-classes.tab.len │ │ │ │ │ ├── source-to-classes.tab.values.at │ │ │ │ │ ├── source-to-classes.tab_i │ │ │ │ │ └── source-to-classes.tab_i.len │ │ │ └── lookups │ │ │ │ ├── counters.tab │ │ │ │ ├── file-to-id.tab │ │ │ │ ├── file-to-id.tab.keystream │ │ │ │ ├── file-to-id.tab.keystream.len │ │ │ │ ├── file-to-id.tab.len │ │ │ │ ├── file-to-id.tab.values.at │ │ │ │ ├── file-to-id.tab_i │ │ │ │ ├── file-to-id.tab_i.len │ │ │ │ ├── id-to-file.tab │ │ │ │ ├── id-to-file.tab.keystream │ │ │ │ ├── id-to-file.tab.keystream.len │ │ │ │ ├── id-to-file.tab.len │ │ │ │ ├── id-to-file.tab.values.at │ │ │ │ ├── id-to-file.tab_i │ │ │ │ ├── id-to-file.tab_i.len │ │ │ │ ├── lookups.tab │ │ │ │ ├── lookups.tab.keystream │ │ │ │ ├── lookups.tab.keystream.len │ │ │ │ ├── lookups.tab.len │ │ │ │ ├── lookups.tab.values.at │ │ │ │ ├── lookups.tab_i │ │ │ │ └── lookups.tab_i.len │ │ │ ├── data-container-format-version.txt │ │ │ ├── format-version.txt │ │ │ ├── gradle-format-version.txt │ │ │ └── last-build.bin │ ├── libs │ │ └── SharedCode-android.jar │ └── tmp │ │ └── androidJar │ │ └── MANIFEST.MF └── src │ ├── androidMain │ └── kotlin │ │ ├── actual.kt │ │ └── data │ │ └── cache │ │ └── MovieCache.kt │ ├── commonMain │ └── kotlin │ │ ├── data │ │ ├── api │ │ │ ├── CommonApiManager.kt │ │ │ ├── ExpectSuccess.kt │ │ │ ├── OmdbApiManager.kt │ │ │ └── TraktTvApiManager.kt │ │ ├── cache │ │ │ └── MovieCache.kt │ │ └── repository │ │ │ └── MovieDataRepository.kt │ │ ├── di │ │ └── Injections.kt │ │ ├── domain │ │ ├── fetcher │ │ │ ├── CoroutineFetcher.kt │ │ │ ├── Status.kt │ │ │ └── result_listener │ │ │ │ ├── RequestType.kt │ │ │ │ └── ResultListener.kt │ │ ├── mapper │ │ │ └── MovieMapper.kt │ │ ├── models │ │ │ ├── Movie.kt │ │ │ └── response │ │ │ │ ├── OmdbResponse.kt │ │ │ │ └── TraktTvResponse.kt │ │ ├── parser │ │ │ ├── OmdbJsonParser.kt │ │ │ └── TraktTvJsonParser.kt │ │ └── repository │ │ │ └── MovieRepository.kt │ │ ├── presentation │ │ ├── base │ │ │ ├── BaseContract.kt │ │ │ └── BasePresenter.kt │ │ ├── movie_detail │ │ │ ├── MovieDetailContract.kt │ │ │ └── MovieDetailPresenter.kt │ │ └── movie_list │ │ │ ├── MovieListContract.kt │ │ │ └── MovieListPresenter.kt │ │ └── util │ │ ├── Constants.kt │ │ ├── Logger.kt │ │ └── common.kt │ └── iOSMain │ └── kotlin │ ├── MainLoopDispatcher.kt │ ├── actual.kt │ └── data │ └── cache │ └── MovieCache.kt ├── android ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── armcha │ │ │ └── kotlinmultiplatformexample │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── io │ │ │ │ └── github │ │ │ │ └── armcha │ │ │ │ └── kotlinmultiplatformexample │ │ │ │ ├── App.kt │ │ │ │ ├── ui │ │ │ │ ├── BaseActivity.kt │ │ │ │ ├── MovieDetailActivity.kt │ │ │ │ ├── MovieListActivity.kt │ │ │ │ └── MovieListAdapter.kt │ │ │ │ └── util │ │ │ │ └── PlatformLogger.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── dark_knight.jpg │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── activity_movie_detail.xml │ │ │ └── item_view.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── armcha │ │ └── kotlinmultiplatformexample │ │ └── ExampleUnitTest.kt └── build.gradle ├── build.gradle ├── diagram ├── android.gif ├── ios.gif └── structure.png ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ios └── KotlinMultiplatformIos │ ├── KotlinMultiplatformIos.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── v-mobile.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── v-mobile.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist │ └── KotlinMultiplatformIos │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── BaseViewController.swift │ ├── Info.plist │ ├── PlatformLogger.swift │ ├── UI.swift │ └── ViewController.swift └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches/build_file_checksums.ser 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | -------------------------------------------------------------------------------- /.idea/artifacts/SharedCode_android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/SharedCode/build/libs 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # KotlinMultiplatformSample 2 | 3 | ### This repo is demonstrative sample project of **Kotlin** multiplatform 4 | 5 | It contains a sample project for **IOS** and **Android** and the **Shared** module. 6 | The app shares business logic for both **IOS** and **Android** app, it just gets popular films list from TraktTv and Omdb API. 7 | All the rest **calls**, **parsings** and **mappings** encapsulated inside a shared module 8 | 9 | **Android** and **IOS** apps just implement view interfaces and make his own realisations for UI. 10 | 11 | Project structure diagram below 12 | 13 | ![](diagram/structure.png) 14 | 15 | | Android | Ios | 16 | | :-------------: | :-------------: | 17 | | | 18 | 19 | ### Contact :book: 20 | 21 | :arrow_forward: **Email**: chatikyana@gmail.com 22 | 23 | :arrow_forward: **Medium**: https://medium.com/@chatikyan 24 | 25 | :arrow_forward: **Twitter**: https://twitter.com/ArmanChatikyan 26 | 27 | :arrow_forward: **Google+**: https://plus.google.com/+ArmanChatikyan 28 | 29 | :arrow_forward: **Website**: https://armcha.github.io/ 30 | 31 | License 32 | -------- 33 | 34 | KotlinMultiplatformSample 35 | Copyright (c) 2018 Arman Chatikyan (https://github.com/armcha/KotlinMultiplatformSample). 36 | 37 | Licensed under the Apache License, Version 2.0 (the "License"); 38 | you may not use this file except in compliance with the License. 39 | You may obtain a copy of the License at 40 | 41 | http://www.apache.org/licenses/LICENSE-2.0 42 | 43 | Unless required by applicable law or agreed to in writing, software 44 | distributed under the License is distributed on an "AS IS" BASIS, 45 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 46 | See the License for the specific language governing permissions and 47 | limitations under the License. 48 | 49 | -------------------------------------------------------------------------------- /SharedCode/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'kotlin-multiplatform' 2 | apply plugin: 'kotlinx-serialization' 3 | 4 | kotlin { 5 | targets { 6 | final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \ 7 | ? presets.iosArm64 : presets.iosX64 8 | 9 | fromPreset(iOSTarget, 'iOS') { 10 | compilations.main.outputKinds('FRAMEWORK') 11 | } 12 | 13 | fromPreset(presets.jvm, 'android') 14 | } 15 | 16 | sourceSets { 17 | commonMain{ 18 | dependencies { 19 | implementation "org.jetbrains.kotlin:kotlin-stdlib" 20 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutines_version" 21 | implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serialization_version" 22 | //implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-jsonparser:0.6.2" 23 | 24 | 25 | implementation "io.ktor:ktor-client-core:$ktor_version" 26 | implementation "io.ktor:ktor-client-json:$ktor_version" 27 | } 28 | } 29 | 30 | androidMain{ 31 | dependencies { 32 | implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version" 33 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 34 | implementation "io.ktor:ktor-client-android:$ktor_version" 35 | implementation "io.ktor:ktor-client-json-jvm:$ktor_version" 36 | implementation "io.ktor:ktor-client-core-jvm:$ktor_version" 37 | } 38 | } 39 | 40 | iOSMain{ 41 | dependencies { 42 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 43 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version" 44 | implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version" 45 | //implementation "org.jetbrains.kotlinx:jsonparser-native:0.6.2" 46 | 47 | implementation "io.ktor:ktor-client-ios:$ktor_version" 48 | implementation "io.ktor:ktor-client-core-ios:$ktor_version" 49 | implementation "io.ktor:ktor-client-json-ios:$ktor_version" 50 | } 51 | } 52 | } 53 | } 54 | // workaround for https://youtrack.jetbrains.com/issue/KT-27170 55 | configurations { 56 | compileClasspath 57 | } 58 | 59 | task packForXCode(type: Sync) { 60 | final File frameworkDir = new File(buildDir, "xcode-frameworks") 61 | final String mode = System.getenv('CONFIGURATION')?.toUpperCase() ?: 'DEBUG' 62 | 63 | inputs.property "mode", mode 64 | dependsOn kotlin.targets.iOS.compilations.main.linkTaskName("FRAMEWORK", mode) 65 | 66 | from { kotlin.targets.iOS.compilations.main.getBinary("FRAMEWORK", mode).parentFile } 67 | into frameworkDir 68 | 69 | doLast { 70 | new File(frameworkDir, 'gradlew').with { 71 | text = "#!/bin/bash\nexport 'JAVA_HOME=${System.getProperty("java.home")}'\ncd '${rootProject.rootDir}'\n./gradlew \$@\n" 72 | setExecutable(true) 73 | } 74 | } 75 | } 76 | 77 | tasks.build.dependsOn packForXCode 78 | -------------------------------------------------------------------------------- /SharedCode/build/classes/kotlin/android/main/META-INF/SharedCode.kotlin_module: -------------------------------------------------------------------------------- 1 |  2 | + 3 | org.kotlin.mpp.mobileActualKtCommonKt 4 |  5 | util ConstantsKt -------------------------------------------------------------------------------- /SharedCode/build/classes/kotlin/android/main/org/kotlin/mpp/mobile/CommonKt.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/classes/kotlin/android/main/org/kotlin/mpp/mobile/CommonKt.class -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/build-history.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/build-history.bin -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab.keystream: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab.keystream -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab.keystream.len: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab.len: -------------------------------------------------------------------------------- 1 | h -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab.values.at: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab.values.at -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/inputs/source-to-output.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream: -------------------------------------------------------------------------------- 1 | #data.repository.MovieDataRepository)presentation.movie_list.MovieListContract.presentation.movie_list.MovieListContract.View3presentation.movie_list.MovieListContract.Presenter*presentation.movie_list.MovieListPresenter di.Injectionsdata.api.CommonApiManagerdata.api.ExpectSuccessdata.api.ApiExceptiondata.api.OmdbApiManagerdata.api.TraktTvApiManager*domain.fetcher.result_listener.RequestType-domain.fetcher.result_listener.ResultListenerdomain.parser.OmdbJsonParserdomain.parser.TraktTvJsonParser4org.kotlin.mpp.mobile.presentation.base.BaseContract9org.kotlin.mpp.mobile.presentation.base.BaseContract.View>org.kotlin.mpp.mobile.presentation.base.BaseContract.Presenterdomain.mapper.MovieMapperdomain.models.Movie-presentation.movie_detail.MovieDetailContract2presentation.movie_detail.MovieDetailContract.View7presentation.movie_detail.MovieDetailContract.Presenter.presentation.movie_detail.MovieDetailPresenter!domain.repository.MovieRepositorypresentation.base.BasePresenterorg.kotlin.mpp.mobile.Loggerorg.kotlin.mpp.mobile.Stringsdata.cache.MovieCachedomain.fetcher.CoroutineFetcherdomain.fetcher.Statusdomain.fetcher.Status.Loadingdomain.fetcher.Status.Errordomain.fetcher.Status.Success"domain.fetcher.Status.EmptySuccessdomain.fetcher.Status.Idle#domain.models.response.OmdbResponse-domain.models.response.OmdbResponse.Companion/domain.models.response.OmdbResponse.$serializerdomain.models.response.Rating'domain.models.response.Rating.Companion)domain.models.response.Rating.$serializer&domain.models.response.TraktTvResponse0domain.models.response.TraktTvResponse.Companion2domain.models.response.TraktTvResponse.$serializer)domain.models.response.TraktTvIdsResponse3domain.models.response.TraktTvIdsResponse.Companion5domain.models.response.TraktTvIdsResponse.$serializer -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab.keystream: -------------------------------------------------------------------------------- 1 | j/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/commonMain/kotlin/data/cache/MovieCache.kt`/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/commonMain/kotlin/util/common.ktk/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/androidMain/kotlin/data/cache/MovieCache.kt\/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/androidMain/kotlin/actual.kt -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab.keystream.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab.keystream.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab.values.at: -------------------------------------------------------------------------------- 1 | /Header Record For PersistentHashMapValueStoragelk/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/androidMain/kotlin/data/cache/MovieCache.kt]\/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/androidMain/kotlin/actual.ktkj/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/commonMain/kotlin/data/cache/MovieCache.kta`/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/src/commonMain/kotlin/util/common.kt -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/complementary-files.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream: -------------------------------------------------------------------------------- 1 | #data/repository/MovieDataRepository2data/repository/MovieDataRepository$getMovieList$1)presentation/movie_list/MovieListContract.presentation/movie_list/MovieListContract$View3presentation/movie_list/MovieListContract$Presenter*presentation/movie_list/MovieListPresenter;presentation/movie_list/MovieListPresenter$fetchMovieList$1;presentation/movie_list/MovieListPresenter$fetchMovieList$2 di/Injections!di/Injections$provideMovieCache$2data/api/CommonApiManager"data/api/CommonApiManager$apiUrl$2&data/api/CommonApiManager$httpClient$1(data/api/CommonApiManager$httpClient$1$1data/api/ExpectSuccess data/api/ExpectSuccess$install$1data/api/ApiExceptiondata/api/OmdbApiManager5data/api/OmdbApiManager$getMoviePoster$$inlined$get$1(data/api/OmdbApiManager$getMoviePoster$1data/api/TraktTvApiManager6data/api/TraktTvApiManager$getMovieList$$inlined$get$1)data/api/TraktTvApiManager$getMovieList$1*domain/fetcher/result_listener/RequestType-domain/fetcher/result_listener/ResultListener:domain/fetcher/result_listener/ResultListener$DefaultImplsdomain/parser/OmdbJsonParserdomain/parser/TraktTvJsonParser4org/kotlin/mpp/mobile/presentation/base/BaseContract9org/kotlin/mpp/mobile/presentation/base/BaseContract$View>org/kotlin/mpp/mobile/presentation/base/BaseContract$Presenterdomain/mapper/MovieMapperdomain/models/Movie-presentation/movie_detail/MovieDetailContract2presentation/movie_detail/MovieDetailContract$View7presentation/movie_detail/MovieDetailContract$Presenter.presentation/movie_detail/MovieDetailPresenter?presentation/movie_detail/MovieDetailPresenter$fetchMovieById$1?presentation/movie_detail/MovieDetailPresenter$fetchMovieById$2util/ConstantsKt!domain/repository/MovieRepositorypresentation/base/BasePresenter)presentation/base/BasePresenter$fetcher$2org/kotlin/mpp/mobile/ActualKtorg/kotlin/mpp/mobile/Loggerorg/kotlin/mpp/mobile/Stringsorg/kotlin/mpp/mobile/CommonKtdata/cache/MovieCachedomain/fetcher/CoroutineFetcher'domain/fetcher/CoroutineFetcher$fetch$1'domain/fetcher/CoroutineFetcher$fetch$2*domain/fetcher/CoroutineFetcher$complete$1Udomain/fetcher/CoroutineFetcher$exceptionHandler$$inlined$CoroutineExceptionHandler$1domain/fetcher/Statusdomain/fetcher/Status$Loadingdomain/fetcher/Status$Errordomain/fetcher/Status$Success"domain/fetcher/Status$EmptySuccessdomain/fetcher/Status$Idle#domain/models/response/OmdbResponse-domain/models/response/OmdbResponse$Companion/domain/models/response/OmdbResponse$$serializerdomain/models/response/Rating'domain/models/response/Rating$Companion)domain/models/response/Rating$$serializer&domain/models/response/TraktTvResponse0domain/models/response/TraktTvResponse$Companion2domain/models/response/TraktTvResponse$$serializer)domain/models/response/TraktTvIdsResponse3domain/models/response/TraktTvIdsResponse$Companion5domain/models/response/TraktTvIdsResponse$$serializer -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len: -------------------------------------------------------------------------------- 1 | 4 -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab.keystream: -------------------------------------------------------------------------------- 1 | util/ConstantsKtorg/kotlin/mpp/mobile/ActualKtorg/kotlin/mpp/mobile/CommonKt -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len: -------------------------------------------------------------------------------- 1 | O -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab.values.at: -------------------------------------------------------------------------------- 1 | /Header Record For PersistentHashMapValueStorage -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/package-parts.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab.keystream: -------------------------------------------------------------------------------- 1 | #data/repository/MovieDataRepository)presentation/movie_list/MovieListContract.presentation/movie_list/MovieListContract$View3presentation/movie_list/MovieListContract$Presenter*presentation/movie_list/MovieListPresenter di/Injectionsdata/api/CommonApiManagerdata/api/ExpectSuccessdata/api/ApiExceptiondata/api/OmdbApiManagerdata/api/TraktTvApiManager*domain/fetcher/result_listener/RequestType-domain/fetcher/result_listener/ResultListenerdomain/parser/OmdbJsonParserdomain/parser/TraktTvJsonParser4org/kotlin/mpp/mobile/presentation/base/BaseContract9org/kotlin/mpp/mobile/presentation/base/BaseContract$View>org/kotlin/mpp/mobile/presentation/base/BaseContract$Presenterdomain/mapper/MovieMapperdomain/models/Movie-presentation/movie_detail/MovieDetailContract2presentation/movie_detail/MovieDetailContract$View7presentation/movie_detail/MovieDetailContract$Presenter.presentation/movie_detail/MovieDetailPresenterutil/ConstantsKt!domain/repository/MovieRepositorypresentation/base/BasePresenterorg/kotlin/mpp/mobile/ActualKtorg/kotlin/mpp/mobile/Loggerorg/kotlin/mpp/mobile/Stringsorg/kotlin/mpp/mobile/CommonKtdata/cache/MovieCachedomain/fetcher/CoroutineFetcherdomain/fetcher/Statusdomain/fetcher/Status$Loadingdomain/fetcher/Status$Errordomain/fetcher/Status$Success"domain/fetcher/Status$EmptySuccessdomain/fetcher/Status$Idle#domain/models/response/OmdbResponse-domain/models/response/OmdbResponse$Companion/domain/models/response/OmdbResponse$$serializerdomain/models/response/Rating'domain/models/response/Rating$Companion)domain/models/response/Rating$$serializer&domain/models/response/TraktTvResponse0domain/models/response/TraktTvResponse$Companion2domain/models/response/TraktTvResponse$$serializer)domain/models/response/TraktTvIdsResponse3domain/models/response/TraktTvIdsResponse$Companion5domain/models/response/TraktTvIdsResponse$$serializer.kotlin_module -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab.keystream.len: -------------------------------------------------------------------------------- 1 | l -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab.len: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab.values.at: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab.values.at -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/proto.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len: -------------------------------------------------------------------------------- 1 | � -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab.len: -------------------------------------------------------------------------------- 1 | h -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/counters.tab: -------------------------------------------------------------------------------- 1 | 29 2 | 0 -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab.keystream: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab.keystream -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab.keystream.len: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab.len: -------------------------------------------------------------------------------- 1 | h -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab.values.at: -------------------------------------------------------------------------------- 1 | /Header Record For PersistentHashMapValueStorage  2 |     -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/file-to-id.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab.keystream: -------------------------------------------------------------------------------- 1 |  2 |  -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab.keystream.len: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab.len: -------------------------------------------------------------------------------- 1 | h -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab.values.at: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab.values.at -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/id-to-file.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab.keystream: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab.keystream -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab.keystream.len: -------------------------------------------------------------------------------- 1 | /x -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab.len: -------------------------------------------------------------------------------- 1 | 0 -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab.values.at: -------------------------------------------------------------------------------- 1 | /Header Record For PersistentHashMapValueStorage 2 |    3 |    4 |   5 |  6 |     7 |  8 |  9 |  10 |   11 |  12 |  13 |   14 |        15 |  16 |  17 |  18 |  19 |  20 |     21 |   22 |     23 |   24 |  25 |   26 |  27 |    28 |  29 |  30 |  31 |   32 |   33 |     34 |    35 |   36 |   T  37 |   38 |     39 |  40 |  41 | (     42 |  43 |   44 |  45 |      46 |   47 |  48 |     49 |  50 |    51 |    52 |  53 |  54 |    55 |     56 |  57 |   58 |  59 |   60 |      61 |  62 |  63 |   64 |  65 |        66 |  67 |   68 |  69 |   70 |  71 |  72 |      73 |    74 |  75 |  76 |  77 |   78 |  0 79 |        80 |  81 |     82 |   83 |        84 |      85 |  86 |  87 |      88 |  89 | ,      90 |  91 |   92 |  93 | ,    94 |  95 |        96 |    97 |    98 |  99 |  100 |  101 |   102 |  103 |  104 |  105 |     106 |  107 |  108 |  109 |      110 |   111 |   112 |  113 |  114 |  115 |   116 |     117 |      118 |  119 |  120 |   121 |  122 |  123 |   124 |   125 |  126 |    127 |  128 |   129 |   130 |   131 |   132 |    133 |   134 |  135 |   136 |  137 |    138 |          139 |  140 |  141 |      142 |       143 |  -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab_i: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab_i -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab_i.len: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/caches-jvm/lookups/lookups.tab_i.len -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/data-container-format-version.txt: -------------------------------------------------------------------------------- 1 | 3011001 -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/format-version.txt: -------------------------------------------------------------------------------- 1 | 9011001 -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/gradle-format-version.txt: -------------------------------------------------------------------------------- 1 | 4011001 -------------------------------------------------------------------------------- /SharedCode/build/kotlin/compileKotlinAndroid/last-build.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/kotlin/compileKotlinAndroid/last-build.bin -------------------------------------------------------------------------------- /SharedCode/build/libs/SharedCode-android.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/SharedCode/build/libs/SharedCode-android.jar -------------------------------------------------------------------------------- /SharedCode/build/tmp/androidJar/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | 3 | -------------------------------------------------------------------------------- /SharedCode/src/androidMain/kotlin/actual.kt: -------------------------------------------------------------------------------- 1 | package org.kotlin.mpp.mobile 2 | 3 | 4 | actual fun platformName(): String { 5 | return "Android" 6 | } -------------------------------------------------------------------------------- /SharedCode/src/androidMain/kotlin/data/cache/MovieCache.kt: -------------------------------------------------------------------------------- 1 | package data.cache 2 | 3 | import domain.models.Movie 4 | 5 | 6 | /** 7 | * 8 | * Created by Arman Chatikyan on 17 Oct 2018 9 | * 10 | */ 11 | 12 | actual object MovieCache { 13 | 14 | actual val cache = mutableListOf() 15 | 16 | actual fun cache(movieList: List) { 17 | cache.addAll(movieList) 18 | } 19 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/data/api/CommonApiManager.kt: -------------------------------------------------------------------------------- 1 | package data.api 2 | 3 | import io.ktor.client.HttpClient 4 | import io.ktor.client.features.json.JsonFeature 5 | import io.ktor.client.features.json.serializer.KotlinxSerializer 6 | import io.ktor.client.request.HttpRequestBuilder 7 | import io.ktor.client.request.header 8 | import io.ktor.http.URLProtocol 9 | import domain.models.response.TraktTvIdsResponse 10 | import domain.models.response.TraktTvResponse 11 | import domain.models.response.OmdbResponse 12 | import domain.models.response.Rating 13 | 14 | internal abstract class CommonApiManager(private val endPoint: String) { 15 | 16 | protected val httpClient = HttpClient { 17 | install(JsonFeature) { 18 | serializer = KotlinxSerializer().apply { 19 | setMapper(TraktTvResponse::class, TraktTvResponse.serializer()) 20 | setMapper(TraktTvIdsResponse::class, TraktTvIdsResponse.serializer()) 21 | setMapper(OmdbResponse::class, OmdbResponse.serializer()) 22 | setMapper(Rating::class, Rating.serializer()) 23 | } 24 | } 25 | install(ExpectSuccess) 26 | } 27 | 28 | protected fun HttpRequestBuilder.apiUrl(path: String = "") { 29 | withHeaders().forEach { 30 | header(it.first, it.second) 31 | } 32 | url { 33 | protocol = URLProtocol.HTTPS 34 | host = endPoint 35 | encodedPath = path 36 | } 37 | } 38 | 39 | open fun withHeaders() = listOf>() 40 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/data/api/ExpectSuccess.kt: -------------------------------------------------------------------------------- 1 | package data.api 2 | 3 | import io.ktor.client.* 4 | import io.ktor.client.features.* 5 | import io.ktor.client.response.* 6 | import io.ktor.http.* 7 | import io.ktor.util.* 8 | 9 | internal object ExpectSuccess : HttpClientFeature { 10 | override val key: AttributeKey = AttributeKey("ExpectSuccess") 11 | 12 | override fun prepare(block: Unit.() -> Unit): ExpectSuccess = this 13 | 14 | override fun install(feature: ExpectSuccess, scope: HttpClient) { 15 | scope.responsePipeline.intercept(HttpResponsePipeline.Receive) { 16 | val response = subject.response as HttpResponse 17 | if (!response.status.isSuccess()) throw ApiException(response) 18 | proceedWith(subject) 19 | } 20 | } 21 | } 22 | 23 | class ApiException(val response: HttpResponse) : Throwable() 24 | -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/data/api/OmdbApiManager.kt: -------------------------------------------------------------------------------- 1 | package data.api 2 | 3 | import io.ktor.client.request.get 4 | import io.ktor.client.request.parameter 5 | import domain.models.response.OmdbResponse 6 | import domain.parser.OmdbJsonParser 7 | import util.OMDB_API_KEY 8 | import util.OMDB_URL 9 | 10 | internal class OmdbApiManager : CommonApiManager(OMDB_URL) { 11 | 12 | private val API_KEY = "apikey" 13 | private val IMDB_ID = "i" 14 | 15 | suspend fun getMoviePoster(movieImdb:String): OmdbResponse { 16 | val omdbResponse = httpClient.get { 17 | parameter(IMDB_ID, movieImdb) 18 | parameter(API_KEY, OMDB_API_KEY) 19 | apiUrl() 20 | } 21 | 22 | return OmdbJsonParser.parse(omdbResponse) 23 | } 24 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/data/api/TraktTvApiManager.kt: -------------------------------------------------------------------------------- 1 | package data.api 2 | 3 | import domain.parser.TraktTvJsonParser 4 | import io.ktor.client.request.get 5 | import io.ktor.client.request.parameter 6 | import util.TRAKT_TV_API_KEY 7 | import util.TRAKT_TV_URL 8 | 9 | internal class TraktTvApiManager : CommonApiManager(TRAKT_TV_URL) { 10 | 11 | private val LIMIT = "limit" 12 | private val path = "movies/popular" 13 | private val apiKey = "trakt-api-key" 14 | private val apiVersion = "trakt-api-version" 15 | 16 | @ExperimentalUnsignedTypes 17 | suspend fun getMovieList(movieCount:UInt): List { 18 | val traktTvResponse = httpClient.get { 19 | parameter(LIMIT,movieCount.toString()) 20 | apiUrl(path) 21 | } 22 | return TraktTvJsonParser.parse(traktTvResponse) 23 | } 24 | 25 | override fun withHeaders(): List> { 26 | return listOf( 27 | apiKey to TRAKT_TV_API_KEY, 28 | apiVersion to "2") 29 | } 30 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/data/cache/MovieCache.kt: -------------------------------------------------------------------------------- 1 | package data.cache 2 | 3 | import domain.models.Movie 4 | 5 | 6 | /** 7 | * 8 | * Created by Arman Chatikyan on 17 Oct 2018 9 | * 10 | */ 11 | 12 | expect object MovieCache { 13 | 14 | val cache: MutableList 15 | 16 | fun cache(movieList: List) 17 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/data/repository/MovieDataRepository.kt: -------------------------------------------------------------------------------- 1 | package data.repository 2 | 3 | import data.api.OmdbApiManager 4 | import data.api.TraktTvApiManager 5 | import data.cache.MovieCache 6 | import domain.mapper.MovieMapper 7 | import domain.repository.MovieRepository 8 | import domain.models.Movie 9 | 10 | internal class MovieDataRepository constructor( 11 | private val traktTvApiManager: TraktTvApiManager, 12 | private val omdbApiManager: OmdbApiManager, 13 | private val localCache: MovieCache 14 | ) : MovieRepository { 15 | 16 | @ExperimentalUnsignedTypes 17 | override suspend fun getMovieList(movieCount:UInt): List { 18 | val omdbResponseList = traktTvApiManager.getMovieList(movieCount) 19 | .map { omdbApiManager.getMoviePoster(it) } 20 | val movieList = MovieMapper.omdbResponseListToMovieList(omdbResponseList) 21 | localCache.cache(movieList) 22 | return movieList 23 | } 24 | 25 | override suspend fun getMovieById(id: String): Movie { 26 | return localCache.cache.find { it.id == id}!! 27 | } 28 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/di/Injections.kt: -------------------------------------------------------------------------------- 1 | package di 2 | 3 | import data.api.OmdbApiManager 4 | import data.api.TraktTvApiManager 5 | import data.cache.MovieCache 6 | import data.repository.MovieDataRepository 7 | import kotlinx.coroutines.CoroutineDispatcher 8 | import presentation.movie_list.MovieListPresenter 9 | import presentation.movie_detail.MovieDetailContract 10 | import presentation.movie_detail.MovieDetailPresenter 11 | import presentation.movie_list.MovieListContract 12 | 13 | class Injections { 14 | 15 | private val provideMovieCache by lazy { 16 | MovieCache 17 | } 18 | 19 | private val provideTractApiManager = TraktTvApiManager() 20 | 21 | private val provideOmdbApiManager = OmdbApiManager() 22 | 23 | private val provideMovieRepository = 24 | MovieDataRepository(provideTractApiManager, provideOmdbApiManager, provideMovieCache) 25 | 26 | fun provideMovieListPresenter(uiDispatcher: CoroutineDispatcher): MovieListContract.Presenter { 27 | return MovieListPresenter(uiDispatcher, provideMovieRepository) 28 | } 29 | 30 | fun provideMovieDetailPresenter(uiDispatcher: CoroutineDispatcher): MovieDetailContract.Presenter { 31 | return MovieDetailPresenter(uiDispatcher, provideMovieRepository) 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/fetcher/CoroutineFetcher.kt: -------------------------------------------------------------------------------- 1 | package domain.fetcher 2 | 3 | import domain.fetcher.result_listener.RequestType 4 | import domain.fetcher.result_listener.ResultListener 5 | import kotlinx.coroutines.* 6 | import kotlin.coroutines.CoroutineContext 7 | 8 | /** 9 | * 10 | * Created by Arman Chatikyan on 13 Aug 2018 11 | * 12 | */ 13 | 14 | internal class CoroutineFetcher constructor(private val uiContext: CoroutineDispatcher) : CoroutineScope { 15 | 16 | private val jobMap = mutableMapOf>() 17 | private val requestMap = mutableMapOf>() 18 | 19 | private val ResultListener.key: String 20 | get() { 21 | val kClass = this::class 22 | return kClass.qualifiedName ?: kClass.simpleName ?: "" 23 | } 24 | 25 | override val coroutineContext: CoroutineContext 26 | get() = uiContext 27 | 28 | @ExperimentalCoroutinesApi 29 | fun fetch( 30 | deferred: Deferred, requestType: RequestType, 31 | resultListener: ResultListener, success: (T) -> Unit 32 | ) { 33 | 34 | createOrGetJobList(resultListener) += launch(uiContext) { 35 | resultListener add requestType 36 | deferred.join() 37 | if (!(deferred.isCancelled && deferred.isCompleted)) { 38 | val result = deferred.getCompleted() 39 | resultListener.onSuccess(requestType, result, success) 40 | } else { 41 | val throwable = deferred.getCompletionExceptionOrNull() 42 | resultListener.sendErrorFor(requestType, throwable) 43 | } 44 | } 45 | } 46 | 47 | fun fetch( 48 | body: suspend () -> T, requestType: RequestType, 49 | resultListener: ResultListener, success: (T) -> Unit 50 | ) { 51 | createOrGetJobList(resultListener) += launch( 52 | uiContext 53 | + exceptionHandler(resultListener, requestType) 54 | ) { 55 | resultListener add requestType 56 | resultListener.onSuccess(requestType, body(), success) 57 | } 58 | } 59 | 60 | fun complete( 61 | body: suspend () -> Unit, requestType: RequestType, 62 | resultListener: ResultListener, success: () -> Unit 63 | ) { 64 | createOrGetJobList(resultListener) += launch( 65 | uiContext 66 | + exceptionHandler(resultListener, requestType) 67 | ) { 68 | resultListener add requestType 69 | body() 70 | changeRequestStatus(resultListener, requestType, Status.Success) 71 | success() 72 | } 73 | } 74 | 75 | private fun exceptionHandler(resultListener: ResultListener, requestType: RequestType): CoroutineExceptionHandler { 76 | return CoroutineExceptionHandler { _, throwable -> 77 | resultListener.sendErrorFor(requestType, throwable) 78 | } 79 | } 80 | 81 | private fun ResultListener.onSuccess(requestType: RequestType, result: T, success: (T) -> Unit) { 82 | val status = if (result is List<*> && result.isEmpty()) { 83 | Status.EmptySuccess 84 | } else { 85 | Status.Success 86 | } 87 | changeRequestStatus(this, requestType, status) 88 | success(result) 89 | } 90 | 91 | private fun createOrGetJobList(resultListener: ResultListener): MutableList { 92 | return jobMap.getOrPut(resultListener.key) { mutableListOf() } 93 | } 94 | 95 | infix fun clear(resultListener: ResultListener) { 96 | val key = resultListener.key 97 | jobMap.run { 98 | if (containsKey(key)) { 99 | this[key]?.forEach { it.cancel() } 100 | ?.also { clear() } 101 | remove(key) 102 | } 103 | } 104 | requestMap.remove(key) 105 | } 106 | 107 | fun changeRequestStatus(resultListener: ResultListener, requestType: RequestType, status: Status) { 108 | if (requestMap.containsKey(resultListener.key)) { 109 | val currentRequest = requestMap[resultListener.key]!! //FIXME 110 | currentRequest[requestType] = status 111 | requestMap[resultListener.key] = currentRequest 112 | } 113 | } 114 | 115 | fun getRequestStatus(resultListener: ResultListener, requestType: RequestType): Status { 116 | val currentRequest = requestMap[resultListener.key] 117 | return currentRequest?.get(requestType) ?: Status.Idle 118 | } 119 | 120 | private infix fun ResultListener.add(requestType: RequestType) { 121 | onRequestStart(requestType) 122 | if (requestType != RequestType.TYPE_NONE) { 123 | if (requestMap.containsKey(key)) { 124 | changeRequestStatus(this, requestType, Status.Loading) 125 | } else { 126 | val status = Status.Loading as Status 127 | requestMap[key] = concurrentMapOf(requestType to status) 128 | } 129 | } 130 | } 131 | 132 | private fun ResultListener.sendErrorFor(requestType: RequestType, throwable: Throwable?) { 133 | changeRequestStatus(this, requestType, Status.Error) 134 | onRequestError(requestType, throwable) 135 | } 136 | 137 | private fun concurrentMapOf(vararg pair: Pair): HashMap { 138 | val map = HashMap() 139 | pair.forEach { 140 | map[it.first] = it.second 141 | } 142 | return map 143 | } 144 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/fetcher/Status.kt: -------------------------------------------------------------------------------- 1 | package domain.fetcher 2 | 3 | internal sealed class Status { 4 | 5 | object Loading : Status() 6 | object Error : Status() 7 | object Success : Status() 8 | object EmptySuccess : Status() 9 | object Idle : Status() 10 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/fetcher/result_listener/RequestType.kt: -------------------------------------------------------------------------------- 1 | package domain.fetcher.result_listener 2 | 3 | internal enum class RequestType { 4 | 5 | TYPE_NONE, 6 | GET_POPULAR, 7 | GET_MOVIE_BY_ID 8 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/fetcher/result_listener/ResultListener.kt: -------------------------------------------------------------------------------- 1 | package domain.fetcher.result_listener 2 | 3 | internal interface ResultListener { 4 | 5 | fun onRequestStart(requestType: RequestType) {} 6 | 7 | fun onRequestError(requestType: RequestType, throwable: Throwable?) {} 8 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/mapper/MovieMapper.kt: -------------------------------------------------------------------------------- 1 | package domain.mapper 2 | 3 | import domain.models.Movie 4 | import domain.models.response.OmdbResponse 5 | 6 | 7 | /** 8 | * 9 | * Created by Arman Chatikyan on 17 Oct 2018 10 | * 11 | */ 12 | 13 | internal object MovieMapper { 14 | 15 | private fun omdbResponseToMovie(omdbResponse: OmdbResponse): Movie { 16 | return with(omdbResponse) { 17 | Movie(imdbID, Title, Year, Released, Runtime, Genre, Director, Writer, Actors, Plot, Poster) 18 | } 19 | } 20 | 21 | fun omdbResponseListToMovieList(omdbResponseList: List): List { 22 | return omdbResponseList.map { 23 | omdbResponseToMovie(it) 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/models/Movie.kt: -------------------------------------------------------------------------------- 1 | package domain.models 2 | 3 | data class Movie( 4 | val id:String, 5 | val title: String, 6 | val year: String, 7 | val released: String, 8 | val runtime: String, 9 | val genre: String, 10 | val director: String, 11 | val writer: String, 12 | val actors: String, 13 | val plot: String, 14 | val poster: String 15 | ) -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/models/response/OmdbResponse.kt: -------------------------------------------------------------------------------- 1 | package domain.models.response 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | @Serializable 6 | internal data class OmdbResponse( 7 | val Title: String, 8 | val Year: String, 9 | val Released: String, 10 | val Rated: String, 11 | val Runtime: String, 12 | val Genre: String, 13 | val Director: String, 14 | val Writer: String, 15 | val Actors: String, 16 | val Plot: String, 17 | val Language: String, 18 | val Country: String, 19 | val Awards: String, 20 | val Poster: String, 21 | val imdbID:String) 22 | 23 | @Serializable 24 | data class Rating( 25 | val Source: String, 26 | val Value: String 27 | ) -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/models/response/TraktTvResponse.kt: -------------------------------------------------------------------------------- 1 | package domain.models.response 2 | 3 | import kotlinx.serialization.Serializable 4 | 5 | /** 6 | * 7 | * Created by Arman Chatikyan on 17 Oct 2018 8 | * 9 | */ 10 | 11 | @Serializable 12 | internal data class TraktTvResponse( 13 | val title: String, 14 | val year: Int, 15 | val ids: TraktTvIdsResponse 16 | ) 17 | 18 | @Serializable 19 | internal data class TraktTvIdsResponse( 20 | val trakt: Int, 21 | val slug: String, 22 | val imdb: String, 23 | val tmdb: Int 24 | ) -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/parser/OmdbJsonParser.kt: -------------------------------------------------------------------------------- 1 | package domain.parser 2 | 3 | import domain.models.response.OmdbResponse 4 | import kotlinx.serialization.json.JsonElement 5 | import kotlinx.serialization.json.JsonObject 6 | import kotlinx.serialization.json.JsonTreeParser 7 | import kotlinx.serialization.json.content 8 | 9 | internal object OmdbJsonParser { 10 | 11 | fun parse(jsonString: String): OmdbResponse { 12 | val response: JsonElement = JsonTreeParser(jsonString).read() 13 | val jsonObject: JsonObject = response.jsonObject 14 | return with(jsonObject) { 15 | OmdbResponse( 16 | getKey("Title"), 17 | getKey("Year"), 18 | getKey("Released"), 19 | getKey("Rated"), 20 | getKey("Runtime"), 21 | getKey("Genre"), 22 | getKey("Director"), 23 | getKey("Writer"), 24 | getKey("Actors"), 25 | getKey("Plot"), 26 | getKey("Language"), 27 | getKey("Country"), 28 | getKey("Awards"), 29 | getKey("Poster"), 30 | getKey("imdbID") 31 | ) 32 | } 33 | } 34 | 35 | private fun JsonObject.getKey(key: String): String { 36 | return get(key).content 37 | } 38 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/parser/TraktTvJsonParser.kt: -------------------------------------------------------------------------------- 1 | package domain.parser 2 | 3 | import kotlinx.serialization.json.JsonArray 4 | import kotlinx.serialization.json.JsonTreeParser 5 | import kotlinx.serialization.json.content 6 | 7 | internal object TraktTvJsonParser { 8 | 9 | fun parse(jsonString: String):List{ 10 | val response: JsonArray = JsonTreeParser(jsonString).readFully().jsonArray 11 | return response 12 | .map {it.jsonObject} 13 | .map { it.getObject("ids") } 14 | .map { it.get("imdb") } 15 | .map { it.content } 16 | } 17 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/domain/repository/MovieRepository.kt: -------------------------------------------------------------------------------- 1 | package domain.repository 2 | 3 | import domain.models.Movie 4 | 5 | internal interface MovieRepository { 6 | 7 | @ExperimentalUnsignedTypes 8 | suspend fun getMovieList(movieCount:UInt): List 9 | 10 | suspend fun getMovieById(id:String): Movie 11 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/presentation/base/BaseContract.kt: -------------------------------------------------------------------------------- 1 | package org.kotlin.mpp.mobile.presentation.base 2 | 3 | interface BaseContract { 4 | 5 | interface View 6 | 7 | interface Presenter { 8 | 9 | var view: V? 10 | 11 | fun onPresenterCreate(view: V) 12 | 13 | fun onDestroy() 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/presentation/base/BasePresenter.kt: -------------------------------------------------------------------------------- 1 | package presentation.base 2 | 3 | import domain.fetcher.CoroutineFetcher 4 | import domain.fetcher.result_listener.RequestType 5 | import domain.fetcher.result_listener.ResultListener 6 | import kotlinx.coroutines.CoroutineDispatcher 7 | import org.kotlin.mpp.mobile.presentation.base.BaseContract 8 | 9 | 10 | /** 11 | * 12 | * Created by Arman Chatikyan on 17 Oct 2018 13 | * 14 | */ 15 | 16 | internal abstract class BasePresenter(uiDispatcher: CoroutineDispatcher) : BaseContract.Presenter, 17 | ResultListener { 18 | 19 | private val fetcher: CoroutineFetcher by lazy { 20 | CoroutineFetcher(uiDispatcher) 21 | } 22 | 23 | override var view: V? = null 24 | 25 | override fun onPresenterCreate(view: V) { 26 | this.view = view 27 | } 28 | 29 | override fun onDestroy() { 30 | view = null 31 | fetcher.clear(this) 32 | } 33 | 34 | fun fetch(body: suspend () -> T, requestType: RequestType, success: (T) -> Unit) { 35 | fetcher.fetch(body, requestType, this, success) 36 | } 37 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/presentation/movie_detail/MovieDetailContract.kt: -------------------------------------------------------------------------------- 1 | package presentation.movie_detail 2 | 3 | import domain.models.Movie 4 | import org.kotlin.mpp.mobile.presentation.base.BaseContract 5 | 6 | 7 | /** 8 | * 9 | * Created by Arman Chatikyan on 17 Oct 2018 10 | * 11 | */ 12 | 13 | interface MovieDetailContract { 14 | 15 | interface View : BaseContract.View { 16 | 17 | fun onMovieReceive(movie: Movie) 18 | } 19 | 20 | interface Presenter : BaseContract.Presenter { 21 | 22 | fun fetchMovieById(id:String) 23 | } 24 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/presentation/movie_detail/MovieDetailPresenter.kt: -------------------------------------------------------------------------------- 1 | package presentation.movie_detail 2 | 3 | import domain.fetcher.result_listener.RequestType 4 | import domain.repository.MovieRepository 5 | import kotlinx.coroutines.CoroutineDispatcher 6 | import presentation.base.BasePresenter 7 | 8 | internal class MovieDetailPresenter(uiDispatcher: CoroutineDispatcher, private val movieRepository: MovieRepository) : 9 | BasePresenter(uiDispatcher), 10 | MovieDetailContract.Presenter { 11 | 12 | override fun fetchMovieById(id: String) { 13 | fetch({movieRepository.getMovieById(id)}, RequestType.GET_MOVIE_BY_ID) { 14 | view?.onMovieReceive(it) 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/presentation/movie_list/MovieListContract.kt: -------------------------------------------------------------------------------- 1 | package presentation.movie_list 2 | 3 | import domain.models.Movie 4 | import org.kotlin.mpp.mobile.presentation.base.BaseContract 5 | 6 | 7 | /** 8 | * 9 | * Created by Arman Chatikyan on 17 Oct 2018 10 | * 11 | */ 12 | 13 | interface MovieListContract { 14 | 15 | interface View : BaseContract.View { 16 | 17 | fun showLoading() 18 | 19 | fun hideLoading() 20 | 21 | fun showError(message: String?) 22 | 23 | fun onMovieListReceive(movieList: List) 24 | } 25 | 26 | interface Presenter : BaseContract.Presenter { 27 | 28 | @ExperimentalUnsignedTypes 29 | fun fetchMovieList(movieCount:UInt) 30 | } 31 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/presentation/movie_list/MovieListPresenter.kt: -------------------------------------------------------------------------------- 1 | package presentation.movie_list 2 | 3 | import domain.fetcher.result_listener.RequestType 4 | import domain.repository.MovieRepository 5 | import kotlinx.coroutines.CoroutineDispatcher 6 | import presentation.base.BasePresenter 7 | 8 | internal class MovieListPresenter(uiDispatcher: CoroutineDispatcher, private val movieRepository: MovieRepository) : 9 | BasePresenter(uiDispatcher), 10 | MovieListContract.Presenter { 11 | 12 | @ExperimentalUnsignedTypes 13 | override fun fetchMovieList(movieCount:UInt) { 14 | fetch({movieRepository.getMovieList(movieCount)}, RequestType.GET_POPULAR) { 15 | view?.hideLoading() 16 | view?.onMovieListReceive(it) 17 | } 18 | } 19 | 20 | override fun onRequestStart(requestType: RequestType) { 21 | super.onRequestStart(requestType) 22 | view?.showLoading() 23 | } 24 | 25 | override fun onRequestError(requestType: RequestType, throwable: Throwable?) { 26 | super.onRequestError(requestType, throwable) 27 | view?.showError(throwable?.message) 28 | view?.hideLoading() 29 | } 30 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/util/Constants.kt: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | 4 | /** 5 | * 6 | * Created by Arman Chatikyan on 17 Oct 2018 7 | * 8 | */ 9 | 10 | const val OMDB_URL = "www.omdbapi.com" 11 | const val OMDB_API_KEY = "5a90179d" 12 | 13 | const val TRAKT_TV_URL = "api.trakt.tv" 14 | const val TRAKT_TV_API_KEY = "077e2b30113120bbf9800f67d4da380276ee59aaebb9c0a8e4a6a75d80eb1b7b" 15 | 16 | 17 | -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/util/Logger.kt: -------------------------------------------------------------------------------- 1 | package org.kotlin.mpp.mobile 2 | 3 | interface Logger { 4 | 5 | fun log(message:String?) 6 | } -------------------------------------------------------------------------------- /SharedCode/src/commonMain/kotlin/util/common.kt: -------------------------------------------------------------------------------- 1 | package org.kotlin.mpp.mobile 2 | 3 | expect fun platformName(): String 4 | 5 | fun createApplicationScreenMessage(): String { 6 | return "Kotlin Rocks on ${platformName()}" 7 | } 8 | 9 | var logger: Logger? = null 10 | 11 | fun log(message: String) { 12 | logger?.log(message) 13 | } 14 | 15 | //Strings 16 | object Strings { 17 | const val alert_error_message = "Something went wrong" 18 | const val alert_positive_button_text = "Close" 19 | const val example_string_id = "Example text" 20 | const val user_hint = "Please add phone number to continue" 21 | } 22 | -------------------------------------------------------------------------------- /SharedCode/src/iOSMain/kotlin/MainLoopDispatcher.kt: -------------------------------------------------------------------------------- 1 | package org.kotlin.mpp.mobile 2 | 3 | import kotlinx.coroutines.CoroutineDispatcher 4 | import kotlinx.coroutines.Runnable 5 | import platform.Foundation.NSRunLoop 6 | import platform.Foundation.performBlock 7 | import kotlin.coroutines.CoroutineContext 8 | 9 | object MainLoopDispatcher: CoroutineDispatcher() { 10 | override fun dispatch(context: CoroutineContext, block: Runnable) { 11 | NSRunLoop.mainRunLoop().performBlock { 12 | block.run() 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /SharedCode/src/iOSMain/kotlin/actual.kt: -------------------------------------------------------------------------------- 1 | package org.kotlin.mpp.mobile 2 | 3 | 4 | import platform.UIKit.UIDevice 5 | import platform.UIKit.UIViewController 6 | 7 | actual fun platformName(): String { 8 | 9 | return UIDevice.currentDevice.systemName() + 10 | " " + 11 | UIDevice.currentDevice.systemVersion 12 | } 13 | -------------------------------------------------------------------------------- /SharedCode/src/iOSMain/kotlin/data/cache/MovieCache.kt: -------------------------------------------------------------------------------- 1 | package data.cache 2 | 3 | import domain.models.Movie 4 | 5 | 6 | /** 7 | * 8 | * Created by Arman Chatikyan on 17 Oct 2018 9 | * 10 | */ 11 | 12 | @ThreadLocal 13 | actual object MovieCache { 14 | 15 | @ThreadLocal 16 | actual val cache = mutableListOf() 17 | 18 | actual fun cache(movieList: List) { 19 | cache.addAll(movieList) 20 | } 21 | } -------------------------------------------------------------------------------- /android/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | apply plugin: 'kotlinx-serialization' 5 | 6 | android { 7 | compileSdkVersion 28 8 | defaultConfig { 9 | applicationId "io.github.armcha.kotlinmultiplatformexample" 10 | minSdkVersion 21 11 | targetSdkVersion 28 12 | versionCode 1 13 | versionName "1.0" 14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | debug{ 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | } 27 | 28 | dependencies { 29 | implementation fileTree(dir: 'libs', include: ['*.jar']) 30 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 31 | implementation 'com.android.support:appcompat-v7:28.0.0' 32 | implementation 'com.android.support:design:28.0.0' 33 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 34 | implementation 'com.squareup.picasso:picasso:2.71828' 35 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" 36 | implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" 37 | implementation "io.ktor:ktor-client-json-jvm:$ktor_version" 38 | implementation "io.ktor:ktor-client-core-jvm:$ktor_version" 39 | implementation project(':SharedCode') 40 | testImplementation 'junit:junit:4.12' 41 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 42 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 43 | } 44 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /android/app/src/androidTest/java/io/github/armcha/kotlinmultiplatformexample/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("io.github.armcha.kotlinmultiplatformexample", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/github/armcha/kotlinmultiplatformexample/App.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample 2 | 3 | import android.app.Application 4 | import io.github.armcha.kotlinmultiplatformexample.util.PlatformLogger 5 | import org.kotlin.mpp.mobile.logger 6 | 7 | 8 | /** 9 | * 10 | * Created by Arman Chatikyan on 17 Oct 2018 11 | * 12 | */ 13 | 14 | class App : Application() { 15 | 16 | override fun onCreate() { 17 | super.onCreate() 18 | logger = PlatformLogger() 19 | } 20 | } -------------------------------------------------------------------------------- /android/app/src/main/java/io/github/armcha/kotlinmultiplatformexample/ui/BaseActivity.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample.ui 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import org.kotlin.mpp.mobile.presentation.base.BaseContract 6 | 7 | abstract class BaseActivity> : AppCompatActivity(), 8 | BaseContract.View { 9 | 10 | abstract val presenter: P 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | presenter.onPresenterCreate(this as V) 15 | } 16 | 17 | override fun onDestroy() { 18 | presenter.onDestroy() 19 | super.onDestroy() 20 | } 21 | } -------------------------------------------------------------------------------- /android/app/src/main/java/io/github/armcha/kotlinmultiplatformexample/ui/MovieDetailActivity.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample.ui 2 | 3 | import android.app.Activity 4 | import android.content.Intent 5 | import android.os.Bundle 6 | import com.squareup.picasso.Picasso 7 | import di.Injections 8 | import domain.models.Movie 9 | import io.github.armcha.kotlinmultiplatformexample.R 10 | import kotlinx.android.synthetic.main.activity_movie_detail.* 11 | import kotlinx.coroutines.Dispatchers 12 | import presentation.movie_detail.MovieDetailContract 13 | 14 | 15 | const val MOVIE_ID_KEY = "movieId" 16 | 17 | class MovieDetailActivity : BaseActivity(), MovieDetailContract.View { 18 | 19 | override val presenter: MovieDetailContract.Presenter by lazy { 20 | Injections().provideMovieDetailPresenter(Dispatchers.Main) 21 | } 22 | 23 | override fun onCreate(savedInstanceState: Bundle?) { 24 | super.onCreate(savedInstanceState) 25 | setContentView(R.layout.activity_movie_detail) 26 | val movieId = intent.getStringExtra(MOVIE_ID_KEY) 27 | presenter.fetchMovieById(movieId) 28 | } 29 | 30 | override fun onMovieReceive(movie: Movie) { 31 | Picasso.get() 32 | .load(movie.poster) 33 | .into(moviePoster) 34 | movieTitle.text = movie.title 35 | movieDescription.text = movie.plot 36 | cast.text = movie.actors 37 | date.text = movie.released 38 | } 39 | } 40 | 41 | fun Activity.startMovieActivity(movieId: String) { 42 | Intent(this, MovieDetailActivity::class.java) 43 | .apply { putExtra(MOVIE_ID_KEY, movieId) } 44 | .also { startActivity(it) } 45 | } 46 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/github/armcha/kotlinmultiplatformexample/ui/MovieListActivity.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample.ui 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AlertDialog 5 | import android.view.View 6 | import di.Injections 7 | import domain.models.Movie 8 | import io.github.armcha.kotlinmultiplatformexample.R 9 | import kotlinx.android.synthetic.main.activity_main.* 10 | import kotlinx.coroutines.Dispatchers 11 | import org.kotlin.mpp.mobile.Strings 12 | import presentation.movie_list.MovieListContract 13 | 14 | 15 | class MovieListActivity : BaseActivity(), MovieListContract.View { 16 | 17 | override val presenter: MovieListContract.Presenter by lazy { 18 | Injections().provideMovieListPresenter(Dispatchers.Main) 19 | } 20 | 21 | override fun onCreate(savedInstanceState: Bundle?) { 22 | super.onCreate(savedInstanceState) 23 | setContentView(R.layout.activity_main) 24 | presenter.fetchMovieList(50U) 25 | } 26 | 27 | override fun showError(message: String?) { 28 | AlertDialog.Builder(this).setMessage(Strings.alert_error_message) 29 | .setPositiveButton(Strings.alert_positive_button_text, null) 30 | .create() 31 | .show() 32 | } 33 | 34 | override fun onMovieListReceive(movieList: List) { 35 | movieRecyclerView setUpWith MovieListAdapter(movieList, object : ItemCLickListener { 36 | override fun onItemClick(movieId: String) { 37 | startMovieActivity(movieId) 38 | } 39 | }) 40 | } 41 | 42 | override fun showLoading() { 43 | progressBar.visibility = View.VISIBLE 44 | } 45 | 46 | override fun hideLoading() { 47 | progressBar.visibility = View.GONE 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/github/armcha/kotlinmultiplatformexample/ui/MovieListAdapter.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample.ui 2 | 3 | import android.support.v7.widget.LinearLayoutManager 4 | import android.support.v7.widget.RecyclerView 5 | import android.view.LayoutInflater 6 | import android.view.View 7 | import android.view.ViewGroup 8 | import com.squareup.picasso.Picasso 9 | import domain.models.Movie 10 | import io.github.armcha.kotlinmultiplatformexample.R 11 | import kotlinx.android.synthetic.main.item_view.view.* 12 | 13 | class MovieListAdapter(private val items: List, private val itemCLickListener: ItemCLickListener) 14 | : RecyclerView.Adapter() { 15 | 16 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { 17 | val holder = ViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_view, parent, false)) 18 | holder.itemView.setOnClickListener { 19 | val position = holder.adapterPosition 20 | itemCLickListener.onItemClick(items[position].id) 21 | } 22 | return holder 23 | } 24 | 25 | override fun getItemCount(): Int { 26 | return items.size 27 | } 28 | 29 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { 30 | val item = items[position] 31 | holder.bind(item) 32 | } 33 | 34 | class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { 35 | 36 | fun bind(movie: Movie) { 37 | itemView.movieName.text = movie.title 38 | itemView.movieDescription.text = movie.plot 39 | Picasso.get() 40 | .load(movie.poster) 41 | .into(itemView.imageView) 42 | } 43 | } 44 | } 45 | 46 | interface ItemCLickListener { 47 | 48 | fun onItemClick(movieId: String) 49 | } 50 | 51 | infix fun RecyclerView.setUpWith(movieListAdapter: MovieListAdapter){ 52 | adapter = movieListAdapter 53 | layoutManager = LinearLayoutManager(context) 54 | } -------------------------------------------------------------------------------- /android/app/src/main/java/io/github/armcha/kotlinmultiplatformexample/util/PlatformLogger.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample.util 2 | 3 | import android.util.Log 4 | import org.kotlin.mpp.mobile.Logger 5 | 6 | 7 | /** 8 | * 9 | * Created by Arman Chatikyan on 17 Oct 2018 10 | * 11 | */ 12 | 13 | class PlatformLogger : Logger { 14 | 15 | override fun log(message: String?) { 16 | Log.e("Tag", message) 17 | } 18 | } -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/dark_knight.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/drawable/dark_knight.jpg -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 27 | 28 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/activity_movie_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 21 | 22 | 31 | 32 | 33 | 43 | 44 | 58 | 59 | 70 | 71 | 80 | 81 | 92 | 93 | 102 | 103 | -------------------------------------------------------------------------------- /android/app/src/main/res/layout/item_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 | 30 | 31 | 32 | 33 | 45 | 46 | 50 | 51 | 60 | 61 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #fff 4 | #000 5 | #d50000 6 | #fff 7 | #000 8 | #969696 9 | #90a4ae 10 | #d50000 11 | #424242 12 | #311b92 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | KotlinMultiplatformExample 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/app/src/test/java/io/github/armcha/kotlinmultiplatformexample/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.armcha.kotlinmultiplatformexample 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | maven { url "http://kotlin.bintray.com/kotlin-dev" } 4 | maven { url "http://kotlin.bintray.com/kotlin-eap" } 5 | maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } 6 | maven { url "http://kotlin.bintray.com/kotlin-dev" } 7 | maven { url "https://kotlin.bintray.com/kotlinx" } 8 | maven { url 'https://dl.bintray.com/jetbrains/kotlin-native-dependencies' } 9 | maven { url "https://dl.bintray.com/kotlin/ktor/" } 10 | maven { url "https://dl.bintray.com/kotlin/kotlinx/" } 11 | maven { url 'https://kotlin.bintray.com/kotlinx' } 12 | maven { url 'https://dl.bintray.com/kotlin/ktor' } 13 | jcenter() 14 | google() 15 | } 16 | dependencies { 17 | classpath 'com.android.tools.build:gradle:3.2.1' 18 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 19 | } 20 | } 21 | allprojects { 22 | repositories { 23 | google() 24 | jcenter() 25 | } 26 | } 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | 31 | dependencies { 32 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | buildscript { 3 | repositories { 4 | maven { url "http://kotlin.bintray.com/kotlin-eap" } 5 | maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } 6 | maven { url "http://kotlin.bintray.com/kotlin-dev" } 7 | maven { url "https://kotlin.bintray.com/kotlinx" } 8 | maven { url 'https://dl.bintray.com/jetbrains/kotlin-native-dependencies' } 9 | maven { url "https://dl.bintray.com/kotlin/ktor/" } 10 | maven { url "https://dl.bintray.com/kotlin/kotlinx/" } 11 | maven { url 'https://kotlin.bintray.com/kotlinx' } 12 | maven { url 'https://dl.bintray.com/kotlin/ktor' } 13 | maven { url "https://dl.bintray.com/kotlin/kotlinx/kotlinx.serialization.runtime" } 14 | 15 | google() 16 | jcenter() 17 | } 18 | dependencies { 19 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 20 | classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" 21 | } 22 | } 23 | repositories { 24 | maven { url "http://kotlin.bintray.com/kotlin-eap" } 25 | maven { url "https://dl.bintray.com/kotlin/kotlinx/kotlinx.serialization.runtime" } 26 | maven { url "http://kotlin.bintray.com/kotlin-dev" } 27 | maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } 28 | maven { url "https://kotlin.bintray.com/kotlinx" } 29 | maven { url "https://dl.bintray.com/sargunster/maven" } 30 | maven { url 'https://dl.bintray.com/jetbrains/kotlin-native-dependencies' } 31 | maven { url "https://dl.bintray.com/kotlin/squash" } 32 | maven { url "https://dl.bintray.com/russhwolf/multiplatform-settings" } 33 | maven { url "https://dl.bintray.com/kotlin/ktor/" } 34 | maven { url "https://dl.bintray.com/kotlin/kotlinx/" } 35 | maven { url 'https://kotlin.bintray.com/kotlinx' } 36 | maven { url 'https://dl.bintray.com/kotlin/ktor' } 37 | 38 | google() 39 | jcenter() 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /diagram/android.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/diagram/android.gif -------------------------------------------------------------------------------- /diagram/ios.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/diagram/ios.gif -------------------------------------------------------------------------------- /diagram/structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/diagram/structure.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | #kotlin.code.style=official 16 | # gradle 17 | org.gradle.parallel=true 18 | 19 | # kotlin 20 | kotlin_version=1.3.0 21 | kotlin.incremental.multiplatform = true 22 | # kotlin libraries 23 | coroutines_version=1.0.0 24 | 25 | ktor_version=1.0.0-beta-3 26 | serialization_version=0.9.0 27 | # android 28 | INCLUDE_ANDROID=true 29 | gradle_android_version=3.1.3 30 | anko_version=0.10.5 31 | # backend 32 | squash_version=0.2.3 33 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Oct 20 16:00:19 AMT 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 235964F12170DE0500B423BD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 235964F02170DE0500B423BD /* AppDelegate.swift */; }; 11 | 235964F32170DE0500B423BD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 235964F22170DE0500B423BD /* ViewController.swift */; }; 12 | 235964F62170DE0500B423BD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 235964F42170DE0500B423BD /* Main.storyboard */; }; 13 | 235964F82170DE0F00B423BD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 235964F72170DE0F00B423BD /* Assets.xcassets */; }; 14 | 235964FB2170DE0F00B423BD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 235964F92170DE0F00B423BD /* LaunchScreen.storyboard */; }; 15 | 239B9DF22174CB1B00A8289C /* SharedCode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 239B9DF12174CB1B00A8289C /* SharedCode.framework */; }; 16 | 239B9DF32174CB1B00A8289C /* SharedCode.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 239B9DF12174CB1B00A8289C /* SharedCode.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 23ACBBAB2175F8DE006DAE7C /* UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23ACBBAA2175F8DE006DAE7C /* UI.swift */; }; 18 | 23ACBBAD21760740006DAE7C /* PlatformLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23ACBBAC21760740006DAE7C /* PlatformLogger.swift */; }; 19 | 23B1AA6921786D9600FBEF13 /* BaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23B1AA6821786D9600FBEF13 /* BaseViewController.swift */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXCopyFilesBuildPhase section */ 23 | 239B9DF42174CB1B00A8289C /* Embed Frameworks */ = { 24 | isa = PBXCopyFilesBuildPhase; 25 | buildActionMask = 2147483647; 26 | dstPath = ""; 27 | dstSubfolderSpec = 10; 28 | files = ( 29 | 239B9DF32174CB1B00A8289C /* SharedCode.framework in Embed Frameworks */, 30 | ); 31 | name = "Embed Frameworks"; 32 | runOnlyForDeploymentPostprocessing = 0; 33 | }; 34 | /* End PBXCopyFilesBuildPhase section */ 35 | 36 | /* Begin PBXFileReference section */ 37 | 235964ED2170DE0500B423BD /* KotlinMultiplatformIos.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KotlinMultiplatformIos.app; sourceTree = BUILT_PRODUCTS_DIR; }; 38 | 235964F02170DE0500B423BD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 235964F22170DE0500B423BD /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 40 | 235964F52170DE0500B423BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 235964F72170DE0F00B423BD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 42 | 235964FA2170DE0F00B423BD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 43 | 235964FC2170DE0F00B423BD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 239B9DF12174CB1B00A8289C /* SharedCode.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SharedCode.framework; path = "../../SharedCode/build/xcode-frameworks/SharedCode.framework"; sourceTree = ""; }; 45 | 23ACBBAA2175F8DE006DAE7C /* UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UI.swift; sourceTree = ""; }; 46 | 23ACBBAC21760740006DAE7C /* PlatformLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlatformLogger.swift; sourceTree = ""; }; 47 | 23B1AA6821786D9600FBEF13 /* BaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseViewController.swift; sourceTree = ""; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | 235964EA2170DE0500B423BD /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | 239B9DF22174CB1B00A8289C /* SharedCode.framework in Frameworks */, 56 | ); 57 | runOnlyForDeploymentPostprocessing = 0; 58 | }; 59 | /* End PBXFrameworksBuildPhase section */ 60 | 61 | /* Begin PBXGroup section */ 62 | 235964E42170DE0400B423BD = { 63 | isa = PBXGroup; 64 | children = ( 65 | 239B9DF12174CB1B00A8289C /* SharedCode.framework */, 66 | 235964EF2170DE0500B423BD /* KotlinMultiplatformIos */, 67 | 235964EE2170DE0500B423BD /* Products */, 68 | ); 69 | sourceTree = ""; 70 | }; 71 | 235964EE2170DE0500B423BD /* Products */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 235964ED2170DE0500B423BD /* KotlinMultiplatformIos.app */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | 235964EF2170DE0500B423BD /* KotlinMultiplatformIos */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 235964F02170DE0500B423BD /* AppDelegate.swift */, 83 | 235964F22170DE0500B423BD /* ViewController.swift */, 84 | 235964F42170DE0500B423BD /* Main.storyboard */, 85 | 235964F72170DE0F00B423BD /* Assets.xcassets */, 86 | 235964F92170DE0F00B423BD /* LaunchScreen.storyboard */, 87 | 235964FC2170DE0F00B423BD /* Info.plist */, 88 | 23ACBBAA2175F8DE006DAE7C /* UI.swift */, 89 | 23ACBBAC21760740006DAE7C /* PlatformLogger.swift */, 90 | 23B1AA6821786D9600FBEF13 /* BaseViewController.swift */, 91 | ); 92 | path = KotlinMultiplatformIos; 93 | sourceTree = ""; 94 | }; 95 | /* End PBXGroup section */ 96 | 97 | /* Begin PBXNativeTarget section */ 98 | 235964EC2170DE0500B423BD /* KotlinMultiplatformIos */ = { 99 | isa = PBXNativeTarget; 100 | buildConfigurationList = 235964FF2170DE0F00B423BD /* Build configuration list for PBXNativeTarget "KotlinMultiplatformIos" */; 101 | buildPhases = ( 102 | 235965062170DFE500B423BD /* Run Script */, 103 | 235964E92170DE0500B423BD /* Sources */, 104 | 235964EA2170DE0500B423BD /* Frameworks */, 105 | 235964EB2170DE0500B423BD /* Resources */, 106 | 239B9DF42174CB1B00A8289C /* Embed Frameworks */, 107 | ); 108 | buildRules = ( 109 | ); 110 | dependencies = ( 111 | ); 112 | name = KotlinMultiplatformIos; 113 | productName = KotlinMultiplatformIos; 114 | productReference = 235964ED2170DE0500B423BD /* KotlinMultiplatformIos.app */; 115 | productType = "com.apple.product-type.application"; 116 | }; 117 | /* End PBXNativeTarget section */ 118 | 119 | /* Begin PBXProject section */ 120 | 235964E52170DE0400B423BD /* Project object */ = { 121 | isa = PBXProject; 122 | attributes = { 123 | LastSwiftUpdateCheck = 1000; 124 | LastUpgradeCheck = 1000; 125 | ORGANIZATIONNAME = "V-Mobile"; 126 | TargetAttributes = { 127 | 235964EC2170DE0500B423BD = { 128 | CreatedOnToolsVersion = 10.0; 129 | }; 130 | }; 131 | }; 132 | buildConfigurationList = 235964E82170DE0400B423BD /* Build configuration list for PBXProject "KotlinMultiplatformIos" */; 133 | compatibilityVersion = "Xcode 9.3"; 134 | developmentRegion = en; 135 | hasScannedForEncodings = 0; 136 | knownRegions = ( 137 | en, 138 | Base, 139 | ); 140 | mainGroup = 235964E42170DE0400B423BD; 141 | productRefGroup = 235964EE2170DE0500B423BD /* Products */; 142 | projectDirPath = ""; 143 | projectRoot = ""; 144 | targets = ( 145 | 235964EC2170DE0500B423BD /* KotlinMultiplatformIos */, 146 | ); 147 | }; 148 | /* End PBXProject section */ 149 | 150 | /* Begin PBXResourcesBuildPhase section */ 151 | 235964EB2170DE0500B423BD /* Resources */ = { 152 | isa = PBXResourcesBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | 235964FB2170DE0F00B423BD /* LaunchScreen.storyboard in Resources */, 156 | 235964F82170DE0F00B423BD /* Assets.xcassets in Resources */, 157 | 235964F62170DE0500B423BD /* Main.storyboard in Resources */, 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | /* End PBXResourcesBuildPhase section */ 162 | 163 | /* Begin PBXShellScriptBuildPhase section */ 164 | 235965062170DFE500B423BD /* Run Script */ = { 165 | isa = PBXShellScriptBuildPhase; 166 | buildActionMask = 2147483647; 167 | files = ( 168 | ); 169 | inputFileListPaths = ( 170 | ); 171 | inputPaths = ( 172 | ); 173 | name = "Run Script"; 174 | outputFileListPaths = ( 175 | ); 176 | outputPaths = ( 177 | ); 178 | runOnlyForDeploymentPostprocessing = 0; 179 | shellPath = /bin/sh; 180 | shellScript = "\ncd \"/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/build/xcode-frameworks\"\n./gradlew :SharedCode:packForXCode\n"; 181 | }; 182 | /* End PBXShellScriptBuildPhase section */ 183 | 184 | /* Begin PBXSourcesBuildPhase section */ 185 | 235964E92170DE0500B423BD /* Sources */ = { 186 | isa = PBXSourcesBuildPhase; 187 | buildActionMask = 2147483647; 188 | files = ( 189 | 23B1AA6921786D9600FBEF13 /* BaseViewController.swift in Sources */, 190 | 23ACBBAD21760740006DAE7C /* PlatformLogger.swift in Sources */, 191 | 235964F32170DE0500B423BD /* ViewController.swift in Sources */, 192 | 235964F12170DE0500B423BD /* AppDelegate.swift in Sources */, 193 | 23ACBBAB2175F8DE006DAE7C /* UI.swift in Sources */, 194 | ); 195 | runOnlyForDeploymentPostprocessing = 0; 196 | }; 197 | /* End PBXSourcesBuildPhase section */ 198 | 199 | /* Begin PBXVariantGroup section */ 200 | 235964F42170DE0500B423BD /* Main.storyboard */ = { 201 | isa = PBXVariantGroup; 202 | children = ( 203 | 235964F52170DE0500B423BD /* Base */, 204 | ); 205 | name = Main.storyboard; 206 | sourceTree = ""; 207 | }; 208 | 235964F92170DE0F00B423BD /* LaunchScreen.storyboard */ = { 209 | isa = PBXVariantGroup; 210 | children = ( 211 | 235964FA2170DE0F00B423BD /* Base */, 212 | ); 213 | name = LaunchScreen.storyboard; 214 | sourceTree = ""; 215 | }; 216 | /* End PBXVariantGroup section */ 217 | 218 | /* Begin XCBuildConfiguration section */ 219 | 235964FD2170DE0F00B423BD /* Debug */ = { 220 | isa = XCBuildConfiguration; 221 | buildSettings = { 222 | ALWAYS_SEARCH_USER_PATHS = NO; 223 | CLANG_ANALYZER_NONNULL = YES; 224 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 225 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 226 | CLANG_CXX_LIBRARY = "libc++"; 227 | CLANG_ENABLE_MODULES = YES; 228 | CLANG_ENABLE_OBJC_ARC = YES; 229 | CLANG_ENABLE_OBJC_WEAK = YES; 230 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 231 | CLANG_WARN_BOOL_CONVERSION = YES; 232 | CLANG_WARN_COMMA = YES; 233 | CLANG_WARN_CONSTANT_CONVERSION = YES; 234 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 236 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 237 | CLANG_WARN_EMPTY_BODY = YES; 238 | CLANG_WARN_ENUM_CONVERSION = YES; 239 | CLANG_WARN_INFINITE_RECURSION = YES; 240 | CLANG_WARN_INT_CONVERSION = YES; 241 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 242 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 243 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 244 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 245 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 246 | CLANG_WARN_STRICT_PROTOTYPES = YES; 247 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 248 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 249 | CLANG_WARN_UNREACHABLE_CODE = YES; 250 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 251 | CODE_SIGN_IDENTITY = "iPhone Developer"; 252 | COPY_PHASE_STRIP = NO; 253 | DEBUG_INFORMATION_FORMAT = dwarf; 254 | ENABLE_STRICT_OBJC_MSGSEND = YES; 255 | ENABLE_TESTABILITY = YES; 256 | GCC_C_LANGUAGE_STANDARD = gnu11; 257 | GCC_DYNAMIC_NO_PIC = NO; 258 | GCC_NO_COMMON_BLOCKS = YES; 259 | GCC_OPTIMIZATION_LEVEL = 0; 260 | GCC_PREPROCESSOR_DEFINITIONS = ( 261 | "DEBUG=1", 262 | "$(inherited)", 263 | ); 264 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 265 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 266 | GCC_WARN_UNDECLARED_SELECTOR = YES; 267 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 268 | GCC_WARN_UNUSED_FUNCTION = YES; 269 | GCC_WARN_UNUSED_VARIABLE = YES; 270 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 271 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 272 | MTL_FAST_MATH = YES; 273 | ONLY_ACTIVE_ARCH = YES; 274 | SDKROOT = iphoneos; 275 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 276 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 277 | }; 278 | name = Debug; 279 | }; 280 | 235964FE2170DE0F00B423BD /* Release */ = { 281 | isa = XCBuildConfiguration; 282 | buildSettings = { 283 | ALWAYS_SEARCH_USER_PATHS = NO; 284 | CLANG_ANALYZER_NONNULL = YES; 285 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 286 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 287 | CLANG_CXX_LIBRARY = "libc++"; 288 | CLANG_ENABLE_MODULES = YES; 289 | CLANG_ENABLE_OBJC_ARC = YES; 290 | CLANG_ENABLE_OBJC_WEAK = YES; 291 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 292 | CLANG_WARN_BOOL_CONVERSION = YES; 293 | CLANG_WARN_COMMA = YES; 294 | CLANG_WARN_CONSTANT_CONVERSION = YES; 295 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 296 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 297 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 298 | CLANG_WARN_EMPTY_BODY = YES; 299 | CLANG_WARN_ENUM_CONVERSION = YES; 300 | CLANG_WARN_INFINITE_RECURSION = YES; 301 | CLANG_WARN_INT_CONVERSION = YES; 302 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 303 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 304 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 305 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 306 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 307 | CLANG_WARN_STRICT_PROTOTYPES = YES; 308 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 309 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 310 | CLANG_WARN_UNREACHABLE_CODE = YES; 311 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 312 | CODE_SIGN_IDENTITY = "iPhone Developer"; 313 | COPY_PHASE_STRIP = NO; 314 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 315 | ENABLE_NS_ASSERTIONS = NO; 316 | ENABLE_STRICT_OBJC_MSGSEND = YES; 317 | GCC_C_LANGUAGE_STANDARD = gnu11; 318 | GCC_NO_COMMON_BLOCKS = YES; 319 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 320 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 321 | GCC_WARN_UNDECLARED_SELECTOR = YES; 322 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 323 | GCC_WARN_UNUSED_FUNCTION = YES; 324 | GCC_WARN_UNUSED_VARIABLE = YES; 325 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 326 | MTL_ENABLE_DEBUG_INFO = NO; 327 | MTL_FAST_MATH = YES; 328 | SDKROOT = iphoneos; 329 | SWIFT_COMPILATION_MODE = wholemodule; 330 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 331 | VALIDATE_PRODUCT = YES; 332 | }; 333 | name = Release; 334 | }; 335 | 235965002170DE0F00B423BD /* Debug */ = { 336 | isa = XCBuildConfiguration; 337 | buildSettings = { 338 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 339 | CODE_SIGN_STYLE = Automatic; 340 | DEVELOPMENT_TEAM = F3B6CRF6JT; 341 | ENABLE_BITCODE = NO; 342 | FRAMEWORK_SEARCH_PATHS = "/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/build/xcode-frameworks"; 343 | INFOPLIST_FILE = KotlinMultiplatformIos/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = ( 345 | "$(inherited)", 346 | "@executable_path/Frameworks", 347 | ); 348 | PRODUCT_BUNDLE_IDENTIFIER = test.KotlinMultiplatformIos; 349 | PRODUCT_NAME = "$(TARGET_NAME)"; 350 | SWIFT_VERSION = 4.2; 351 | TARGETED_DEVICE_FAMILY = "1,2"; 352 | }; 353 | name = Debug; 354 | }; 355 | 235965012170DE0F00B423BD /* Release */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 359 | CODE_SIGN_STYLE = Automatic; 360 | DEVELOPMENT_TEAM = F3B6CRF6JT; 361 | ENABLE_BITCODE = NO; 362 | FRAMEWORK_SEARCH_PATHS = "/Users/v-mobile/Desktop/KotlinMultiplatformTests/SharedCode/build/xcode-frameworks"; 363 | INFOPLIST_FILE = KotlinMultiplatformIos/Info.plist; 364 | LD_RUNPATH_SEARCH_PATHS = ( 365 | "$(inherited)", 366 | "@executable_path/Frameworks", 367 | ); 368 | PRODUCT_BUNDLE_IDENTIFIER = test.KotlinMultiplatformIos; 369 | PRODUCT_NAME = "$(TARGET_NAME)"; 370 | SWIFT_VERSION = 4.2; 371 | TARGETED_DEVICE_FAMILY = "1,2"; 372 | }; 373 | name = Release; 374 | }; 375 | /* End XCBuildConfiguration section */ 376 | 377 | /* Begin XCConfigurationList section */ 378 | 235964E82170DE0400B423BD /* Build configuration list for PBXProject "KotlinMultiplatformIos" */ = { 379 | isa = XCConfigurationList; 380 | buildConfigurations = ( 381 | 235964FD2170DE0F00B423BD /* Debug */, 382 | 235964FE2170DE0F00B423BD /* Release */, 383 | ); 384 | defaultConfigurationIsVisible = 0; 385 | defaultConfigurationName = Release; 386 | }; 387 | 235964FF2170DE0F00B423BD /* Build configuration list for PBXNativeTarget "KotlinMultiplatformIos" */ = { 388 | isa = XCConfigurationList; 389 | buildConfigurations = ( 390 | 235965002170DE0F00B423BD /* Debug */, 391 | 235965012170DE0F00B423BD /* Release */, 392 | ); 393 | defaultConfigurationIsVisible = 0; 394 | defaultConfigurationName = Release; 395 | }; 396 | /* End XCConfigurationList section */ 397 | }; 398 | rootObject = 235964E52170DE0400B423BD /* Project object */; 399 | } 400 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos.xcodeproj/project.xcworkspace/xcuserdata/v-mobile.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armcha/KotlinMultiplatformSample/9ea9fdc880084cdf94f491222e39ce1f0c9eea21/ios/KotlinMultiplatformIos/KotlinMultiplatformIos.xcodeproj/project.xcworkspace/xcuserdata/v-mobile.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos.xcodeproj/xcuserdata/v-mobile.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | KotlinMultiplatformIos.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SharedCode 3 | 4 | @UIApplicationMain 5 | class AppDelegate: UIResponder, UIApplicationDelegate { 6 | 7 | var window: UIWindow? 8 | 9 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 10 | return true 11 | } 12 | 13 | func applicationWillResignActive(_ application: UIApplication) { 14 | // 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. 15 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 16 | } 17 | 18 | func applicationDidEnterBackground(_ application: UIApplication) { 19 | // 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. 20 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 21 | } 22 | 23 | func applicationWillEnterForeground(_ application: UIApplication) { 24 | // 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. 25 | } 26 | 27 | func applicationDidBecomeActive(_ application: UIApplication) { 28 | // 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. 29 | } 30 | 31 | func applicationWillTerminate(_ application: UIApplication) { 32 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 33 | } 34 | 35 | 36 | } 37 | 38 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/BaseViewController.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | import SharedCode 4 | import UIKit 5 | 6 | class BaseViewController : 7 | UIViewController,BaseContractView{ 8 | 9 | lazy var presenter:P = [P]() as! P 10 | 11 | override func viewDidLoad() { 12 | presenter.onPresenterCreate(view: self) 13 | } 14 | 15 | deinit{ 16 | presenter.onDestroy() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/PlatformLogger.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | import SharedCode 4 | 5 | class PlatformLogger:Logger { 6 | func log(message: String?) { 7 | print(message) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/UI.swift: -------------------------------------------------------------------------------- 1 | 2 | import Foundation 3 | import UIKit 4 | import SharedCode 5 | 6 | public class UI: Kotlinx_coroutines_core_nativeCoroutineDispatcher { 7 | override public func dispatch(context: KotlinCoroutineContext, block: Kotlinx_coroutines_core_nativeRunnable) { 8 | DispatchQueue.main.async { 9 | block.run() 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /ios/KotlinMultiplatformIos/KotlinMultiplatformIos/ViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import SharedCode 3 | 4 | class ViewController: BaseViewController, 5 | MovieListContractView, UITableViewDelegate, UITableViewDataSource { 6 | 7 | @IBOutlet weak var indicator: UIActivityIndicatorView! 8 | @IBOutlet weak var tableView: UITableView! 9 | 10 | var movies:[Movie] = [] 11 | let cellIdentifier = "MovieCellIdentifier" 12 | 13 | override lazy var presenter: MovieListContractPresenter = Injections().provideMovieListPresenter(uiDispatcher: UI()) 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | presenter.fetchMovieList(movieCount: UInt32(20)) 18 | 19 | self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellIdentifier) 20 | tableView.delegate = self 21 | tableView.dataSource = self 22 | } 23 | 24 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 25 | return movies.count 26 | } 27 | 28 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 29 | let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) 30 | let movie = movies[indexPath.row] 31 | cell.textLabel?.text = movie.title 32 | return cell 33 | } 34 | 35 | func showLoading() { 36 | print("ShowLoading") 37 | indicator.startAnimating() 38 | } 39 | 40 | func hideLoading() { 41 | indicator.isHidden = true 42 | print("HideLoading") 43 | } 44 | 45 | func showError(message: String?) { 46 | let alert = UIAlertController(title: Strings().alert_error_message, message: "", 47 | preferredStyle: .alert) 48 | 49 | alert.addAction(UIAlertAction(title: Strings().alert_positive_button_text, 50 | style: .default, handler: nil)) 51 | self.present(alert, animated: true) 52 | } 53 | 54 | func onMovieListReceive(movieList: [Movie]) { 55 | movies = movieList 56 | tableView.isHidden = false 57 | tableView.reloadData() 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | enableFeaturePreview('GRADLE_METADATA') 2 | 3 | include 'SharedCode' 4 | include 'android' 5 | include 'android:app' 6 | --------------------------------------------------------------------------------