├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── app_js
├── src
│ └── main
│ │ ├── kotlin
│ │ ├── TextProvider.kt
│ │ ├── i18nextModules.kt
│ │ ├── ru
│ │ │ └── pocketbyte
│ │ │ │ └── locolaser
│ │ │ │ └── example
│ │ │ │ └── ui
│ │ │ │ └── MainScreenView.kt
│ │ └── main.kt
│ │ └── resources
│ │ ├── locales
│ │ └── en
│ │ │ └── strings.json
│ │ ├── index.html
│ │ ├── jquery-i18next.min.js
│ │ ├── i18nextXHRBackend.js
│ │ └── i18nextBrowserLanguageDetector.js
└── build.gradle
├── app_ios
├── locolaser-kotlin-multiplatform-example
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── locolaser-kotlin-multiplatform-example
│ │ ├── Assets.xcassets
│ │ │ ├── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── Base.lproj
│ │ │ ├── Localizable.strings
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── ViewController.swift
│ │ ├── Info.plist
│ │ └── AppDelegate.swift
│ ├── locolaser-kotlin-multiplatform-example.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ ├── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ │ └── xcuserdata
│ │ │ │ └── dash.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ ├── xcuserdata
│ │ │ └── dash.xcuserdatad
│ │ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ └── project.pbxproj
│ ├── Base.lproj
│ │ ├── Localizable.strings
│ │ ├── Localizable.stringsdict
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── build.gradle
│ ├── ViewController.swift
│ ├── Info.plist
│ └── AppDelegate.swift
├── locolaser-kotlin-multiplatform-example.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ └── dash.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── xcuserdata
│ │ └── dash.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ └── project.pbxproj
└── ios_app_framework
│ ├── ios_app_framework.h
│ └── Info.plist
├── app_android
├── src
│ └── main
│ │ ├── res
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ ├── values
│ │ │ ├── colors.xml
│ │ │ ├── styles.xml
│ │ │ └── strings.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── layout
│ │ │ └── activity_main.xml
│ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ └── drawable
│ │ │ └── ic_launcher_background.xml
│ │ ├── java
│ │ └── ru
│ │ │ └── pocketbyte
│ │ │ └── locolaser
│ │ │ └── example
│ │ │ ├── ApplicationImpl.kt
│ │ │ └── ui
│ │ │ └── MainActivity.kt
│ │ └── AndroidManifest.xml
├── proguard-rules.pro
└── build.gradle
├── common
├── src
│ ├── main
│ │ └── AndroidManifest.xml
│ ├── commonMain
│ │ └── kotlin
│ │ │ └── ru
│ │ │ └── pocketbyte
│ │ │ └── locolaser
│ │ │ └── example
│ │ │ ├── repository
│ │ │ └── Repository.kt
│ │ │ └── presentation
│ │ │ ├── MainScreenContract.kt
│ │ │ └── MainScreenPresenter.kt
│ ├── iosMain
│ │ └── kotlin
│ │ │ └── ru
│ │ │ └── pocketbyte
│ │ │ └── locolaser
│ │ │ └── example
│ │ │ └── repository
│ │ │ └── Repository.kt
│ ├── jsMain
│ │ └── kotlin
│ │ │ └── ru
│ │ │ └── pocketbyte
│ │ │ └── locolaser
│ │ │ └── example
│ │ │ └── repository
│ │ │ └── Repository.kt
│ ├── jvmMain
│ │ └── kotlin
│ │ │ └── ru
│ │ │ └── pocketbyte
│ │ │ └── locolaser
│ │ │ └── example
│ │ │ └── repository
│ │ │ └── Repository.kt
│ └── androidMain
│ │ └── kotlin
│ │ └── ru
│ │ └── pocketbyte
│ │ └── locolaser
│ │ └── example
│ │ └── repository
│ │ └── Repository.kt
├── localize_config.json
└── build.gradle
├── .gitignore
├── LICENSE.txt
├── gradle.properties
├── gradlew.bat
├── gradlew
├── README.md
└── LICENSE
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app_android'
2 | include ':app_js'
3 | include ':common'
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app_js/src/main/kotlin/TextProvider.kt:
--------------------------------------------------------------------------------
1 | object TextProvider {
2 | fun getText(): String {
3 | return "Hello Kotlin JS"
4 | }
5 | }
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/app_js/src/main/kotlin/i18nextModules.kt:
--------------------------------------------------------------------------------
1 | external val i18nextXHRBackend: dynamic = definedExternally
2 | external val i18nextBrowserLanguageDetector: dynamic = definedExternally
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/common/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app_android/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/common/src/commonMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.repository
2 |
3 | import ru.pocketbyte.locolaser.kmpp.StringRepository
4 |
5 | expect object Repository {
6 |
7 | val str: StringRepository
8 |
9 | }
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun May 27 17:30:22 MSK 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.0-all.zip
7 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app_js/src/main/resources/locales/en/strings.json:
--------------------------------------------------------------------------------
1 | {"app_name": "locolaser-kotlin-multiplatform-example","screen_main_hello_text": "Hello Kotlin!","screen_main_plural_string_plural_0": "Plural: one apple","screen_main_plural_string_plural_1": "Plural: {{count}} apples","screen_main_formatted_text": "The price for {{product}} is {{price}}"}
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/xcuserdata/dash.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_ios/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/xcuserdata/dash.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/app_android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/common/src/iosMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.repository
2 |
3 | import ru.pocketbyte.locolaser.kmpp.IosStringRepository
4 | import ru.pocketbyte.locolaser.kmpp.StringRepository
5 |
6 | actual object Repository {
7 |
8 | actual val str: StringRepository = IosStringRepository()
9 |
10 | }
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example/Base.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This file was automatically generated by the LocoLaser tool.
4 | * It should not be modified by hand.
5 | */
6 |
7 | "app_name" = "locolaser-kotlin-multiplatform-example";
8 |
9 | "screen_main_hello_text" = "Hello Kotlin!";
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/xcuserdata/dash.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/PocketByte/locolaser-kotlin-mpp-example/HEAD/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example.xcodeproj/project.xcworkspace/xcuserdata/dash.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/Base.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This file was automatically generated by the LocoLaser tool.
4 | * It should not be modified by hand.
5 | */
6 |
7 | "app_name" = "locolaser-kotlin-multiplatform-example";
8 |
9 | "screen_main_hello_text" = "Hello Kotlin!";
10 |
11 | "screen_main_formatted_text" = "The price for %@ is %.2f";
--------------------------------------------------------------------------------
/common/src/commonMain/kotlin/ru/pocketbyte/locolaser/example/presentation/MainScreenContract.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.presentation
2 |
3 | interface MainScreenContract {
4 |
5 | interface View {
6 | fun showMessage1(message: String)
7 | fun showMessage2(message: String)
8 | fun showMessage3(message: String)
9 | }
10 |
11 | interface Presenter {
12 | fun start()
13 | }
14 |
15 | }
--------------------------------------------------------------------------------
/app_android/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'konan'
2 |
3 | // Specify targets to build the framework: iOS and iOS simulator
4 | konan.targets = ['ios_arm64', 'ios_x64']
5 |
6 | konanArtifacts {
7 | // Declare building into a framework.
8 | program('App') {
9 | // The multiplatform support is disabled by default.
10 | enableMultiplatform true
11 | }
12 | }
13 |
14 | dependencies {
15 | expectedBy project(':common')
16 | }
17 |
--------------------------------------------------------------------------------
/app_android/src/main/java/ru/pocketbyte/locolaser/example/ApplicationImpl.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example
2 |
3 | import android.app.Application
4 | import ru.pocketbyte.locolaser.example.repository.Repository
5 | import ru.pocketbyte.locolaser.kmpp.AndroidStringRepository
6 |
7 | public class ApplicationImpl : Application() {
8 |
9 | override fun onCreate() {
10 | super.onCreate()
11 |
12 | // 5.1 Init Android Repository
13 | Repository.initInstance(AndroidStringRepository(this))
14 | }
15 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #built application files
2 | *.apk
3 | *.ap_
4 |
5 | # files for the dex VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 | *.iml
11 |
12 | # generated files
13 | bin/
14 | gen/
15 |
16 | # Local configuration file (sdk path, etc)
17 | local.properties
18 |
19 | # Windows thumbnail db
20 | Thumbs.db
21 |
22 | # OSX files
23 | .DS_Store
24 |
25 | # Eclipse project files
26 | .classpath
27 | .project
28 |
29 | # Android Studio
30 | .idea
31 | #.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
32 | .gradle
33 | build/
--------------------------------------------------------------------------------
/common/src/jsMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.repository
2 |
3 | import ru.pocketbyte.locolaser.kmpp.StringRepository
4 |
5 | actual object Repository {
6 |
7 | private var _str: StringRepository? = null
8 |
9 | actual val str: StringRepository
10 | get() = _str!!
11 |
12 | fun init(str: StringRepository) {
13 | if (_str != null)
14 | throw IllegalStateException("Repository already initialized")
15 | _str = str
16 | }
17 |
18 |
19 | }
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example.xcodeproj/xcuserdata/dash.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | locolaser-kotlin-multiplatform-example.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app_js/src/main/resources/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/common/src/commonMain/kotlin/ru/pocketbyte/locolaser/example/presentation/MainScreenPresenter.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.presentation
2 |
3 | import ru.pocketbyte.locolaser.example.repository.Repository
4 |
5 | public class MainScreenPresenter(
6 | private val view: MainScreenContract.View
7 | ): MainScreenContract.Presenter {
8 |
9 | override fun start() {
10 | this.view.showMessage1(Repository.str.screen_main_hello_text)
11 | this.view.showMessage2(Repository.str.screen_main_plural_string(10))
12 | this.view.showMessage3(Repository.str.screen_main_formatted_text("Apple", 3.5))
13 | }
14 | }
--------------------------------------------------------------------------------
/common/src/jvmMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.repository
2 |
3 | import ru.pocketbyte.locolaser.kmpp.StringRepository
4 |
5 | actual object Repository {
6 |
7 | private var stringRepository: StringRepository? = null
8 |
9 | public fun initInstance(stringRepository: StringRepository) {
10 | if (this.stringRepository != null)
11 | throw IllegalStateException("Repository already initialized")
12 | this.stringRepository = stringRepository
13 | }
14 |
15 | actual val str: StringRepository
16 | get() = this.stringRepository!!
17 |
18 | }
--------------------------------------------------------------------------------
/common/src/androidMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.repository
2 |
3 | import ru.pocketbyte.locolaser.kmpp.StringRepository
4 |
5 | actual object Repository {
6 |
7 | private var stringRepository: StringRepository? = null
8 |
9 | public fun initInstance(stringRepository: StringRepository) {
10 | if (this.stringRepository != null)
11 | throw IllegalStateException("Repository already initialized")
12 | this.stringRepository = stringRepository
13 | }
14 |
15 | actual val str: StringRepository
16 | get() = this.stringRepository!!
17 |
18 | }
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright © 2019 Denis Shurygin. All rights reserved.
2 | Contacts:
3 |
4 | Licensed under the Apache License, Version 2.0 (the "License");
5 | you may not use this file except in compliance with the License.
6 | You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License.
15 |
--------------------------------------------------------------------------------
/app_ios/ios_app_framework/ios_app_framework.h:
--------------------------------------------------------------------------------
1 | //
2 | // ios_app_framework.h
3 | // ios_app_framework
4 | //
5 | // Created by Dash on 03/09/2019.
6 | // Copyright © 2019 PcketByte.ru. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for ios_app_framework.
12 | FOUNDATION_EXPORT double ios_app_frameworkVersionNumber;
13 |
14 | //! Project version string for ios_app_framework.
15 | FOUNDATION_EXPORT const unsigned char ios_app_frameworkVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app_android/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | locolaser-kotlin-multiplatform-example
8 | Hello Kotlin!
9 |
10 | - Plural: no apples
11 | - Plural: one apple
12 | - Plural: %d apples
13 |
14 | The price for %s is %.2f
15 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | org.gradle.configureondemand=false
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example.xcodeproj/xcuserdata/dash.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ios_app_framework.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 1
11 |
12 | locolaser-kotlin-multiplatform-example.xcscheme
13 |
14 | orderHint
15 | 0
16 |
17 | locolaser-kotlin-multiplatform-example.xcscheme_^#shared#^_
18 |
19 | orderHint
20 | 0
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app_ios/ios_app_framework/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 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app_android/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 |
--------------------------------------------------------------------------------
/app_android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app_android/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion project.android_sdk_compile
7 | buildToolsVersion project.android_build_tool_version
8 |
9 | defaultConfig {
10 | applicationId "ru.pocketbyte.locolaser.example"
11 | minSdkVersion project.android_sdk_min
12 | targetSdkVersion project.android_sdk_target
13 | versionCode 1
14 | versionName "1.0"
15 | }
16 | buildTypes {
17 | release {
18 |
19 | }
20 | }
21 |
22 | packagingOptions {
23 | exclude 'META-INF/main.kotlin_module'
24 | }
25 | }
26 |
27 | dependencies {
28 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
29 | implementation "com.android.support:appcompat-v7:$android_support_version"
30 |
31 | implementation project(':common')
32 | }
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // VievController.swift
3 | // locolaser-kotlin-multiplatform-example
4 | //
5 | // Created by Dash on 28.05.2018.
6 | // Copyright © 2018 PcketByte.ru. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import ios_app_framework
11 |
12 | class ViewController: UIViewController, MainScreenContractView {
13 |
14 | @IBOutlet weak var labelMessage1: UILabel!
15 | @IBOutlet weak var labelMessage2: UILabel!
16 | @IBOutlet weak var labelMessage3: UILabel!
17 |
18 | override func viewDidLoad() {
19 | super.viewDidLoad()
20 |
21 | MainScreenPresenter(view: self).start()
22 | }
23 |
24 | func showMessage1(message: String) {
25 | labelMessage1.text = message
26 | }
27 |
28 | func showMessage2(message: String) {
29 | labelMessage2.text = message
30 | }
31 |
32 | func showMessage3(message: String) {
33 | labelMessage3.text = message
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/Base.lproj/Localizable.stringsdict:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | screen_main_plural_string
9 |
10 | NSStringLocalizedFormatKey
11 | %#@value@
12 | value
13 |
14 | NSStringFormatSpecTypeKey
15 | NSStringPluralRuleType
16 | NSStringFormatValueTypeKey
17 | d
18 | zero
19 | Plural: no apples
20 | one
21 | Plural: one apple
22 | other
23 | Plural: %d apples
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app_js/src/main/kotlin/ru/pocketbyte/locolaser/example/ui/MainScreenView.kt:
--------------------------------------------------------------------------------
1 | import org.w3c.dom.Document
2 | import kotlin.dom.*
3 | import ru.pocketbyte.locolaser.example.presentation.MainScreenContract
4 | import ru.pocketbyte.locolaser.example.repository.Repository
5 |
6 | class MainScreenView(document: Document): MainScreenContract.View {
7 |
8 | private val textTitle = document.getElementById("text_title")
9 | private val text1 = document.getElementById("text_1")
10 | private val text2 = document.getElementById("text_2")
11 | private val text3 = document.getElementById("text_3")
12 |
13 | init {
14 | textTitle?.appendText(Repository.str.app_name)
15 | }
16 |
17 | override fun showMessage1(message: String) {
18 | text1?.clear()
19 | text1?.appendText(message)
20 | }
21 |
22 | override fun showMessage2(message: String) {
23 | text2?.clear()
24 | text2?.appendText(message)
25 | }
26 |
27 | override fun showMessage3(message: String) {
28 | text3?.clear()
29 | text3?.appendText(message)
30 | }
31 | }
--------------------------------------------------------------------------------
/common/localize_config.json:
--------------------------------------------------------------------------------
1 | {
2 | "platform": [
3 | {
4 | "type": "kotlin-common",
5 | "res_dir": "./build/generated/locolaser/common/"
6 | },
7 | {
8 | "type": "kotlin-android",
9 | "res_dir": "./build/generated/locolaser/android/"
10 | },
11 | {
12 | "type": "kotlin-ios",
13 | "res_dir": "./build/generated/locolaser/ios/"
14 | },
15 | {
16 | "type": "kotlin-js",
17 | "res_dir": "./build/generated/locolaser/js/"
18 | }
19 | ],
20 | "source": [
21 | {
22 | "type": "android",
23 | "res_dir": "../app_android/src/main/res/"
24 | },
25 | {
26 | "type": "ios",
27 | "res_dir": "../app_ios/locolaser-kotlin-multiplatform-example/"
28 | },
29 | {
30 | "type": "json",
31 | "res_dir": "../app_js/src/main/resources/locales/"
32 | }
33 | ],
34 | "locales": ["base"],
35 | "temp_dir": "./build/temp/",
36 | "duplicate_comment":false
37 | }
--------------------------------------------------------------------------------
/app_android/src/main/java/ru/pocketbyte/locolaser/example/ui/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package ru.pocketbyte.locolaser.example.ui
2 |
3 | import android.support.v7.app.AppCompatActivity
4 | import android.os.Bundle
5 | import kotlinx.android.synthetic.main.activity_main.*
6 | import ru.pocketbyte.locolaser.example.R
7 | import ru.pocketbyte.locolaser.example.presentation.MainScreenContract
8 | import ru.pocketbyte.locolaser.example.presentation.MainScreenPresenter
9 |
10 | public class MainActivity : AppCompatActivity(), MainScreenContract.View {
11 |
12 | private var presenter: MainScreenContract.Presenter = MainScreenPresenter(this)
13 |
14 | protected override fun onCreate(savedInstanceState: Bundle?) {
15 | super.onCreate(savedInstanceState)
16 | setContentView(R.layout.activity_main)
17 |
18 | this.presenter.start()
19 | }
20 |
21 | override fun showMessage1(message: String) {
22 | text1.text = message
23 | }
24 |
25 | override fun showMessage2(message: String) {
26 | text2.text = message
27 | }
28 |
29 | override fun showMessage3(message: String) {
30 | text3.text = message
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // VievController.swift
3 | // locolaser-kotlin-multiplatform-example
4 | //
5 | // Created by Dash on 28.05.2018.
6 | // Copyright © 2018 PcketByte.ru. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | @IBOutlet var label: UILabel!
14 |
15 | override func viewDidLoad() {
16 | super.viewDidLoad()
17 |
18 | // Do any additional setup after loading the view.
19 | }
20 |
21 | override func didReceiveMemoryWarning() {
22 | super.didReceiveMemoryWarning()
23 | // Dispose of any resources that can be recreated.
24 | }
25 |
26 |
27 | /*
28 | // MARK: - Navigation
29 |
30 | // In a storyboard-based application, you will often want to do a little preparation before navigation
31 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
32 | // Get the new view controller using segue.destinationViewController.
33 | // Pass the selected object to the new view controller.
34 | }
35 | */
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app_android/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
23 |
24 |
25 |
31 |
32 |
--------------------------------------------------------------------------------
/app_js/src/main/kotlin/main.kt:
--------------------------------------------------------------------------------
1 | import kotlin.browser.*
2 | import i18next.*
3 | import ru.pocketbyte.locolaser.example.presentation.MainScreenContract
4 | import ru.pocketbyte.locolaser.example.presentation.MainScreenPresenter
5 | import ru.pocketbyte.locolaser.kmpp.JsStringRepository
6 | import ru.pocketbyte.locolaser.example.repository.Repository
7 |
8 | fun main() {
9 | initI18n { _, _ ->
10 | // 5.3 Init JS Repository
11 | Repository.init(JsStringRepository(i18next))
12 | initPresentation()
13 | }
14 | }
15 |
16 | lateinit var presenter: MainScreenContract.Presenter
17 |
18 | fun initPresentation() {
19 | presenter = MainScreenPresenter(MainScreenView(document))
20 | presenter.start()
21 | }
22 |
23 | private val remoteConfig = js("""{
24 | fallbackLng: 'en',
25 | debug: true,
26 | ns: ['strings'],
27 | defaultNS: 'strings',
28 | simplifyPluralSuffix: false,
29 | backend: {
30 | loadPath: "./locales/{{lng}}/{{ns}}.json",
31 | crossDomain: true
32 | }
33 | }""")
34 |
35 | private fun initI18n(callback: (err: Any?, t: Any?) -> Unit) {
36 | i18next.use(i18nextXHRBackend)
37 | .use(i18nextBrowserLanguageDetector)
38 | .init(remoteConfig, callback)
39 | }
40 |
--------------------------------------------------------------------------------
/app_js/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin2js'
2 |
3 | group 'ru.pocketbyte.locolaser'
4 | version '1.0'
5 |
6 | ext {
7 | outputDir = "./build/out"
8 | }
9 |
10 | repositories {
11 | mavenCentral()
12 | jcenter()
13 | }
14 |
15 | dependencies {
16 | implementation "org.jetbrains.kotlin:kotlin-stdlib-js"
17 | implementation "org.jetbrains.kotlinx:kotlinx-html-js:0.6.12"
18 | implementation "ru.pocketbyte.locolaser:i18next-externals:1.0"
19 | implementation project.findProject(":common")
20 | }
21 |
22 | task copyAppSources(type: Copy) {
23 | from "$buildDir/classes/kotlin/main/${project.name}.js",
24 | "$projectDir/src/main/resources/"
25 | into file("$outputDir/")
26 | }
27 |
28 | task copyKotlinJs(type: Copy) {
29 | from(zipTree(project.configurations.runtimeClasspath.find {
30 | it.name.startsWith("kotlin-stdlib-js-")
31 | }.canonicalPath)) {
32 | include "kotlin.js"
33 | }
34 | into file("$outputDir/")
35 | }
36 |
37 | task copyCommonJs(type: Copy) {
38 | from(zipTree(project.configurations.runtimeClasspath.find {
39 | it.name.startsWith("common")
40 | }.canonicalPath)) {
41 | include "common.js"
42 | }
43 | into file("$outputDir/")
44 | }
45 |
46 | task copyAllSourcesIntoOutputDir {
47 | dependsOn copyAppSources
48 | dependsOn copyKotlinJs
49 | dependsOn copyCommonJs
50 | }
51 |
52 | project.tasks.build.finalizedBy copyAllSourcesIntoOutputDir
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/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 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example/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 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/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 |
--------------------------------------------------------------------------------
/app_js/src/main/resources/jquery-i18next.min.js:
--------------------------------------------------------------------------------
1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.jqueryI18next=e()}(this,function(){"use strict";function t(t,a){function i(n,a,i){function r(t,n){return f.parseDefaultValueFromContent?e({},t,{defaultValue:n}):t}if(0!==a.length){var o="text";if(0===a.indexOf("[")){var l=a.split("]");a=l[1],o=l[0].substr(1,l[0].length-1)}if(a.indexOf(";")===a.length-1&&(a=a.substr(0,a.length-2)),"html"===o)n.html(t.t(a,r(i,n.html())));else if("text"===o)n.text(t.t(a,r(i,n.text())));else if("prepend"===o)n.prepend(t.t(a,r(i,n.html())));else if("append"===o)n.append(t.t(a,r(i,n.html())));else if(0===o.indexOf("data-")){var s=o.substr("data-".length),d=t.t(a,r(i,n.data(s)));n.data(s,d),n.attr(o,d)}else n.attr(o,t.t(a,r(i,n.attr(o))))}}function r(t,n){var r=t.attr(f.selectorAttr);if(r||void 0===r||!1===r||(r=t.text()||t.val()),r){var o=t,l=t.data(f.targetAttr);if(l&&(o=t.find(l)||t),n||!0!==f.useOptionsAttr||(n=t.data(f.optionsAttr)),n=n||{},r.indexOf(";")>=0){var s=r.split(";");a.each(s,function(t,e){""!==e&&i(o,e.trim(),n)})}else i(o,r,n);if(!0===f.useOptionsAttr){var d={};d=e({clone:d},n),delete d.lng,t.data(f.optionsAttr,d)}}}function o(t){return this.each(function(){r(a(this),t),a(this).find("["+f.selectorAttr+"]").each(function(){r(a(this),t)})})}var f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};f=e({},n,f),a[f.tName]=t.t.bind(t),a[f.i18nName]=t,a.fn[f.handleName]=o}var e=Object.assign||function(t){for(var e=1;e
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 |
--------------------------------------------------------------------------------
/app_android/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/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 | }
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example/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 | }
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // locolaser-kotlin-multiplatform-example
4 | //
5 | // Created by Dash on 27.05.2018.
6 | // Copyright © 2018 PcketByte.ru. 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 | // Override point for customization after application launch.
18 | return true
19 | }
20 |
21 | func applicationWillResignActive(_ application: UIApplication) {
22 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
23 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
24 | }
25 |
26 | func applicationDidEnterBackground(_ application: UIApplication) {
27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | func applicationWillEnterForeground(_ application: UIApplication) {
32 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
33 | }
34 |
35 | func applicationDidBecomeActive(_ application: UIApplication) {
36 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
37 | }
38 |
39 | func applicationWillTerminate(_ application: UIApplication) {
40 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
41 | }
42 |
43 |
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // locolaser-kotlin-multiplatform-example
4 | //
5 | // Created by Dash on 27.05.2018.
6 | // Copyright © 2018 PcketByte.ru. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(_ application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(_ application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(_ application: UIApplication) {
33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(_ application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(_ application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/common/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'kotlin-multiplatform'
2 | apply plugin: 'com.android.library'
3 |
4 | // 2.1: Apply LocoLaser plugin
5 | apply plugin: "ru.pocketbyte.locolaser"
6 |
7 | group = 'ru.pocketbyte.locolaser.kotlin_multiplatform_example'
8 | version = '1.0'
9 |
10 | // 2.2: Configure localization config
11 | localize {
12 | configFromFile("${project.projectDir}/localize_config.json")
13 | }
14 |
15 | android {
16 | compileSdkVersion project.android_sdk_compile
17 | buildToolsVersion project.android_build_tool_version
18 |
19 | defaultConfig {
20 | minSdkVersion project.android_sdk_min
21 | targetSdkVersion project.android_sdk_target
22 | versionCode 1
23 | versionName project.version
24 | }
25 | buildTypes {
26 | release {
27 | minifyEnabled false
28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
29 | }
30 | }
31 | }
32 |
33 | kotlin {
34 | targets {
35 | fromPreset(presets.android, 'android')
36 | fromPreset(presets.jvm, 'jvm')
37 | fromPreset(presets.js, 'js') {
38 | configure([compilations.main, compilations.test]) {
39 | tasks.getByName(compileKotlinTaskName).kotlinOptions {
40 | sourceMap = true
41 | moduleKind = "umd"
42 | metaInfo = true
43 | }
44 | }
45 | }
46 |
47 | final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
48 | ? presets.iosArm64 : presets.iosX64
49 |
50 | fromPreset(iOSTarget, 'ios') {
51 | binaries {
52 | framework('ios_app_framework')
53 | }
54 | }
55 | }
56 |
57 | sourceSets {
58 | commonMain {
59 | // 6.1 Add source dir for generated common classes
60 | kotlin.srcDir('./build/generated/locolaser/common/')
61 | dependencies {
62 | api 'org.jetbrains.kotlin:kotlin-stdlib-common'
63 |
64 | }
65 | }
66 |
67 | androidMain {
68 | // 6.2 Add source dir for generated android classes
69 | kotlin.srcDir('./build/generated/locolaser/android/')
70 | dependencies {
71 | api 'org.jetbrains.kotlin:kotlin-stdlib'
72 | api "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
73 | }
74 | }
75 |
76 | jsMain {
77 | // 6.3 Add source dir for generated js classes
78 | kotlin.srcDir('./build/generated/locolaser/js/')
79 | dependencies {
80 | api 'org.jetbrains.kotlin:kotlin-stdlib'
81 | api "org.jetbrains.kotlin:kotlin-stdlib-js"
82 | // 5.2 Add i18next dependency
83 | api "ru.pocketbyte.locolaser:i18next-externals:1.0"
84 | }
85 | }
86 |
87 | iosMain {
88 | // 6.4 Add source dir for generated iOS classes
89 | kotlin.srcDir('./build/generated/locolaser/ios/')
90 | }
91 | }
92 | }
93 |
94 | // 4 Run task ‘localize’ before each build
95 | preBuild.dependsOn {
96 | project.tasks.getByPath(':common:localize')
97 | }
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example/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 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
25 |
31 |
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # LocoLaser Kotlin Multiplatform Example
2 | [LocoLaser](https://github.com/PocketByte/LocoLaser/) - Localization tool that generate localization files for various platforms depends on common source.
3 |
This example shows how to use LocoLaser in Kotlin Mobile Multiplatform projects to generate localized strings repository class with common interface for both mobile platforms: Android and iOS.
4 |
5 | ##### 1 Step: Add artifacts dependency
6 | Choose which type of artifact you will use and add them as **`classpath`** dependency.
7 | This example uses artifact to work with Kotlin Mobile Multiplatform projects:
8 | ```groovy
9 | buildscript {
10 | repositories {
11 | // 1.1: Add maven repositories
12 | maven { url "https://plugins.gradle.org/m2/" }
13 | mavenCentral()
14 | ...
15 | }
16 | dependencies {
17 | // 1.2: Add plugin classpath dependency
18 | classpath "gradle.plugin.ru.pocketbyte.locolaser:plugin:2.2.5"
19 |
20 | // 1.3: Add dependency for Kotlin Multiplatform
21 | classpath "ru.pocketbyte.locolaser:platform-kotlin-mpp:2.2.5"
22 | // 1.4: Add dependency for JSON platform (for JS i18next)
23 | classpath "ru.pocketbyte.locolaser:platform-json:2.2.5"
24 |
25 | ...
26 | }
27 | }
28 | ```
29 |
30 | ##### 2 Step: Apply and configure gradle plugin
31 | Example uses standard way to apply custom gradle plugin.
32 | Apply plugin in **`build.gradle`** of common module:
33 | ```groovy
34 | // 2.1: Apply LocoLaser plugin
35 | apply plugin: "ru.pocketbyte.locolaser"
36 |
37 | // 2.2: Configure localization config
38 | localize {
39 | configFromFile("${project.projectDir}/localize_config.json")
40 | }
41 | ```
42 |
43 | ##### 3 Step: Create configuration file
44 | How to build config file you can find in Wiki:[Platform: Kotlin Mobile Multiplatform](https://github.com/PocketByte/LocoLaser/wiki/Platform:-Kotlin-Mobile-Multiplatform)
45 | By default this config file should have name`"localize_config.json"` and be placed in the root folder of the project.
46 |
47 | ##### 4 Step: Run task 'localize' before build
48 | This example run **`:localize`** task before each build. To do it add task dependencies in **`build.gradle`** of common module:
49 | ```groovy
50 | // 4 Run task ‘localize’ before each build
51 | preBuild.dependsOn {
52 | project.tasks.getByPath(':common:localize')
53 | }
54 | ```
55 |
56 |
57 | ##### 5 Step: Init repository
58 | As a final step instance of Strings repository should be created. This example use common object [Repository](https://github.com/PocketByte/locolaser-kotlin-mpp-example/blob/master/common/src/commonMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt) with ‘expect’ modifier. This object should be implemented for each platform independently.
59 | In Android application it's better to implement [standard singleton](https://github.com/PocketByte/locolaser-kotlin-mpp-example/blob/master/common/src/androidMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt) and initialize it in `Application` class in method `onCreate`:
60 | ```kotlin
61 | // 5.1 Init Android Repository
62 | Repository.initInstance(AndroidStringRepository(this))
63 | ```
64 | In iOS application it's better to initialize property right in [property declaration](https://github.com/PocketByte/locolaser-kotlin-mpp-example/blob/master/common/src/iosMain/kotlin/ru/pocketbyte/locolaser/example/repository/Repository.kt)
65 |
66 | JS implementation require `i18next` object as parameter So at first first add dependency with externals into common **`build.gradle`**:
67 | ```groovy
68 | kotlin {
69 | sourceSets {
70 | jsMain {
71 | // 5.2 Add i18next dependency
72 | dependencies {
73 | api "ru.pocketbyte.locolaser:i18next-externals:1.0"
74 | }
75 | }
76 | }
77 | }
78 | ```
79 | Then you should initialize it before use:
80 | ```kotlin
81 | i18next.init(localizationConfig) { _, _ ->
82 | // 5.3 Init JS Repository
83 | Repository.init(JsStringRepository(i18next))
84 | ...
85 | }
86 | ```
87 |
88 | ##### Usage in code
89 | Now any string can be received using code as following:
90 | ```kotlin
91 | Repository.str.screen_main_hello_text
92 | ```
93 |
94 | ##### 6 Step: Move generated files into build folder
95 | Because String Repository classes generated depends on string resources, no need to hold them together with other source classes and commit into git. This example overrides `res_dir` of kotlin classes and put them into folders `./build/generated/locolaser/[platform]`. To tell gradle plugin about this files, add source dirs into **`gradle.build`** of common module:
96 | ```groovy
97 |
98 | kotlin {
99 | sourceSets {
100 | commonMain {
101 | // 6.1 Add source dir for generated common classes
102 | kotlin.srcDir('./build/generated/locolaser/common/')
103 |
104 | ...
105 | }
106 |
107 | androidMain {
108 | // 6.2 Add source dir for generated android classes
109 | kotlin.srcDir('./build/generated/locolaser/android/')
110 |
111 | ...
112 | }
113 |
114 | jsMain {
115 | // 6.3 Add source dir for generated js classes
116 | kotlin.srcDir('./build/generated/locolaser/js/')
117 |
118 | ...
119 | }
120 |
121 | iosMain {
122 | // 6.4 Add source dir for generated iOS classes
123 | kotlin.srcDir('./build/generated/locolaser/ios/')
124 |
125 | ...
126 | }
127 | }
128 | ...
129 | }
130 | ```
131 |
132 | ## License
133 | ```
134 | Copyright © 2019 Denis Shurygin. All rights reserved.
135 | Contacts:
136 |
137 | Licensed under the Apache License, Version 2.0 (the "License");
138 | you may not use this file except in compliance with the License.
139 | You may obtain a copy of the License at
140 |
141 | http://www.apache.org/licenses/LICENSE-2.0
142 |
143 | Unless required by applicable law or agreed to in writing, software
144 | distributed under the License is distributed on an "AS IS" BASIS,
145 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
146 | See the License for the specific language governing permissions and
147 | limitations under the License.
148 | ```
149 |
--------------------------------------------------------------------------------
/app_android/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app_js/src/main/resources/i18nextXHRBackend.js:
--------------------------------------------------------------------------------
1 | (function (global, factory) {
2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 | typeof define === 'function' && define.amd ? define(factory) :
4 | (global = global || self, global.i18nextXHRBackend = factory());
5 | }(this, function () { 'use strict';
6 |
7 | function _classCallCheck(instance, Constructor) {
8 | if (!(instance instanceof Constructor)) {
9 | throw new TypeError("Cannot call a class as a function");
10 | }
11 | }
12 |
13 | function _defineProperties(target, props) {
14 | for (var i = 0; i < props.length; i++) {
15 | var descriptor = props[i];
16 | descriptor.enumerable = descriptor.enumerable || false;
17 | descriptor.configurable = true;
18 | if ("value" in descriptor) descriptor.writable = true;
19 | Object.defineProperty(target, descriptor.key, descriptor);
20 | }
21 | }
22 |
23 | function _createClass(Constructor, protoProps, staticProps) {
24 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
25 | if (staticProps) _defineProperties(Constructor, staticProps);
26 | return Constructor;
27 | }
28 |
29 | var arr = [];
30 | var each = arr.forEach;
31 | var slice = arr.slice;
32 | function defaults(obj) {
33 | each.call(slice.call(arguments, 1), function (source) {
34 | if (source) {
35 | for (var prop in source) {
36 | if (obj[prop] === undefined) obj[prop] = source[prop];
37 | }
38 | }
39 | });
40 | return obj;
41 | }
42 |
43 | function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
44 |
45 | function _typeof(obj) {
46 | if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
47 | _typeof = function _typeof(obj) {
48 | return _typeof2(obj);
49 | };
50 | } else {
51 | _typeof = function _typeof(obj) {
52 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
53 | };
54 | }
55 |
56 | return _typeof(obj);
57 | }
58 |
59 | function addQueryString(url, params) {
60 | if (params && _typeof(params) === 'object') {
61 | var queryString = '',
62 | e = encodeURIComponent; // Must encode data
63 |
64 | for (var paramName in params) {
65 | queryString += '&' + e(paramName) + '=' + e(params[paramName]);
66 | }
67 |
68 | if (!queryString) {
69 | return url;
70 | }
71 |
72 | url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);
73 | }
74 |
75 | return url;
76 | } // https://gist.github.com/Xeoncross/7663273
77 |
78 |
79 | function ajax(url, options, callback, data, cache) {
80 | if (data && _typeof(data) === 'object') {
81 | if (!cache) {
82 | data['_t'] = new Date();
83 | } // URL encoded form data must be in querystring format
84 |
85 |
86 | data = addQueryString('', data).slice(1);
87 | }
88 |
89 | if (options.queryStringParams) {
90 | url = addQueryString(url, options.queryStringParams);
91 | }
92 |
93 | try {
94 | var x;
95 |
96 | if (XMLHttpRequest) {
97 | x = new XMLHttpRequest();
98 | } else {
99 | x = new ActiveXObject('MSXML2.XMLHTTP.3.0');
100 | }
101 |
102 | x.open(data ? 'POST' : 'GET', url, 1);
103 |
104 | if (!options.crossDomain) {
105 | x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
106 | }
107 |
108 | x.withCredentials = !!options.withCredentials;
109 |
110 | if (data) {
111 | x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
112 | }
113 |
114 | if (x.overrideMimeType) {
115 | x.overrideMimeType("application/json");
116 | }
117 |
118 | var h = options.customHeaders;
119 |
120 | if (h) {
121 | for (var i in h) {
122 | x.setRequestHeader(i, h[i]);
123 | }
124 | }
125 |
126 | x.onreadystatechange = function () {
127 | x.readyState > 3 && callback && callback(x.responseText, x);
128 | };
129 |
130 | x.send(data);
131 | } catch (e) {
132 | console && console.log(e);
133 | }
134 | }
135 |
136 | function getDefaults() {
137 | return {
138 | loadPath: '/locales/{{lng}}/{{ns}}.json',
139 | addPath: '/locales/add/{{lng}}/{{ns}}',
140 | allowMultiLoading: false,
141 | parse: JSON.parse,
142 | crossDomain: false,
143 | ajax: ajax
144 | };
145 | }
146 |
147 | var Backend =
148 | /*#__PURE__*/
149 | function () {
150 | function Backend(services) {
151 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
152 |
153 | _classCallCheck(this, Backend);
154 |
155 | this.init(services, options);
156 | this.type = 'backend';
157 | }
158 |
159 | _createClass(Backend, [{
160 | key: "init",
161 | value: function init(services) {
162 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
163 | this.services = services;
164 | this.options = defaults(options, this.options || {}, getDefaults());
165 | }
166 | }, {
167 | key: "readMulti",
168 | value: function readMulti(languages, namespaces, callback) {
169 | var loadPath = this.options.loadPath;
170 |
171 | if (typeof this.options.loadPath === 'function') {
172 | loadPath = this.options.loadPath(languages, namespaces);
173 | }
174 |
175 | var url = this.services.interpolator.interpolate(loadPath, {
176 | lng: languages.join('+'),
177 | ns: namespaces.join('+')
178 | });
179 | this.loadUrl(url, callback);
180 | }
181 | }, {
182 | key: "read",
183 | value: function read(language, namespace, callback) {
184 | var loadPath = this.options.loadPath;
185 |
186 | if (typeof this.options.loadPath === 'function') {
187 | loadPath = this.options.loadPath([language], [namespace]);
188 | }
189 |
190 | var url = this.services.interpolator.interpolate(loadPath, {
191 | lng: language,
192 | ns: namespace
193 | });
194 | this.loadUrl(url, callback);
195 | }
196 | }, {
197 | key: "loadUrl",
198 | value: function loadUrl(url, callback) {
199 | var _this = this;
200 |
201 | this.options.ajax(url, this.options, function (data, xhr) {
202 | if (xhr.status >= 500 && xhr.status < 600) return callback('failed loading ' + url, true
203 | /* retry */
204 | );
205 | if (xhr.status >= 400 && xhr.status < 500) return callback('failed loading ' + url, false
206 | /* no retry */
207 | );
208 | var ret, err;
209 |
210 | try {
211 | ret = _this.options.parse(data, url);
212 | } catch (e) {
213 | err = 'failed parsing ' + url + ' to json';
214 | }
215 |
216 | if (err) return callback(err, false);
217 | callback(null, ret);
218 | });
219 | }
220 | }, {
221 | key: "create",
222 | value: function create(languages, namespace, key, fallbackValue) {
223 | var _this2 = this;
224 |
225 | if (typeof languages === 'string') languages = [languages];
226 | var payload = {};
227 | payload[key] = fallbackValue || '';
228 | languages.forEach(function (lng) {
229 | var url = _this2.services.interpolator.interpolate(_this2.options.addPath, {
230 | lng: lng,
231 | ns: namespace
232 | });
233 |
234 | _this2.options.ajax(url, _this2.options, function (data, xhr) {//const statusCode = xhr.status.toString();
235 | // TODO: if statusCode === 4xx do log
236 | }, payload);
237 | });
238 | }
239 | }]);
240 |
241 | return Backend;
242 | }();
243 |
244 | Backend.type = 'backend';
245 |
246 | return Backend;
247 |
248 | }));
249 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app_js/src/main/resources/i18nextBrowserLanguageDetector.js:
--------------------------------------------------------------------------------
1 | (function (global, factory) {
2 | typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 | typeof define === 'function' && define.amd ? define(factory) :
4 | (global.i18nextBrowserLanguageDetector = factory());
5 | }(this, function () { 'use strict';
6 |
7 | var arr = [];
8 | var each = arr.forEach;
9 | var slice = arr.slice;
10 |
11 | function defaults(obj) {
12 | each.call(slice.call(arguments, 1), function (source) {
13 | if (source) {
14 | for (var prop in source) {
15 | if (obj[prop] === undefined) obj[prop] = source[prop];
16 | }
17 | }
18 | });
19 | return obj;
20 | }
21 |
22 | var cookie = {
23 | create: function create(name, value, minutes, domain) {
24 | var expires = void 0;
25 | if (minutes) {
26 | var date = new Date();
27 | date.setTime(date.getTime() + minutes * 60 * 1000);
28 | expires = '; expires=' + date.toGMTString();
29 | } else expires = '';
30 | domain = domain ? 'domain=' + domain + ';' : '';
31 | document.cookie = name + '=' + value + expires + ';' + domain + 'path=/';
32 | },
33 |
34 | read: function read(name) {
35 | var nameEQ = name + '=';
36 | var ca = document.cookie.split(';');
37 | for (var i = 0; i < ca.length; i++) {
38 | var c = ca[i];
39 | while (c.charAt(0) === ' ') {
40 | c = c.substring(1, c.length);
41 | }if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
42 | }
43 | return null;
44 | },
45 |
46 | remove: function remove(name) {
47 | this.create(name, '', -1);
48 | }
49 | };
50 |
51 | var cookie$1 = {
52 | name: 'cookie',
53 |
54 | lookup: function lookup(options) {
55 | var found = void 0;
56 |
57 | if (options.lookupCookie && typeof document !== 'undefined') {
58 | var c = cookie.read(options.lookupCookie);
59 | if (c) found = c;
60 | }
61 |
62 | return found;
63 | },
64 | cacheUserLanguage: function cacheUserLanguage(lng, options) {
65 | if (options.lookupCookie && typeof document !== 'undefined') {
66 | cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain);
67 | }
68 | }
69 | };
70 |
71 | var querystring = {
72 | name: 'querystring',
73 |
74 | lookup: function lookup(options) {
75 | var found = void 0;
76 |
77 | if (typeof window !== 'undefined') {
78 | var query = window.location.search.substring(1);
79 | var params = query.split('&');
80 | for (var i = 0; i < params.length; i++) {
81 | var pos = params[i].indexOf('=');
82 | if (pos > 0) {
83 | var key = params[i].substring(0, pos);
84 | if (key === options.lookupQuerystring) {
85 | found = params[i].substring(pos + 1);
86 | }
87 | }
88 | }
89 | }
90 |
91 | return found;
92 | }
93 | };
94 |
95 | var hasLocalStorageSupport = void 0;
96 | try {
97 | hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;
98 | var testKey = 'i18next.translate.boo';
99 | window.localStorage.setItem(testKey, 'foo');
100 | window.localStorage.removeItem(testKey);
101 | } catch (e) {
102 | hasLocalStorageSupport = false;
103 | }
104 |
105 | var localStorage = {
106 | name: 'localStorage',
107 |
108 | lookup: function lookup(options) {
109 | var found = void 0;
110 |
111 | if (options.lookupLocalStorage && hasLocalStorageSupport) {
112 | var lng = window.localStorage.getItem(options.lookupLocalStorage);
113 | if (lng) found = lng;
114 | }
115 |
116 | return found;
117 | },
118 | cacheUserLanguage: function cacheUserLanguage(lng, options) {
119 | if (options.lookupLocalStorage && hasLocalStorageSupport) {
120 | window.localStorage.setItem(options.lookupLocalStorage, lng);
121 | }
122 | }
123 | };
124 |
125 | var navigator$1 = {
126 | name: 'navigator',
127 |
128 | lookup: function lookup(options) {
129 | var found = [];
130 |
131 | if (typeof navigator !== 'undefined') {
132 | if (navigator.languages) {
133 | // chrome only; not an array, so can't use .push.apply instead of iterating
134 | for (var i = 0; i < navigator.languages.length; i++) {
135 | found.push(navigator.languages[i]);
136 | }
137 | }
138 | if (navigator.userLanguage) {
139 | found.push(navigator.userLanguage);
140 | }
141 | if (navigator.language) {
142 | found.push(navigator.language);
143 | }
144 | }
145 |
146 | return found.length > 0 ? found : undefined;
147 | }
148 | };
149 |
150 | var htmlTag = {
151 | name: 'htmlTag',
152 |
153 | lookup: function lookup(options) {
154 | var found = void 0;
155 | var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);
156 |
157 | if (htmlTag && typeof htmlTag.getAttribute === 'function') {
158 | found = htmlTag.getAttribute('lang');
159 | }
160 |
161 | return found;
162 | }
163 | };
164 |
165 | var path = {
166 | name: 'path',
167 |
168 | lookup: function lookup(options) {
169 | var found = void 0;
170 | if (typeof window !== 'undefined') {
171 | var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
172 | if (language instanceof Array) {
173 | if (typeof options.lookupFromPathIndex === 'number') {
174 | if (typeof language[options.lookupFromPathIndex] !== 'string') {
175 | return undefined;
176 | }
177 | found = language[options.lookupFromPathIndex].replace('/', '');
178 | } else {
179 | found = language[0].replace('/', '');
180 | }
181 | }
182 | }
183 | return found;
184 | }
185 | };
186 |
187 | var subdomain = {
188 | name: 'subdomain',
189 |
190 | lookup: function lookup(options) {
191 | var found = void 0;
192 | if (typeof window !== 'undefined') {
193 | var language = window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);
194 | if (language instanceof Array) {
195 | if (typeof options.lookupFromSubdomainIndex === 'number') {
196 | found = language[options.lookupFromSubdomainIndex].replace('http://', '').replace('https://', '').replace('.', '');
197 | } else {
198 | found = language[0].replace('http://', '').replace('https://', '').replace('.', '');
199 | }
200 | }
201 | }
202 | return found;
203 | }
204 | };
205 |
206 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
207 |
208 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
209 |
210 | function getDefaults() {
211 | return {
212 | order: ['querystring', 'cookie', 'localStorage', 'navigator', 'htmlTag'],
213 | lookupQuerystring: 'lng',
214 | lookupCookie: 'i18next',
215 | lookupLocalStorage: 'i18nextLng',
216 |
217 | // cache user language
218 | caches: ['localStorage'],
219 | excludeCacheFor: ['cimode']
220 | //cookieMinutes: 10,
221 | //cookieDomain: 'myDomain'
222 | };
223 | }
224 |
225 | var Browser = function () {
226 | function Browser(services) {
227 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
228 |
229 | _classCallCheck(this, Browser);
230 |
231 | this.type = 'languageDetector';
232 | this.detectors = {};
233 |
234 | this.init(services, options);
235 | }
236 |
237 | _createClass(Browser, [{
238 | key: 'init',
239 | value: function init(services) {
240 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
241 | var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
242 |
243 | this.services = services;
244 | this.options = defaults(options, this.options || {}, getDefaults());
245 |
246 | // backwards compatibility
247 | if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
248 |
249 | this.i18nOptions = i18nOptions;
250 |
251 | this.addDetector(cookie$1);
252 | this.addDetector(querystring);
253 | this.addDetector(localStorage);
254 | this.addDetector(navigator$1);
255 | this.addDetector(htmlTag);
256 | this.addDetector(path);
257 | this.addDetector(subdomain);
258 | }
259 | }, {
260 | key: 'addDetector',
261 | value: function addDetector(detector) {
262 | this.detectors[detector.name] = detector;
263 | }
264 | }, {
265 | key: 'detect',
266 | value: function detect(detectionOrder) {
267 | var _this = this;
268 |
269 | if (!detectionOrder) detectionOrder = this.options.order;
270 |
271 | var detected = [];
272 | detectionOrder.forEach(function (detectorName) {
273 | if (_this.detectors[detectorName]) {
274 | var lookup = _this.detectors[detectorName].lookup(_this.options);
275 | if (lookup && typeof lookup === 'string') lookup = [lookup];
276 | if (lookup) detected = detected.concat(lookup);
277 | }
278 | });
279 |
280 | var found = void 0;
281 | detected.forEach(function (lng) {
282 | if (found) return;
283 | var cleanedLng = _this.services.languageUtils.formatLanguageCode(lng);
284 | if (_this.services.languageUtils.isWhitelisted(cleanedLng)) found = cleanedLng;
285 | });
286 |
287 | if (!found) {
288 | var fallbacks = this.i18nOptions.fallbackLng;
289 | if (typeof fallbacks === 'string') fallbacks = [fallbacks];
290 | if (!fallbacks) fallbacks = [];
291 |
292 | if (Object.prototype.toString.apply(fallbacks) === '[object Array]') {
293 | found = fallbacks[0];
294 | } else {
295 | found = fallbacks[0] || fallbacks.default && fallbacks.default[0];
296 | }
297 | };
298 |
299 | return found;
300 | }
301 | }, {
302 | key: 'cacheUserLanguage',
303 | value: function cacheUserLanguage(lng, caches) {
304 | var _this2 = this;
305 |
306 | if (!caches) caches = this.options.caches;
307 | if (!caches) return;
308 | if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
309 | caches.forEach(function (cacheName) {
310 | if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options);
311 | });
312 | }
313 | }]);
314 |
315 | return Browser;
316 | }();
317 |
318 | Browser.type = 'languageDetector';
319 |
320 | return Browser;
321 |
322 | }));
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example/locolaser-kotlin-multiplatform-example.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | C89A9D0520BDF9F500A19C77 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C89A9D0320BDF9F500A19C77 /* Localizable.strings */; };
11 | C8A822BE20BAF801004C070F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8A822BC20BAF801004C070F /* Main.storyboard */; };
12 | C8A822C020BAF802004C070F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8A822BF20BAF802004C070F /* Assets.xcassets */; };
13 | C8A822C320BAF802004C070F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8A822C120BAF802004C070F /* LaunchScreen.storyboard */; };
14 | C8A822D020BC9B76004C070F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A822CF20BC9B76004C070F /* ViewController.swift */; };
15 | C8A822D220BCA023004C070F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A822D120BCA023004C070F /* AppDelegate.swift */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXFileReference section */
19 | C89A9D0420BDF9F500A19C77 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; };
20 | C8A822B520BAF801004C070F /* locolaser-kotlin-multiplatform-example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "locolaser-kotlin-multiplatform-example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
21 | C8A822BD20BAF801004C070F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
22 | C8A822BF20BAF802004C070F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
23 | C8A822C220BAF802004C070F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
24 | C8A822C420BAF802004C070F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
25 | C8A822CD20BC9AC1004C070F /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; path = src; sourceTree = SOURCE_ROOT; };
26 | C8A822CF20BC9B76004C070F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
27 | C8A822D120BCA023004C070F /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
28 | /* End PBXFileReference section */
29 |
30 | /* Begin PBXFrameworksBuildPhase section */
31 | C8A822B220BAF801004C070F /* Frameworks */ = {
32 | isa = PBXFrameworksBuildPhase;
33 | buildActionMask = 2147483647;
34 | files = (
35 | );
36 | runOnlyForDeploymentPostprocessing = 0;
37 | };
38 | /* End PBXFrameworksBuildPhase section */
39 |
40 | /* Begin PBXGroup section */
41 | C8A822AC20BAF801004C070F = {
42 | isa = PBXGroup;
43 | children = (
44 | C8A822B720BAF801004C070F /* locolaser-kotlin-multiplatform-example */,
45 | C8A822B620BAF801004C070F /* Products */,
46 | );
47 | sourceTree = "";
48 | };
49 | C8A822B620BAF801004C070F /* Products */ = {
50 | isa = PBXGroup;
51 | children = (
52 | C8A822B520BAF801004C070F /* locolaser-kotlin-multiplatform-example.app */,
53 | );
54 | name = Products;
55 | sourceTree = "";
56 | };
57 | C8A822B720BAF801004C070F /* locolaser-kotlin-multiplatform-example */ = {
58 | isa = PBXGroup;
59 | children = (
60 | C8A822D120BCA023004C070F /* AppDelegate.swift */,
61 | C8A822CF20BC9B76004C070F /* ViewController.swift */,
62 | C8A822BC20BAF801004C070F /* Main.storyboard */,
63 | C8A822BF20BAF802004C070F /* Assets.xcassets */,
64 | C89A9D0320BDF9F500A19C77 /* Localizable.strings */,
65 | C8A822C120BAF802004C070F /* LaunchScreen.storyboard */,
66 | C8A822C420BAF802004C070F /* Info.plist */,
67 | C8A822CD20BC9AC1004C070F /* src */,
68 | );
69 | path = "locolaser-kotlin-multiplatform-example";
70 | sourceTree = "";
71 | };
72 | /* End PBXGroup section */
73 |
74 | /* Begin PBXNativeTarget section */
75 | C8A822B420BAF801004C070F /* locolaser-kotlin-multiplatform-example */ = {
76 | isa = PBXNativeTarget;
77 | buildConfigurationList = C8A822C720BAF802004C070F /* Build configuration list for PBXNativeTarget "locolaser-kotlin-multiplatform-example" */;
78 | buildPhases = (
79 | C8A822CA20BC9933004C070F /* Remove Original Binary */,
80 | C8A822B120BAF801004C070F /* Sources */,
81 | C8A822B220BAF801004C070F /* Frameworks */,
82 | C8A822CB20BC995C004C070F /* Build Binary From Kotlin Sources */,
83 | C8A822CC20BC99C8004C070F /* Replace Binary */,
84 | C8A822B320BAF801004C070F /* Resources */,
85 | );
86 | buildRules = (
87 | );
88 | dependencies = (
89 | );
90 | name = "locolaser-kotlin-multiplatform-example";
91 | productName = "locolaser-kotlin-multiplatform-example";
92 | productReference = C8A822B520BAF801004C070F /* locolaser-kotlin-multiplatform-example.app */;
93 | productType = "com.apple.product-type.application";
94 | };
95 | /* End PBXNativeTarget section */
96 |
97 | /* Begin PBXProject section */
98 | C8A822AD20BAF801004C070F /* Project object */ = {
99 | isa = PBXProject;
100 | attributes = {
101 | LastSwiftUpdateCheck = 0930;
102 | LastUpgradeCheck = 0930;
103 | ORGANIZATIONNAME = PcketByte.ru;
104 | TargetAttributes = {
105 | C8A822B420BAF801004C070F = {
106 | CreatedOnToolsVersion = 9.3.1;
107 | };
108 | };
109 | };
110 | buildConfigurationList = C8A822B020BAF801004C070F /* Build configuration list for PBXProject "locolaser-kotlin-multiplatform-example" */;
111 | compatibilityVersion = "Xcode 9.3";
112 | developmentRegion = en;
113 | hasScannedForEncodings = 0;
114 | knownRegions = (
115 | en,
116 | Base,
117 | );
118 | mainGroup = C8A822AC20BAF801004C070F;
119 | productRefGroup = C8A822B620BAF801004C070F /* Products */;
120 | projectDirPath = "";
121 | projectRoot = "";
122 | targets = (
123 | C8A822B420BAF801004C070F /* locolaser-kotlin-multiplatform-example */,
124 | );
125 | };
126 | /* End PBXProject section */
127 |
128 | /* Begin PBXResourcesBuildPhase section */
129 | C8A822B320BAF801004C070F /* Resources */ = {
130 | isa = PBXResourcesBuildPhase;
131 | buildActionMask = 2147483647;
132 | files = (
133 | C89A9D0520BDF9F500A19C77 /* Localizable.strings in Resources */,
134 | C8A822C320BAF802004C070F /* LaunchScreen.storyboard in Resources */,
135 | C8A822C020BAF802004C070F /* Assets.xcassets in Resources */,
136 | C8A822BE20BAF801004C070F /* Main.storyboard in Resources */,
137 | );
138 | runOnlyForDeploymentPostprocessing = 0;
139 | };
140 | /* End PBXResourcesBuildPhase section */
141 |
142 | /* Begin PBXShellScriptBuildPhase section */
143 | C8A822CA20BC9933004C070F /* Remove Original Binary */ = {
144 | isa = PBXShellScriptBuildPhase;
145 | buildActionMask = 2147483647;
146 | files = (
147 | );
148 | inputPaths = (
149 | );
150 | name = "Remove Original Binary";
151 | outputPaths = (
152 | );
153 | runOnlyForDeploymentPostprocessing = 0;
154 | shellPath = /bin/sh;
155 | shellScript = "rm -f \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"";
156 | };
157 | C8A822CB20BC995C004C070F /* Build Binary From Kotlin Sources */ = {
158 | isa = PBXShellScriptBuildPhase;
159 | buildActionMask = 2147483647;
160 | files = (
161 | );
162 | inputPaths = (
163 | );
164 | name = "Build Binary From Kotlin Sources";
165 | outputPaths = (
166 | );
167 | runOnlyForDeploymentPostprocessing = 0;
168 | shellPath = /bin/sh;
169 | shellScript = "\"$SRCROOT/../gradlew\" -p \"$SRCROOT\" \"$KONAN_TASK\" \\\n-Pkonan.configuration.build.dir=\"$CONFIGURATION_BUILD_DIR\" \\\n-Pkonan.debugging.symbols=\"$DEBUGGING_SYMBOLS\" \\\n-Pkonan.optimizations.enable=\"$KONAN_ENABLE_OPTIMIZATIONS\"";
170 | };
171 | C8A822CC20BC99C8004C070F /* Replace Binary */ = {
172 | isa = PBXShellScriptBuildPhase;
173 | buildActionMask = 2147483647;
174 | files = (
175 | );
176 | inputPaths = (
177 | );
178 | name = "Replace Binary";
179 | outputPaths = (
180 | );
181 | runOnlyForDeploymentPostprocessing = 0;
182 | shellPath = /bin/sh;
183 | shellScript = "cp \"$TARGET_BUILD_DIR/app.kexe\" \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"";
184 | };
185 | /* End PBXShellScriptBuildPhase section */
186 |
187 | /* Begin PBXSourcesBuildPhase section */
188 | C8A822B120BAF801004C070F /* Sources */ = {
189 | isa = PBXSourcesBuildPhase;
190 | buildActionMask = 2147483647;
191 | files = (
192 | C8A822D220BCA023004C070F /* AppDelegate.swift in Sources */,
193 | C8A822D020BC9B76004C070F /* ViewController.swift in Sources */,
194 | );
195 | runOnlyForDeploymentPostprocessing = 0;
196 | };
197 | /* End PBXSourcesBuildPhase section */
198 |
199 | /* Begin PBXVariantGroup section */
200 | C89A9D0320BDF9F500A19C77 /* Localizable.strings */ = {
201 | isa = PBXVariantGroup;
202 | children = (
203 | C89A9D0420BDF9F500A19C77 /* Base */,
204 | );
205 | name = Localizable.strings;
206 | sourceTree = "";
207 | };
208 | C8A822BC20BAF801004C070F /* Main.storyboard */ = {
209 | isa = PBXVariantGroup;
210 | children = (
211 | C8A822BD20BAF801004C070F /* Base */,
212 | );
213 | name = Main.storyboard;
214 | sourceTree = "";
215 | };
216 | C8A822C120BAF802004C070F /* LaunchScreen.storyboard */ = {
217 | isa = PBXVariantGroup;
218 | children = (
219 | C8A822C220BAF802004C070F /* Base */,
220 | );
221 | name = LaunchScreen.storyboard;
222 | sourceTree = "";
223 | };
224 | /* End PBXVariantGroup section */
225 |
226 | /* Begin XCBuildConfiguration section */
227 | C8A822C520BAF802004C070F /* Debug */ = {
228 | isa = XCBuildConfiguration;
229 | buildSettings = {
230 | ALWAYS_SEARCH_USER_PATHS = NO;
231 | CLANG_ANALYZER_NONNULL = YES;
232 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
233 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
234 | CLANG_CXX_LIBRARY = "libc++";
235 | CLANG_ENABLE_MODULES = YES;
236 | CLANG_ENABLE_OBJC_ARC = YES;
237 | CLANG_ENABLE_OBJC_WEAK = YES;
238 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
239 | CLANG_WARN_BOOL_CONVERSION = YES;
240 | CLANG_WARN_COMMA = YES;
241 | CLANG_WARN_CONSTANT_CONVERSION = YES;
242 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
243 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
244 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
245 | CLANG_WARN_EMPTY_BODY = YES;
246 | CLANG_WARN_ENUM_CONVERSION = YES;
247 | CLANG_WARN_INFINITE_RECURSION = YES;
248 | CLANG_WARN_INT_CONVERSION = YES;
249 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
250 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
251 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
253 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
254 | CLANG_WARN_STRICT_PROTOTYPES = YES;
255 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
256 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
257 | CLANG_WARN_UNREACHABLE_CODE = YES;
258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
259 | CODE_SIGN_IDENTITY = "iPhone Developer";
260 | COPY_PHASE_STRIP = NO;
261 | DEBUG_INFORMATION_FORMAT = dwarf;
262 | ENABLE_STRICT_OBJC_MSGSEND = YES;
263 | ENABLE_TESTABILITY = YES;
264 | GCC_C_LANGUAGE_STANDARD = gnu11;
265 | GCC_DYNAMIC_NO_PIC = NO;
266 | GCC_NO_COMMON_BLOCKS = YES;
267 | GCC_OPTIMIZATION_LEVEL = 0;
268 | GCC_PREPROCESSOR_DEFINITIONS = (
269 | "DEBUG=1",
270 | "$(inherited)",
271 | );
272 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
273 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
274 | GCC_WARN_UNDECLARED_SELECTOR = YES;
275 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
276 | GCC_WARN_UNUSED_FUNCTION = YES;
277 | GCC_WARN_UNUSED_VARIABLE = YES;
278 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
279 | MTL_ENABLE_DEBUG_INFO = YES;
280 | ONLY_ACTIVE_ARCH = YES;
281 | SDKROOT = iphoneos;
282 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
283 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
284 | };
285 | name = Debug;
286 | };
287 | C8A822C620BAF802004C070F /* Release */ = {
288 | isa = XCBuildConfiguration;
289 | buildSettings = {
290 | ALWAYS_SEARCH_USER_PATHS = NO;
291 | CLANG_ANALYZER_NONNULL = YES;
292 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
293 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
294 | CLANG_CXX_LIBRARY = "libc++";
295 | CLANG_ENABLE_MODULES = YES;
296 | CLANG_ENABLE_OBJC_ARC = YES;
297 | CLANG_ENABLE_OBJC_WEAK = YES;
298 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
299 | CLANG_WARN_BOOL_CONVERSION = YES;
300 | CLANG_WARN_COMMA = YES;
301 | CLANG_WARN_CONSTANT_CONVERSION = YES;
302 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
303 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
304 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
305 | CLANG_WARN_EMPTY_BODY = YES;
306 | CLANG_WARN_ENUM_CONVERSION = YES;
307 | CLANG_WARN_INFINITE_RECURSION = YES;
308 | CLANG_WARN_INT_CONVERSION = YES;
309 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
310 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
311 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
312 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
313 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
314 | CLANG_WARN_STRICT_PROTOTYPES = YES;
315 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
316 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
317 | CLANG_WARN_UNREACHABLE_CODE = YES;
318 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
319 | CODE_SIGN_IDENTITY = "iPhone Developer";
320 | COPY_PHASE_STRIP = NO;
321 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
322 | ENABLE_NS_ASSERTIONS = NO;
323 | ENABLE_STRICT_OBJC_MSGSEND = YES;
324 | GCC_C_LANGUAGE_STANDARD = gnu11;
325 | GCC_NO_COMMON_BLOCKS = YES;
326 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
327 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
328 | GCC_WARN_UNDECLARED_SELECTOR = YES;
329 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
330 | GCC_WARN_UNUSED_FUNCTION = YES;
331 | GCC_WARN_UNUSED_VARIABLE = YES;
332 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
333 | MTL_ENABLE_DEBUG_INFO = NO;
334 | SDKROOT = iphoneos;
335 | SWIFT_COMPILATION_MODE = wholemodule;
336 | SWIFT_OPTIMIZATION_LEVEL = "-O";
337 | VALIDATE_PRODUCT = YES;
338 | };
339 | name = Release;
340 | };
341 | C8A822C820BAF802004C070F /* Debug */ = {
342 | isa = XCBuildConfiguration;
343 | buildSettings = {
344 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
345 | CODE_SIGN_STYLE = Automatic;
346 | DEVELOPMENT_TEAM = QYF24V9H2B;
347 | INFOPLIST_FILE = "locolaser-kotlin-multiplatform-example/Info.plist";
348 | KONAN_ENABLE_OPTIMIZATIONS = NO;
349 | KONAN_TASK = "";
350 | "KONAN_TASK[sdk=iphonesimulator*]" = compileKonanAppIos_x64;
351 | LD_RUNPATH_SEARCH_PATHS = (
352 | "$(inherited)",
353 | "@executable_path/Frameworks",
354 | );
355 | PRODUCT_BUNDLE_IDENTIFIER = "ru.pocketbyte.locolaser-kotlin-multiplatform-example";
356 | PRODUCT_NAME = "$(TARGET_NAME)";
357 | SWIFT_VERSION = 4.0;
358 | TARGETED_DEVICE_FAMILY = "1,2";
359 | };
360 | name = Debug;
361 | };
362 | C8A822C920BAF802004C070F /* Release */ = {
363 | isa = XCBuildConfiguration;
364 | buildSettings = {
365 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
366 | CODE_SIGN_STYLE = Automatic;
367 | DEVELOPMENT_TEAM = QYF24V9H2B;
368 | INFOPLIST_FILE = "locolaser-kotlin-multiplatform-example/Info.plist";
369 | KONAN_ENABLE_OPTIMIZATIONS = YES;
370 | KONAN_TASK = "";
371 | LD_RUNPATH_SEARCH_PATHS = (
372 | "$(inherited)",
373 | "@executable_path/Frameworks",
374 | );
375 | PRODUCT_BUNDLE_IDENTIFIER = "ru.pocketbyte.locolaser-kotlin-multiplatform-example";
376 | PRODUCT_NAME = "$(TARGET_NAME)";
377 | SWIFT_VERSION = 4.0;
378 | TARGETED_DEVICE_FAMILY = "1,2";
379 | };
380 | name = Release;
381 | };
382 | /* End XCBuildConfiguration section */
383 |
384 | /* Begin XCConfigurationList section */
385 | C8A822B020BAF801004C070F /* Build configuration list for PBXProject "locolaser-kotlin-multiplatform-example" */ = {
386 | isa = XCConfigurationList;
387 | buildConfigurations = (
388 | C8A822C520BAF802004C070F /* Debug */,
389 | C8A822C620BAF802004C070F /* Release */,
390 | );
391 | defaultConfigurationIsVisible = 0;
392 | defaultConfigurationName = Release;
393 | };
394 | C8A822C720BAF802004C070F /* Build configuration list for PBXNativeTarget "locolaser-kotlin-multiplatform-example" */ = {
395 | isa = XCConfigurationList;
396 | buildConfigurations = (
397 | C8A822C820BAF802004C070F /* Debug */,
398 | C8A822C920BAF802004C070F /* Release */,
399 | );
400 | defaultConfigurationIsVisible = 0;
401 | defaultConfigurationName = Release;
402 | };
403 | /* End XCConfigurationList section */
404 | };
405 | rootObject = C8A822AD20BAF801004C070F /* Project object */;
406 | }
407 |
--------------------------------------------------------------------------------
/app_ios/locolaser-kotlin-multiplatform-example.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | C80A5FD72209D732007710B2 /* Localizable.stringsdict in Resources */ = {isa = PBXBuildFile; fileRef = C80A5FD52209D732007710B2 /* Localizable.stringsdict */; };
11 | C89A9D0520BDF9F500A19C77 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C89A9D0320BDF9F500A19C77 /* Localizable.strings */; };
12 | C8A822BE20BAF801004C070F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8A822BC20BAF801004C070F /* Main.storyboard */; };
13 | C8A822C020BAF802004C070F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8A822BF20BAF802004C070F /* Assets.xcassets */; };
14 | C8A822C320BAF802004C070F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8A822C120BAF802004C070F /* LaunchScreen.storyboard */; };
15 | C8A822D020BC9B76004C070F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A822CF20BC9B76004C070F /* ViewController.swift */; };
16 | C8A822D220BCA023004C070F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8A822D120BCA023004C070F /* AppDelegate.swift */; };
17 | C8ABCBE4231E7D2100248112 /* ios_app_framework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8ABCBDD231E7D2100248112 /* ios_app_framework.framework */; };
18 | C8ABCBE5231E7D2100248112 /* ios_app_framework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8ABCBDD231E7D2100248112 /* ios_app_framework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | C8ABCBE2231E7D2100248112 /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = C8A822AD20BAF801004C070F /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = C8ABCBDC231E7D2100248112;
27 | remoteInfo = ios_app_framework;
28 | };
29 | /* End PBXContainerItemProxy section */
30 |
31 | /* Begin PBXCopyFilesBuildPhase section */
32 | C840A50822A4227A00465BA0 /* Embed Frameworks */ = {
33 | isa = PBXCopyFilesBuildPhase;
34 | buildActionMask = 2147483647;
35 | dstPath = "";
36 | dstSubfolderSpec = 10;
37 | files = (
38 | C8ABCBE5231E7D2100248112 /* ios_app_framework.framework in Embed Frameworks */,
39 | );
40 | name = "Embed Frameworks";
41 | runOnlyForDeploymentPostprocessing = 0;
42 | };
43 | /* End PBXCopyFilesBuildPhase section */
44 |
45 | /* Begin PBXFileReference section */
46 | C80A5FD62209D732007710B2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = Base; path = Base.lproj/Localizable.stringsdict; sourceTree = ""; };
47 | C89A9D0420BDF9F500A19C77 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = Base; path = Base.lproj/Localizable.strings; sourceTree = ""; };
48 | C8A822B520BAF801004C070F /* locolaser-kotlin-multiplatform-example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "locolaser-kotlin-multiplatform-example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
49 | C8A822BD20BAF801004C070F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
50 | C8A822BF20BAF802004C070F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
51 | C8A822C220BAF802004C070F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
52 | C8A822C420BAF802004C070F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
53 | C8A822CF20BC9B76004C070F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
54 | C8A822D120BCA023004C070F /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
55 | C8ABCBDD231E7D2100248112 /* ios_app_framework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ios_app_framework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
56 | C8ABCBDF231E7D2100248112 /* ios_app_framework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ios_app_framework.h; sourceTree = ""; };
57 | C8ABCBE0231E7D2100248112 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | C8A822B220BAF801004C070F /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | C8ABCBE4231E7D2100248112 /* ios_app_framework.framework in Frameworks */,
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | /* End PBXFrameworksBuildPhase section */
70 |
71 | /* Begin PBXGroup section */
72 | C8A822AC20BAF801004C070F = {
73 | isa = PBXGroup;
74 | children = (
75 | C8ABCBDE231E7D2100248112 /* ios_app_framework */,
76 | C8A822B720BAF801004C070F /* locolaser-kotlin-multiplatform-example */,
77 | C8A822B620BAF801004C070F /* Products */,
78 | );
79 | sourceTree = "";
80 | };
81 | C8A822B620BAF801004C070F /* Products */ = {
82 | isa = PBXGroup;
83 | children = (
84 | C8A822B520BAF801004C070F /* locolaser-kotlin-multiplatform-example.app */,
85 | C8ABCBDD231E7D2100248112 /* ios_app_framework.framework */,
86 | );
87 | name = Products;
88 | sourceTree = "";
89 | };
90 | C8A822B720BAF801004C070F /* locolaser-kotlin-multiplatform-example */ = {
91 | isa = PBXGroup;
92 | children = (
93 | C8A822D120BCA023004C070F /* AppDelegate.swift */,
94 | C8A822CF20BC9B76004C070F /* ViewController.swift */,
95 | C8A822BC20BAF801004C070F /* Main.storyboard */,
96 | C8A822BF20BAF802004C070F /* Assets.xcassets */,
97 | C89A9D0320BDF9F500A19C77 /* Localizable.strings */,
98 | C80A5FD52209D732007710B2 /* Localizable.stringsdict */,
99 | C8A822C120BAF802004C070F /* LaunchScreen.storyboard */,
100 | C8A822C420BAF802004C070F /* Info.plist */,
101 | );
102 | path = "locolaser-kotlin-multiplatform-example";
103 | sourceTree = "";
104 | };
105 | C8ABCBDE231E7D2100248112 /* ios_app_framework */ = {
106 | isa = PBXGroup;
107 | children = (
108 | C8ABCBDF231E7D2100248112 /* ios_app_framework.h */,
109 | C8ABCBE0231E7D2100248112 /* Info.plist */,
110 | );
111 | path = ios_app_framework;
112 | sourceTree = "";
113 | };
114 | /* End PBXGroup section */
115 |
116 | /* Begin PBXNativeTarget section */
117 | C8A822B420BAF801004C070F /* locolaser-kotlin-multiplatform-example */ = {
118 | isa = PBXNativeTarget;
119 | buildConfigurationList = C8A822C720BAF802004C070F /* Build configuration list for PBXNativeTarget "locolaser-kotlin-multiplatform-example" */;
120 | buildPhases = (
121 | C8A822B120BAF801004C070F /* Sources */,
122 | C8A822B220BAF801004C070F /* Frameworks */,
123 | C8A822B320BAF801004C070F /* Resources */,
124 | C840A50822A4227A00465BA0 /* Embed Frameworks */,
125 | );
126 | buildRules = (
127 | );
128 | dependencies = (
129 | C8ABCBE3231E7D2100248112 /* PBXTargetDependency */,
130 | );
131 | name = "locolaser-kotlin-multiplatform-example";
132 | productName = "locolaser-kotlin-multiplatform-example";
133 | productReference = C8A822B520BAF801004C070F /* locolaser-kotlin-multiplatform-example.app */;
134 | productType = "com.apple.product-type.application";
135 | };
136 | C8ABCBDC231E7D2100248112 /* ios_app_framework */ = {
137 | isa = PBXNativeTarget;
138 | buildConfigurationList = C8ABCBE8231E7D2100248112 /* Build configuration list for PBXNativeTarget "ios_app_framework" */;
139 | buildPhases = (
140 | C8ABCBE9231E7D7700248112 /* Build Binary From Kotlin Sources */,
141 | C8ABCBEA231E7D9700248112 /* CopyFramevork */,
142 | );
143 | buildRules = (
144 | );
145 | dependencies = (
146 | );
147 | name = ios_app_framework;
148 | productName = ios_app_framework;
149 | productReference = C8ABCBDD231E7D2100248112 /* ios_app_framework.framework */;
150 | productType = "com.apple.product-type.framework";
151 | };
152 | /* End PBXNativeTarget section */
153 |
154 | /* Begin PBXProject section */
155 | C8A822AD20BAF801004C070F /* Project object */ = {
156 | isa = PBXProject;
157 | attributes = {
158 | LastSwiftUpdateCheck = 0930;
159 | LastUpgradeCheck = 0930;
160 | ORGANIZATIONNAME = PcketByte.ru;
161 | TargetAttributes = {
162 | C8A822B420BAF801004C070F = {
163 | CreatedOnToolsVersion = 9.3.1;
164 | LastSwiftMigration = 1150;
165 | };
166 | C8ABCBDC231E7D2100248112 = {
167 | CreatedOnToolsVersion = 10.3;
168 | };
169 | };
170 | };
171 | buildConfigurationList = C8A822B020BAF801004C070F /* Build configuration list for PBXProject "locolaser-kotlin-multiplatform-example" */;
172 | compatibilityVersion = "Xcode 9.3";
173 | developmentRegion = en;
174 | hasScannedForEncodings = 0;
175 | knownRegions = (
176 | en,
177 | Base,
178 | );
179 | mainGroup = C8A822AC20BAF801004C070F;
180 | productRefGroup = C8A822B620BAF801004C070F /* Products */;
181 | projectDirPath = "";
182 | projectRoot = "";
183 | targets = (
184 | C8A822B420BAF801004C070F /* locolaser-kotlin-multiplatform-example */,
185 | C8ABCBDC231E7D2100248112 /* ios_app_framework */,
186 | );
187 | };
188 | /* End PBXProject section */
189 |
190 | /* Begin PBXResourcesBuildPhase section */
191 | C8A822B320BAF801004C070F /* Resources */ = {
192 | isa = PBXResourcesBuildPhase;
193 | buildActionMask = 2147483647;
194 | files = (
195 | C89A9D0520BDF9F500A19C77 /* Localizable.strings in Resources */,
196 | C8A822C320BAF802004C070F /* LaunchScreen.storyboard in Resources */,
197 | C8A822C020BAF802004C070F /* Assets.xcassets in Resources */,
198 | C80A5FD72209D732007710B2 /* Localizable.stringsdict in Resources */,
199 | C8A822BE20BAF801004C070F /* Main.storyboard in Resources */,
200 | );
201 | runOnlyForDeploymentPostprocessing = 0;
202 | };
203 | /* End PBXResourcesBuildPhase section */
204 |
205 | /* Begin PBXShellScriptBuildPhase section */
206 | C8ABCBE9231E7D7700248112 /* Build Binary From Kotlin Sources */ = {
207 | isa = PBXShellScriptBuildPhase;
208 | buildActionMask = 2147483647;
209 | files = (
210 | );
211 | inputFileListPaths = (
212 | );
213 | inputPaths = (
214 | );
215 | name = "Build Binary From Kotlin Sources";
216 | outputFileListPaths = (
217 | );
218 | outputPaths = (
219 | );
220 | runOnlyForDeploymentPostprocessing = 0;
221 | shellPath = /bin/sh;
222 | shellScript = "PRJ_DIR=\"$SRCROOT/..\";\nTASK_TARGET=\"$(tr '[:lower:]' '[:upper:]' <<< ${KOTLIN_TARGET:0:1})${KOTLIN_TARGET:1}\"\n\n\"${PRJ_DIR}/gradlew\" -p \"${PRJ_DIR}/\" \":common:linkIos_app_framework${CONFIGURATION}FrameworkIos\" \\\n-Pkonan.configuration.build.dir=\"$CONFIGURATION_BUILD_DIR\" \\\n-Pkonan.debugging.symbols=\"$DEBUGGING_SYMBOLS\" \\\n-Pkonan.optimizations.enable=\"$KONAN_ENABLE_OPTIMIZATIONS\"\n";
223 | };
224 | C8ABCBEA231E7D9700248112 /* CopyFramevork */ = {
225 | isa = PBXShellScriptBuildPhase;
226 | buildActionMask = 2147483647;
227 | files = (
228 | );
229 | inputFileListPaths = (
230 | );
231 | inputPaths = (
232 | );
233 | name = CopyFramevork;
234 | outputFileListPaths = (
235 | );
236 | outputPaths = (
237 | );
238 | runOnlyForDeploymentPostprocessing = 0;
239 | shellPath = /bin/sh;
240 | shellScript = "BUILD_TYPE=\"$(tr '[:upper:]' '[:lower:]' <<< ${CONFIGURATION:0:1})${CONFIGURATION:1}\"\nSOURCE_DIR=\"$SRCROOT/../common/build/bin/ios/${PRODUCT_NAME}${BUILD_TYPE}Framework/\"\n\nmkdir -p \"$CONFIGURATION_BUILD_DIR\"\ncp -r \"${SOURCE_DIR}/.\" \"$CONFIGURATION_BUILD_DIR\"\n";
241 | };
242 | /* End PBXShellScriptBuildPhase section */
243 |
244 | /* Begin PBXSourcesBuildPhase section */
245 | C8A822B120BAF801004C070F /* Sources */ = {
246 | isa = PBXSourcesBuildPhase;
247 | buildActionMask = 2147483647;
248 | files = (
249 | C8A822D220BCA023004C070F /* AppDelegate.swift in Sources */,
250 | C8A822D020BC9B76004C070F /* ViewController.swift in Sources */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | /* End PBXSourcesBuildPhase section */
255 |
256 | /* Begin PBXTargetDependency section */
257 | C8ABCBE3231E7D2100248112 /* PBXTargetDependency */ = {
258 | isa = PBXTargetDependency;
259 | target = C8ABCBDC231E7D2100248112 /* ios_app_framework */;
260 | targetProxy = C8ABCBE2231E7D2100248112 /* PBXContainerItemProxy */;
261 | };
262 | /* End PBXTargetDependency section */
263 |
264 | /* Begin PBXVariantGroup section */
265 | C80A5FD52209D732007710B2 /* Localizable.stringsdict */ = {
266 | isa = PBXVariantGroup;
267 | children = (
268 | C80A5FD62209D732007710B2 /* Base */,
269 | );
270 | name = Localizable.stringsdict;
271 | sourceTree = "";
272 | };
273 | C89A9D0320BDF9F500A19C77 /* Localizable.strings */ = {
274 | isa = PBXVariantGroup;
275 | children = (
276 | C89A9D0420BDF9F500A19C77 /* Base */,
277 | );
278 | name = Localizable.strings;
279 | sourceTree = "";
280 | };
281 | C8A822BC20BAF801004C070F /* Main.storyboard */ = {
282 | isa = PBXVariantGroup;
283 | children = (
284 | C8A822BD20BAF801004C070F /* Base */,
285 | );
286 | name = Main.storyboard;
287 | sourceTree = "";
288 | };
289 | C8A822C120BAF802004C070F /* LaunchScreen.storyboard */ = {
290 | isa = PBXVariantGroup;
291 | children = (
292 | C8A822C220BAF802004C070F /* Base */,
293 | );
294 | name = LaunchScreen.storyboard;
295 | sourceTree = "";
296 | };
297 | /* End PBXVariantGroup section */
298 |
299 | /* Begin XCBuildConfiguration section */
300 | C8A822C520BAF802004C070F /* Debug */ = {
301 | isa = XCBuildConfiguration;
302 | buildSettings = {
303 | ALWAYS_SEARCH_USER_PATHS = NO;
304 | CLANG_ANALYZER_NONNULL = YES;
305 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
306 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
307 | CLANG_CXX_LIBRARY = "libc++";
308 | CLANG_ENABLE_MODULES = YES;
309 | CLANG_ENABLE_OBJC_ARC = YES;
310 | CLANG_ENABLE_OBJC_WEAK = YES;
311 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
312 | CLANG_WARN_BOOL_CONVERSION = YES;
313 | CLANG_WARN_COMMA = YES;
314 | CLANG_WARN_CONSTANT_CONVERSION = YES;
315 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
316 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
317 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
318 | CLANG_WARN_EMPTY_BODY = YES;
319 | CLANG_WARN_ENUM_CONVERSION = YES;
320 | CLANG_WARN_INFINITE_RECURSION = YES;
321 | CLANG_WARN_INT_CONVERSION = YES;
322 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
323 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
324 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
326 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
327 | CLANG_WARN_STRICT_PROTOTYPES = YES;
328 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
329 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
330 | CLANG_WARN_UNREACHABLE_CODE = YES;
331 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
332 | CODE_SIGN_IDENTITY = "iPhone Developer";
333 | COPY_PHASE_STRIP = NO;
334 | DEBUG_INFORMATION_FORMAT = dwarf;
335 | ENABLE_STRICT_OBJC_MSGSEND = YES;
336 | ENABLE_TESTABILITY = YES;
337 | GCC_C_LANGUAGE_STANDARD = gnu11;
338 | GCC_DYNAMIC_NO_PIC = NO;
339 | GCC_NO_COMMON_BLOCKS = YES;
340 | GCC_OPTIMIZATION_LEVEL = 0;
341 | GCC_PREPROCESSOR_DEFINITIONS = (
342 | "DEBUG=1",
343 | "$(inherited)",
344 | );
345 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
346 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
347 | GCC_WARN_UNDECLARED_SELECTOR = YES;
348 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
349 | GCC_WARN_UNUSED_FUNCTION = YES;
350 | GCC_WARN_UNUSED_VARIABLE = YES;
351 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
352 | MTL_ENABLE_DEBUG_INFO = YES;
353 | ONLY_ACTIVE_ARCH = YES;
354 | SDKROOT = iphoneos;
355 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
356 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
357 | };
358 | name = Debug;
359 | };
360 | C8A822C620BAF802004C070F /* Release */ = {
361 | isa = XCBuildConfiguration;
362 | buildSettings = {
363 | ALWAYS_SEARCH_USER_PATHS = NO;
364 | CLANG_ANALYZER_NONNULL = YES;
365 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
366 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
367 | CLANG_CXX_LIBRARY = "libc++";
368 | CLANG_ENABLE_MODULES = YES;
369 | CLANG_ENABLE_OBJC_ARC = YES;
370 | CLANG_ENABLE_OBJC_WEAK = YES;
371 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
372 | CLANG_WARN_BOOL_CONVERSION = YES;
373 | CLANG_WARN_COMMA = YES;
374 | CLANG_WARN_CONSTANT_CONVERSION = YES;
375 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
376 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
377 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
378 | CLANG_WARN_EMPTY_BODY = YES;
379 | CLANG_WARN_ENUM_CONVERSION = YES;
380 | CLANG_WARN_INFINITE_RECURSION = YES;
381 | CLANG_WARN_INT_CONVERSION = YES;
382 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
383 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
384 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
385 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
386 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
387 | CLANG_WARN_STRICT_PROTOTYPES = YES;
388 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
389 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
390 | CLANG_WARN_UNREACHABLE_CODE = YES;
391 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
392 | CODE_SIGN_IDENTITY = "iPhone Developer";
393 | COPY_PHASE_STRIP = NO;
394 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
395 | ENABLE_NS_ASSERTIONS = NO;
396 | ENABLE_STRICT_OBJC_MSGSEND = YES;
397 | GCC_C_LANGUAGE_STANDARD = gnu11;
398 | GCC_NO_COMMON_BLOCKS = YES;
399 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
400 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
401 | GCC_WARN_UNDECLARED_SELECTOR = YES;
402 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
403 | GCC_WARN_UNUSED_FUNCTION = YES;
404 | GCC_WARN_UNUSED_VARIABLE = YES;
405 | IPHONEOS_DEPLOYMENT_TARGET = 11.3;
406 | MTL_ENABLE_DEBUG_INFO = NO;
407 | SDKROOT = iphoneos;
408 | SWIFT_COMPILATION_MODE = wholemodule;
409 | SWIFT_OPTIMIZATION_LEVEL = "-O";
410 | VALIDATE_PRODUCT = YES;
411 | };
412 | name = Release;
413 | };
414 | C8A822C820BAF802004C070F /* Debug */ = {
415 | isa = XCBuildConfiguration;
416 | buildSettings = {
417 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
418 | CLANG_ENABLE_MODULES = YES;
419 | CODE_SIGN_STYLE = Automatic;
420 | DEVELOPMENT_TEAM = QYF24V9H2B;
421 | FRAMEWORK_SEARCH_PATHS = "";
422 | INFOPLIST_FILE = "locolaser-kotlin-multiplatform-example/Info.plist";
423 | LD_RUNPATH_SEARCH_PATHS = (
424 | "$(inherited)",
425 | "@executable_path/Frameworks",
426 | );
427 | PRODUCT_BUNDLE_IDENTIFIER = "ru.pocketbyte.locolaser-kotlin-multiplatform-example";
428 | PRODUCT_NAME = "$(TARGET_NAME)";
429 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
430 | SWIFT_VERSION = 4.0;
431 | TARGETED_DEVICE_FAMILY = "1,2";
432 | };
433 | name = Debug;
434 | };
435 | C8A822C920BAF802004C070F /* Release */ = {
436 | isa = XCBuildConfiguration;
437 | buildSettings = {
438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
439 | CLANG_ENABLE_MODULES = YES;
440 | CODE_SIGN_STYLE = Automatic;
441 | DEVELOPMENT_TEAM = QYF24V9H2B;
442 | FRAMEWORK_SEARCH_PATHS = "";
443 | INFOPLIST_FILE = "locolaser-kotlin-multiplatform-example/Info.plist";
444 | LD_RUNPATH_SEARCH_PATHS = (
445 | "$(inherited)",
446 | "@executable_path/Frameworks",
447 | );
448 | PRODUCT_BUNDLE_IDENTIFIER = "ru.pocketbyte.locolaser-kotlin-multiplatform-example";
449 | PRODUCT_NAME = "$(TARGET_NAME)";
450 | SWIFT_VERSION = 4.0;
451 | TARGETED_DEVICE_FAMILY = "1,2";
452 | };
453 | name = Release;
454 | };
455 | C8ABCBE6231E7D2100248112 /* Debug */ = {
456 | isa = XCBuildConfiguration;
457 | buildSettings = {
458 | CODE_SIGN_IDENTITY = "";
459 | CODE_SIGN_STYLE = Automatic;
460 | CURRENT_PROJECT_VERSION = 1;
461 | DEFINES_MODULE = YES;
462 | DEVELOPMENT_TEAM = QYF24V9H2B;
463 | DYLIB_COMPATIBILITY_VERSION = 1;
464 | DYLIB_CURRENT_VERSION = 1;
465 | DYLIB_INSTALL_NAME_BASE = "@rpath";
466 | INFOPLIST_FILE = ios_app_framework/Info.plist;
467 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
468 | IPHONEOS_DEPLOYMENT_TARGET = 12.4;
469 | KOTLIN_TARGET = "";
470 | "KOTLIN_TARGET[sdk=iphoneos*]" = ios_arm64;
471 | "KOTLIN_TARGET[sdk=iphonesimulator*]" = ios_x64;
472 | LD_RUNPATH_SEARCH_PATHS = (
473 | "$(inherited)",
474 | "@executable_path/Frameworks",
475 | "@loader_path/Frameworks",
476 | );
477 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
478 | MTL_FAST_MATH = YES;
479 | PRODUCT_BUNDLE_IDENTIFIER = "ru.pocketbyte.ios-app-framework";
480 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
481 | SKIP_INSTALL = YES;
482 | SWIFT_VERSION = 5.0;
483 | TARGETED_DEVICE_FAMILY = "1,2";
484 | VERSIONING_SYSTEM = "apple-generic";
485 | VERSION_INFO_PREFIX = "";
486 | };
487 | name = Debug;
488 | };
489 | C8ABCBE7231E7D2100248112 /* Release */ = {
490 | isa = XCBuildConfiguration;
491 | buildSettings = {
492 | CODE_SIGN_IDENTITY = "";
493 | CODE_SIGN_STYLE = Automatic;
494 | CURRENT_PROJECT_VERSION = 1;
495 | DEFINES_MODULE = YES;
496 | DEVELOPMENT_TEAM = QYF24V9H2B;
497 | DYLIB_COMPATIBILITY_VERSION = 1;
498 | DYLIB_CURRENT_VERSION = 1;
499 | DYLIB_INSTALL_NAME_BASE = "@rpath";
500 | INFOPLIST_FILE = ios_app_framework/Info.plist;
501 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
502 | IPHONEOS_DEPLOYMENT_TARGET = 12.4;
503 | KOTLIN_TARGET = "";
504 | LD_RUNPATH_SEARCH_PATHS = (
505 | "$(inherited)",
506 | "@executable_path/Frameworks",
507 | "@loader_path/Frameworks",
508 | );
509 | MTL_FAST_MATH = YES;
510 | PRODUCT_BUNDLE_IDENTIFIER = "ru.pocketbyte.ios-app-framework";
511 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
512 | SKIP_INSTALL = YES;
513 | SWIFT_VERSION = 5.0;
514 | TARGETED_DEVICE_FAMILY = "1,2";
515 | VERSIONING_SYSTEM = "apple-generic";
516 | VERSION_INFO_PREFIX = "";
517 | };
518 | name = Release;
519 | };
520 | /* End XCBuildConfiguration section */
521 |
522 | /* Begin XCConfigurationList section */
523 | C8A822B020BAF801004C070F /* Build configuration list for PBXProject "locolaser-kotlin-multiplatform-example" */ = {
524 | isa = XCConfigurationList;
525 | buildConfigurations = (
526 | C8A822C520BAF802004C070F /* Debug */,
527 | C8A822C620BAF802004C070F /* Release */,
528 | );
529 | defaultConfigurationIsVisible = 0;
530 | defaultConfigurationName = Release;
531 | };
532 | C8A822C720BAF802004C070F /* Build configuration list for PBXNativeTarget "locolaser-kotlin-multiplatform-example" */ = {
533 | isa = XCConfigurationList;
534 | buildConfigurations = (
535 | C8A822C820BAF802004C070F /* Debug */,
536 | C8A822C920BAF802004C070F /* Release */,
537 | );
538 | defaultConfigurationIsVisible = 0;
539 | defaultConfigurationName = Release;
540 | };
541 | C8ABCBE8231E7D2100248112 /* Build configuration list for PBXNativeTarget "ios_app_framework" */ = {
542 | isa = XCConfigurationList;
543 | buildConfigurations = (
544 | C8ABCBE6231E7D2100248112 /* Debug */,
545 | C8ABCBE7231E7D2100248112 /* Release */,
546 | );
547 | defaultConfigurationIsVisible = 0;
548 | defaultConfigurationName = Release;
549 | };
550 | /* End XCConfigurationList section */
551 | };
552 | rootObject = C8A822AD20BAF801004C070F /* Project object */;
553 | }
554 |
--------------------------------------------------------------------------------