├── .github └── workflows │ └── pull_request.yml ├── .gitignore ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle.kts ├── google-services.json ├── gradle.properties ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── sample │ │ ├── CrashlyticsAntilog.kt │ │ ├── MainActivity.kt │ │ └── NapierApp.kt │ └── res │ ├── drawable-v24 │ └── ic_launcher_foreground.xml │ ├── drawable │ └── ic_launcher_background.xml │ ├── layout │ └── activity_main.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ └── ic_launcher_round.png │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml ├── arts ├── logo.jpg ├── screenshot-android.jpg ├── screenshot-ios.jpg ├── screenshot-js.jpg └── screenshot-jvm.jpg ├── build.gradle ├── buildSrc ├── .gitignore ├── build.gradle.kts └── src │ └── main │ └── kotlin │ ├── Variables.kt │ └── dependencies │ ├── Dep.kt │ └── Versions.kt ├── gradle.properties ├── gradle ├── publish.gradle.kts └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ios ├── .bundle │ └── config ├── .gitignore ├── Gemfile ├── Gemfile.lock ├── Makefile ├── Napier.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Napier.xcscheme ├── Napier.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Napier │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GoogleService-Info.plist │ ├── Info.plist │ ├── Napier.swift │ └── ViewController.swift ├── Podfile └── Podfile.lock ├── js ├── .gitignore ├── build.gradle.kts ├── run.sh ├── src │ └── main │ │ ├── kotlin │ │ └── io │ │ │ └── github │ │ │ └── aakira │ │ │ └── napier │ │ │ └── sample │ │ │ └── Main.kt │ │ ├── resources │ │ └── index.html │ │ └── web │ │ └── index.html └── webpack.config.d │ └── .gitkeep ├── jvm ├── .gitignore ├── README.md ├── build.gradle.kts ├── run.sh └── src │ └── main │ └── kotlin │ └── io │ └── github │ └── aakira │ └── napier │ └── sample │ └── Main.kt ├── macOS ├── Podfile ├── Podfile.lock ├── Pods │ ├── Local Podspecs │ │ └── mpp_sample.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ ├── aakira.xcuserdatad │ │ │ └── xcschemes │ │ │ │ ├── Pods-macOS (macOS).xcscheme │ │ │ │ ├── mpp_sample.xcscheme │ │ │ │ └── xcschememanagement.plist │ │ │ └── akira.aratani.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ └── Target Support Files │ │ ├── Pods-macOS (macOS) │ │ ├── Pods-macOS (macOS)-Info.plist │ │ ├── Pods-macOS (macOS)-acknowledgements.markdown │ │ ├── Pods-macOS (macOS)-acknowledgements.plist │ │ ├── Pods-macOS (macOS)-dummy.m │ │ ├── Pods-macOS (macOS)-umbrella.h │ │ ├── Pods-macOS (macOS).debug.xcconfig │ │ ├── Pods-macOS (macOS).modulemap │ │ └── Pods-macOS (macOS).release.xcconfig │ │ └── mpp_sample │ │ ├── mpp_sample.debug.xcconfig │ │ └── mpp_sample.release.xcconfig ├── Shared │ ├── Assets.xcassets │ │ ├── AccentColor.colorset │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── ContentView.swift │ └── macOSApp.swift ├── Tests iOS │ ├── Info.plist │ └── Tests_iOS.swift ├── Tests macOS │ ├── Info.plist │ └── Tests_macOS.swift ├── iOS │ └── Info.plist ├── macOS.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── aakira.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ │ │ └── akira.aratani.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── aakira.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── akira.aratani.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── macOS.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ ├── aakira.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ │ └── akira.aratani.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── macOS │ ├── Info.plist │ └── macOS.entitlements ├── mpp-sample ├── .gitignore ├── build.gradle.kts ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── kotlin-js-store │ └── yarn.lock ├── mpp_sample.podspec └── src │ ├── androidMain │ ├── AndroidManifest.xml │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── mppsample │ │ └── RunBlocking.kt │ ├── commonMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── mppsample │ │ ├── RunBlocking.kt │ │ └── Sample.kt │ ├── darwinMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── mppsample │ │ ├── Coroutine.kt │ │ ├── CoroutineProxy.kt │ │ ├── CrashlyticsAntilog.kt │ │ ├── NapierProxy.kt │ │ └── RunBlocking.kt │ ├── jsMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── mppsample │ │ └── RunBlocking.kt │ └── jvmMain │ └── kotlin │ └── io │ └── github │ └── aakira │ └── napier │ └── mppsample │ └── RunBlocking.kt ├── napier ├── .gitignore ├── build.gradle.kts └── src │ ├── androidMain │ ├── AndroidManifest.xml │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ ├── DebugAntilog.kt │ │ └── atomic │ │ └── AtomicRef.kt │ ├── androidUnitTest │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── NapierAndroidTest.kt │ ├── commonMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ ├── Antilog.kt │ │ ├── DebugAntilog.kt │ │ ├── LogLevel.kt │ │ ├── Napier.kt │ │ └── atomic │ │ ├── AtomicMutableList.kt │ │ └── AtomicRef.kt │ ├── commonTest │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── NapierTest.kt │ ├── darwinMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ ├── DebugAntilog.kt │ │ └── atomic │ │ └── AtomicRef.kt │ ├── darwinTest │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── NapierIosTest.kt │ ├── jsMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ ├── DebugAntilog.kt │ │ └── atomic │ │ └── AtomicRef.kt │ ├── jsTest │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── NapierJsTest.kt │ ├── jvmMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ ├── DebugAntilog.kt │ │ └── atomic │ │ └── AtomicRef.kt │ ├── jvmTest │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ └── NapierJvmTest.kt │ ├── wasmJsMain │ └── kotlin │ │ └── io │ │ └── github │ │ └── aakira │ │ └── napier │ │ ├── DebugAntilog.kt │ │ └── atomic │ │ └── AtomicRef.kt │ └── wasmJsTest │ └── kotlin │ └── io │ └── github │ └── aakira │ └── napier │ └── NapierJsTest.kt ├── scripts └── sonatypeUpload.sh ├── settings.gradle.kts └── watchOS ├── Podfile ├── Podfile.lock ├── Pods ├── Local Podspecs │ └── mpp_sample.podspec.json ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── aakira.xcuserdatad │ │ └── xcschemes │ │ ├── Pods-watchOS WatchKit App.xcscheme │ │ ├── Pods-watchOS WatchKit Extension.xcscheme │ │ ├── Pods-watchOS-watchOSUITests.xcscheme │ │ ├── Pods-watchOS.xcscheme │ │ ├── Pods-watchOSTests.xcscheme │ │ ├── mpp_sample.xcscheme │ │ └── xcschememanagement.plist └── Target Support Files │ ├── Pods-watchOS WatchKit App │ ├── Pods-watchOS WatchKit App-Info.plist │ ├── Pods-watchOS WatchKit App-acknowledgements.markdown │ ├── Pods-watchOS WatchKit App-acknowledgements.plist │ ├── Pods-watchOS WatchKit App-dummy.m │ ├── Pods-watchOS WatchKit App-umbrella.h │ ├── Pods-watchOS WatchKit App.debug.xcconfig │ ├── Pods-watchOS WatchKit App.modulemap │ └── Pods-watchOS WatchKit App.release.xcconfig │ ├── Pods-watchOS WatchKit Extension │ ├── Pods-watchOS WatchKit Extension-Info.plist │ ├── Pods-watchOS WatchKit Extension-acknowledgements.markdown │ ├── Pods-watchOS WatchKit Extension-acknowledgements.plist │ ├── Pods-watchOS WatchKit Extension-dummy.m │ ├── Pods-watchOS WatchKit Extension-umbrella.h │ ├── Pods-watchOS WatchKit Extension.debug.xcconfig │ ├── Pods-watchOS WatchKit Extension.modulemap │ └── Pods-watchOS WatchKit Extension.release.xcconfig │ ├── Pods-watchOS-watchOSUITests │ ├── Pods-watchOS-watchOSUITests-Info.plist │ ├── Pods-watchOS-watchOSUITests-acknowledgements.markdown │ ├── Pods-watchOS-watchOSUITests-acknowledgements.plist │ ├── Pods-watchOS-watchOSUITests-dummy.m │ ├── Pods-watchOS-watchOSUITests-umbrella.h │ ├── Pods-watchOS-watchOSUITests.debug.xcconfig │ ├── Pods-watchOS-watchOSUITests.modulemap │ └── Pods-watchOS-watchOSUITests.release.xcconfig │ ├── Pods-watchOS │ ├── Pods-watchOS-Info.plist │ ├── Pods-watchOS-acknowledgements.markdown │ ├── Pods-watchOS-acknowledgements.plist │ ├── Pods-watchOS-dummy.m │ ├── Pods-watchOS-umbrella.h │ ├── Pods-watchOS.debug.xcconfig │ ├── Pods-watchOS.modulemap │ └── Pods-watchOS.release.xcconfig │ ├── Pods-watchOSTests │ ├── Pods-watchOSTests-Info.plist │ ├── Pods-watchOSTests-acknowledgements.markdown │ ├── Pods-watchOSTests-acknowledgements.plist │ ├── Pods-watchOSTests-dummy.m │ ├── Pods-watchOSTests-umbrella.h │ ├── Pods-watchOSTests.debug.xcconfig │ ├── Pods-watchOSTests.modulemap │ └── Pods-watchOSTests.release.xcconfig │ └── mpp_sample │ ├── mpp_sample.debug.xcconfig │ └── mpp_sample.release.xcconfig ├── watchOS WatchKit App ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json └── Info.plist ├── watchOS WatchKit Extension ├── Assets.xcassets │ ├── Complication.complicationset │ │ ├── Circular.imageset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── Extra Large.imageset │ │ │ └── Contents.json │ │ ├── Graphic Bezel.imageset │ │ │ └── Contents.json │ │ ├── Graphic Circular.imageset │ │ │ └── Contents.json │ │ ├── Graphic Corner.imageset │ │ │ └── Contents.json │ │ ├── Graphic Extra Large.imageset │ │ │ └── Contents.json │ │ ├── Graphic Large Rectangular.imageset │ │ │ └── Contents.json │ │ ├── Modular.imageset │ │ │ └── Contents.json │ │ └── Utilitarian.imageset │ │ │ └── Contents.json │ └── Contents.json ├── ComplicationController.swift ├── ContentView.swift ├── Info.plist ├── NotificationController.swift ├── NotificationView.swift ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── PushNotificationPayload.apns └── watchOSApp.swift ├── watchOS.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── aakira.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── aakira.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── watchOS.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── aakira.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── watchOSTests ├── Info.plist └── watchOSTests.swift └── watchOSUITests ├── Info.plist └── watchOSUITests.swift /.github/workflows/pull_request.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: [pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - name: Checkout the repo 10 | uses: actions/checkout@v2 11 | - name: Cache gradle 12 | uses: actions/cache@v1 13 | with: 14 | path: ~/.gradle/caches 15 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} 16 | restore-keys: | 17 | ${{ runner.os }}-gradle- 18 | - name: "Setup Java" 19 | uses: actions/setup-java@v1 20 | with: 21 | java-version: 17 22 | 23 | - name: Run common tests 24 | run: ./gradlew :napier:test --stacktrace 25 | - name: Run android tests 26 | run: ./gradlew :napier:testReleaseUnitTest --stacktrace 27 | - name: Run jvm tests 28 | run: ./gradlew :napier:jvmTest --stacktrace 29 | - name: Run ios(intel) tests 30 | run: ./gradlew :napier:iosX64Test --stacktrace 31 | - name: Run ios(apple silicon) tests 32 | run: ./gradlew :napier:iosSimulatorArm64Test --stacktrace 33 | - name: Run macos(intel) tests 34 | run: ./gradlew :napier:macosX64Test --stacktrace 35 | - name: Run macos(apple silicon) tests 36 | run: ./gradlew :napier:macosArm64Test --stacktrace 37 | - name: Run watchos(intel) tests 38 | run: ./gradlew :napier:watchosX64Test --stacktrace 39 | - name: Run watchos(apple silicon) tests 40 | run: ./gradlew :napier:watchosSimulatorArm64Test --stacktrace 41 | - name: Run tvos(intel) tests 42 | run: ./gradlew :napier:tvosX64Test --stacktrace 43 | - name: Run tvos(apple silicon) tests 44 | run: ./gradlew :napier:tvosSimulatorArm64Test --stacktrace 45 | - name: Run wasmJs tests 46 | run: ./gradlew :napier:wasmJsTest --stacktrace 47 | 48 | - name: Bundle the build report 49 | if: failure() 50 | run: find . -type d -name 'reports' | zip -@ -r build-reports.zip 51 | - name: Upload the build report 52 | if: failure() 53 | uses: actions/upload-artifact@master 54 | with: 55 | name: error-report 56 | path: build-reports.zip 57 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /build 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import dependencies.Dep 2 | import dependencies.Versions 3 | 4 | plugins { 5 | id("com.android.application") 6 | kotlin("android") 7 | 8 | id("com.google.gms.google-services") 9 | id("com.google.firebase.crashlytics") 10 | } 11 | 12 | android { 13 | compileSdk = Versions.compileSdkVersion 14 | buildToolsVersion = Versions.buildToolsVersion 15 | 16 | defaultConfig { 17 | namespace = "io.github.aakira.napier.sample" 18 | minSdk = Versions.minSdkVersion 19 | targetSdk = Versions.targetSdkVersion 20 | versionCode = Versions.androidVersionCode 21 | versionName = Versions.androidVersionName 22 | } 23 | 24 | buildTypes { 25 | getByName("release") { 26 | isMinifyEnabled = true 27 | proguardFiles( 28 | getDefaultProguardFile("proguard-android-optimize.txt"), 29 | "proguard-rules.pro" 30 | ) 31 | } 32 | } 33 | 34 | packagingOptions { 35 | exclude("META-INF/kotlinx-coroutines-core.kotlin_module") 36 | } 37 | 38 | buildFeatures { 39 | viewBinding = true 40 | buildConfig = true 41 | } 42 | 43 | compileOptions { 44 | sourceCompatibility(JavaVersion.VERSION_17) 45 | targetCompatibility(JavaVersion.VERSION_17) 46 | } 47 | } 48 | 49 | dependencies { 50 | implementation(project(":napier")) 51 | implementation(project(":mpp-sample")) 52 | // write the below in your project, instead of above 53 | // implementation "io.github.aakira:napier:[version name]" 54 | 55 | implementation(Dep.Kotlin.jvm) 56 | implementation(Dep.Coroutines.core) 57 | 58 | implementation(Dep.Android.appCompat) 59 | implementation(Dep.Android.constraintLayout) 60 | 61 | // for crashlytics sample 62 | implementation(platform(Dep.Firebase.platform)) 63 | implementation(Dep.Firebase.crashlytics) 64 | } 65 | -------------------------------------------------------------------------------- /android/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "1072620373207", 4 | "firebase_url": "https://napier-82786.firebaseio.com", 5 | "project_id": "napier-82786", 6 | "storage_bucket": "napier-82786.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:1072620373207:android:ab90809f391c88a6", 12 | "android_client_info": { 13 | "package_name": "com.github.aakira.napier.sample" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "1072620373207-fvt7g7gejodn5902pcqk3pnu3rarcn2m.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyB2FOeVHSdlKZFYEQSfjG1dVBOUhLCnh5o" 25 | } 26 | ], 27 | "services": { 28 | "appinvite_service": { 29 | "other_platform_oauth_client": [ 30 | { 31 | "client_id": "1072620373207-fvt7g7gejodn5902pcqk3pnu3rarcn2m.apps.googleusercontent.com", 32 | "client_type": 3 33 | }, 34 | { 35 | "client_id": "1072620373207-89solc0vol23brafmaho0nnbc9bvucdr.apps.googleusercontent.com", 36 | "client_type": 2, 37 | "ios_info": { 38 | "bundle_id": "io.github.aakira.napier.sample" 39 | } 40 | } 41 | ] 42 | } 43 | } 44 | }, 45 | { 46 | "client_info": { 47 | "mobilesdk_app_id": "1:1072620373207:android:d95a2b4bcb9bd045481c92", 48 | "android_client_info": { 49 | "package_name": "io.github.aakira.napier.sample" 50 | } 51 | }, 52 | "oauth_client": [ 53 | { 54 | "client_id": "1072620373207-fvt7g7gejodn5902pcqk3pnu3rarcn2m.apps.googleusercontent.com", 55 | "client_type": 3 56 | } 57 | ], 58 | "api_key": [ 59 | { 60 | "current_key": "AIzaSyB2FOeVHSdlKZFYEQSfjG1dVBOUhLCnh5o" 61 | } 62 | ], 63 | "services": { 64 | "appinvite_service": { 65 | "other_platform_oauth_client": [ 66 | { 67 | "client_id": "1072620373207-fvt7g7gejodn5902pcqk3pnu3rarcn2m.apps.googleusercontent.com", 68 | "client_type": 3 69 | }, 70 | { 71 | "client_id": "1072620373207-89solc0vol23brafmaho0nnbc9bvucdr.apps.googleusercontent.com", 72 | "client_type": 2, 73 | "ios_info": { 74 | "bundle_id": "io.github.aakira.napier.sample" 75 | } 76 | } 77 | ] 78 | } 79 | } 80 | } 81 | ], 82 | "configuration_version": "1" 83 | } -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1024m 2 | 3 | android.useAndroidX = true 4 | android.enableJetifier = true 5 | 6 | # for crashlytics 7 | USE_FIREBASE_APP_ID=true 8 | -------------------------------------------------------------------------------- /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.kts. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /android/src/main/java/io/github/aakira/napier/sample/CrashlyticsAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.sample 2 | 3 | import android.content.Context 4 | import com.google.firebase.crashlytics.FirebaseCrashlytics 5 | import io.github.aakira.napier.Antilog 6 | import io.github.aakira.napier.LogLevel 7 | 8 | class CrashlyticsAntilog(private val context: Context) : Antilog() { 9 | 10 | override fun performLog( 11 | priority: LogLevel, 12 | tag: String?, 13 | throwable: Throwable?, 14 | message: String? 15 | ) { 16 | // send only error log 17 | if (priority < LogLevel.ERROR) return 18 | 19 | throwable?.let { 20 | when (it) { 21 | // e.g. http exception, add a customized your exception message 22 | // is KtorException -> { 23 | // FirebaseCrashlytics.getInstance() 24 | // .log("${priority.ordinal}, HTTP Exception, ${it.response?.errorBody}") 25 | // } 26 | else -> FirebaseCrashlytics.getInstance().recordException(it) 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/io/github/aakira/napier/sample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.sample 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import io.github.aakira.napier.mppsample.Sample 6 | import io.github.aakira.napier.sample.databinding.ActivityMainBinding 7 | import kotlinx.coroutines.GlobalScope 8 | import kotlinx.coroutines.launch 9 | 10 | class MainActivity : AppCompatActivity() { 11 | 12 | private lateinit var binding: ActivityMainBinding 13 | 14 | override fun onCreate(savedInstanceState: Bundle?) { 15 | super.onCreate(savedInstanceState) 16 | 17 | binding = ActivityMainBinding.inflate(layoutInflater) 18 | setContentView(binding.root) 19 | 20 | binding.textView.text = Sample().hello() 21 | 22 | GlobalScope.launch { 23 | Sample().suspendHello() 24 | } 25 | 26 | Sample().handleError() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /android/src/main/java/io/github/aakira/napier/sample/NapierApp.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.sample 2 | 3 | import android.app.Application 4 | import com.google.firebase.crashlytics.FirebaseCrashlytics 5 | import io.github.aakira.napier.DebugAntilog 6 | import io.github.aakira.napier.Napier 7 | 8 | class NapierApp : Application() { 9 | 10 | override fun onCreate() { 11 | super.onCreate() 12 | 13 | if (BuildConfig.DEBUG) { 14 | // Debug build 15 | FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(false) 16 | 17 | // init napier 18 | Napier.base(DebugAntilog()) 19 | } else { 20 | // Others(Release build) 21 | FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true) 22 | 23 | // init napier 24 | Napier.base(CrashlyticsAntilog(this)) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /android/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /android/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Napier Sample 3 | true 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /arts/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/arts/logo.jpg -------------------------------------------------------------------------------- /arts/screenshot-android.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/arts/screenshot-android.jpg -------------------------------------------------------------------------------- /arts/screenshot-ios.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/arts/screenshot-ios.jpg -------------------------------------------------------------------------------- /arts/screenshot-js.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/arts/screenshot-js.jpg -------------------------------------------------------------------------------- /arts/screenshot-jvm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/arts/screenshot-jvm.jpg -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Can't read dependencies.Dep when using kts 2 | // https://github.com/gradle/gradle/issues/9270 3 | import dependencies.Dep 4 | 5 | buildscript { 6 | repositories { 7 | google() 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | classpath Dep.GradlePlugin.kotlin 13 | classpath Dep.GradlePlugin.android 14 | 15 | // for crashlytics sample 16 | classpath Dep.GradlePlugin.crashlytics 17 | classpath Dep.GradlePlugin.googleService 18 | } 19 | } 20 | 21 | allprojects { 22 | repositories { 23 | google() 24 | mavenCentral() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /buildSrc/.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /build 3 | -------------------------------------------------------------------------------- /buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.gradle.kotlin.dsl.`kotlin-dsl` 2 | 3 | plugins { 4 | `kotlin-dsl` 5 | } 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/Variables.kt: -------------------------------------------------------------------------------- 1 | // Run on IntelliJ 2 | val ideaActive = System.getProperty("idea.active") == "true" 3 | 4 | // Run on apple silicon 5 | val isAppleSilicon = System.getProperty("os.arch") == "aarch64" 6 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/dependencies/Dep.kt: -------------------------------------------------------------------------------- 1 | package dependencies 2 | 3 | object Dep { 4 | 5 | private const val kotlin = "1.9.21" 6 | 7 | object GradlePlugin { 8 | const val kotlin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Dep.kotlin}" 9 | 10 | const val android = "com.android.tools.build:gradle:8.2.0" 11 | 12 | const val crashlytics = "com.google.firebase:firebase-crashlytics-gradle:2.5.2" 13 | const val googleService = "com.google.gms:google-services:4.3.5" 14 | } 15 | 16 | object Kotlin { 17 | const val common = "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin" 18 | const val jvm = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin" 19 | const val js = "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin" 20 | } 21 | 22 | object Coroutines { 23 | private const val version = "1.8.0-RC2" 24 | 25 | const val core = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version" 26 | } 27 | 28 | object Test { 29 | const val common = "org.jetbrains.kotlin:kotlin-test:$kotlin" 30 | const val annotation = "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin" 31 | const val jvm = "org.jetbrains.kotlin:kotlin-test-junit:$kotlin" 32 | const val js = "org.jetbrains.kotlin:kotlin-test-js:$kotlin" 33 | } 34 | 35 | object Android { 36 | const val appCompat = "androidx.appcompat:appcompat:1.3.1" 37 | const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.0" 38 | } 39 | 40 | object Firebase { 41 | const val platform = "com.google.firebase:firebase-bom:27.1.0" 42 | const val crashlytics = "com.google.firebase:firebase-crashlytics-ktx" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /buildSrc/src/main/kotlin/dependencies/Versions.kt: -------------------------------------------------------------------------------- 1 | package dependencies 2 | 3 | object Versions { 4 | const val versionCode = 26 5 | const val versionName = "2.7.1" 6 | 7 | // android 8 | const val androidVersionCode = 1 9 | const val androidVersionName = "1.0.0" 10 | const val compileSdkVersion = 34 11 | const val buildToolsVersion = "34.0.0" 12 | const val minSdkVersion = 16 13 | const val targetSdkVersion = 34 14 | } 15 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xms2048M -Xmx5120M 2 | 3 | kotlin.code.style=official 4 | 5 | kotlin.native.distribution.type=prebuilt 6 | 7 | # Android 8 | android.useAndroidX=true 9 | android.enableJetifier=true 10 | 11 | # Snatype 12 | 13 | GROUP=aakira 14 | ARTIFACT_ID=napier 15 | 16 | repository=maven 17 | projectName=napier 18 | mavenGroup=io.github.aakira 19 | 20 | issueUrl=https://github.com/aakira/Napier/issues 21 | siteUrl=https://github.com/aakira/Napier 22 | vcsUrl=https://github.com/aakira/Napier.git 23 | 24 | pomLicenseName=The Apache Software License, Version 2.0 25 | pomLicenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt 26 | pomLicenseDist=repo 27 | pomDeveloperId=aakira 28 | pomDeveloperName=aakira 29 | pomOrganizationName=aakira 30 | pomOrganizationUrl=https://github.com/aakira 31 | pomDescription=Kotlin Multiplatform libraries that show logs in common module. 32 | -------------------------------------------------------------------------------- /gradle/publish.gradle.kts: -------------------------------------------------------------------------------- 1 | import dependencies.Versions 2 | 3 | apply(plugin = "maven-publish") 4 | apply(plugin = "signing") 5 | 6 | fun Project.publishing(action: PublishingExtension.() -> Unit) = 7 | configure(action) 8 | 9 | fun Project.signing(configure: SigningExtension.() -> Unit): Unit = 10 | configure(configure) 11 | 12 | val publications: PublicationContainer = 13 | (extensions.getByName("publishing") as PublishingExtension).publications 14 | 15 | val javadocJar by tasks.registering(Jar::class) { 16 | archiveClassifier.set("javadoc") 17 | } 18 | 19 | // read values from gradle.properties 20 | val mavenGroup: String by project 21 | val projectName: String by project 22 | val pomDescription: String by project 23 | val siteUrl: String by project 24 | val pomLicenseName: String by project 25 | val pomLicenseUrl: String by project 26 | val pomLicenseDist: String by project 27 | val pomDeveloperId: String by project 28 | val pomDeveloperName: String by project 29 | val pomOrganizationName: String by project 30 | val pomOrganizationUrl: String by project 31 | 32 | val sonatypeUser: String? by project 33 | val sonatypePassword: String? by project 34 | val sonatypePasswordEnv: String? = System.getenv()["SONATYPE_PASSWORD"] 35 | val sonatypeUsernameEnv: String? = System.getenv()["SONATYPE_USERNAME"] 36 | 37 | publishing { 38 | publications.all { 39 | group = mavenGroup 40 | version = Versions.versionName 41 | } 42 | 43 | publications.withType().all { 44 | artifact(javadocJar.get()) 45 | 46 | pom { 47 | name.set(projectName) 48 | description.set(pomDescription) 49 | url.set(siteUrl) 50 | licenses { 51 | license { 52 | name.set(pomLicenseName) 53 | url.set(pomLicenseUrl) 54 | distribution.set(pomLicenseDist) 55 | } 56 | } 57 | developers { 58 | developer { 59 | id.set(pomDeveloperId) 60 | name.set(pomDeveloperName) 61 | organization.set(pomOrganizationName) 62 | organizationUrl.set(pomOrganizationUrl) 63 | } 64 | } 65 | scm { 66 | url.set(siteUrl) 67 | } 68 | } 69 | } 70 | 71 | // FIXME - workaround for https://github.com/gradle/gradle/issues/26091 72 | val signingTasks = tasks.withType() 73 | tasks.withType().configureEach { 74 | mustRunAfter(signingTasks) 75 | } 76 | 77 | repositories { 78 | maven { 79 | name = "Sonatype" 80 | url = uri( 81 | if (version.toString().endsWith("SNAPSHOT")) { 82 | "https://s01.oss.sonatype.org/content/repositories/snapshots" 83 | } else { 84 | "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2" 85 | } 86 | ) 87 | 88 | credentials { 89 | username = sonatypeUser ?: sonatypeUsernameEnv ?: "" 90 | password = sonatypePassword ?: sonatypePasswordEnv ?: "" 91 | } 92 | } 93 | } 94 | } 95 | 96 | signing { 97 | sign(publications) 98 | } 99 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /ios/.bundle/config: -------------------------------------------------------------------------------- 1 | --- 2 | BUNDLE_PATH: "vendor/bundle" 3 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | DerivedData/ 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | xcuserdata/ 12 | *.moved-aside 13 | *.xccheckout 14 | *.xcscmblueprint 15 | *.hmap 16 | *.ipa 17 | *.dSYM.zip 18 | *.dSYM 19 | 20 | Pods/ 21 | vendor/ 22 | -------------------------------------------------------------------------------- /ios/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "cocoapods", "1.6.0" 4 | -------------------------------------------------------------------------------- /ios/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.0) 5 | activesupport (4.2.11) 6 | i18n (~> 0.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | atomos (0.1.3) 11 | claide (1.0.2) 12 | cocoapods (1.6.0) 13 | activesupport (>= 4.0.2, < 5) 14 | claide (>= 1.0.2, < 2.0) 15 | cocoapods-core (= 1.6.0) 16 | cocoapods-deintegrate (>= 1.0.2, < 2.0) 17 | cocoapods-downloader (>= 1.2.2, < 2.0) 18 | cocoapods-plugins (>= 1.0.0, < 2.0) 19 | cocoapods-search (>= 1.0.0, < 2.0) 20 | cocoapods-stats (>= 1.0.0, < 2.0) 21 | cocoapods-trunk (>= 1.3.1, < 2.0) 22 | cocoapods-try (>= 1.1.0, < 2.0) 23 | colored2 (~> 3.1) 24 | escape (~> 0.0.4) 25 | fourflusher (>= 2.2.0, < 3.0) 26 | gh_inspector (~> 1.0) 27 | molinillo (~> 0.6.6) 28 | nap (~> 1.0) 29 | ruby-macho (~> 1.3, >= 1.3.1) 30 | xcodeproj (>= 1.8.0, < 2.0) 31 | cocoapods-core (1.6.0) 32 | activesupport (>= 4.0.2, < 6) 33 | fuzzy_match (~> 2.0.4) 34 | nap (~> 1.0) 35 | cocoapods-deintegrate (1.0.2) 36 | cocoapods-downloader (1.6.3) 37 | cocoapods-plugins (1.0.0) 38 | nap 39 | cocoapods-search (1.0.0) 40 | cocoapods-stats (1.1.0) 41 | cocoapods-trunk (1.3.1) 42 | nap (>= 0.8, < 2.0) 43 | netrc (~> 0.11) 44 | cocoapods-try (1.1.0) 45 | colored2 (3.1.2) 46 | concurrent-ruby (1.1.4) 47 | escape (0.0.4) 48 | fourflusher (2.2.0) 49 | fuzzy_match (2.0.4) 50 | gh_inspector (1.1.3) 51 | i18n (0.9.5) 52 | concurrent-ruby (~> 1.0) 53 | minitest (5.11.3) 54 | molinillo (0.6.6) 55 | nanaimo (0.2.6) 56 | nap (1.1.0) 57 | netrc (0.11.0) 58 | ruby-macho (1.3.1) 59 | thread_safe (0.3.6) 60 | tzinfo (1.2.5) 61 | thread_safe (~> 0.1) 62 | xcodeproj (1.8.0) 63 | CFPropertyList (>= 2.3.3, < 4.0) 64 | atomos (~> 0.1.3) 65 | claide (>= 1.0.2, < 2.0) 66 | colored2 (~> 3.1) 67 | nanaimo (~> 0.2.6) 68 | 69 | PLATFORMS 70 | ruby 71 | x86_64-darwin-19 72 | 73 | DEPENDENCIES 74 | cocoapods (= 1.6.0) 75 | 76 | BUNDLED WITH 77 | 2.2.2 78 | -------------------------------------------------------------------------------- /ios/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: init 2 | init: 3 | bundle install --path vendor/bundle 4 | bundle exec pod install 5 | -------------------------------------------------------------------------------- /ios/Napier.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Napier.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Napier.xcodeproj/xcshareddata/xcschemes/Napier.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /ios/Napier.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Napier.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Napier/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Firebase 3 | import mpp_sample 4 | 5 | @UIApplicationMain 6 | class AppDelegate: UIResponder, UIApplicationDelegate { 7 | 8 | var window: UIWindow? 9 | 10 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 11 | 12 | #if DEBUG 13 | // Debug build 14 | 15 | // init napier 16 | NapierProxyKt.debugBuild() 17 | 18 | #else 19 | // Others(Release build) 20 | 21 | // init firebase crashlytics 22 | FirebaseApp.configure() 23 | 24 | // init napier 25 | NapierProxyKt.releaseBuild(antilog: CrashlyticsAntilog( 26 | crashlyticsAddLog: { priority, tag, message in 27 | Crashlytics.crashlytics().log("\(String(describing: tag)): \(String(describing: message))") 28 | }, 29 | crashlyticsSendLog: { throwable in 30 | Crashlytics.crashlytics().record(error: throwable) 31 | })) 32 | #endif 33 | 34 | return true 35 | } 36 | 37 | func applicationWillResignActive(_ application: UIApplication) { 38 | } 39 | 40 | func applicationDidEnterBackground(_ application: UIApplication) { 41 | } 42 | 43 | func applicationWillEnterForeground(_ application: UIApplication) { 44 | } 45 | 46 | func applicationDidBecomeActive(_ application: UIApplication) { 47 | } 48 | 49 | func applicationWillTerminate(_ application: UIApplication) { 50 | } 51 | } 52 | 53 | extension KotlinThrowable: Swift.Error {} 54 | -------------------------------------------------------------------------------- /ios/Napier/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ios/Napier/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ios/Napier/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ios/Napier/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/Napier/GoogleService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CLIENT_ID 6 | 1072620373207-89solc0vol23brafmaho0nnbc9bvucdr.apps.googleusercontent.com 7 | REVERSED_CLIENT_ID 8 | com.googleusercontent.apps.1072620373207-89solc0vol23brafmaho0nnbc9bvucdr 9 | API_KEY 10 | AIzaSyA5PEay6wuq7bQu7HFEl4nspIT1rg2YsdY 11 | GCM_SENDER_ID 12 | 1072620373207 13 | PLIST_VERSION 14 | 1 15 | BUNDLE_ID 16 | io.github.aakira.napier.sample 17 | PROJECT_ID 18 | napier-82786 19 | STORAGE_BUCKET 20 | napier-82786.appspot.com 21 | IS_ADS_ENABLED 22 | 23 | IS_ANALYTICS_ENABLED 24 | 25 | IS_APPINVITE_ENABLED 26 | 27 | IS_GCM_ENABLED 28 | 29 | IS_SIGNIN_ENABLED 30 | 31 | GOOGLE_APP_ID 32 | 1:1072620373207:ios:4ad674a7f2a06989481c92 33 | DATABASE_URL 34 | https://napier-82786.firebaseio.com 35 | 36 | -------------------------------------------------------------------------------- /ios/Napier/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 | firebase_crashlytics_collection_enabled 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/Napier/Napier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Napier.swift 3 | // Napier 4 | // 5 | // Created by Phil on 23.10.2021. 6 | // Copyright © 2021 AAkira. All rights reserved. 7 | // 8 | 9 | import mpp_sample 10 | 11 | extension Napier { 12 | static func v(tag: String? = nil, _ items: Any..., separator: String = " ", file: String = #file, function: String = #function) { 13 | log(logLevel: .verbose, tag: tag, items, separator: separator, file: file, function: function) 14 | } 15 | 16 | static func d(tag: String? = nil, _ items: Any..., separator: String = " ", file: String = #file, function: String = #function) { 17 | log(logLevel: .debug, tag: tag, items, separator: separator, file: file, function: function) 18 | } 19 | 20 | static func i(tag: String? = nil, _ items: Any..., separator: String = " ", file: String = #file, function: String = #function) { 21 | log(logLevel: .info, tag: tag, items, separator: separator, file: file, function: function) 22 | } 23 | 24 | static func w(tag: String? = nil, _ items: Any..., separator: String = " ", file: String = #file, function: String = #function) { 25 | log(logLevel: .warning, tag: tag, items, separator: separator, file: file, function: function) 26 | } 27 | 28 | static func e(tag: String? = nil, _ items: Any..., separator: String = " ", file: String = #file, function: String = #function) { 29 | log(logLevel: .error, tag: tag, items, separator: separator, file: file, function: function) 30 | } 31 | 32 | static func a(tag: String? = nil, _ items: Any..., separator: String = " ", file: String = #file, function: String = #function) { 33 | log(logLevel: .assert, tag: tag, items, separator: separator, file: file, function: function) 34 | } 35 | 36 | static private func log(logLevel: LogLevel, tag: String?, _ items: [Any], separator: String, file: String, function: String) { 37 | let message = items.map { "\($0)" }.joined(separator: separator) 38 | shared.log( 39 | priority: logLevel, 40 | tag: tag ?? { 41 | let fileName = URL(fileURLWithPath: file).lastPathComponent 42 | let functionName: String 43 | if let firstBraceIndex = function.firstIndex(of: "(") { 44 | functionName = String(function[.. '../mpp-sample' 8 | end 9 | -------------------------------------------------------------------------------- /ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Firebase/CoreOnly (7.10.0): 3 | - FirebaseCore (= 7.10.0) 4 | - Firebase/Crashlytics (7.10.0): 5 | - Firebase/CoreOnly 6 | - FirebaseCrashlytics (~> 7.10.0) 7 | - FirebaseCore (7.10.0): 8 | - FirebaseCoreDiagnostics (~> 7.4) 9 | - GoogleUtilities/Environment (~> 7.0) 10 | - GoogleUtilities/Logger (~> 7.0) 11 | - FirebaseCoreDiagnostics (7.10.0): 12 | - GoogleDataTransport (~> 8.4) 13 | - GoogleUtilities/Environment (~> 7.0) 14 | - GoogleUtilities/Logger (~> 7.0) 15 | - nanopb (~> 2.30908.0) 16 | - FirebaseCrashlytics (7.10.0): 17 | - FirebaseCore (~> 7.0) 18 | - FirebaseInstallations (~> 7.0) 19 | - GoogleDataTransport (~> 8.4) 20 | - nanopb (~> 2.30908.0) 21 | - PromisesObjC (~> 1.2) 22 | - FirebaseInstallations (7.10.0): 23 | - FirebaseCore (~> 7.0) 24 | - GoogleUtilities/Environment (~> 7.0) 25 | - GoogleUtilities/UserDefaults (~> 7.0) 26 | - PromisesObjC (~> 1.2) 27 | - GoogleDataTransport (8.4.0): 28 | - GoogleUtilities/Environment (~> 7.2) 29 | - nanopb (~> 2.30908.0) 30 | - PromisesObjC (~> 1.2) 31 | - GoogleUtilities/Environment (7.3.1): 32 | - PromisesObjC (~> 1.2) 33 | - GoogleUtilities/Logger (7.3.1): 34 | - GoogleUtilities/Environment 35 | - GoogleUtilities/UserDefaults (7.3.1): 36 | - GoogleUtilities/Logger 37 | - mpp_sample (1.0.0) 38 | - nanopb (2.30908.0): 39 | - nanopb/decode (= 2.30908.0) 40 | - nanopb/encode (= 2.30908.0) 41 | - nanopb/decode (2.30908.0) 42 | - nanopb/encode (2.30908.0) 43 | - PromisesObjC (1.2.12) 44 | 45 | DEPENDENCIES: 46 | - Firebase/Crashlytics 47 | - mpp_sample (from `../mpp-sample`) 48 | 49 | SPEC REPOS: 50 | trunk: 51 | - Firebase 52 | - FirebaseCore 53 | - FirebaseCoreDiagnostics 54 | - FirebaseCrashlytics 55 | - FirebaseInstallations 56 | - GoogleDataTransport 57 | - GoogleUtilities 58 | - nanopb 59 | - PromisesObjC 60 | 61 | EXTERNAL SOURCES: 62 | mpp_sample: 63 | :path: "../mpp-sample" 64 | 65 | SPEC CHECKSUMS: 66 | Firebase: fffddd0bab8677d07376538365faa93ff3889b39 67 | FirebaseCore: ec566d917b2195fc2610aeb148dae99f57a788f9 68 | FirebaseCoreDiagnostics: 5662a3823ffcc0acbaa9a21ba5ed302fac634705 69 | FirebaseCrashlytics: e7669d368a22d202f1d0c7546ffdfdff496e1a8c 70 | FirebaseInstallations: bf2ec8dbf36ff4c91af6b9a003d15855757680c1 71 | GoogleDataTransport: cd9db2180fcecd8da1b561aea31e3e56cf834aa7 72 | GoogleUtilities: e1d9ed4e544fc32a93e00e721400cbc3f377200d 73 | mpp_sample: 967ec869a75e439dbe4f674ea3bd3b4817776de9 74 | nanopb: a0ba3315591a9ae0a16a309ee504766e90db0c96 75 | PromisesObjC: 3113f7f76903778cf4a0586bd1ab89329a0b7b97 76 | 77 | PODFILE CHECKSUM: 441ae05d1695723ea9a68d3223ef8b6460bbec0f 78 | 79 | COCOAPODS: 1.10.2 80 | -------------------------------------------------------------------------------- /js/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /js/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import dependencies.Dep 2 | import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig 3 | 4 | plugins { 5 | kotlin("js") 6 | } 7 | 8 | dependencies { 9 | implementation(project(":napier")) 10 | implementation(project(":mpp-sample")) 11 | 12 | implementation(Dep.Kotlin.js) 13 | implementation(Dep.Coroutines.core) 14 | } 15 | 16 | kotlin { 17 | js { 18 | browser { 19 | // execute :js:browserRun to launch dev server 20 | runTask { 21 | devServer = KotlinWebpackConfig.DevServer( 22 | open = true, 23 | port = 8080, 24 | proxy = null, 25 | contentBase = mutableListOf("${projectDir}/src/main/resources") 26 | ) 27 | outputFileName = "main.js" 28 | } 29 | // execute :js:browserWebpack to build webpack bundle in `./build/distributions` 30 | webpackTask { 31 | outputFileName = "main.js" 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /js/run.sh: -------------------------------------------------------------------------------- 1 | rm -fR js/build/bundle 2 | ./gradlew :js:build 3 | open js/src/main/web/index.html 4 | -------------------------------------------------------------------------------- /js/src/main/kotlin/io/github/aakira/napier/sample/Main.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.sample 2 | 3 | import io.github.aakira.napier.DebugAntilog 4 | import io.github.aakira.napier.Napier 5 | import io.github.aakira.napier.mppsample.Sample 6 | import kotlinx.coroutines.GlobalScope 7 | import kotlinx.coroutines.launch 8 | 9 | fun main() { 10 | Napier.base(DebugAntilog("napier js")) 11 | 12 | Sample().hello() 13 | 14 | GlobalScope.launch { 15 | Sample().suspendHello() 16 | } 17 | 18 | Sample().handleError() 19 | } 20 | -------------------------------------------------------------------------------- /js/src/main/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Napier 7 | 8 | 9 | 10 |

Napier

11 | 12 |

See console log

13 | 14 | -------------------------------------------------------------------------------- /js/src/main/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Napier 7 | 8 | 9 | 10 |

Napier

11 | 12 |

See console log

13 | 14 | -------------------------------------------------------------------------------- /js/webpack.config.d/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/js/webpack.config.d/.gitkeep -------------------------------------------------------------------------------- /jvm/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /build 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /jvm/README.md: -------------------------------------------------------------------------------- 1 | # Jvm sample 2 | 3 | ## Run Script 4 | 5 | ```sh 6 | ./gradlew :jvm:build 7 | java -jar jvm/build/libs/jvm.jar 8 | ``` 9 | 10 | ## Known issues 11 | 12 | * java.lang.NoClassDefFoundError 13 | 14 | Downgrade the gradle to 4.x if it doesn't work. 15 | And change the dependencies of gradle. 16 | 17 | ```groovy 18 | compile project(":napier") 19 | compile project(":mpp-sample") 20 | ``` 21 | -------------------------------------------------------------------------------- /jvm/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import dependencies.Dep 2 | 3 | plugins { 4 | kotlin("jvm") 5 | } 6 | 7 | dependencies { 8 | implementation(project(":napier")) 9 | implementation(project(":mpp-sample")) 10 | 11 | implementation(Dep.Kotlin.jvm) 12 | implementation(Dep.Coroutines.core) 13 | } 14 | 15 | val jar by tasks.getting(Jar::class) { 16 | manifest { 17 | attributes["Main-Class"] = "io.github.aakira.napier.sample.MainKt" 18 | } 19 | 20 | from( 21 | configurations["runtimeClasspath"].map { 22 | if (it.isDirectory) it else zipTree(it) 23 | } 24 | ) 25 | exclude("META-INF/versions/9/module-info.class") 26 | } 27 | -------------------------------------------------------------------------------- /jvm/run.sh: -------------------------------------------------------------------------------- 1 | ./gradlew :jvm:build 2 | java -jar jvm/build/libs/jvm.jar 3 | -------------------------------------------------------------------------------- /jvm/src/main/kotlin/io/github/aakira/napier/sample/Main.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.sample 2 | 3 | import io.github.aakira.napier.DebugAntilog 4 | import io.github.aakira.napier.Napier 5 | import io.github.aakira.napier.mppsample.Sample 6 | import kotlinx.coroutines.GlobalScope 7 | import kotlinx.coroutines.launch 8 | 9 | fun main() { 10 | Napier.base(DebugAntilog()) 11 | 12 | val sample = Sample() 13 | sample.hello() 14 | 15 | GlobalScope.launch { 16 | sample.suspendHello() 17 | } 18 | 19 | sample.handleError() 20 | 21 | Thread.sleep(5000) 22 | } 23 | -------------------------------------------------------------------------------- /macOS/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'macOS (macOS)' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for macOS (macOS) 9 | pod 'mpp_sample', :path => '../mpp-sample' 10 | end 11 | -------------------------------------------------------------------------------- /macOS/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - mpp_sample (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - mpp_sample (from `../mpp-sample`) 6 | 7 | EXTERNAL SOURCES: 8 | mpp_sample: 9 | :path: "../mpp-sample" 10 | 11 | SPEC CHECKSUMS: 12 | mpp_sample: 07fdbc60934b60a9bbfb833df6298899fe345026 13 | 14 | PODFILE CHECKSUM: bc4ce6f8ddff432aa3bca804121efe1d46ba7a07 15 | 16 | COCOAPODS: 1.10.1 17 | -------------------------------------------------------------------------------- /macOS/Pods/Local Podspecs/mpp_sample.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mpp_sample", 3 | "version": "1.0.0", 4 | "homepage": "https://github.com/AAkira/Napier", 5 | "source": { 6 | "git": "Not Published", 7 | "tag": "Cocoapods/mpp_sample/1.0.0" 8 | }, 9 | "authors": "", 10 | "license": "", 11 | "summary": "CocoaPods library", 12 | "static_framework": true, 13 | "vendored_frameworks": "build/cocoapods/framework/mpp_sample.framework", 14 | "libraries": "c++", 15 | "module_name": "mpp_sample_umbrella", 16 | "pod_target_xcconfig": { 17 | "KOTLIN_TARGET[sdk=iphonesimulator*]": "ios_x64", 18 | "KOTLIN_TARGET[sdk=iphoneos*]": "ios_arm", 19 | "KOTLIN_TARGET[sdk=watchsimulator*]": "watchos_x64", 20 | "KOTLIN_TARGET[sdk=watchos*]": "watchos_arm", 21 | "KOTLIN_TARGET[sdk=appletvsimulator*]": "tvos_x64", 22 | "KOTLIN_TARGET[sdk=appletvos*]": "tvos_arm64", 23 | "KOTLIN_TARGET[sdk=macosx*]": "macos_x64" 24 | }, 25 | "script_phases": [ 26 | { 27 | "name": "Build mpp_sample", 28 | "execution_position": "before_compile", 29 | "shell_path": "/bin/sh", 30 | "script": " set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$REPO_ROOT/../gradlew\" -p \"$REPO_ROOT\" :mpp-sample:syncFramework -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags=\"$OTHER_CFLAGS\" -Pkotlin.native.cocoapods.paths.headers=\"$HEADER_SEARCH_PATHS\" -Pkotlin.native.cocoapods.paths.frameworks=\"$FRAMEWORK_SEARCH_PATHS\"\n" 31 | } 32 | ], 33 | "platforms": { 34 | "osx": null, 35 | "ios": null, 36 | "tvos": null, 37 | "watchos": null 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /macOS/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - mpp_sample (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - mpp_sample (from `../mpp-sample`) 6 | 7 | EXTERNAL SOURCES: 8 | mpp_sample: 9 | :path: "../mpp-sample" 10 | 11 | SPEC CHECKSUMS: 12 | mpp_sample: 07fdbc60934b60a9bbfb833df6298899fe345026 13 | 14 | PODFILE CHECKSUM: bc4ce6f8ddff432aa3bca804121efe1d46ba7a07 15 | 16 | COCOAPODS: 1.10.1 17 | -------------------------------------------------------------------------------- /macOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/Pods-macOS (macOS).xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /macOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/mpp_sample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /macOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-macOS (macOS).xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 1 13 | 14 | mpp_sample.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 0 20 | 21 | 22 | SuppressBuildableAutocreation 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /macOS/Pods/Pods.xcodeproj/xcuserdata/akira.aratani.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-macOS (macOS).xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | mpp_sample.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 3 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS)-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS)-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS)-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS)-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_macOS__macOS_ : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_macOS__macOS_ 5 | @end 6 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS)-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_macOS__macOS_VersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_macOS__macOS_VersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS).debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -framework "mpp_sample" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS).modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_macOS__macOS_ { 2 | umbrella header "Pods-macOS (macOS)-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/Pods-macOS (macOS)/Pods-macOS (macOS).release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -framework "mpp_sample" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/mpp_sample/mpp_sample.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/mpp_sample 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | KOTLIN_TARGET[sdk=appletvos*] = tvos_arm64 6 | KOTLIN_TARGET[sdk=appletvsimulator*] = tvos_x64 7 | KOTLIN_TARGET[sdk=iphoneos*] = ios_arm 8 | KOTLIN_TARGET[sdk=iphonesimulator*] = ios_x64 9 | KOTLIN_TARGET[sdk=macosx*] = macos_x64 10 | KOTLIN_TARGET[sdk=watchos*] = watchos_arm 11 | KOTLIN_TARGET[sdk=watchsimulator*] = watchos_x64 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_ROOT = ${SRCROOT} 15 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../mpp-sample 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 18 | SKIP_INSTALL = YES 19 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 20 | -------------------------------------------------------------------------------- /macOS/Pods/Target Support Files/mpp_sample/mpp_sample.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/mpp_sample 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | KOTLIN_TARGET[sdk=appletvos*] = tvos_arm64 6 | KOTLIN_TARGET[sdk=appletvsimulator*] = tvos_x64 7 | KOTLIN_TARGET[sdk=iphoneos*] = ios_arm 8 | KOTLIN_TARGET[sdk=iphonesimulator*] = ios_x64 9 | KOTLIN_TARGET[sdk=macosx*] = macos_x64 10 | KOTLIN_TARGET[sdk=watchos*] = watchos_arm 11 | KOTLIN_TARGET[sdk=watchsimulator*] = watchos_x64 12 | PODS_BUILD_DIR = ${BUILD_DIR} 13 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 14 | PODS_ROOT = ${SRCROOT} 15 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../mpp-sample 16 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 17 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 18 | SKIP_INSTALL = YES 19 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 20 | -------------------------------------------------------------------------------- /macOS/Shared/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /macOS/Shared/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | }, 93 | { 94 | "idiom" : "mac", 95 | "scale" : "1x", 96 | "size" : "16x16" 97 | }, 98 | { 99 | "idiom" : "mac", 100 | "scale" : "2x", 101 | "size" : "16x16" 102 | }, 103 | { 104 | "idiom" : "mac", 105 | "scale" : "1x", 106 | "size" : "32x32" 107 | }, 108 | { 109 | "idiom" : "mac", 110 | "scale" : "2x", 111 | "size" : "32x32" 112 | }, 113 | { 114 | "idiom" : "mac", 115 | "scale" : "1x", 116 | "size" : "128x128" 117 | }, 118 | { 119 | "idiom" : "mac", 120 | "scale" : "2x", 121 | "size" : "128x128" 122 | }, 123 | { 124 | "idiom" : "mac", 125 | "scale" : "1x", 126 | "size" : "256x256" 127 | }, 128 | { 129 | "idiom" : "mac", 130 | "scale" : "2x", 131 | "size" : "256x256" 132 | }, 133 | { 134 | "idiom" : "mac", 135 | "scale" : "1x", 136 | "size" : "512x512" 137 | }, 138 | { 139 | "idiom" : "mac", 140 | "scale" : "2x", 141 | "size" : "512x512" 142 | } 143 | ], 144 | "info" : { 145 | "author" : "xcode", 146 | "version" : 1 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /macOS/Shared/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /macOS/Shared/ContentView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct ContentView: View { 4 | var body: some View { 5 | Text("Hello, world!") 6 | .padding() 7 | } 8 | } 9 | 10 | struct ContentView_Previews: PreviewProvider { 11 | static var previews: some View { 12 | ContentView() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /macOS/Shared/macOSApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import Cocoa 3 | import mpp_sample 4 | 5 | @main 6 | struct macOSApp: App { 7 | @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate 8 | 9 | var body: some Scene { 10 | WindowGroup { 11 | ContentView() 12 | } 13 | } 14 | } 15 | 16 | class AppDelegate: NSObject, NSApplicationDelegate { 17 | func applicationDidFinishLaunching(_ notification: Notification) { 18 | #if DEBUG 19 | // Debug build 20 | 21 | // init napier 22 | NapierProxyKt.debugBuild() 23 | 24 | #else 25 | // Others(Release build) 26 | 27 | // init firebase crashlytics 28 | FirebaseApp.configure() 29 | 30 | // init napier 31 | NapierProxyKt.releaseBuild(antilog: CrashlyticsAntilog( 32 | crashlyticsAddLog: { priority, tag, message in 33 | Crashlytics.crashlytics().log("\(String(describing: tag)): \(String(describing: message))") 34 | }, 35 | crashlyticsSendLog: { throwable in 36 | Crashlytics.crashlytics().record(error: throwable) 37 | })) 38 | #endif 39 | 40 | let sample = Sample() 41 | sample.hello() 42 | 43 | sample.suspendHelloKt() 44 | 45 | sample.handleError() 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /macOS/Tests iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /macOS/Tests iOS/Tests_iOS.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class Tests_iOS: XCTestCase { 4 | 5 | override func setUpWithError() throws { 6 | // Put setup code here. This method is called before the invocation of each test method in the class. 7 | 8 | // In UI tests it is usually best to stop immediately when a failure occurs. 9 | continueAfterFailure = false 10 | 11 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 12 | } 13 | 14 | override func tearDownWithError() throws { 15 | // Put teardown code here. This method is called after the invocation of each test method in the class. 16 | } 17 | 18 | func testExample() throws { 19 | // UI tests must launch the application that they test. 20 | let app = XCUIApplication() 21 | app.launch() 22 | 23 | // Use recording to get started writing UI tests. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testLaunchPerformance() throws { 28 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 29 | // This measures how long it takes to launch your application. 30 | measure(metrics: [XCTApplicationLaunchMetric()]) { 31 | XCUIApplication().launch() 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /macOS/Tests macOS/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 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /macOS/Tests macOS/Tests_macOS.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class Tests_macOS: XCTestCase { 4 | 5 | override func setUpWithError() throws { 6 | // Put setup code here. This method is called before the invocation of each test method in the class. 7 | 8 | // In UI tests it is usually best to stop immediately when a failure occurs. 9 | continueAfterFailure = false 10 | 11 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 12 | } 13 | 14 | override func tearDownWithError() throws { 15 | // Put teardown code here. This method is called after the invocation of each test method in the class. 16 | } 17 | 18 | func testExample() throws { 19 | // UI tests must launch the application that they test. 20 | let app = XCUIApplication() 21 | app.launch() 22 | 23 | // Use recording to get started writing UI tests. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testLaunchPerformance() throws { 28 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 29 | // This measures how long it takes to launch your application. 30 | measure(metrics: [XCTApplicationLaunchMetric()]) { 31 | XCUIApplication().launch() 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /macOS/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | 28 | UIApplicationSupportsIndirectInputEvents 29 | 30 | UILaunchScreen 31 | 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /macOS/macOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /macOS/macOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macOS/macOS.xcodeproj/project.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/macOS/macOS.xcodeproj/project.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /macOS/macOS.xcodeproj/project.xcworkspace/xcuserdata/akira.aratani.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/macOS/macOS.xcodeproj/project.xcworkspace/xcuserdata/akira.aratani.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /macOS/macOS.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | macOS (iOS).xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | macOS (macOS).xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 3 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /macOS/macOS.xcodeproj/xcuserdata/akira.aratani.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | macOS (iOS).xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | macOS (macOS).xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /macOS/macOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /macOS/macOS.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macOS/macOS.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/macOS/macOS.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /macOS/macOS.xcworkspace/xcuserdata/akira.aratani.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/macOS/macOS.xcworkspace/xcuserdata/akira.aratani.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /macOS/macOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | 26 | 27 | -------------------------------------------------------------------------------- /macOS/macOS/macOS.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /mpp-sample/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | /build 6 | .DS_Store 7 | -------------------------------------------------------------------------------- /mpp-sample/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import dependencies.Dep 2 | import dependencies.Versions 3 | import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget 4 | import org.jetbrains.kotlin.gradle.plugin.mpp.Framework 5 | import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn 6 | 7 | plugins { 8 | kotlin("multiplatform") 9 | id("com.android.library") 10 | kotlin("native.cocoapods") 11 | } 12 | 13 | version = "1.0.0" 14 | 15 | yarn.lockFileDirectory = file("kotlin-js-store") 16 | 17 | kotlin { 18 | androidTarget() 19 | js { 20 | browser() 21 | } 22 | jvm() 23 | 24 | // darwin 25 | if (ideaActive.not()) { 26 | // intel 27 | macosX64() 28 | iosX64() 29 | watchosX64() 30 | 31 | // apple silicon 32 | macosArm64() 33 | iosSimulatorArm64() 34 | watchosSimulatorArm64() 35 | } else { 36 | if (isAppleSilicon) { 37 | // apple silicon 38 | macosArm64() 39 | iosSimulatorArm64() 40 | watchosSimulatorArm64() 41 | } else { 42 | // intel 43 | macosX64() 44 | iosX64() 45 | watchosX64() 46 | } 47 | } 48 | targets.withType { 49 | binaries.withType { 50 | export(project(":napier")) 51 | } 52 | } 53 | sourceSets { 54 | val commonMain by getting { 55 | dependencies { 56 | implementation(Dep.Kotlin.common) 57 | implementation(Dep.Coroutines.core) 58 | 59 | implementation(project(":napier")) 60 | api(project(":napier")) 61 | } 62 | } 63 | val androidMain by getting { 64 | dependencies { 65 | implementation(Dep.Kotlin.jvm) 66 | } 67 | } 68 | val jsMain by getting { 69 | dependencies { 70 | implementation(Dep.Kotlin.js) 71 | } 72 | } 73 | val jvmMain by getting { 74 | dependencies { 75 | implementation(Dep.Kotlin.jvm) 76 | } 77 | } 78 | 79 | // darwin 80 | val darwinMain by creating { 81 | dependsOn(commonMain) 82 | } 83 | // darwin 84 | if (ideaActive.not()) { 85 | // intel 86 | val macosX64Main by getting { 87 | dependsOn(darwinMain) 88 | } 89 | val iosX64Main by getting { 90 | dependsOn(darwinMain) 91 | } 92 | val watchosX64Main by getting { 93 | dependsOn(darwinMain) 94 | } 95 | 96 | // apple silicon 97 | val macosArm64Main by getting { 98 | dependsOn(darwinMain) 99 | } 100 | val iosSimulatorArm64Main by getting { 101 | dependsOn(darwinMain) 102 | } 103 | val watchosSimulatorArm64Main by getting { 104 | dependsOn(darwinMain) 105 | } 106 | } else { 107 | if (isAppleSilicon) { 108 | // apple silicon 109 | val macosArm64Main by getting { 110 | dependsOn(darwinMain) 111 | } 112 | val iosSimulatorArm64Main by getting { 113 | dependsOn(darwinMain) 114 | } 115 | val watchosSimulatorArm64Main by getting { 116 | dependsOn(darwinMain) 117 | } 118 | } else { 119 | // intel 120 | val macosX64Main by getting { 121 | dependsOn(darwinMain) 122 | } 123 | val iosX64Main by getting { 124 | dependsOn(darwinMain) 125 | } 126 | val watchosX64Main by getting { 127 | dependsOn(darwinMain) 128 | } 129 | } 130 | } 131 | } 132 | 133 | cocoapods { 134 | summary = "CocoaPods library" 135 | homepage = "https://github.com/AAkira/Napier" 136 | } 137 | } 138 | 139 | android { 140 | compileSdk = Versions.compileSdkVersion 141 | buildToolsVersion = Versions.buildToolsVersion 142 | 143 | defaultConfig { 144 | namespace = "io.github.aakira.napier.mppsample" 145 | minSdk = Versions.minSdkVersion 146 | } 147 | 148 | lint { 149 | targetSdk = Versions.targetSdkVersion 150 | } 151 | 152 | sourceSets { 153 | getByName("main") { 154 | manifest.srcFile("src/androidMain/AndroidManifest.xml") 155 | } 156 | } 157 | 158 | compileOptions { 159 | sourceCompatibility = JavaVersion.VERSION_17 160 | targetCompatibility = JavaVersion.VERSION_17 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /mpp-sample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/mpp-sample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /mpp-sample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Mar 10 00:34:56 JST 2020 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.5.1-all.zip 7 | -------------------------------------------------------------------------------- /mpp-sample/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 | -------------------------------------------------------------------------------- /mpp-sample/mpp_sample.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'mpp_sample' 3 | spec.version = '1.0.0' 4 | spec.homepage = 'https://github.com/AAkira/Napier' 5 | spec.source = { :http=> ''} 6 | spec.authors = '' 7 | spec.license = '' 8 | spec.summary = 'CocoaPods library' 9 | spec.vendored_frameworks = 'build/cocoapods/framework/mpp_sample.framework' 10 | spec.libraries = 'c++' 11 | 12 | 13 | 14 | if !Dir.exist?('build/cocoapods/framework/mpp_sample.framework') || Dir.empty?('build/cocoapods/framework/mpp_sample.framework') 15 | raise " 16 | 17 | Kotlin framework 'mpp_sample' doesn't exist yet, so a proper Xcode project can't be generated. 18 | 'pod install' should be executed after running ':generateDummyFramework' Gradle task: 19 | 20 | ./gradlew :mpp-sample:generateDummyFramework 21 | 22 | Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" 23 | end 24 | 25 | spec.pod_target_xcconfig = { 26 | 'KOTLIN_PROJECT_PATH' => ':mpp-sample', 27 | 'PRODUCT_MODULE_NAME' => 'mpp_sample', 28 | } 29 | 30 | spec.script_phases = [ 31 | { 32 | :name => 'Build mpp_sample', 33 | :execution_position => :before_compile, 34 | :shell_path => '/bin/sh', 35 | :script => <<-SCRIPT 36 | if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then 37 | echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" 38 | exit 0 39 | fi 40 | set -ev 41 | REPO_ROOT="$PODS_TARGET_SRCROOT" 42 | "$REPO_ROOT/../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ 43 | -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ 44 | -Pkotlin.native.cocoapods.archs="$ARCHS" \ 45 | -Pkotlin.native.cocoapods.configuration="$CONFIGURATION" 46 | SCRIPT 47 | } 48 | ] 49 | 50 | end -------------------------------------------------------------------------------- /mpp-sample/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /mpp-sample/src/androidMain/kotlin/io/github/aakira/napier/mppsample/RunBlocking.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import kotlinx.coroutines.runBlocking 4 | 5 | actual fun runBlocking(block: suspend () -> T) { 6 | runBlocking { block() } 7 | } 8 | -------------------------------------------------------------------------------- /mpp-sample/src/commonMain/kotlin/io/github/aakira/napier/mppsample/RunBlocking.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | expect fun runBlocking(block: suspend () -> T) 4 | -------------------------------------------------------------------------------- /mpp-sample/src/commonMain/kotlin/io/github/aakira/napier/mppsample/Sample.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import io.github.aakira.napier.Napier 4 | import kotlinx.coroutines.delay 5 | 6 | class Sample { 7 | 8 | fun hello(): String { 9 | Napier.v("Hello napier") 10 | Napier.d("optional tag", tag = "your tag") 11 | 12 | return "Hello Napier" 13 | } 14 | 15 | suspend fun suspendHello(): String { 16 | Napier.i("Hello") 17 | 18 | delay(3000L) 19 | 20 | Napier.w("Napier!") 21 | 22 | return "Suspend Hello Napier" 23 | } 24 | 25 | fun handleError() { 26 | try { 27 | throw Exception("throw error") 28 | } catch (e: Exception) { 29 | Napier.e("Napier Error", e) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /mpp-sample/src/darwinMain/kotlin/io/github/aakira/napier/mppsample/Coroutine.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import kotlinx.coroutines.CoroutineExceptionHandler 4 | import kotlinx.coroutines.CoroutineScope 5 | import kotlinx.coroutines.Dispatchers 6 | import kotlinx.coroutines.Job 7 | import kotlin.coroutines.CoroutineContext 8 | 9 | internal val mainScope = SharedScope(Dispatchers.Main) 10 | 11 | internal val backgroundScope = SharedScope(Dispatchers.Default) 12 | 13 | internal class SharedScope(private val context: CoroutineContext) : CoroutineScope { 14 | private val job = Job() 15 | private val exceptionHandler = CoroutineExceptionHandler { _, throwable -> 16 | println("[Coroutine Exception] $throwable") 17 | } 18 | 19 | override val coroutineContext: CoroutineContext 20 | get() = context + job + exceptionHandler 21 | } 22 | -------------------------------------------------------------------------------- /mpp-sample/src/darwinMain/kotlin/io/github/aakira/napier/mppsample/CoroutineProxy.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import kotlinx.coroutines.launch 4 | 5 | fun Sample.suspendHelloKt() { 6 | backgroundScope.launch { 7 | suspendHello() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /mpp-sample/src/darwinMain/kotlin/io/github/aakira/napier/mppsample/CrashlyticsAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import io.github.aakira.napier.Antilog 4 | import io.github.aakira.napier.LogLevel 5 | 6 | class CrashlyticsAntilog( 7 | private val crashlyticsAddLog: (priority: Int, tag: String?, message: String?) -> Unit, 8 | private val crashlyticsSendLog: (throwable: Throwable) -> Unit 9 | ) : Antilog() { 10 | 11 | override fun performLog(priority: LogLevel, tag: String?, throwable: Throwable?, message: String?) { 12 | // send only error log 13 | if (priority < LogLevel.ERROR) return 14 | 15 | crashlyticsAddLog.invoke(priority.ordinal, tag, message) 16 | 17 | throwable?.let { 18 | when { 19 | // e.g. http exception, add a customized your exception message 20 | // it is KtorException -> { 21 | // crashlyticsAddLog.invoke(priority.ordinal, "HTTP Exception", it.response?.errorBody.toString()) 22 | // } 23 | } 24 | crashlyticsSendLog.invoke(it) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mpp-sample/src/darwinMain/kotlin/io/github/aakira/napier/mppsample/NapierProxy.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import io.github.aakira.napier.Antilog 4 | import io.github.aakira.napier.DebugAntilog 5 | import io.github.aakira.napier.Napier 6 | 7 | fun debugBuild() { 8 | Napier.base(DebugAntilog()) 9 | } 10 | 11 | fun releaseBuild(antilog: Antilog) { 12 | Napier.base(antilog) 13 | } 14 | -------------------------------------------------------------------------------- /mpp-sample/src/darwinMain/kotlin/io/github/aakira/napier/mppsample/RunBlocking.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import kotlinx.coroutines.runBlocking 4 | 5 | actual fun runBlocking(block: suspend () -> T) { 6 | runBlocking { block() } 7 | } 8 | -------------------------------------------------------------------------------- /mpp-sample/src/jsMain/kotlin/io/github/aakira/napier/mppsample/RunBlocking.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import kotlinx.coroutines.GlobalScope 4 | import kotlinx.coroutines.promise 5 | import kotlin.coroutines.EmptyCoroutineContext 6 | 7 | actual fun runBlocking(block: suspend () -> T) { 8 | GlobalScope.promise(EmptyCoroutineContext) { block() } 9 | } 10 | -------------------------------------------------------------------------------- /mpp-sample/src/jvmMain/kotlin/io/github/aakira/napier/mppsample/RunBlocking.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.mppsample 2 | 3 | import kotlinx.coroutines.runBlocking 4 | 5 | actual fun runBlocking(block: suspend () -> T) { 6 | runBlocking { block() } 7 | } 8 | -------------------------------------------------------------------------------- /napier/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /napier/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /napier/src/androidMain/kotlin/io/github/aakira/napier/DebugAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | import android.os.Build 4 | import android.util.Log 5 | import java.io.PrintWriter 6 | import java.io.StringWriter 7 | import java.util.regex.Pattern 8 | import kotlin.math.min 9 | 10 | actual class DebugAntilog actual constructor(private val defaultTag: String) : Antilog() { 11 | 12 | companion object { 13 | private const val MAX_LOG_LENGTH = 4000 14 | private const val MAX_TAG_LENGTH = 23 15 | private const val CALL_STACK_INDEX = 9 16 | } 17 | 18 | private val anonymousClass = Pattern.compile("(\\$\\d+)+$") 19 | 20 | override fun performLog( 21 | priority: LogLevel, 22 | tag: String?, 23 | throwable: Throwable?, 24 | message: String?, 25 | ) { 26 | 27 | val debugTag = tag ?: performTag(defaultTag) 28 | 29 | val fullMessage = if (message != null) { 30 | if (throwable != null) { 31 | "$message\n${throwable.stackTraceString}" 32 | } else { 33 | message 34 | } 35 | } else throwable?.stackTraceString ?: return 36 | 37 | val length = fullMessage.length 38 | if (length <= MAX_LOG_LENGTH) { 39 | // Fast path for small messages which can fit in a single call. 40 | if (priority == LogLevel.ASSERT) { 41 | Log.wtf(debugTag, fullMessage) 42 | } else { 43 | Log.println(priority.toValue(), debugTag, fullMessage) 44 | } 45 | return 46 | } 47 | 48 | // Slow path: Split by line, then ensure each line can fit into Log's maximum length. 49 | // TODO use lastIndexOf instead of indexOf to batch multiple lines into single calls. 50 | var i = 0 51 | while (i < length) { 52 | var newline = fullMessage.indexOf('\n', i) 53 | newline = if (newline != -1) newline else length 54 | do { 55 | val end = min(newline, i + MAX_LOG_LENGTH) 56 | val part = fullMessage.substring(i, end) 57 | if (priority.toValue() == Log.ASSERT) { 58 | Log.wtf(debugTag, part) 59 | } else { 60 | Log.println(priority.toValue(), debugTag, part) 61 | } 62 | i = end 63 | } while (i < newline) 64 | i++ 65 | } 66 | } 67 | 68 | private fun performTag(tag: String): String { 69 | val thread = Thread.currentThread().stackTrace 70 | 71 | return if (thread.size >= CALL_STACK_INDEX) { 72 | thread[CALL_STACK_INDEX].run { 73 | "${createStackElementTag(className)}\$$methodName" 74 | } 75 | } else { 76 | tag 77 | } 78 | } 79 | 80 | internal fun createStackElementTag(className: String): String { 81 | var tag = className 82 | val m = anonymousClass.matcher(tag) 83 | if (m.find()) { 84 | tag = m.replaceAll("") 85 | } 86 | tag = tag.substring(tag.lastIndexOf('.') + 1) 87 | // Tag length limit was removed in API 24. 88 | return if (tag.length <= MAX_TAG_LENGTH || Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 89 | tag 90 | } else tag.substring(0, MAX_TAG_LENGTH) 91 | } 92 | 93 | private val Throwable.stackTraceString 94 | get(): String { 95 | // DO NOT replace this with Log.getStackTraceString() - it hides UnknownHostException, which is 96 | // not what we want. 97 | val sw = StringWriter(256) 98 | val pw = PrintWriter(sw, false) 99 | printStackTrace(pw) 100 | pw.flush() 101 | return sw.toString() 102 | } 103 | 104 | private fun LogLevel.toValue() = when (this) { 105 | LogLevel.VERBOSE -> Log.VERBOSE 106 | LogLevel.DEBUG -> Log.DEBUG 107 | LogLevel.INFO -> Log.INFO 108 | LogLevel.WARNING -> Log.WARN 109 | LogLevel.ERROR -> Log.ERROR 110 | LogLevel.ASSERT -> Log.ASSERT 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /napier/src/androidMain/kotlin/io/github/aakira/napier/atomic/AtomicRef.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.atomic 2 | 3 | internal actual class AtomicRef actual constructor(actual var value: T) 4 | -------------------------------------------------------------------------------- /napier/src/androidUnitTest/kotlin/io/github/aakira/napier/NapierAndroidTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | import org.junit.Test 4 | import kotlin.test.assertEquals 5 | import kotlin.test.assertNotEquals 6 | 7 | class NapierAndroidTest { 8 | 9 | @Test 10 | fun `Check createStackElementTag`() { 11 | val debugAntilog = DebugAntilog() 12 | 13 | assertEquals("Hoge", debugAntilog.createStackElementTag("io.github.aakira.napier.Hoge")) 14 | assertEquals( 15 | "Hoge2", 16 | debugAntilog.createStackElementTag("AA\$io.github.aakira.napier.Hoge2") 17 | ) 18 | assertEquals( 19 | "Hoge3\$default", 20 | debugAntilog.createStackElementTag("io.github.aakira.napier.Hoge3\$default") 21 | ) 22 | assertNotEquals( 23 | "default", 24 | debugAntilog.createStackElementTag("io.github.aakira.napier.Hoge3\$default") 25 | ) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /napier/src/commonMain/kotlin/io/github/aakira/napier/Antilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | abstract class Antilog { 4 | 5 | open fun isEnable(priority: LogLevel, tag: String?) = true 6 | 7 | fun log(priority: LogLevel, tag: String?, throwable: Throwable?, message: String?) { 8 | if (isEnable(priority, tag)) { 9 | performLog(priority, tag, throwable, message) 10 | } 11 | } 12 | 13 | internal fun rawLog( 14 | priority: LogLevel, 15 | tag: String?, 16 | throwable: Throwable?, 17 | message: String?, 18 | ) { 19 | performLog(priority, tag, throwable, message) 20 | } 21 | 22 | protected abstract fun performLog( 23 | priority: LogLevel, 24 | tag: String?, 25 | throwable: Throwable?, 26 | message: String?, 27 | ) 28 | } 29 | -------------------------------------------------------------------------------- /napier/src/commonMain/kotlin/io/github/aakira/napier/DebugAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | expect class DebugAntilog(defaultTag: String = "app") : Antilog -------------------------------------------------------------------------------- /napier/src/commonMain/kotlin/io/github/aakira/napier/LogLevel.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | enum class LogLevel { 4 | VERBOSE, 5 | DEBUG, 6 | INFO, 7 | WARNING, 8 | ERROR, 9 | ASSERT, 10 | } 11 | 12 | -------------------------------------------------------------------------------- /napier/src/commonMain/kotlin/io/github/aakira/napier/atomic/AtomicMutableList.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.atomic 2 | 3 | internal class AtomicMutableList(value: List) : AbstractList() { 4 | constructor() : this(listOf()) 5 | 6 | private val atomicReference = AtomicRef(value) 7 | 8 | fun add(element: T, index: Int = count()) = 9 | modify(+1) { 10 | add(index, element) 11 | } 12 | 13 | fun remove(t: T) = 14 | modify(-1) { 15 | remove(t) 16 | } 17 | 18 | fun clear() = 19 | modify(-size) { 20 | clear() 21 | } 22 | 23 | fun removeAt(index: Int): T = 24 | modify(-1) { 25 | removeAt(index) 26 | } 27 | 28 | fun set(index: Int, element: T): T = 29 | modify(0) { 30 | set(index, element) 31 | } 32 | 33 | fun dropAll(): List { 34 | val result = atomicReference.value 35 | atomicReference.value = listOf() 36 | return result 37 | } 38 | 39 | override val size: Int get() = atomicReference.value.size 40 | override fun isEmpty(): Boolean = atomicReference.value.isEmpty() 41 | override fun contains(element: T): Boolean = atomicReference.value.contains(element) 42 | override fun get(index: Int): T = atomicReference.value[index] 43 | override fun indexOf(element: T): Int = atomicReference.value.indexOf(element) 44 | override fun lastIndexOf(element: T): Int = atomicReference.value.lastIndexOf(element) 45 | override fun iterator(): Iterator = atomicReference.value.iterator() 46 | 47 | private fun modify(capacityDiff: Int, block: ArrayList.() -> R): R { 48 | val newValue = ArrayList(size + capacityDiff) 49 | newValue.addAll(this) 50 | val result = block(newValue) 51 | atomicReference.value = newValue 52 | return result 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /napier/src/commonMain/kotlin/io/github/aakira/napier/atomic/AtomicRef.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.atomic 2 | 3 | internal expect class AtomicRef(value: T) { 4 | var value: T 5 | } 6 | -------------------------------------------------------------------------------- /napier/src/darwinMain/kotlin/io/github/aakira/napier/DebugAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | import platform.Foundation.NSDate 4 | import platform.Foundation.NSDateFormatter 5 | import platform.Foundation.NSThread 6 | import kotlin.experimental.ExperimentalNativeApi 7 | 8 | private const val CALL_STACK_INDEX = 8 9 | 10 | actual class DebugAntilog( 11 | private val defaultTag: String = "app", 12 | private val coroutinesSuffix: Boolean = true, 13 | ) : Antilog() { 14 | actual constructor(defaultTag: String) : this(defaultTag, coroutinesSuffix = true) 15 | 16 | var crashAssert = false 17 | 18 | private val dateFormatter = NSDateFormatter().apply { 19 | dateFormat = "MM-dd HH:mm:ss.SSS" 20 | } 21 | 22 | private val tagMap: HashMap = hashMapOf( 23 | LogLevel.VERBOSE to "💜 VERBOSE", 24 | LogLevel.DEBUG to "💚 DEBUG", 25 | LogLevel.INFO to "💙 INFO", 26 | LogLevel.WARNING to "💛 WARN", 27 | LogLevel.ERROR to "❤️ ERROR", 28 | LogLevel.ASSERT to "💞 ASSERT" 29 | ) 30 | 31 | @OptIn(ExperimentalNativeApi::class) 32 | override fun performLog( 33 | priority: LogLevel, 34 | tag: String?, 35 | throwable: Throwable?, 36 | message: String?, 37 | ) { 38 | if (priority == LogLevel.ASSERT) { 39 | assert(crashAssert) { buildLog(priority, tag, throwable, message) } 40 | } else { 41 | println(buildLog(priority, tag, throwable, message)) 42 | } 43 | } 44 | 45 | fun setTag(level: LogLevel, tag: String) { 46 | tagMap[level] = tag 47 | } 48 | 49 | fun setDateFormatterString(formatter: String) { 50 | dateFormatter.dateFormat = formatter 51 | } 52 | 53 | private fun getCurrentTime() = dateFormatter.stringFromDate(NSDate()) 54 | 55 | private fun buildLog(priority: LogLevel, tag: String?, throwable: Throwable?, message: String?): String { 56 | val baseLogString = "${getCurrentTime()} ${tagMap[priority]} ${tag ?: performTag(defaultTag)} - $message" 57 | return if (throwable != null) { 58 | "$baseLogString\n${throwable.stackTraceToString()}" 59 | } else { 60 | baseLogString 61 | } 62 | } 63 | 64 | // find stack trace 65 | private fun performTag(tag: String): String { 66 | val symbols = NSThread.callStackSymbols 67 | if (symbols.size <= CALL_STACK_INDEX) return tag 68 | 69 | return (symbols[CALL_STACK_INDEX] as? String)?.let { 70 | createStackElementTag(it) 71 | } ?: tag 72 | } 73 | 74 | internal fun createStackElementTag(string: String): String { 75 | var tag = string 76 | tag = tag.substringBeforeLast('$') 77 | tag = tag.substringBeforeLast('(') 78 | if (tag.contains("$")) { 79 | // coroutines 80 | tag = tag.substring(tag.lastIndexOf(".", tag.lastIndexOf(".") - 1) + 1) 81 | tag = tag.replace("$", "") 82 | tag = tag.replace("COROUTINE", if (coroutinesSuffix) "[async]" else "") 83 | } else { 84 | // others 85 | tag = tag.substringAfterLast(".") 86 | tag = tag.replace("#", ".") 87 | } 88 | return tag 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /napier/src/darwinMain/kotlin/io/github/aakira/napier/atomic/AtomicRef.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.atomic 2 | 3 | import kotlin.concurrent.AtomicReference 4 | import kotlin.native.concurrent.freeze 5 | 6 | internal actual class AtomicRef actual constructor(value: T) { 7 | private val atomicRef = AtomicReference(value.freeze()) 8 | actual var value: T 9 | get() = atomicRef.value 10 | set(value) { 11 | atomicRef.value = value.freeze() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /napier/src/darwinTest/kotlin/io/github/aakira/napier/NapierIosTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | import kotlin.test.Test 4 | import kotlin.test.assertEquals 5 | 6 | class NapierIosTest { 7 | 8 | @Test 9 | fun `Check createStackElementTag`() { 10 | val debugAntilog = DebugAntilog() 11 | 12 | val sampleHello = debugAntilog.createStackElementTag( 13 | "8 Napier 0x0000000100f0eb3d kfun:io.github.aakira.napier.mppsample.Sample#hello(){}kotlin.String + 205" 14 | ) 15 | assertEquals("Sample.hello", sampleHello) 16 | 17 | val handleError = debugAntilog.createStackElementTag( 18 | "8 Napier 0x0000000100f0f57c kfun:io.github.aakira.napier.mppsample.Sample#handleError(){} + 412" 19 | ) 20 | assertEquals("Sample.handleError", handleError) 21 | 22 | val coroutine = debugAntilog.createStackElementTag( 23 | "8 Napier 0x0000000100f0f0e2 kfun:io.github.aakira.napier.mppsample.Sample.\$suspendHelloCOROUTINE\$2#invokeSuspend(kotlin.Result){}kotlin.Any? + 930" 24 | ) 25 | assertEquals("Sample.suspendHello[async]", coroutine) 26 | } 27 | 28 | @Test 29 | fun `Check createStackElementTag without coroutines suffix`() { 30 | val debugAntilog = DebugAntilog( 31 | coroutinesSuffix = false, 32 | ) 33 | 34 | val sampleHello = debugAntilog.createStackElementTag( 35 | "8 Napier 0x0000000100f0eb3d kfun:io.github.aakira.napier.mppsample.Sample#hello(){}kotlin.String + 205" 36 | ) 37 | assertEquals("Sample.hello", sampleHello) 38 | 39 | val handleError = debugAntilog.createStackElementTag( 40 | "8 Napier 0x0000000100f0f57c kfun:io.github.aakira.napier.mppsample.Sample#handleError(){} + 412" 41 | ) 42 | assertEquals("Sample.handleError", handleError) 43 | 44 | val coroutine = debugAntilog.createStackElementTag( 45 | "8 Napier 0x0000000100f0f0e2 kfun:io.github.aakira.napier.mppsample.Sample.\$suspendHelloCOROUTINE\$2#invokeSuspend(kotlin.Result){}kotlin.Any? + 930" 46 | ) 47 | assertEquals("Sample.suspendHello", coroutine) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /napier/src/jsMain/kotlin/io/github/aakira/napier/DebugAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | actual class DebugAntilog actual constructor(private val defaultTag: String) : Antilog() { 4 | 5 | override fun performLog( 6 | priority: LogLevel, 7 | tag: String?, 8 | throwable: Throwable?, 9 | message: String?, 10 | ) { 11 | val logTag = tag ?: defaultTag 12 | 13 | val fullMessage = if (message != null) { 14 | if (throwable != null) { 15 | "$message\n${throwable.message}" 16 | } else { 17 | message 18 | } 19 | } else throwable?.message ?: return 20 | 21 | when (priority) { 22 | LogLevel.VERBOSE -> console.log("VERBOSE $logTag : $fullMessage") 23 | LogLevel.DEBUG -> console.log("DEBUG $logTag : $fullMessage") 24 | LogLevel.INFO -> console.info("INFO $logTag : $fullMessage") 25 | LogLevel.WARNING -> console.warn("WARNING $logTag : $fullMessage") 26 | LogLevel.ERROR -> console.error("ERROR $logTag : $fullMessage") 27 | LogLevel.ASSERT -> console.error("ASSERT $logTag : $fullMessage") 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /napier/src/jsMain/kotlin/io/github/aakira/napier/atomic/AtomicRef.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.atomic 2 | 3 | internal actual class AtomicRef actual constructor(actual var value: T) 4 | -------------------------------------------------------------------------------- /napier/src/jsTest/kotlin/io/github/aakira/napier/NapierJsTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | class NapierJsTest { 4 | } 5 | -------------------------------------------------------------------------------- /napier/src/jvmMain/kotlin/io/github/aakira/napier/DebugAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | import java.io.PrintWriter 4 | import java.io.StringWriter 5 | import java.util.logging.* 6 | import java.util.regex.Pattern 7 | 8 | actual class DebugAntilog( 9 | private val defaultTag: String = "app", 10 | private val handler: List = listOf() 11 | ) : Antilog() { 12 | actual constructor(defaultTag: String) : this(defaultTag, handler = listOf()) 13 | 14 | companion object { 15 | private const val CALL_STACK_INDEX = 8 16 | } 17 | 18 | private val consoleHandler: ConsoleHandler = ConsoleHandler().apply { 19 | level = Level.ALL 20 | formatter = SimpleFormatter() 21 | } 22 | 23 | private val logger: Logger = Logger.getLogger(DebugAntilog::class.java.name).apply { 24 | level = Level.ALL 25 | 26 | if (handler.isEmpty()) { 27 | addHandler(consoleHandler) 28 | return@apply 29 | } 30 | handler.forEach { 31 | addHandler(it) 32 | } 33 | }.also { it.useParentHandlers = false } 34 | 35 | private val anonymousClass = Pattern.compile("(\\$\\d+)+$") 36 | 37 | private val tagMap: HashMap = hashMapOf( 38 | LogLevel.VERBOSE to "[VERBOSE]", 39 | LogLevel.DEBUG to "[DEBUG]", 40 | LogLevel.INFO to "[INFO]", 41 | LogLevel.WARNING to "[WARN]", 42 | LogLevel.ERROR to "[ERROR]", 43 | LogLevel.ASSERT to "[ASSERT]" 44 | ) 45 | 46 | override fun performLog( 47 | priority: LogLevel, 48 | tag: String?, 49 | throwable: Throwable?, 50 | message: String?, 51 | ) { 52 | 53 | val debugTag = tag ?: performTag(defaultTag) 54 | 55 | val fullMessage = if (message != null) { 56 | if (throwable != null) { 57 | "$message\n${throwable.stackTraceString}" 58 | } else { 59 | message 60 | } 61 | } else throwable?.stackTraceString ?: return 62 | 63 | when (priority) { 64 | LogLevel.VERBOSE -> logger.finest(buildLog(priority, debugTag, fullMessage)) 65 | LogLevel.DEBUG -> logger.fine(buildLog(priority, debugTag, fullMessage)) 66 | LogLevel.INFO -> logger.info(buildLog(priority, debugTag, fullMessage)) 67 | LogLevel.WARNING -> logger.warning(buildLog(priority, debugTag, fullMessage)) 68 | LogLevel.ERROR -> logger.severe(buildLog(priority, debugTag, fullMessage)) 69 | LogLevel.ASSERT -> logger.severe(buildLog(priority, debugTag, fullMessage)) 70 | } 71 | } 72 | 73 | internal fun buildLog(priority: LogLevel, tag: String?, message: String?): String { 74 | return "${tagMap[priority]} ${tag ?: performTag(defaultTag)} - $message" 75 | } 76 | 77 | private fun performTag(defaultTag: String): String { 78 | val thread = Thread.currentThread().stackTrace 79 | 80 | return if (thread.size >= CALL_STACK_INDEX) { 81 | thread[CALL_STACK_INDEX].run { 82 | "${createStackElementTag(className)}\$$methodName" 83 | } 84 | } else { 85 | defaultTag 86 | } 87 | } 88 | 89 | internal fun createStackElementTag(className: String): String { 90 | var tag = className 91 | val m = anonymousClass.matcher(tag) 92 | if (m.find()) { 93 | tag = m.replaceAll("") 94 | } 95 | return tag.substring(tag.lastIndexOf('.') + 1) 96 | } 97 | 98 | private val Throwable.stackTraceString 99 | get(): String { 100 | // DO NOT replace this with Log.getStackTraceString() - it hides UnknownHostException, which is 101 | // not what we want. 102 | val sw = StringWriter(256) 103 | val pw = PrintWriter(sw, false) 104 | printStackTrace(pw) 105 | pw.flush() 106 | return sw.toString() 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /napier/src/jvmMain/kotlin/io/github/aakira/napier/atomic/AtomicRef.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.atomic 2 | 3 | internal actual class AtomicRef actual constructor(actual var value: T) 4 | -------------------------------------------------------------------------------- /napier/src/jvmTest/kotlin/io/github/aakira/napier/NapierJvmTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | import org.junit.Test 4 | import kotlin.test.assertEquals 5 | import kotlin.test.assertNotEquals 6 | 7 | class NapierJvmTest { 8 | 9 | private val debugAntilog = DebugAntilog() 10 | 11 | @Test 12 | fun `Check createStackElementTag`() { 13 | assertEquals("Hoge", debugAntilog.createStackElementTag("io.github.aakira.napier.Hoge")) 14 | assertEquals( 15 | "Hoge2", 16 | debugAntilog.createStackElementTag("AA\$io.github.aakira.napier.Hoge2") 17 | ) 18 | assertNotEquals( 19 | "default", 20 | debugAntilog.createStackElementTag("io.github.aakira.napier.Hoge3\$default") 21 | ) 22 | } 23 | 24 | @Test 25 | fun `Check buildLog`() { 26 | assertEquals( 27 | "[VERBOSE] defaultTag - message", 28 | debugAntilog.buildLog(LogLevel.VERBOSE, "defaultTag", "message") 29 | ) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /napier/src/wasmJsMain/kotlin/io/github/aakira/napier/DebugAntilog.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | 4 | private fun log(message: String): Unit = js( 5 | """{ 6 | console.log(message); 7 | }""" 8 | ) 9 | 10 | private fun info(message: String): Unit = js( 11 | """{ 12 | console.info(message); 13 | }""" 14 | ) 15 | 16 | private fun warn(message: String): Unit = js( 17 | """{ 18 | console.warn(message); 19 | }""" 20 | ) 21 | private fun error(message: String): Unit = js( 22 | """{ 23 | console.error(message); 24 | }""" 25 | ) 26 | 27 | actual class DebugAntilog actual constructor(private val defaultTag: String) : Antilog() { 28 | 29 | override fun performLog( 30 | priority: LogLevel, 31 | tag: String?, 32 | throwable: Throwable?, 33 | message: String?, 34 | ) { 35 | val logTag = tag ?: defaultTag 36 | 37 | val fullMessage = if (message != null) { 38 | if (throwable != null) { 39 | "$message\n${throwable.message}" 40 | } else { 41 | message 42 | } 43 | } else throwable?.message ?: return 44 | 45 | when (priority) { 46 | LogLevel.VERBOSE -> log("VERBOSE $logTag : $fullMessage") 47 | LogLevel.DEBUG -> log("DEBUG $logTag : $fullMessage") 48 | LogLevel.INFO -> info("INFO $logTag : $fullMessage") 49 | LogLevel.WARNING -> warn("WARNING $logTag : $fullMessage") 50 | LogLevel.ERROR -> error("ERROR $logTag : $fullMessage") 51 | LogLevel.ASSERT -> error("ASSERT $logTag : $fullMessage") 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /napier/src/wasmJsMain/kotlin/io/github/aakira/napier/atomic/AtomicRef.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier.atomic 2 | 3 | internal actual class AtomicRef actual constructor(actual var value: T) 4 | -------------------------------------------------------------------------------- /napier/src/wasmJsTest/kotlin/io/github/aakira/napier/NapierJsTest.kt: -------------------------------------------------------------------------------- 1 | package io.github.aakira.napier 2 | 3 | class NapierJsTest { 4 | } 5 | -------------------------------------------------------------------------------- /scripts/sonatypeUpload.sh: -------------------------------------------------------------------------------- 1 | ./gradlew clean 2 | ./gradlew publish 3 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | include(":napier") 2 | include(":mpp-sample") 3 | include(":android") 4 | include(":jvm") 5 | include(":js") 6 | -------------------------------------------------------------------------------- /watchOS/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'watchOS' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for watchOS 9 | 10 | target 'watchOSTests' do 11 | inherit! :search_paths 12 | # Pods for testing 13 | end 14 | 15 | target 'watchOSUITests' do 16 | # Pods for testing 17 | end 18 | 19 | end 20 | 21 | target 'watchOS WatchKit App' do 22 | # Comment the next line if you don't want to use dynamic frameworks 23 | use_frameworks! 24 | 25 | # Pods for watchOS WatchKit App 26 | 27 | end 28 | 29 | target 'watchOS WatchKit Extension' do 30 | # Comment the next line if you don't want to use dynamic frameworks 31 | use_frameworks! 32 | 33 | # Pods for watchOS WatchKit Extension 34 | pod 'mpp_sample', :path => '../mpp-sample' 35 | end 36 | -------------------------------------------------------------------------------- /watchOS/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - mpp_sample (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - mpp_sample (from `../mpp-sample`) 6 | 7 | EXTERNAL SOURCES: 8 | mpp_sample: 9 | :path: "../mpp-sample" 10 | 11 | SPEC CHECKSUMS: 12 | mpp_sample: 07fdbc60934b60a9bbfb833df6298899fe345026 13 | 14 | PODFILE CHECKSUM: b3436ce517ca1a0cce102f45d61571a87947fefe 15 | 16 | COCOAPODS: 1.10.1 17 | -------------------------------------------------------------------------------- /watchOS/Pods/Local Podspecs/mpp_sample.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mpp_sample", 3 | "version": "1.0.0", 4 | "homepage": "https://github.com/AAkira/Napier", 5 | "source": { 6 | "git": "Not Published", 7 | "tag": "Cocoapods/mpp_sample/1.0.0" 8 | }, 9 | "authors": "", 10 | "license": "", 11 | "summary": "CocoaPods library", 12 | "static_framework": true, 13 | "vendored_frameworks": "build/cocoapods/framework/mpp_sample.framework", 14 | "libraries": "c++", 15 | "module_name": "mpp_sample_umbrella", 16 | "pod_target_xcconfig": { 17 | "KOTLIN_TARGET[sdk=iphonesimulator*]": "ios_x64", 18 | "KOTLIN_TARGET[sdk=iphoneos*]": "ios_arm", 19 | "KOTLIN_TARGET[sdk=watchsimulator*]": "watchos_x64", 20 | "KOTLIN_TARGET[sdk=watchos*]": "watchos_arm", 21 | "KOTLIN_TARGET[sdk=appletvsimulator*]": "tvos_x64", 22 | "KOTLIN_TARGET[sdk=appletvos*]": "tvos_arm64", 23 | "KOTLIN_TARGET[sdk=macosx*]": "macos_x64" 24 | }, 25 | "script_phases": [ 26 | { 27 | "name": "Build mpp_sample", 28 | "execution_position": "before_compile", 29 | "shell_path": "/bin/sh", 30 | "script": " set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$REPO_ROOT/../gradlew\" -p \"$REPO_ROOT\" :mpp-sample:syncFramework -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags=\"$OTHER_CFLAGS\" -Pkotlin.native.cocoapods.paths.headers=\"$HEADER_SEARCH_PATHS\" -Pkotlin.native.cocoapods.paths.frameworks=\"$FRAMEWORK_SEARCH_PATHS\"\n" 31 | } 32 | ], 33 | "platforms": { 34 | "osx": null, 35 | "ios": null, 36 | "tvos": null, 37 | "watchos": null 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /watchOS/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - mpp_sample (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - mpp_sample (from `../mpp-sample`) 6 | 7 | EXTERNAL SOURCES: 8 | mpp_sample: 9 | :path: "../mpp-sample" 10 | 11 | SPEC CHECKSUMS: 12 | mpp_sample: 07fdbc60934b60a9bbfb833df6298899fe345026 13 | 14 | PODFILE CHECKSUM: b3436ce517ca1a0cce102f45d61571a87947fefe 15 | 16 | COCOAPODS: 1.10.1 17 | -------------------------------------------------------------------------------- /watchOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/Pods-watchOS WatchKit App.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /watchOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/Pods-watchOS WatchKit Extension.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /watchOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/Pods-watchOS-watchOSUITests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /watchOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/Pods-watchOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /watchOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/Pods-watchOSTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /watchOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/mpp_sample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /watchOS/Pods/Pods.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Pods-watchOS WatchKit App.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 2 13 | 14 | Pods-watchOS WatchKit Extension.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 3 20 | 21 | Pods-watchOS-watchOSUITests.xcscheme 22 | 23 | isShown 24 | 25 | orderHint 26 | 4 27 | 28 | Pods-watchOS.xcscheme 29 | 30 | isShown 31 | 32 | orderHint 33 | 1 34 | 35 | Pods-watchOSTests.xcscheme 36 | 37 | isShown 38 | 39 | orderHint 40 | 5 41 | 42 | mpp_sample.xcscheme 43 | 44 | isShown 45 | 46 | orderHint 47 | 0 48 | 49 | 50 | SuppressBuildableAutocreation 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_watchOS_WatchKit_App : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_watchOS_WatchKit_App 5 | @end 6 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_watchOS_WatchKit_AppVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_watchOS_WatchKit_AppVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_watchOS_WatchKit_App { 2 | umbrella header "Pods-watchOS WatchKit App-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit App/Pods-watchOS WatchKit App.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_watchOS_WatchKit_Extension : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_watchOS_WatchKit_Extension 5 | @end 6 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_watchOS_WatchKit_ExtensionVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_watchOS_WatchKit_ExtensionVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -framework "mpp_sample" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_watchOS_WatchKit_Extension { 2 | umbrella header "Pods-watchOS WatchKit Extension-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS WatchKit Extension/Pods-watchOS WatchKit Extension.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -framework "mpp_sample" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_watchOS_watchOSUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_watchOS_watchOSUITests 5 | @end 6 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_watchOS_watchOSUITestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_watchOS_watchOSUITestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_watchOS_watchOSUITests { 2 | umbrella header "Pods-watchOS-watchOSUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS-watchOSUITests/Pods-watchOS-watchOSUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_watchOS : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_watchOS 5 | @end 6 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_watchOSVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_watchOSVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_watchOS { 2 | umbrella header "Pods-watchOS-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOS/Pods-watchOS.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_watchOSTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_watchOSTests 5 | @end 6 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_watchOSTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_watchOSTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_watchOSTests { 2 | umbrella header "Pods-watchOSTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/Pods-watchOSTests/Pods-watchOSTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | PODS_BUILD_DIR = ${BUILD_DIR} 4 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 5 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 6 | PODS_ROOT = ${SRCROOT}/Pods 7 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/mpp_sample/mpp_sample.debug.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/mpp_sample 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | KOTLIN_TARGET[sdk=appletvos*] = tvos_arm64 7 | KOTLIN_TARGET[sdk=appletvsimulator*] = tvos_x64 8 | KOTLIN_TARGET[sdk=iphoneos*] = ios_arm 9 | KOTLIN_TARGET[sdk=iphonesimulator*] = ios_x64 10 | KOTLIN_TARGET[sdk=macosx*] = macos_x64 11 | KOTLIN_TARGET[sdk=watchos*] = watchos_arm 12 | KOTLIN_TARGET[sdk=watchsimulator*] = watchos_x64 13 | PODS_BUILD_DIR = ${BUILD_DIR} 14 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 15 | PODS_ROOT = ${SRCROOT} 16 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../mpp-sample 17 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 18 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 19 | SKIP_INSTALL = YES 20 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 21 | -------------------------------------------------------------------------------- /watchOS/Pods/Target Support Files/mpp_sample/mpp_sample.release.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/mpp_sample 4 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../mpp-sample/build/cocoapods/framework" 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | KOTLIN_TARGET[sdk=appletvos*] = tvos_arm64 7 | KOTLIN_TARGET[sdk=appletvsimulator*] = tvos_x64 8 | KOTLIN_TARGET[sdk=iphoneos*] = ios_arm 9 | KOTLIN_TARGET[sdk=iphonesimulator*] = ios_x64 10 | KOTLIN_TARGET[sdk=macosx*] = macos_x64 11 | KOTLIN_TARGET[sdk=watchos*] = watchos_arm 12 | KOTLIN_TARGET[sdk=watchsimulator*] = watchos_x64 13 | PODS_BUILD_DIR = ${BUILD_DIR} 14 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 15 | PODS_ROOT = ${SRCROOT} 16 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../mpp-sample 17 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 18 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 19 | SKIP_INSTALL = YES 20 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 21 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit App/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit App/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "role" : "notificationCenter", 6 | "scale" : "2x", 7 | "size" : "24x24", 8 | "subtype" : "38mm" 9 | }, 10 | { 11 | "idiom" : "watch", 12 | "role" : "notificationCenter", 13 | "scale" : "2x", 14 | "size" : "27.5x27.5", 15 | "subtype" : "42mm" 16 | }, 17 | { 18 | "idiom" : "watch", 19 | "role" : "companionSettings", 20 | "scale" : "2x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "watch", 25 | "role" : "companionSettings", 26 | "scale" : "3x", 27 | "size" : "29x29" 28 | }, 29 | { 30 | "idiom" : "watch", 31 | "role" : "appLauncher", 32 | "scale" : "2x", 33 | "size" : "40x40", 34 | "subtype" : "38mm" 35 | }, 36 | { 37 | "idiom" : "watch", 38 | "role" : "appLauncher", 39 | "scale" : "2x", 40 | "size" : "44x44", 41 | "subtype" : "40mm" 42 | }, 43 | { 44 | "idiom" : "watch", 45 | "role" : "appLauncher", 46 | "scale" : "2x", 47 | "size" : "50x50", 48 | "subtype" : "44mm" 49 | }, 50 | { 51 | "idiom" : "watch", 52 | "role" : "quickLook", 53 | "scale" : "2x", 54 | "size" : "86x86", 55 | "subtype" : "38mm" 56 | }, 57 | { 58 | "idiom" : "watch", 59 | "role" : "quickLook", 60 | "scale" : "2x", 61 | "size" : "98x98", 62 | "subtype" : "42mm" 63 | }, 64 | { 65 | "idiom" : "watch", 66 | "role" : "quickLook", 67 | "scale" : "2x", 68 | "size" : "108x108", 69 | "subtype" : "44mm" 70 | }, 71 | { 72 | "idiom" : "watch-marketing", 73 | "scale" : "1x", 74 | "size" : "1024x1024" 75 | } 76 | ], 77 | "info" : { 78 | "author" : "xcode", 79 | "version" : 1 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit App/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | watchOS WatchKit App 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | UISupportedInterfaceOrientations 24 | 25 | UIInterfaceOrientationPortrait 26 | UIInterfaceOrientationPortraitUpsideDown 27 | 28 | WKWatchKitApp 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "assets" : [ 3 | { 4 | "filename" : "Circular.imageset", 5 | "idiom" : "watch", 6 | "role" : "circular" 7 | }, 8 | { 9 | "filename" : "Extra Large.imageset", 10 | "idiom" : "watch", 11 | "role" : "extra-large" 12 | }, 13 | { 14 | "filename" : "Graphic Bezel.imageset", 15 | "idiom" : "watch", 16 | "role" : "graphic-bezel" 17 | }, 18 | { 19 | "filename" : "Graphic Circular.imageset", 20 | "idiom" : "watch", 21 | "role" : "graphic-circular" 22 | }, 23 | { 24 | "filename" : "Graphic Corner.imageset", 25 | "idiom" : "watch", 26 | "role" : "graphic-corner" 27 | }, 28 | { 29 | "filename" : "Graphic Extra Large.imageset", 30 | "idiom" : "watch", 31 | "role" : "graphic-extra-large" 32 | }, 33 | { 34 | "filename" : "Graphic Large Rectangular.imageset", 35 | "idiom" : "watch", 36 | "role" : "graphic-large-rectangular" 37 | }, 38 | { 39 | "filename" : "Modular.imageset", 40 | "idiom" : "watch", 41 | "role" : "modular" 42 | }, 43 | { 44 | "filename" : "Utilitarian.imageset", 45 | "idiom" : "watch", 46 | "role" : "utilitarian" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : ">161" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">183" 12 | } 13 | ], 14 | "info" : { 15 | "author" : "xcode", 16 | "version" : 1 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "watch", 5 | "scale" : "2x", 6 | "screen-width" : "<=145" 7 | }, 8 | { 9 | "idiom" : "watch", 10 | "scale" : "2x", 11 | "screen-width" : ">161" 12 | }, 13 | { 14 | "idiom" : "watch", 15 | "scale" : "2x", 16 | "screen-width" : ">145" 17 | }, 18 | { 19 | "idiom" : "watch", 20 | "scale" : "2x", 21 | "screen-width" : ">183" 22 | } 23 | ], 24 | "info" : { 25 | "author" : "xcode", 26 | "version" : 1 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/ComplicationController.swift: -------------------------------------------------------------------------------- 1 | import ClockKit 2 | 3 | 4 | class ComplicationController: NSObject, CLKComplicationDataSource { 5 | 6 | // MARK: - Complication Configuration 7 | 8 | func getComplicationDescriptors(handler: @escaping ([CLKComplicationDescriptor]) -> Void) { 9 | let descriptors = [ 10 | CLKComplicationDescriptor(identifier: "complication", displayName: "watchOS", supportedFamilies: CLKComplicationFamily.allCases) 11 | // Multiple complication support can be added here with more descriptors 12 | ] 13 | 14 | // Call the handler with the currently supported complication descriptors 15 | handler(descriptors) 16 | } 17 | 18 | func handleSharedComplicationDescriptors(_ complicationDescriptors: [CLKComplicationDescriptor]) { 19 | // Do any necessary work to support these newly shared complication descriptors 20 | } 21 | 22 | // MARK: - Timeline Configuration 23 | 24 | func getTimelineEndDate(for complication: CLKComplication, withHandler handler: @escaping (Date?) -> Void) { 25 | // Call the handler with the last entry date you can currently provide or nil if you can't support future timelines 26 | handler(nil) 27 | } 28 | 29 | func getPrivacyBehavior(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationPrivacyBehavior) -> Void) { 30 | // Call the handler with your desired behavior when the device is locked 31 | handler(.showOnLockScreen) 32 | } 33 | 34 | // MARK: - Timeline Population 35 | 36 | func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> Void) { 37 | // Call the handler with the current timeline entry 38 | handler(nil) 39 | } 40 | 41 | func getTimelineEntries(for complication: CLKComplication, after date: Date, limit: Int, withHandler handler: @escaping ([CLKComplicationTimelineEntry]?) -> Void) { 42 | // Call the handler with the timeline entries after the given date 43 | handler(nil) 44 | } 45 | 46 | // MARK: - Sample Templates 47 | 48 | func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) { 49 | // This method will be called once per supported complication, and the results will be cached 50 | handler(nil) 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/ContentView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct ContentView: View { 4 | var body: some View { 5 | Text("Hello, World!") 6 | .padding() 7 | } 8 | } 9 | 10 | struct ContentView_Previews: PreviewProvider { 11 | static var previews: some View { 12 | ContentView() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | watchOS WatchKit Extension 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | CLKComplicationPrincipalClass 24 | $(PRODUCT_MODULE_NAME).ComplicationController 25 | NSExtension 26 | 27 | NSExtensionAttributes 28 | 29 | WKAppBundleIdentifier 30 | io.github.aakira.napier.watchOS.watchkitapp 31 | 32 | NSExtensionPointIdentifier 33 | com.apple.watchkit 34 | 35 | WKWatchOnly 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/NotificationController.swift: -------------------------------------------------------------------------------- 1 | import WatchKit 2 | import SwiftUI 3 | import UserNotifications 4 | 5 | class NotificationController: WKUserNotificationHostingController { 6 | 7 | override var body: NotificationView { 8 | return NotificationView() 9 | } 10 | 11 | override func willActivate() { 12 | // This method is called when watch view controller is about to be visible to user 13 | super.willActivate() 14 | } 15 | 16 | override func didDeactivate() { 17 | // This method is called when watch view controller is no longer visible 18 | super.didDeactivate() 19 | } 20 | 21 | override func didReceive(_ notification: UNNotification) { 22 | // This method is called when a notification needs to be presented. 23 | // Implement it if you use a dynamic notification interface. 24 | // Populate your dynamic notification interface as quickly as possible. 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/NotificationView.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | struct NotificationView: View { 4 | var body: some View { 5 | Text("Hello, World!") 6 | } 7 | } 8 | 9 | struct NotificationView_Previews: PreviewProvider { 10 | static var previews: some View { 11 | NotificationView() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/PushNotificationPayload.apns: -------------------------------------------------------------------------------- 1 | { 2 | "aps": { 3 | "alert": { 4 | "body": "Test message", 5 | "title": "Optional title", 6 | "subtitle": "Optional subtitle" 7 | }, 8 | "category": "myCategory", 9 | "thread-id": "5280" 10 | }, 11 | 12 | "WatchKit Simulator Actions": [ 13 | { 14 | "title": "First Button", 15 | "identifier": "firstButtonAction" 16 | } 17 | ], 18 | 19 | "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." 20 | } 21 | -------------------------------------------------------------------------------- /watchOS/watchOS WatchKit Extension/watchOSApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | import mpp_sample 3 | 4 | @main 5 | struct watchOSApp: App { 6 | 7 | init() { 8 | NapierProxyKt.debugBuild() 9 | let sample = Sample() 10 | sample.hello() 11 | sample.suspendHelloKt() 12 | sample.handleError() 13 | } 14 | 15 | @SceneBuilder var body: some Scene { 16 | WindowGroup { 17 | NavigationView { 18 | ContentView() 19 | } 20 | } 21 | 22 | WKNotificationScene(controller: NotificationController.self, category: "myCategory") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /watchOS/watchOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /watchOS/watchOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /watchOS/watchOS.xcodeproj/project.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/watchOS/watchOS.xcodeproj/project.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /watchOS/watchOS.xcodeproj/xcuserdata/aakira.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | watchOS WatchKit App (Complication).xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 8 11 | 12 | watchOS WatchKit App (Notification).xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 7 16 | 17 | watchOS WatchKit App.xcscheme_^#shared#^_ 18 | 19 | orderHint 20 | 6 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /watchOS/watchOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /watchOS/watchOS.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /watchOS/watchOS.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AAkira/Napier/50835e2e12a61f1175e5fce770420f72caed5b08/watchOS/watchOS.xcworkspace/xcuserdata/aakira.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /watchOS/watchOSTests/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 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /watchOS/watchOSTests/watchOSTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import watchOS_WatchKit_Extension 3 | 4 | class watchOSTests: XCTestCase { 5 | 6 | override func setUpWithError() throws { 7 | // Put setup code here. This method is called before the invocation of each test method in the class. 8 | } 9 | 10 | override func tearDownWithError() throws { 11 | // Put teardown code here. This method is called after the invocation of each test method in the class. 12 | } 13 | 14 | func testExample() throws { 15 | // This is an example of a functional test case. 16 | // Use XCTAssert and related functions to verify your tests produce the correct results. 17 | } 18 | 19 | func testPerformanceExample() throws { 20 | // This is an example of a performance test case. 21 | self.measure { 22 | // Put the code you want to measure the time of here. 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /watchOS/watchOSUITests/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 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /watchOS/watchOSUITests/watchOSUITests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | 3 | class watchOSUITests: XCTestCase { 4 | 5 | override func setUpWithError() throws { 6 | // Put setup code here. This method is called before the invocation of each test method in the class. 7 | 8 | // In UI tests it is usually best to stop immediately when a failure occurs. 9 | continueAfterFailure = false 10 | 11 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 12 | } 13 | 14 | override func tearDownWithError() throws { 15 | // Put teardown code here. This method is called after the invocation of each test method in the class. 16 | } 17 | 18 | func testExample() throws { 19 | // UI tests must launch the application that they test. 20 | let app = XCUIApplication() 21 | app.launch() 22 | 23 | // Use recording to get started writing UI tests. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testLaunchPerformance() throws { 28 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { 29 | // This measures how long it takes to launch your application. 30 | measure(metrics: [XCTApplicationLaunchMetric()]) { 31 | XCUIApplication().launch() 32 | } 33 | } 34 | } 35 | } 36 | --------------------------------------------------------------------------------