├── .gitignore
├── LICENSE
├── README.md
├── android
├── build.gradle
├── gradle.properties
└── mobile
│ ├── build.gradle
│ ├── deploy_crashlytics.sh
│ ├── google-services.json
│ ├── proguard-rules.pro
│ └── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── marcinmoskala
│ │ └── mkpexample
│ │ └── QuotationsActivity.kt
│ └── res
│ ├── drawable
│ ├── launcher_circle_icon.png
│ └── launcher_icon.png
│ ├── layout
│ └── activity_quotations.xml
│ └── values
│ └── strings.xml
├── build.gradle
├── common-js
└── build.gradle
├── common-jvm
└── build.gradle
├── common-native
└── build.gradle
├── common
├── build.gradle
└── src
│ ├── main
│ └── kotlin
│ │ └── com
│ │ └── marcinmoskala
│ │ ├── data
│ │ └── Quote.kt
│ │ ├── presentation
│ │ └── QuotationPresenter.kt
│ │ ├── repository
│ │ ├── QuotationRepository.kt
│ │ └── QuotationRepositoryImpl.kt
│ │ └── view
│ │ └── QuotationView.kt
│ └── test
│ └── kotlin
│ └── com
│ └── marcinmoskala
│ └── QuotePresenterUnitTest.kt
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios-classic
├── ExampleMKP.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcuserdata
│ │ │ └── marcin.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcuserdata
│ │ └── marcin.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── ExampleMKP
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── ViewController.swift
├── ios.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── xcuserdata
│ │ └── marcin.xcuserdatad
│ │ ├── UserInterfaceState.xcuserstate
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── xcuserdata
│ └── marcin.xcuserdatad
│ └── xcschemes
│ ├── ios.xcscheme
│ └── xcschememanagement.plist
├── ios
├── .idea
│ ├── codeStyles
│ │ └── Project.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── workspace.xml
│ └── xcode.xml
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Info.plist
├── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── ios.xcodeproj
│ └── xcuserdata
│ │ └── marcin.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── src
│ └── main
│ └── kotlin
│ ├── AppDelegate.kt
│ ├── ViewController.kt
│ └── main.kt
├── settings.gradle
├── web-vanilla
├── build.gradle
├── css
│ └── style.css
└── main.html
└── web
├── build.gradle
└── src
└── main
├── kotlin
└── com
│ └── marcinmoskala
│ ├── components
│ └── QuotesComponent.kt
│ └── main.kt
└── web
├── css
└── style.css
└── index.html
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | .gradle
3 | .idea/*
4 | out
5 | *.iml
6 | .directory
7 | node_modules
8 | local.properties
9 | /backend/static/*
10 | keystore.jks
11 | android/mobile/release/*
12 |
13 | .DS_Store
14 | .externalNativeBuild
15 | .database
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Start
2 |
3 | # Known problems
4 |
5 | You might see:
6 | Configuration on demand is not supported by the current version of the Android Gradle plugin since you are using Gradle version 4.6 or above. Suggestion: disable configuration on demand by setting org.gradle.configureondemand=false in your gradle.properties file or use a Gradle version less than 4.6.
7 |
8 | Also:
9 | Error:The modules ['android', 'mobile'] point to the same directory in the file system.
10 | Each module must have a unique path.
11 |
12 | # Hacks
13 |
14 | Multiplatform development in Kotlin still have some limitations.
15 | This is why I had to apply some hacks which are temporary.
16 |
17 | ## Native dependencies
18 |
19 | Cannot declare Gradle dependencies on Konan yet, so we just include sources.
20 |
21 | https://youtrack.jetbrains.net/issue/KT-25582
22 |
23 | ## Names generated by JS
24 |
25 | Generated names for functions have mashed names. This is why from:
26 | ```
27 | interface QuotationView {
28 | fun showQuote(quote: Quote)
29 | }
30 | ```
31 |
32 | We have function required named `showQuote_4z1tej$`
33 |
34 | https://youtrack.jetbrains.net/issue/KT-25583
35 |
36 | ## Mixing Kotlin and Swift dependencies is not allowed in Konan
37 |
38 | We cannot do:
39 | ```
40 | class ViewController : UIViewController, QuotationView {
41 |
42 | override fun showQuote(quote: Quote) {
43 | textView.text = quote.text
44 | authorView.text = quote.person
45 | }
46 |
47 | //...
48 | }
49 | ```
50 |
51 | We need to do instead:
52 | ```
53 | class ViewController : UIViewController {
54 |
55 | private val quotationView = object : QuotationView {
56 | override fun showQuote(quote: Quote) {
57 | textView.text = quote.text
58 | authorView.text = quote.person
59 | }
60 | }
61 |
62 | // ...
63 | }
64 | ```
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | maven { url 'https://maven.google.com' }
4 | jcenter()
5 | google()
6 | mavenCentral()
7 | maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.2" }
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.1.3'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | maven { url 'https://maven.google.com' }
18 | maven { url "http://dl.bintray.com/kotlin/kotlin-eap-1.2" }
19 | jcenter()
20 | }
21 | }
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.configureondemand=false
--------------------------------------------------------------------------------
/android/mobile/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion 27
7 | buildToolsVersion "27.0.3"
8 | defaultConfig {
9 | applicationId "org.kotlinacademy.android"
10 | minSdkVersion 18
11 | targetSdkVersion 27
12 | versionCode 13
13 | versionName "1.1.1"
14 | multiDexEnabled true
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 | }
17 | buildTypes {
18 | debug {}
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | ext.betaDistributionReleaseNotesFilePath = "crashlytics_release_notes.txt"
23 | ext.betaDistributionGroupAliases = "android-testers"
24 | }
25 | }
26 | }
27 |
28 | dependencies {
29 | implementation project(':common-jvm')
30 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
31 | implementation 'com.android.support:appcompat-v7:27.1.1'
32 | implementation 'com.android.support.constraint:constraint-layout:1.1.2'
33 | }
--------------------------------------------------------------------------------
/android/mobile/deploy_crashlytics.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | RELEASE_NOTES="`git log --oneline -1`"
4 |
5 | echo "$RELEASE_NOTES" > crashlytics_release_notes.txt
6 |
7 | ./gradlew :android:mobile:crashlyticsUploadDistributionProdDebug
8 |
--------------------------------------------------------------------------------
/android/mobile/google-services.json:
--------------------------------------------------------------------------------
1 | {
2 | "project_info": {
3 | "project_number": "1091715558873",
4 | "firebase_url": "https://kotlinacademy-d9d13.firebaseio.com",
5 | "project_id": "kotlinacademy-d9d13",
6 | "storage_bucket": "kotlinacademy-d9d13.appspot.com"
7 | },
8 | "client": [
9 | {
10 | "client_info": {
11 | "mobilesdk_app_id": "1:1091715558873:android:5a9be25b5204dbf5",
12 | "android_client_info": {
13 | "package_name": "org.kotlinacademy.android"
14 | }
15 | },
16 | "oauth_client": [
17 | {
18 | "client_id": "1091715558873-vtcva31umnli0vkagq7idvnvb8jjj2pu.apps.googleusercontent.com",
19 | "client_type": 1,
20 | "android_info": {
21 | "package_name": "org.kotlinacademy.android",
22 | "certificate_hash": "b14802083fcb564515737ab7da4242aede14e724"
23 | }
24 | },
25 | {
26 | "client_id": "1091715558873-fjru2ahin89hop1j0ur9frd4t4c7r838.apps.googleusercontent.com",
27 | "client_type": 1,
28 | "android_info": {
29 | "package_name": "org.kotlinacademy.android",
30 | "certificate_hash": "061e967beb23f607f9ac581f4fc61bdfe99a53a1"
31 | }
32 | },
33 | {
34 | "client_id": "1091715558873-si02csudnuqjuib2lv8qfe6gmmafshgp.apps.googleusercontent.com",
35 | "client_type": 3
36 | }
37 | ],
38 | "api_key": [
39 | {
40 | "current_key": "AIzaSyB4UnmW58pO3BHXdfGgtoMFw-Y4ybMSngI"
41 | }
42 | ],
43 | "services": {
44 | "analytics_service": {
45 | "status": 1
46 | },
47 | "appinvite_service": {
48 | "status": 2,
49 | "other_platform_oauth_client": [
50 | {
51 | "client_id": "1091715558873-si02csudnuqjuib2lv8qfe6gmmafshgp.apps.googleusercontent.com",
52 | "client_type": 3
53 | }
54 | ]
55 | },
56 | "ads_service": {
57 | "status": 2
58 | }
59 | }
60 | }
61 | ],
62 | "configuration_version": "1"
63 | }
--------------------------------------------------------------------------------
/android/mobile/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/mobile/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/android/mobile/src/main/java/com/marcinmoskala/mkpexample/QuotationsActivity.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala.mkpexample
2 |
3 | import android.app.Activity
4 | import android.os.Bundle
5 | import kotlinx.android.synthetic.main.activity_quotations.*
6 | import com.marcinmoskala.data.Quote
7 | import com.marcinmoskala.presentation.QuotationPresenter
8 | import com.marcinmoskala.repository.QuotationRepositoryImpl
9 | import com.marcinmoskala.view.QuotationView
10 |
11 | class QuotationsActivity : Activity(), QuotationView {
12 |
13 | private val quotationsRepo = QuotationRepositoryImpl()
14 | private val presenter = QuotationPresenter(this, quotationsRepo)
15 |
16 | override fun onCreate(savedInstanceState: Bundle?) {
17 | super.onCreate(savedInstanceState)
18 | setContentView(R.layout.activity_quotations)
19 | presenter.onStart()
20 | nextButton.setOnClickListener { presenter.onNext() }
21 | }
22 |
23 | override fun showQuote(quote: Quote) {
24 | textView.text = quote.text
25 | authorView.text = quote.person
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/android/mobile/src/main/res/drawable/launcher_circle_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MarcinMoskala/KotlinMultiplatformExample/57b5bca1560442d55eb64c6fb0d6a15d25c01c1c/android/mobile/src/main/res/drawable/launcher_circle_icon.png
--------------------------------------------------------------------------------
/android/mobile/src/main/res/drawable/launcher_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MarcinMoskala/KotlinMultiplatformExample/57b5bca1560442d55eb64c6fb0d6a15d25c01c1c/android/mobile/src/main/res/drawable/launcher_icon.png
--------------------------------------------------------------------------------
/android/mobile/src/main/res/layout/activity_quotations.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
23 |
30 |
40 |
41 |
--------------------------------------------------------------------------------
/android/mobile/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Quotations
4 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | allprojects {
2 | buildscript {
3 | repositories {
4 | maven { url "http://kotlin.bintray.com/kotlin-eap" }
5 | maven { url "http://kotlin.bintray.com/kotlin-dev" }
6 | maven { url "https://kotlin.bintray.com/kotlinx" }
7 | maven { url 'https://dl.bintray.com/jetbrains/kotlin-native-dependencies' }
8 | maven { url "https://plugins.gradle.org/m2/" }
9 | jcenter()
10 | mavenCentral()
11 | mavenLocal()
12 | google()
13 | }
14 | dependencies {
15 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16 | classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.9.2-dev-3973"
17 | classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.32"
18 | classpath 'com.moowork.gradle:gradle-node-plugin:1.2.0'
19 | }
20 |
21 | }
22 | repositories {
23 | maven { url "http://kotlin.bintray.com/kotlin-eap" }
24 | maven { url "http://kotlin.bintray.com/kotlin-dev" }
25 | maven { url "https://kotlin.bintray.com/kotlinx" }
26 | maven { url "http://dl.bintray.com/kotlin/kotlin-js-wrappers" }
27 | maven { url "https://dl.bintray.com/sargunster/maven" }
28 | mavenLocal()
29 |
30 | google()
31 | jcenter()
32 | }
33 | }
--------------------------------------------------------------------------------
/common-js/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-platform-js'
2 | apply plugin: 'com.moowork.node'
3 |
4 | dependencies {
5 | expectedBy project(':common')
6 | compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
7 | testCompile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
8 | testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
9 | testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
10 | testCompile "io.mockk:mockk-js:$mockk_version"
11 |
12 | }
13 |
14 | [compileKotlin2Js, compileTestKotlin2Js]*.configure {
15 | kotlinOptions {
16 | sourceMap = true
17 | sourceMapEmbedSources = "always"
18 | moduleKind = 'commonjs'
19 | }
20 | }
21 |
22 | task populateNodeModules(type: Copy, dependsOn: compileKotlin2Js) {
23 | from compileKotlin2Js.destinationDir
24 |
25 | configurations.testCompile.each {
26 | from zipTree(it.absolutePath).matching { include '*.js' }
27 | }
28 |
29 | into "${buildDir}/node_modules"
30 | }
31 |
32 | node {
33 | version = "8.9.4"
34 | download = true
35 | }
36 |
37 | task installMocha(type: NpmTask) {
38 | args = ['install', 'mocha']
39 | }
40 |
41 | task runMocha(type: NodeTask, dependsOn: [compileTestKotlin2Js, populateNodeModules, installMocha]) {
42 | script = file('node_modules/mocha/bin/mocha')
43 | args = [compileTestKotlin2Js.outputFile]
44 | }
45 |
46 | test.dependsOn runMocha
--------------------------------------------------------------------------------
/common-jvm/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-platform-jvm'
2 |
3 | dependencies {
4 | expectedBy project(':common')
5 | compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6 | testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
7 | testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
8 | testCompile "io.mockk:mockk:$mockk_version"
9 | }
--------------------------------------------------------------------------------
/common-native/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-platform-native'
2 |
3 | dependencies {
4 | expectedBy project(':common')
5 | }
6 |
7 | sourceSets {
8 | main {
9 | component {
10 | baseName = "QuotationsCommon"
11 | targets = ['ios_x64', 'ios_arm64']
12 | outputKinds = [FRAMEWORK]
13 | extraOpts '-Xdisable=devirtualization'
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/common/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-platform-common'
2 |
3 | dependencies {
4 | compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
5 | testCompile "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
6 | testCompile "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version"
7 | testCompile "io.mockk:mockk-common:$mockk_version"
8 | }
--------------------------------------------------------------------------------
/common/src/main/kotlin/com/marcinmoskala/data/Quote.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala.data
2 |
3 | data class Quote(
4 | val text: String,
5 | val person: String
6 | )
--------------------------------------------------------------------------------
/common/src/main/kotlin/com/marcinmoskala/presentation/QuotationPresenter.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala.presentation
2 |
3 | import com.marcinmoskala.repository.QuotationRepository
4 | import com.marcinmoskala.view.QuotationView
5 |
6 | class QuotationPresenter(
7 | private val view: QuotationView,
8 | private val repo: QuotationRepository
9 | ) {
10 | private var nextQuoteId = -1
11 |
12 | fun onStart() {
13 | onNext()
14 | }
15 |
16 | fun onNext() {
17 | nextQuoteId = (nextQuoteId + 1) % repo.quotesNumber
18 | val quote = repo.getQuote(nextQuoteId)
19 | view.showQuote(quote)
20 | }
21 | }
--------------------------------------------------------------------------------
/common/src/main/kotlin/com/marcinmoskala/repository/QuotationRepository.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala.repository
2 |
3 | import com.marcinmoskala.data.Quote
4 |
5 | interface QuotationRepository {
6 | val quotesNumber: Int
7 | fun getQuote(quoteId: Int): Quote
8 | }
--------------------------------------------------------------------------------
/common/src/main/kotlin/com/marcinmoskala/repository/QuotationRepositoryImpl.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala.repository
2 |
3 | import com.marcinmoskala.data.Quote
4 |
5 | class QuotationRepositoryImpl : QuotationRepository {
6 |
7 | override val quotesNumber: Int
8 | get() = quotes.size
9 |
10 | override fun getQuote(quoteId: Int): Quote = quotes[quoteId]
11 |
12 | companion object {
13 | private val quotes = listOf(
14 | Quote("I skate to where the puck is going to be, not where it has been.", "Wayne Gretzky"),
15 | Quote("The future is already here — it's just not very evenly distributed.", "William Gibson"),
16 | Quote("I want to impact the world through futuristic yet affordable technologies to make the world a better place.", "Pranav Mistry"),
17 | Quote("Every once in a while, a new technology, an old problem, and a big idea turn into an innovation.", "Dean Kamen"),
18 | Quote("Seven thousand years is just one day at a time.", "Terry Pratchett")
19 | )
20 | }
21 | }
--------------------------------------------------------------------------------
/common/src/main/kotlin/com/marcinmoskala/view/QuotationView.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala.view
2 |
3 | import com.marcinmoskala.data.Quote
4 |
5 | interface QuotationView {
6 | fun showQuote(quote: Quote)
7 | }
--------------------------------------------------------------------------------
/common/src/test/kotlin/com/marcinmoskala/QuotePresenterUnitTest.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("TestFunctionName")
2 |
3 | package com.marcinmoskala
4 |
5 | import com.marcinmoskala.data.Quote
6 | import com.marcinmoskala.presentation.QuotationPresenter
7 | import com.marcinmoskala.repository.QuotationRepository
8 | import com.marcinmoskala.view.QuotationView
9 | import io.mockk.*
10 | import kotlin.test.Test
11 | import kotlin.test.assertEquals
12 |
13 | class QuotePresenterUnitTest {
14 |
15 | @Test
16 | // After started, is shows a first quote on a view
17 | fun After_started_shows_a_first_quote() {
18 | val quote = someQuote
19 | val view = mockk()
20 | val repo = mockk()
21 | every { view.showQuote(any()) } just runs
22 | every { repo.quotesNumber } returns 1
23 | every { repo.getQuote(0) } returns quote
24 |
25 | val presenter = QuotationPresenter(view, repo)
26 | // When
27 | presenter.onStart()
28 | // Then
29 | verifyAll { view.showQuote(quote) }
30 | }
31 |
32 | @Test
33 | // After on next, is shows second quote on a view
34 | fun On_next_clicked_shows_another_quote() {
35 | val quote1 = someQuote
36 | val quote2 = anotherQuote
37 | val view = mockk()
38 | val repo = mockk()
39 | every { view.showQuote(any()) } just runs
40 | every { repo.quotesNumber } returns 2
41 | every { repo.getQuote(0) } returns quote1
42 | every { repo.getQuote(1) } returns quote2
43 |
44 | val presenter = QuotationPresenter(view, repo)
45 | // When
46 | presenter.onStart()
47 | presenter.onNext()
48 | // Then
49 | verifyOrder {
50 | view.showQuote(quote1)
51 | view.showQuote(quote2)
52 | }
53 | }
54 |
55 | // After last quote, first quote is displayed
56 | @Test
57 | fun Quotes_are_circling() {
58 | val quote1 = someQuote
59 | val quote2 = anotherQuote
60 | val view = mockk()
61 | val repo = mockk()
62 | every { view.showQuote(any()) } just runs
63 | every { repo.quotesNumber } returns 2
64 | every { repo.getQuote(0) } returns quote1
65 | every { repo.getQuote(1) } returns quote2
66 |
67 | val presenter = QuotationPresenter(view, repo)
68 | // When
69 | presenter.onStart()
70 | repeat(4) {
71 | presenter.onNext()
72 | }
73 | // Then
74 | verifyOrder {
75 | view.showQuote(quote1)
76 | view.showQuote(quote2)
77 | view.showQuote(quote1)
78 | view.showQuote(quote2)
79 | view.showQuote(quote1)
80 | }
81 | }
82 |
83 | companion object {
84 | val someQuote = Quote("AAA", "BBB")
85 | val anotherQuote = Quote("CCC", "DDD")
86 | }
87 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # gradle
2 | org.gradle.jvmargs=-Xmx1536m
3 | org.gradle.parallel=true
4 | # kotlin
5 | kotlin_version=1.2.60
6 | kotlin.incremental.multiplatform=true
7 | # kotlin libraries
8 | mockk_version=1.7.17
9 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MarcinMoskala/KotlinMultiplatformExample/57b5bca1560442d55eb64c6fb0d6a15d25c01c1c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Dec 01 11:10:08 CET 2017
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.9-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/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 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
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 Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | D3E9B3B920FD1C04001935A0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E9B3B820FD1C04001935A0 /* AppDelegate.swift */; };
11 | D3E9B3BB20FD1C04001935A0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E9B3BA20FD1C04001935A0 /* ViewController.swift */; };
12 | D3E9B3BE20FD1C04001935A0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D3E9B3BC20FD1C04001935A0 /* Main.storyboard */; };
13 | D3E9B3C020FD1C06001935A0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D3E9B3BF20FD1C06001935A0 /* Assets.xcassets */; };
14 | D3E9B3C320FD1C06001935A0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D3E9B3C120FD1C06001935A0 /* LaunchScreen.storyboard */; };
15 | D3E9B3CC20FD1C6D001935A0 /* QuotationsCommon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D3E9B3CB20FD1C6D001935A0 /* QuotationsCommon.framework */; };
16 | D3E9B3CD20FD1C6D001935A0 /* QuotationsCommon.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = D3E9B3CB20FD1C6D001935A0 /* QuotationsCommon.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXCopyFilesBuildPhase section */
20 | D3E9B3CE20FD1C6D001935A0 /* Embed Frameworks */ = {
21 | isa = PBXCopyFilesBuildPhase;
22 | buildActionMask = 2147483647;
23 | dstPath = "";
24 | dstSubfolderSpec = 10;
25 | files = (
26 | D3E9B3CD20FD1C6D001935A0 /* QuotationsCommon.framework in Embed Frameworks */,
27 | );
28 | name = "Embed Frameworks";
29 | runOnlyForDeploymentPostprocessing = 0;
30 | };
31 | /* End PBXCopyFilesBuildPhase section */
32 |
33 | /* Begin PBXFileReference section */
34 | D3E9B3B520FD1C04001935A0 /* ExampleMKP.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleMKP.app; sourceTree = BUILT_PRODUCTS_DIR; };
35 | D3E9B3B820FD1C04001935A0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
36 | D3E9B3BA20FD1C04001935A0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
37 | D3E9B3BD20FD1C04001935A0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
38 | D3E9B3BF20FD1C06001935A0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
39 | D3E9B3C220FD1C06001935A0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
40 | D3E9B3C420FD1C06001935A0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
41 | D3E9B3CB20FD1C6D001935A0 /* QuotationsCommon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuotationsCommon.framework; path = build/QuotationsCommon.framework; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | D3E9B3B220FD1C04001935A0 /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | D3E9B3CC20FD1C6D001935A0 /* QuotationsCommon.framework in Frameworks */,
50 | );
51 | runOnlyForDeploymentPostprocessing = 0;
52 | };
53 | /* End PBXFrameworksBuildPhase section */
54 |
55 | /* Begin PBXGroup section */
56 | D3E9B3AC20FD1C04001935A0 = {
57 | isa = PBXGroup;
58 | children = (
59 | D3E9B3CB20FD1C6D001935A0 /* QuotationsCommon.framework */,
60 | D3E9B3B720FD1C04001935A0 /* ExampleMKP */,
61 | D3E9B3B620FD1C04001935A0 /* Products */,
62 | );
63 | sourceTree = "";
64 | };
65 | D3E9B3B620FD1C04001935A0 /* Products */ = {
66 | isa = PBXGroup;
67 | children = (
68 | D3E9B3B520FD1C04001935A0 /* ExampleMKP.app */,
69 | );
70 | name = Products;
71 | sourceTree = "";
72 | };
73 | D3E9B3B720FD1C04001935A0 /* ExampleMKP */ = {
74 | isa = PBXGroup;
75 | children = (
76 | D3E9B3B820FD1C04001935A0 /* AppDelegate.swift */,
77 | D3E9B3BA20FD1C04001935A0 /* ViewController.swift */,
78 | D3E9B3BC20FD1C04001935A0 /* Main.storyboard */,
79 | D3E9B3BF20FD1C06001935A0 /* Assets.xcassets */,
80 | D3E9B3C120FD1C06001935A0 /* LaunchScreen.storyboard */,
81 | D3E9B3C420FD1C06001935A0 /* Info.plist */,
82 | );
83 | path = ExampleMKP;
84 | sourceTree = "";
85 | };
86 | /* End PBXGroup section */
87 |
88 | /* Begin PBXNativeTarget section */
89 | D3E9B3B420FD1C04001935A0 /* ExampleMKP */ = {
90 | isa = PBXNativeTarget;
91 | buildConfigurationList = D3E9B3C720FD1C06001935A0 /* Build configuration list for PBXNativeTarget "ExampleMKP" */;
92 | buildPhases = (
93 | D3E9B3CA20FD1C27001935A0 /* Run Script */,
94 | D3E9B3B120FD1C04001935A0 /* Sources */,
95 | D3E9B3B220FD1C04001935A0 /* Frameworks */,
96 | D3E9B3B320FD1C04001935A0 /* Resources */,
97 | D3E9B3CE20FD1C6D001935A0 /* Embed Frameworks */,
98 | );
99 | buildRules = (
100 | );
101 | dependencies = (
102 | );
103 | name = ExampleMKP;
104 | productName = ExampleMKP;
105 | productReference = D3E9B3B520FD1C04001935A0 /* ExampleMKP.app */;
106 | productType = "com.apple.product-type.application";
107 | };
108 | /* End PBXNativeTarget section */
109 |
110 | /* Begin PBXProject section */
111 | D3E9B3AD20FD1C04001935A0 /* Project object */ = {
112 | isa = PBXProject;
113 | attributes = {
114 | LastSwiftUpdateCheck = 0940;
115 | LastUpgradeCheck = 0940;
116 | ORGANIZATIONNAME = "Marcin Moskala";
117 | TargetAttributes = {
118 | D3E9B3B420FD1C04001935A0 = {
119 | CreatedOnToolsVersion = 9.4.1;
120 | };
121 | };
122 | };
123 | buildConfigurationList = D3E9B3B020FD1C04001935A0 /* Build configuration list for PBXProject "ExampleMKP" */;
124 | compatibilityVersion = "Xcode 9.3";
125 | developmentRegion = en;
126 | hasScannedForEncodings = 0;
127 | knownRegions = (
128 | en,
129 | Base,
130 | );
131 | mainGroup = D3E9B3AC20FD1C04001935A0;
132 | productRefGroup = D3E9B3B620FD1C04001935A0 /* Products */;
133 | projectDirPath = "";
134 | projectRoot = "";
135 | targets = (
136 | D3E9B3B420FD1C04001935A0 /* ExampleMKP */,
137 | );
138 | };
139 | /* End PBXProject section */
140 |
141 | /* Begin PBXResourcesBuildPhase section */
142 | D3E9B3B320FD1C04001935A0 /* Resources */ = {
143 | isa = PBXResourcesBuildPhase;
144 | buildActionMask = 2147483647;
145 | files = (
146 | D3E9B3C320FD1C06001935A0 /* LaunchScreen.storyboard in Resources */,
147 | D3E9B3C020FD1C06001935A0 /* Assets.xcassets in Resources */,
148 | D3E9B3BE20FD1C04001935A0 /* Main.storyboard in Resources */,
149 | );
150 | runOnlyForDeploymentPostprocessing = 0;
151 | };
152 | /* End PBXResourcesBuildPhase section */
153 |
154 | /* Begin PBXShellScriptBuildPhase section */
155 | D3E9B3CA20FD1C27001935A0 /* Run Script */ = {
156 | isa = PBXShellScriptBuildPhase;
157 | buildActionMask = 2147483647;
158 | files = (
159 | );
160 | inputPaths = (
161 | );
162 | name = "Run Script";
163 | outputPaths = (
164 | );
165 | runOnlyForDeploymentPostprocessing = 0;
166 | shellPath = /bin/sh;
167 | shellScript = "case \"$PLATFORM_NAME\" in\niphoneos)\nNAME=ios_arm64\n;;\niphonesimulator)\nNAME=ios_x64\n;;\n*)\necho \"Unknown platform: $PLATFORN_NAME\"\nexit 1\n;;\nesac\n\n\"$SRCROOT/../gradlew\" -p \"$SRCROOT/../common-native\" \"build\"\nrm -rf \"$SRCROOT/build/\"\nmkdir \"$SRCROOT/build/\"\ncp -a \"$SRCROOT/../common-native/build/lib/main/debug/$NAME/\" \"$SRCROOT/build/\"";
168 | };
169 | /* End PBXShellScriptBuildPhase section */
170 |
171 | /* Begin PBXSourcesBuildPhase section */
172 | D3E9B3B120FD1C04001935A0 /* Sources */ = {
173 | isa = PBXSourcesBuildPhase;
174 | buildActionMask = 2147483647;
175 | files = (
176 | D3E9B3BB20FD1C04001935A0 /* ViewController.swift in Sources */,
177 | D3E9B3B920FD1C04001935A0 /* AppDelegate.swift in Sources */,
178 | );
179 | runOnlyForDeploymentPostprocessing = 0;
180 | };
181 | /* End PBXSourcesBuildPhase section */
182 |
183 | /* Begin PBXVariantGroup section */
184 | D3E9B3BC20FD1C04001935A0 /* Main.storyboard */ = {
185 | isa = PBXVariantGroup;
186 | children = (
187 | D3E9B3BD20FD1C04001935A0 /* Base */,
188 | );
189 | name = Main.storyboard;
190 | sourceTree = "";
191 | };
192 | D3E9B3C120FD1C06001935A0 /* LaunchScreen.storyboard */ = {
193 | isa = PBXVariantGroup;
194 | children = (
195 | D3E9B3C220FD1C06001935A0 /* Base */,
196 | );
197 | name = LaunchScreen.storyboard;
198 | sourceTree = "";
199 | };
200 | /* End PBXVariantGroup section */
201 |
202 | /* Begin XCBuildConfiguration section */
203 | D3E9B3C520FD1C06001935A0 /* Debug */ = {
204 | isa = XCBuildConfiguration;
205 | buildSettings = {
206 | ALWAYS_SEARCH_USER_PATHS = NO;
207 | CLANG_ANALYZER_NONNULL = YES;
208 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
209 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
210 | CLANG_CXX_LIBRARY = "libc++";
211 | CLANG_ENABLE_MODULES = YES;
212 | CLANG_ENABLE_OBJC_ARC = YES;
213 | CLANG_ENABLE_OBJC_WEAK = YES;
214 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
215 | CLANG_WARN_BOOL_CONVERSION = YES;
216 | CLANG_WARN_COMMA = YES;
217 | CLANG_WARN_CONSTANT_CONVERSION = YES;
218 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
219 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
220 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
221 | CLANG_WARN_EMPTY_BODY = YES;
222 | CLANG_WARN_ENUM_CONVERSION = YES;
223 | CLANG_WARN_INFINITE_RECURSION = YES;
224 | CLANG_WARN_INT_CONVERSION = YES;
225 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
226 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
227 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
228 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
229 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
230 | CLANG_WARN_STRICT_PROTOTYPES = YES;
231 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
232 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
233 | CLANG_WARN_UNREACHABLE_CODE = YES;
234 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
235 | CODE_SIGN_IDENTITY = "iPhone Developer";
236 | COPY_PHASE_STRIP = NO;
237 | DEBUG_INFORMATION_FORMAT = dwarf;
238 | ENABLE_STRICT_OBJC_MSGSEND = YES;
239 | ENABLE_TESTABILITY = YES;
240 | GCC_C_LANGUAGE_STANDARD = gnu11;
241 | GCC_DYNAMIC_NO_PIC = NO;
242 | GCC_NO_COMMON_BLOCKS = YES;
243 | GCC_OPTIMIZATION_LEVEL = 0;
244 | GCC_PREPROCESSOR_DEFINITIONS = (
245 | "DEBUG=1",
246 | "$(inherited)",
247 | );
248 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
249 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
250 | GCC_WARN_UNDECLARED_SELECTOR = YES;
251 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
252 | GCC_WARN_UNUSED_FUNCTION = YES;
253 | GCC_WARN_UNUSED_VARIABLE = YES;
254 | IPHONEOS_DEPLOYMENT_TARGET = 11.4;
255 | MTL_ENABLE_DEBUG_INFO = YES;
256 | ONLY_ACTIVE_ARCH = YES;
257 | SDKROOT = iphoneos;
258 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
259 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
260 | };
261 | name = Debug;
262 | };
263 | D3E9B3C620FD1C06001935A0 /* Release */ = {
264 | isa = XCBuildConfiguration;
265 | buildSettings = {
266 | ALWAYS_SEARCH_USER_PATHS = NO;
267 | CLANG_ANALYZER_NONNULL = YES;
268 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
269 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
270 | CLANG_CXX_LIBRARY = "libc++";
271 | CLANG_ENABLE_MODULES = YES;
272 | CLANG_ENABLE_OBJC_ARC = YES;
273 | CLANG_ENABLE_OBJC_WEAK = YES;
274 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
275 | CLANG_WARN_BOOL_CONVERSION = YES;
276 | CLANG_WARN_COMMA = YES;
277 | CLANG_WARN_CONSTANT_CONVERSION = YES;
278 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
279 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
280 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
281 | CLANG_WARN_EMPTY_BODY = YES;
282 | CLANG_WARN_ENUM_CONVERSION = YES;
283 | CLANG_WARN_INFINITE_RECURSION = YES;
284 | CLANG_WARN_INT_CONVERSION = YES;
285 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
286 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
287 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
288 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
289 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
290 | CLANG_WARN_STRICT_PROTOTYPES = YES;
291 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
292 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
293 | CLANG_WARN_UNREACHABLE_CODE = YES;
294 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
295 | CODE_SIGN_IDENTITY = "iPhone Developer";
296 | COPY_PHASE_STRIP = NO;
297 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
298 | ENABLE_NS_ASSERTIONS = NO;
299 | ENABLE_STRICT_OBJC_MSGSEND = YES;
300 | GCC_C_LANGUAGE_STANDARD = gnu11;
301 | GCC_NO_COMMON_BLOCKS = YES;
302 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
303 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
304 | GCC_WARN_UNDECLARED_SELECTOR = YES;
305 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
306 | GCC_WARN_UNUSED_FUNCTION = YES;
307 | GCC_WARN_UNUSED_VARIABLE = YES;
308 | IPHONEOS_DEPLOYMENT_TARGET = 11.4;
309 | MTL_ENABLE_DEBUG_INFO = NO;
310 | SDKROOT = iphoneos;
311 | SWIFT_COMPILATION_MODE = wholemodule;
312 | SWIFT_OPTIMIZATION_LEVEL = "-O";
313 | VALIDATE_PRODUCT = YES;
314 | };
315 | name = Release;
316 | };
317 | D3E9B3C820FD1C06001935A0 /* Debug */ = {
318 | isa = XCBuildConfiguration;
319 | buildSettings = {
320 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
321 | CODE_SIGN_STYLE = Automatic;
322 | DEVELOPMENT_TEAM = XCLBTRXW67;
323 | FRAMEWORK_SEARCH_PATHS = (
324 | "$(inherited)",
325 | "$(PROJECT_DIR)/build",
326 | );
327 | INFOPLIST_FILE = ExampleMKP/Info.plist;
328 | LD_RUNPATH_SEARCH_PATHS = (
329 | "$(inherited)",
330 | "@executable_path/Frameworks",
331 | );
332 | PRODUCT_BUNDLE_IDENTIFIER = marcinmoskala.ExampleMKP;
333 | PRODUCT_NAME = "$(TARGET_NAME)";
334 | SWIFT_VERSION = 4.0;
335 | TARGETED_DEVICE_FAMILY = "1,2";
336 | };
337 | name = Debug;
338 | };
339 | D3E9B3C920FD1C06001935A0 /* Release */ = {
340 | isa = XCBuildConfiguration;
341 | buildSettings = {
342 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
343 | CODE_SIGN_STYLE = Automatic;
344 | DEVELOPMENT_TEAM = XCLBTRXW67;
345 | FRAMEWORK_SEARCH_PATHS = (
346 | "$(inherited)",
347 | "$(PROJECT_DIR)/build",
348 | );
349 | INFOPLIST_FILE = ExampleMKP/Info.plist;
350 | LD_RUNPATH_SEARCH_PATHS = (
351 | "$(inherited)",
352 | "@executable_path/Frameworks",
353 | );
354 | PRODUCT_BUNDLE_IDENTIFIER = marcinmoskala.ExampleMKP;
355 | PRODUCT_NAME = "$(TARGET_NAME)";
356 | SWIFT_VERSION = 4.0;
357 | TARGETED_DEVICE_FAMILY = "1,2";
358 | };
359 | name = Release;
360 | };
361 | /* End XCBuildConfiguration section */
362 |
363 | /* Begin XCConfigurationList section */
364 | D3E9B3B020FD1C04001935A0 /* Build configuration list for PBXProject "ExampleMKP" */ = {
365 | isa = XCConfigurationList;
366 | buildConfigurations = (
367 | D3E9B3C520FD1C06001935A0 /* Debug */,
368 | D3E9B3C620FD1C06001935A0 /* Release */,
369 | );
370 | defaultConfigurationIsVisible = 0;
371 | defaultConfigurationName = Release;
372 | };
373 | D3E9B3C720FD1C06001935A0 /* Build configuration list for PBXNativeTarget "ExampleMKP" */ = {
374 | isa = XCConfigurationList;
375 | buildConfigurations = (
376 | D3E9B3C820FD1C06001935A0 /* Debug */,
377 | D3E9B3C920FD1C06001935A0 /* Release */,
378 | );
379 | defaultConfigurationIsVisible = 0;
380 | defaultConfigurationName = Release;
381 | };
382 | /* End XCConfigurationList section */
383 | };
384 | rootObject = D3E9B3AD20FD1C04001935A0 /* Project object */;
385 | }
386 |
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP.xcodeproj/project.xcworkspace/xcuserdata/marcin.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MarcinMoskala/KotlinMultiplatformExample/57b5bca1560442d55eb64c6fb0d6a15d25c01c1c/ios-classic/ExampleMKP.xcodeproj/project.xcworkspace/xcuserdata/marcin.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP.xcodeproj/xcuserdata/marcin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ExampleMKP.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // ExampleMKP
4 | //
5 | // Created by Marcin Moskala on 16.07.2018.
6 | // Copyright © 2018 Marcin Moskala. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
17 | return true
18 | }
19 |
20 | func applicationWillResignActive(_ application: UIApplication) {
21 | }
22 |
23 | func applicationDidEnterBackground(_ application: UIApplication) {
24 | }
25 |
26 | func applicationWillEnterForeground(_ application: UIApplication) {
27 | }
28 |
29 | func applicationDidBecomeActive(_ application: UIApplication) {
30 | }
31 |
32 | func applicationWillTerminate(_ application: UIApplication) {
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP/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-classic/ExampleMKP/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP/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-classic/ExampleMKP/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 |
27 |
28 |
29 |
30 |
31 |
38 |
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 |
--------------------------------------------------------------------------------
/ios-classic/ExampleMKP/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-classic/ExampleMKP/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // ExampleMKP
4 | //
5 | // Created by Marcin Moskala on 16.07.2018.
6 | // Copyright © 2018 Marcin Moskala. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import QuotationsCommon
11 |
12 | class ViewController: UIViewController, QuotationView {
13 |
14 | @IBOutlet weak var textView: UILabel!
15 | @IBOutlet weak var authorView: UILabel!
16 |
17 | let repo = QuotationRepositoryImpl()
18 | var presenter: QuotationPresenter!
19 |
20 | override func viewDidLoad() {
21 | super.viewDidLoad()
22 | presenter = QuotationPresenter(view: self, repo: repo)
23 | presenter.onStart()
24 | }
25 |
26 | @IBAction func onNext() {
27 | presenter.onNext()
28 | }
29 |
30 | func showQuote(quote: Quote) {
31 | textView.text = quote.text
32 | authorView.text = quote.person
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ios.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | BF8C70E7EE00D229A40E19D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF8C7D8AC208FCB2DC607237 /* Main.storyboard */; };
11 | BF8C797C3AA8EBAA46BCA2D1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BF8C706392DE3976E583CC5B /* Assets.xcassets */; };
12 | BF8C7AB971E0FF80ADE26585 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BF8C7B5222E2A40A9B2A4972 /* LaunchScreen.storyboard */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXFileReference section */
16 | BF8C70146B1CC6F85D1D0C2F /* gradle-wrapper.properties */ = {isa = PBXFileReference; lastKnownFileType = file.properties; path = "gradle-wrapper.properties"; sourceTree = ""; };
17 | BF8C703E8AB1486AC0F23A76 /* ios.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ios.app; sourceTree = BUILT_PRODUCTS_DIR; };
18 | BF8C706392DE3976E583CC5B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
19 | BF8C70F6FB4A1F07E4C476C6 /* ViewController.kt */ = {isa = PBXFileReference; lastKnownFileType = file.kt; path = ViewController.kt; sourceTree = ""; };
20 | BF8C718AF68360C05910D094 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
21 | BF8C723DB0EFE9C5C51B7465 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
22 | BF8C749A5528D2A6DBBEA0BA /* main.kt */ = {isa = PBXFileReference; lastKnownFileType = file.kt; path = main.kt; sourceTree = ""; };
23 | BF8C79A29EF7273CBF895B91 /* AppDelegate.kt */ = {isa = PBXFileReference; lastKnownFileType = file.kt; path = AppDelegate.kt; sourceTree = ""; };
24 | BF8C79ABFB20F5FAEC2ADD10 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.info; path = Info.plist; sourceTree = ""; };
25 | BF8C7B2F324154C633B9E8A1 /* gradlew */ = {isa = PBXFileReference; lastKnownFileType = text; path = gradlew; sourceTree = ""; };
26 | BF8C7CB0BDC64C28B17D699B /* gradle-wrapper.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = "gradle-wrapper.jar"; sourceTree = ""; };
27 | BF8C7D455A40B02D78B92827 /* build.gradle */ = {isa = PBXFileReference; lastKnownFileType = file.gradle; path = build.gradle; sourceTree = ""; };
28 | /* End PBXFileReference section */
29 |
30 | /* Begin PBXFrameworksBuildPhase section */
31 | BF8C7F822F5A7454C856C489 /* Frameworks */ = {
32 | isa = PBXFrameworksBuildPhase;
33 | buildActionMask = 2147483647;
34 | files = (
35 | );
36 | runOnlyForDeploymentPostprocessing = 0;
37 | };
38 | /* End PBXFrameworksBuildPhase section */
39 |
40 | /* Begin PBXGroup section */
41 | BF8C719FA6F4E1CFDAA8F2EF /* src */ = {
42 | isa = PBXGroup;
43 | children = (
44 | BF8C7C18433FC674F77ACE8A /* main */,
45 | );
46 | path = src;
47 | sourceTree = "";
48 | };
49 | BF8C71A4B828D6A0E0F69DA3 /* wrapper */ = {
50 | isa = PBXGroup;
51 | children = (
52 | BF8C70146B1CC6F85D1D0C2F /* gradle-wrapper.properties */,
53 | BF8C7CB0BDC64C28B17D699B /* gradle-wrapper.jar */,
54 | );
55 | path = wrapper;
56 | sourceTree = "";
57 | };
58 | BF8C71F1640D3FAB983F3012 /* ios */ = {
59 | isa = PBXGroup;
60 | children = (
61 | BF8C79FE532F814D0ADBC059 /* Supporting Files */,
62 | BF8C79ABFB20F5FAEC2ADD10 /* Info.plist */,
63 | BF8C706392DE3976E583CC5B /* Assets.xcassets */,
64 | BF8C7B5222E2A40A9B2A4972 /* LaunchScreen.storyboard */,
65 | BF8C7D8AC208FCB2DC607237 /* Main.storyboard */,
66 | BF8C719FA6F4E1CFDAA8F2EF /* src */,
67 | );
68 | path = ios;
69 | sourceTree = "";
70 | };
71 | BF8C74017254DD9B9848AC0F = {
72 | isa = PBXGroup;
73 | children = (
74 | BF8C7EF03D690DC75F316E9D /* Products */,
75 | BF8C71F1640D3FAB983F3012 /* ios */,
76 | );
77 | sourceTree = "";
78 | };
79 | BF8C791A58BC5B8D6EEDF390 /* gradle */ = {
80 | isa = PBXGroup;
81 | children = (
82 | BF8C71A4B828D6A0E0F69DA3 /* wrapper */,
83 | );
84 | path = gradle;
85 | sourceTree = "";
86 | };
87 | BF8C79FE532F814D0ADBC059 /* Supporting Files */ = {
88 | isa = PBXGroup;
89 | children = (
90 | BF8C7D455A40B02D78B92827 /* build.gradle */,
91 | BF8C7B2F324154C633B9E8A1 /* gradlew */,
92 | BF8C791A58BC5B8D6EEDF390 /* gradle */,
93 | );
94 | name = "Supporting Files";
95 | sourceTree = "";
96 | };
97 | BF8C7C18433FC674F77ACE8A /* main */ = {
98 | isa = PBXGroup;
99 | children = (
100 | BF8C7DB6341A367379D4621F /* kotlin */,
101 | );
102 | path = main;
103 | sourceTree = "";
104 | };
105 | BF8C7DB6341A367379D4621F /* kotlin */ = {
106 | isa = PBXGroup;
107 | children = (
108 | BF8C79A29EF7273CBF895B91 /* AppDelegate.kt */,
109 | BF8C70F6FB4A1F07E4C476C6 /* ViewController.kt */,
110 | BF8C749A5528D2A6DBBEA0BA /* main.kt */,
111 | );
112 | path = kotlin;
113 | sourceTree = "";
114 | };
115 | BF8C7EF03D690DC75F316E9D /* Products */ = {
116 | isa = PBXGroup;
117 | children = (
118 | BF8C703E8AB1486AC0F23A76 /* ios.app */,
119 | );
120 | name = Products;
121 | sourceTree = "";
122 | };
123 | /* End PBXGroup section */
124 |
125 | /* Begin PBXNativeTarget section */
126 | BF8C702E582C23B81D669071 /* ios */ = {
127 | isa = PBXNativeTarget;
128 | buildConfigurationList = BF8C79DC568A7203438EDF3C /* Build configuration list for PBXNativeTarget "ios" */;
129 | buildPhases = (
130 | BF8C7365EBBA87493221AFB0 /* Sources */,
131 | BF8C7F822F5A7454C856C489 /* Frameworks */,
132 | BF8C766FCEDBCD72D6D3157E /* Resources */,
133 | BF8C75B05285D2310B7EEDD7 /* Compile Kotlin/Native */,
134 | );
135 | buildRules = (
136 | );
137 | dependencies = (
138 | );
139 | name = ios;
140 | productName = ios;
141 | productReference = BF8C703E8AB1486AC0F23A76 /* ios.app */;
142 | productType = "com.apple.product-type.application";
143 | };
144 | /* End PBXNativeTarget section */
145 |
146 | /* Begin PBXProject section */
147 | BF8C71DB81C67BFBF8F95703 /* Project object */ = {
148 | isa = PBXProject;
149 | attributes = {
150 | ORGANIZATIONNAME = marcinmoskala;
151 | };
152 | buildConfigurationList = BF8C75CA5EE40A6CF1AB0028 /* Build configuration list for PBXProject "ios" */;
153 | compatibilityVersion = "Xcode 3.2";
154 | developmentRegion = English;
155 | hasScannedForEncodings = 0;
156 | knownRegions = (
157 | en,
158 | );
159 | mainGroup = BF8C74017254DD9B9848AC0F;
160 | productRefGroup = BF8C7EF03D690DC75F316E9D /* Products */;
161 | projectDirPath = "";
162 | projectRoot = "";
163 | targets = (
164 | BF8C702E582C23B81D669071 /* ios */,
165 | );
166 | };
167 | /* End PBXProject section */
168 |
169 | /* Begin PBXResourcesBuildPhase section */
170 | BF8C766FCEDBCD72D6D3157E /* Resources */ = {
171 | isa = PBXResourcesBuildPhase;
172 | buildActionMask = 2147483647;
173 | files = (
174 | BF8C797C3AA8EBAA46BCA2D1 /* Assets.xcassets in Resources */,
175 | BF8C7AB971E0FF80ADE26585 /* LaunchScreen.storyboard in Resources */,
176 | BF8C70E7EE00D229A40E19D4 /* Main.storyboard in Resources */,
177 | );
178 | runOnlyForDeploymentPostprocessing = 0;
179 | };
180 | /* End PBXResourcesBuildPhase section */
181 |
182 | /* Begin PBXShellScriptBuildPhase section */
183 | BF8C75B05285D2310B7EEDD7 /* Compile Kotlin/Native */ = {
184 | isa = PBXShellScriptBuildPhase;
185 | buildActionMask = 2147483647;
186 | files = (
187 | );
188 | inputPaths = (
189 | );
190 | name = "Compile Kotlin/Native";
191 | outputPaths = (
192 | );
193 | runOnlyForDeploymentPostprocessing = 0;
194 | shellPath = /bin/sh;
195 | shellScript = "rm -f \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\ncd \"$SRCROOT/$KONAN_PACKAGE_NAME\"; sh -c \". ./gradlew $KONAN_TASK -Pkonan.configuration.build.dir=\\\"$CONFIGURATION_BUILD_DIR\\\" \\\n-Pkonan.debugging.symbols=$DEBUGGING_SYMBOLS -Pkonan.optimizations.enable=$KONAN_ENABLE_OPTIMIZATIONS\"\ncp \"$TARGET_BUILD_DIR/$KONAN_PACKAGE_NAME.kexe\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"";
196 | };
197 | /* End PBXShellScriptBuildPhase section */
198 |
199 | /* Begin PBXSourcesBuildPhase section */
200 | BF8C7365EBBA87493221AFB0 /* Sources */ = {
201 | isa = PBXSourcesBuildPhase;
202 | buildActionMask = 2147483647;
203 | files = (
204 | );
205 | runOnlyForDeploymentPostprocessing = 0;
206 | };
207 | /* End PBXSourcesBuildPhase section */
208 |
209 | /* Begin PBXVariantGroup section */
210 | BF8C7B5222E2A40A9B2A4972 /* LaunchScreen.storyboard */ = {
211 | isa = PBXVariantGroup;
212 | children = (
213 | BF8C723DB0EFE9C5C51B7465 /* Base */,
214 | );
215 | name = LaunchScreen.storyboard;
216 | sourceTree = "";
217 | };
218 | BF8C7D8AC208FCB2DC607237 /* Main.storyboard */ = {
219 | isa = PBXVariantGroup;
220 | children = (
221 | BF8C718AF68360C05910D094 /* Base */,
222 | );
223 | name = Main.storyboard;
224 | sourceTree = "";
225 | };
226 | /* End PBXVariantGroup section */
227 |
228 | /* Begin XCBuildConfiguration section */
229 | BF8C71E419EFCACEF5BA5658 /* Release */ = {
230 | isa = XCBuildConfiguration;
231 | buildSettings = {
232 | ALWAYS_SEARCH_USER_PATHS = NO;
233 | CLANG_ANALYZER_NONNULL = YES;
234 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
235 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
236 | CLANG_CXX_LIBRARY = "libc++";
237 | CLANG_ENABLE_MODULES = YES;
238 | CLANG_ENABLE_OBJC_ARC = YES;
239 | CLANG_ENABLE_OBJC_WEAK = YES;
240 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
241 | CLANG_WARN_BOOL_CONVERSION = YES;
242 | CLANG_WARN_COMMA = YES;
243 | CLANG_WARN_CONSTANT_CONVERSION = YES;
244 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
245 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
246 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
247 | CLANG_WARN_EMPTY_BODY = YES;
248 | CLANG_WARN_ENUM_CONVERSION = YES;
249 | CLANG_WARN_INFINITE_RECURSION = YES;
250 | CLANG_WARN_INT_CONVERSION = YES;
251 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
252 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
253 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
255 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
256 | CLANG_WARN_STRICT_PROTOTYPES = YES;
257 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
258 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
259 | CLANG_WARN_UNREACHABLE_CODE = YES;
260 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
261 | CODE_SIGN_IDENTITY = "iPhone Developer";
262 | COPY_PHASE_STRIP = NO;
263 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
264 | ENABLE_NS_ASSERTIONS = NO;
265 | ENABLE_STRICT_OBJC_MSGSEND = YES;
266 | GCC_C_LANGUAGE_STANDARD = gnu11;
267 | GCC_NO_COMMON_BLOCKS = YES;
268 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
269 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
270 | GCC_WARN_UNDECLARED_SELECTOR = YES;
271 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
272 | GCC_WARN_UNUSED_FUNCTION = YES;
273 | GCC_WARN_UNUSED_VARIABLE = YES;
274 | IPHONEOS_DEPLOYMENT_TARGET = 11.4;
275 | MTL_ENABLE_DEBUG_INFO = NO;
276 | SDKROOT = iphoneos;
277 | VALIDATE_PRODUCT = YES;
278 | };
279 | name = Release;
280 | };
281 | BF8C7356204ADAF2F05CC375 /* Debug */ = {
282 | isa = XCBuildConfiguration;
283 | buildSettings = {
284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
285 | INFOPLIST_FILE = ios/Info.plist;
286 | KONAN_ENABLE_OPTIMIZATIONS = NO;
287 | KONAN_PACKAGE_NAME = ios;
288 | "KONAN_TASK[sdk=iphoneos*]" = "compileKonan$(TARGET_NAME:c99extidentifier)Ios_arm64";
289 | "KONAN_TASK[sdk=iphonesimulator*]" = "compileKonan$(TARGET_NAME:c99extidentifier)Ios_x64";
290 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
291 | PRODUCT_BUNDLE_IDENTIFIER = com.marcinmoskala.ios;
292 | PRODUCT_NAME = "$(TARGET_NAME)";
293 | TARGETED_DEVICE_FAMILY = "1,2";
294 | VALID_ARCHS = arm64;
295 | };
296 | name = Debug;
297 | };
298 | BF8C74F64823C7D1922C8DE7 /* Release */ = {
299 | isa = XCBuildConfiguration;
300 | buildSettings = {
301 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
302 | INFOPLIST_FILE = ios/Info.plist;
303 | KONAN_ENABLE_OPTIMIZATIONS = YES;
304 | KONAN_PACKAGE_NAME = ios;
305 | "KONAN_TASK[sdk=iphoneos*]" = "compileKonan$(TARGET_NAME:c99extidentifier)Ios_arm64";
306 | "KONAN_TASK[sdk=iphonesimulator*]" = "compileKonan$(TARGET_NAME:c99extidentifier)Ios_x64";
307 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
308 | PRODUCT_BUNDLE_IDENTIFIER = com.marcinmoskala.ios;
309 | PRODUCT_NAME = "$(TARGET_NAME)";
310 | TARGETED_DEVICE_FAMILY = "1,2";
311 | VALID_ARCHS = arm64;
312 | };
313 | name = Release;
314 | };
315 | BF8C757E22822BEB0DF35906 /* Debug */ = {
316 | isa = XCBuildConfiguration;
317 | buildSettings = {
318 | ALWAYS_SEARCH_USER_PATHS = NO;
319 | CLANG_ANALYZER_NONNULL = YES;
320 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
321 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
322 | CLANG_CXX_LIBRARY = "libc++";
323 | CLANG_ENABLE_MODULES = YES;
324 | CLANG_ENABLE_OBJC_ARC = YES;
325 | CLANG_ENABLE_OBJC_WEAK = YES;
326 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
327 | CLANG_WARN_BOOL_CONVERSION = YES;
328 | CLANG_WARN_COMMA = YES;
329 | CLANG_WARN_CONSTANT_CONVERSION = YES;
330 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
332 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
333 | CLANG_WARN_EMPTY_BODY = YES;
334 | CLANG_WARN_ENUM_CONVERSION = YES;
335 | CLANG_WARN_INFINITE_RECURSION = YES;
336 | CLANG_WARN_INT_CONVERSION = YES;
337 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
338 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
339 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
341 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
342 | CLANG_WARN_STRICT_PROTOTYPES = YES;
343 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
344 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
345 | CLANG_WARN_UNREACHABLE_CODE = YES;
346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
347 | CODE_SIGN_IDENTITY = "iPhone Developer";
348 | COPY_PHASE_STRIP = NO;
349 | DEBUG_INFORMATION_FORMAT = dwarf;
350 | ENABLE_STRICT_OBJC_MSGSEND = YES;
351 | ENABLE_TESTABILITY = YES;
352 | GCC_C_LANGUAGE_STANDARD = gnu11;
353 | GCC_DYNAMIC_NO_PIC = NO;
354 | GCC_NO_COMMON_BLOCKS = YES;
355 | GCC_OPTIMIZATION_LEVEL = 0;
356 | GCC_PREPROCESSOR_DEFINITIONS = (
357 | "DEBUG=1",
358 | "$(inherited)",
359 | );
360 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
361 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
362 | GCC_WARN_UNDECLARED_SELECTOR = YES;
363 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
364 | GCC_WARN_UNUSED_FUNCTION = YES;
365 | GCC_WARN_UNUSED_VARIABLE = YES;
366 | IPHONEOS_DEPLOYMENT_TARGET = 11.4;
367 | MTL_ENABLE_DEBUG_INFO = YES;
368 | ONLY_ACTIVE_ARCH = YES;
369 | SDKROOT = iphoneos;
370 | };
371 | name = Debug;
372 | };
373 | /* End XCBuildConfiguration section */
374 |
375 | /* Begin XCConfigurationList section */
376 | BF8C75CA5EE40A6CF1AB0028 /* Build configuration list for PBXProject "ios" */ = {
377 | isa = XCConfigurationList;
378 | buildConfigurations = (
379 | BF8C757E22822BEB0DF35906 /* Debug */,
380 | BF8C71E419EFCACEF5BA5658 /* Release */,
381 | );
382 | defaultConfigurationIsVisible = 0;
383 | defaultConfigurationName = Release;
384 | };
385 | BF8C79DC568A7203438EDF3C /* Build configuration list for PBXNativeTarget "ios" */ = {
386 | isa = XCConfigurationList;
387 | buildConfigurations = (
388 | BF8C7356204ADAF2F05CC375 /* Debug */,
389 | BF8C74F64823C7D1922C8DE7 /* Release */,
390 | );
391 | defaultConfigurationIsVisible = 0;
392 | };
393 | /* End XCConfigurationList section */
394 | };
395 | rootObject = BF8C71DB81C67BFBF8F95703 /* Project object */;
396 | }
397 |
--------------------------------------------------------------------------------
/ios.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios.xcodeproj/project.xcworkspace/xcuserdata/marcin.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MarcinMoskala/KotlinMultiplatformExample/57b5bca1560442d55eb64c6fb0d6a15d25c01c1c/ios.xcodeproj/project.xcworkspace/xcuserdata/marcin.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ios.xcodeproj/project.xcworkspace/xcuserdata/marcin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ios.xcodeproj/xcuserdata/marcin.xcuserdatad/xcschemes/ios.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
8 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ios.xcodeproj/xcuserdata/marcin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ios.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | iOS.xcscheme
13 |
14 | orderHint
15 | 1
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ios/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
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 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/ios/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ios/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
22 |
23 |
24 |
25 |
26 | true
27 | DEFINITION_ORDER
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
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 |
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 |
144 |
145 | 1531862748761
146 |
147 |
148 | 1531862748761
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
--------------------------------------------------------------------------------
/ios/.idea/xcode.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ios/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 | "info" : {
90 | "version" : 1,
91 | "author" : "xcode"
92 | }
93 | }
--------------------------------------------------------------------------------
/ios/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/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 |
27 |
34 |
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 |
--------------------------------------------------------------------------------
/ios/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/build.gradle:
--------------------------------------------------------------------------------
1 | // ios/build.gradle
2 | apply plugin: 'konan'
3 |
4 | konan.targets = [
5 | 'ios_arm64', 'ios_x64'
6 | ]
7 |
8 | konanArtifacts {
9 | program('ios') {
10 | srcFiles fileTree('src/main/kotlin')
11 | enableDebug true
12 | libraries {
13 | allLibrariesFrom project(':common-native')
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/ios/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MarcinMoskala/KotlinMultiplatformExample/57b5bca1560442d55eb64c6fb0d6a15d25c01c1c/ios/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/ios/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.8.1-all.zip
--------------------------------------------------------------------------------
/ios/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 |
--------------------------------------------------------------------------------
/ios/ios.xcodeproj/xcuserdata/marcin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ios.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ios/src/main/kotlin/AppDelegate.kt:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.kt
3 | // ios
4 | //
5 | // Created by Marcin Moskala on 17.07.2018.
6 | // Copyright © 2018 marcinmoskala. All rights reserved.
7 | //
8 |
9 | import kotlinx.cinterop.*
10 | import platform.UIKit.*
11 |
12 | class AppDelegate : UIResponder(), UIApplicationDelegateProtocol {
13 | companion object : UIResponderMeta(), UIApplicationDelegateProtocolMeta {}
14 |
15 | override fun init() = initBy(AppDelegate())
16 |
17 | private var _window: UIWindow? = null
18 | override fun window() = _window
19 | override fun setWindow(window: UIWindow?) { _window = window }
20 | }
--------------------------------------------------------------------------------
/ios/src/main/kotlin/ViewController.kt:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.kt
3 | // ios
4 | //
5 | // Created by Marcin Moskala on 17.07.2018.
6 | // Copyright © 2018 marcinmoskala. All rights reserved.
7 | //
8 |
9 | import kotlinx.cinterop.*
10 | import platform.Foundation.*
11 | import platform.UIKit.*
12 | import com.marcinmoskala.data.Quote
13 | import com.marcinmoskala.presentation.QuotationPresenter
14 | import com.marcinmoskala.repository.QuotationRepositoryImpl
15 | import com.marcinmoskala.view.QuotationView
16 |
17 | @ExportObjCClass
18 | class ViewController : UIViewController {
19 |
20 | constructor(aDecoder: NSCoder): super(aDecoder)
21 | override fun initWithCoder(aDecoder: NSCoder) = initBy(ViewController(aDecoder))
22 |
23 | @ObjCOutlet lateinit var textView: UILabel
24 | @ObjCOutlet lateinit var authorView: UILabel
25 |
26 | private val quotationView = object : QuotationView {
27 | override fun showQuote(quote: Quote) {
28 | textView.text = quote.text
29 | authorView.text = quote.person
30 | }
31 | }
32 | private val quotationsRepo = QuotationRepositoryImpl()
33 | private val presenter = QuotationPresenter(quotationView, quotationsRepo)
34 |
35 | override fun viewDidLoad() {
36 | presenter.onStart()
37 | }
38 |
39 | @ObjCAction
40 | fun onNext() {
41 | presenter.onNext()
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ios/src/main/kotlin/main.kt:
--------------------------------------------------------------------------------
1 | //
2 | // main.kt
3 | // ios
4 | //
5 | // Created by Marcin Moskala on 17.07.2018.
6 | // Copyright © 2018 marcinmoskala. All rights reserved.
7 | //
8 |
9 | import kotlinx.cinterop.*
10 | import platform.Foundation.*
11 | import platform.UIKit.*
12 |
13 | fun main(args: Array) {
14 | memScoped {
15 | val argc = args.size + 1
16 | val argv = (arrayOf("konan") + args).map { it.cstr.getPointer(memScope) }.toCValues()
17 |
18 | autoreleasepool {
19 | UIApplicationMain(argc, argv, null, NSStringFromClass(AppDelegate))
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include 'web'
2 | include 'android'
3 | include 'android:mobile'
4 | include 'common'
5 | include 'common-js'
6 | include 'common-jvm'
7 | include 'common-native'
8 | include 'web-vanilla'
--------------------------------------------------------------------------------
/web-vanilla/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-platform-js'
2 |
3 | dependencies {
4 | expectedBy project(':common')
5 | compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
6 | testCompile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
7 | testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
8 | testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
9 | testCompile "io.mockk:mockk-js:$mockk_version"
10 | }
11 |
12 | compileKotlin2Js {
13 | kotlinOptions.moduleKind = 'plain'
14 | }
15 |
16 | task assembleWeb(type: Sync) {
17 | configurations.compile.each { file ->
18 | from(zipTree(file.absolutePath), {
19 | includeEmptyDirs = false
20 | include { fileTreeElement ->
21 | def path = fileTreeElement.path
22 | path.endsWith(".js") && (path.startsWith("META-INF/resources/") ||
23 | !path.startsWith("META-INF/"))
24 | }
25 | })
26 | }
27 | from compileKotlin2Js.destinationDir
28 | into "${projectDir}/build/web"
29 |
30 | dependsOn classes
31 | }
32 |
33 | assemble.dependsOn assembleWeb
--------------------------------------------------------------------------------
/web-vanilla/css/style.css:
--------------------------------------------------------------------------------
1 | .center {
2 | position: absolute;
3 | top: 50%;
4 | left: 50%;
5 | transform: translate(-50%, -50%);
6 | }
7 |
8 | .person {
9 | text-align: right;
10 | }
11 |
12 | .quotation-container {
13 | text-align: center;
14 | }
15 |
16 | .text {
17 | font-weight: 600;
18 | font-family: "Open Sans", open-sans, sans-serif;
19 | font-size: 28px;
20 | }
--------------------------------------------------------------------------------
/web-vanilla/main.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Quotations
6 |
7 |
8 |
9 |
16 |
17 |
18 |
19 |
31 |
--------------------------------------------------------------------------------
/web/build.gradle:
--------------------------------------------------------------------------------
1 | group "org.kotlinacademy"
2 | version "1.1"
3 |
4 | apply plugin: 'org.jetbrains.kotlin.frontend'
5 | apply plugin: 'kotlin2js'
6 |
7 | kotlinFrontend {
8 | downloadNodeJsVersion = '10.0.0'
9 |
10 | npm {
11 | dependency("webpack-cli", "v2.0.12")
12 | dependency("firebase", "^4.6.2")
13 | dependency("react", "15.6.1")
14 | dependency("react-dom", "15.6.1")
15 | dependency("react-router-dom", "4.2.2")
16 | dependency("@material-ui/core", "1.1.0")
17 | }
18 |
19 | sourceMaps = true
20 |
21 | webpackBundle {
22 | bundleName = "main"
23 | contentPath = file('src/main/web')
24 | proxyUrl = "http://localhost:8080"
25 | }
26 | }
27 |
28 | dependencies {
29 | compile project(':common-js')
30 | compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
31 | compile("org.jetbrains.kotlinx:kotlinx-html-js:0.6.11") { force = true }
32 | compile "org.jetbrains:kotlin-react:16.4.1-pre.34-kotlin-1.2.50"
33 | compile "org.jetbrains:kotlin-react-dom:16.4.1-pre.34-kotlin-1.2.50"
34 | }
35 |
36 | compileKotlin2Js {
37 | kotlinOptions.metaInfo = true
38 | kotlinOptions.outputFile = "$project.buildDir.path/js/${project.name}.js"
39 | kotlinOptions.sourceMap = true
40 | kotlinOptions.moduleKind = 'commonjs'
41 | kotlinOptions.main = "call"
42 | }
--------------------------------------------------------------------------------
/web/src/main/kotlin/com/marcinmoskala/components/QuotesComponent.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala.components
2 |
3 | import com.marcinmoskala.data.*
4 | import com.marcinmoskala.presentation.*
5 | import com.marcinmoskala.repository.*
6 | import com.marcinmoskala.view.*
7 | import kotlinx.html.js.*
8 | import react.*
9 | import react.dom.*
10 |
11 | class QuotesComponent : RComponent(), QuotationView {
12 |
13 | private val repo = QuotationRepositoryImpl()
14 | private val presenter = QuotationPresenter(this, repo)
15 |
16 | override fun componentDidMount() {
17 | presenter.onStart()
18 | }
19 |
20 | override fun RBuilder.render() {
21 | div(classes = "center") {
22 | val quote = state.quote
23 | if (quote == null) {
24 | +"No quote yet"
25 | } else {
26 | div(classes = "quotation-container") {
27 | div(classes = "text") { +quote.text }
28 | div(classes = "person") { +quote.person }
29 | button(classes = "next") {
30 | +"Next"
31 | attrs { onClickFunction = { presenter.onNext() } }
32 | }
33 | }
34 | }
35 | }
36 | }
37 |
38 | override fun showQuote(quote: Quote) {
39 | setState { this.quote = quote }
40 | }
41 | }
42 |
43 | external interface ManagerComponentState : RState {
44 | var quote: Quote?
45 | }
--------------------------------------------------------------------------------
/web/src/main/kotlin/com/marcinmoskala/main.kt:
--------------------------------------------------------------------------------
1 | package com.marcinmoskala
2 |
3 | import com.marcinmoskala.components.QuotesComponent
4 | import react.dom.render
5 | import kotlin.browser.document
6 | import kotlin.browser.window
7 |
8 | fun main(args: Array) {
9 | window.onload = {
10 | render(document.getElementById("root")!!) {
11 | child(QuotesComponent::class) {}
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/web/src/main/web/css/style.css:
--------------------------------------------------------------------------------
1 | .center {
2 | position: absolute;
3 | top: 50%;
4 | left: 50%;
5 | transform: translate(-50%, -50%);
6 | }
7 |
8 | .person {
9 | text-align: right;
10 | }
11 |
12 | .quotation-container {
13 | text-align: center;
14 | }
15 |
16 | .text {
17 | font-weight: 600;
18 | font-family: "Open Sans", open-sans, sans-serif;
19 | font-size: 28px;
20 | }
--------------------------------------------------------------------------------
/web/src/main/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Quotations
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------