From 532e8a4d325fd1c30315eac0f1ab81fbf81c144f Mon Sep 17 00:00:00 2001 From: JimmyDaddy Date: Wed, 29 Nov 2023 14:08:12 +0800 Subject: [PATCH] fix: fix #164 Build Failure on CI Due to CocoaPods 1.1.9 in iOS Project (#165) * fix: fix #164 Build Failure on CI Due to CocoaPods 1.1.9 in iOS Project * ci: gh workflows for native ci * chore: update readme to set ci badge * ci: native gh action status check * chore: release 1.1.10 --- .github/workflows/build-apk.yml | 9 +- .github/workflows/ci.yml | 48 --- .github/workflows/native-ci.yml | 256 ++++++++++++++ CHANGELOG.md | 9 +- README.MD | 3 +- android/build.gradle | 3 + .../imagemarker/base/CornerRadiusTest.kt | 37 ++ example/android/app/build.gradle | 3 + .../imagemarkerexample/MainActivityTest.kt | 28 ++ example/android/build.gradle | 5 + .../project.pbxproj | 319 +++++++----------- .../xcschemes/ImageMarkerExample.xcscheme | 9 +- .../ImageMarkerExampleUITests.xcscheme | 73 ++++ .../ImageMarkerExampleTests.m | 66 ---- .../ios/ImageMarkerExampleTests/Info.plist | 24 -- .../ImageMarkerExampleUITests.swift | 46 +++ ...ImageMarkerExampleUITestsLaunchTests.swift | 32 ++ example/ios/Podfile | 2 +- ios/Podfile | 2 +- ios/RCTImageMarker/ImageMarker.swift | 2 +- .../RCTConvert+ImageMarker.swift | 13 +- package.json | 2 +- 22 files changed, 641 insertions(+), 350 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/native-ci.yml create mode 100644 android/src/test/java/com/jimmydaddy/imagemarker/base/CornerRadiusTest.kt create mode 100644 example/android/app/src/androidTest/java/com/imagemarkerexample/MainActivityTest.kt create mode 100644 example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExampleUITests.xcscheme delete mode 100644 example/ios/ImageMarkerExampleTests/ImageMarkerExampleTests.m delete mode 100644 example/ios/ImageMarkerExampleTests/Info.plist create mode 100644 example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITests.swift create mode 100644 example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITestsLaunchTests.swift diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index 9ece1d02..dc9ad364 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -1,9 +1,6 @@ name: Build Android APK on: - push: - branches: - - main workflow_dispatch: jobs: @@ -29,7 +26,6 @@ jobs: - name: Setup Android SDK uses: android-actions/setup-android@v2 - - name: Install dependencies run: | npm install @@ -42,12 +38,9 @@ jobs: cd example/android ./gradlew assembleRelease mv app/build/outputs/apk/release/app-release.apk app-release-${{ github.sha }}.apk - ls - pwd - echo ${{ github.workspace }} - name: Upload APK uses: actions/upload-artifact@v3 with: name: app-release-${{ github.sha }}.apk - path: example/android/app-release-${{ github.sha }}.apk + path: example/android/app-release-${{ github.sha }}.apk \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9c5ee1fa..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup - uses: ./.github/actions/setup - - - name: Lint files - run: yarn lint - - - name: Typecheck files - run: yarn typecheck - - test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup - uses: ./.github/actions/setup - - - name: Run unit tests - run: yarn test --maxWorkers=2 --coverage - - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup - uses: ./.github/actions/setup - - - name: Build package - run: yarn prepack diff --git a/.github/workflows/native-ci.yml b/.github/workflows/native-ci.yml new file mode 100644 index 00000000..dc9babbc --- /dev/null +++ b/.github/workflows/native-ci.yml @@ -0,0 +1,256 @@ +name: Build and Test +on: + pull_request: + types: [opened, synchronize, reopened] + paths: + - 'example/**' + - 'android/**' + - 'ios/**' + - 'src/**' + - 'assets/**' + - 'package.json' + - 'react-native-image-marker.podspec' + workflow_dispatch: + +jobs: + + install-dep: + runs-on: macos-latest + name: Install dependencies + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - uses: actions/cache@v3 + name: Cache node_modules + id: cache-node-modules + with: + path: | + node_modules + example/node_modules + key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }} + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Setup node 16 + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install npm dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: | + ls + pwd + npm install + cd example + ls + pwd + npm install + + android-build: + runs-on: macos-latest + name: Android Build + needs: install-dep + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - uses: actions/cache@v3 + name: Cache node_modules + id: cache-node-modules + with: + path: | + node_modules + example/node_modules + fail-on-cache-miss: true + key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }} + + - uses: actions/cache@v3 + id: cache-gradle + name: Cache Gradle dependencies + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('android/src/**/*.kt') }} + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + + - name: Setup node 16 + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + + - name: Install Gradle dependencies + if: steps.cache-gradle.outputs.cache-hit != 'true' + run: | + cd example/android + ./gradlew build --stacktrace + + - name: Run unit tests + run: | + cd example/android + ./gradlew test --stacktrace + + - name: Build APK + run: | + npm run prepack + cd example/android + ./gradlew assembleRelease + mv app/build/outputs/apk/release/app-release.apk app-release-${{ github.sha }}.apk + + - name: Upload APK + uses: actions/upload-artifact@v3 + with: + name: app-release-${{ github.sha }}.apk + path: ${{ github.workspace }}/example/android/app-release-${{ github.sha }}.apk + + android-test: + runs-on: macos-latest + needs: android-build + name: Android Test + strategy: + matrix: + api-level: [24, 25, 29, 30, 31] + target: [default] + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - uses: actions/cache@v3 + name: Cache node_modules + id: cache-node-modules + with: + path: | + node_modules + example/node_modules + fail-on-cache-miss: true + key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }} + + - uses: actions/cache@v3 + name: Cache Gradle dependencies + id: cache-gradle + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + fail-on-cache-miss: true + key: ${{ runner.os }}-gradle-${{ hashFiles('example/android/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('android/src/**/*.kt') }} + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + + - name: Setup node 16 + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: 11 + + - name: Instrumentation Tests + uses: reactivecircus/android-emulator-runner@v2 + with: + api-level: ${{ matrix.api-level }} + target: ${{ matrix.target }} + arch: x86_64 + profile: Nexus 6 + script: | + cd example/android && ./gradlew connectedCheck --stacktrace + + - name: Upload Reports + uses: actions/upload-artifact@v3 + with: + name: Test-Reports + path: ${{ github.workspace }}/example/android/app/build/reports + if: always() + + ios-build-test: + runs-on: macos-latest + needs: install-dep + name: iOS Build and Test + strategy: + matrix: + cocoapods: ['1.10.1', '1.11.0', '1.14.3'] + steps: + - name: Checkout the code + uses: actions/checkout@v4 + + - uses: actions/cache@v3 + name: Cache node_modules + id: cache-node-modules + with: + path: | + node_modules + example/node_modules + key: ${{ runner.os }}-nodeModules-${{ hashFiles('package.json') }}-${{ hashFiles('example/package.json') }} + fail-on-cache-miss: true + + - name: Cache Pods + id: cache-pods + uses: actions/cache@v3 + with: + path: example/ios/Pods + key: ${{ runner.os }}-pods-${{ matrix.cocoapods }}-${{ hashFiles('**/Podfile.lock') }} + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + bundler-cache: true + - name: Install Cocoapods + run: gem install cocoapods -v ${{ matrix.cocoapods }} + - name: Setup node 16 + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install Pods + if: steps.cache-pods.outputs.cache-hit != 'true' + run: | + cd example/ios + pod cache clean --all + pod install + + - name: Install xcpretty + run: gem install xcpretty + + - name: Build + run: | + cd example/ios + xcodebuild -workspace ImageMarkerExample.xcworkspace -scheme ImageMarkerExample -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' | xcpretty + - name: Test + run: | + cd example/ios + xcodebuild -workspace ImageMarkerExample.xcworkspace -scheme ImageMarkerExample -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12' test | xcpretty + + native-ci-complete: + name: Complete CI + needs: [android-build, android-test, ios-build-test] + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - name: Check all job status + if: >- + ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} + run: exit 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 303b0c1f..c33409fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ +## [1.1.10](https://github.com/JimmyDaddy/react-native-image-marker/compare/v1.1.8...v1.1.10) (2023-11-29) + + +### Bug Fixes + +* fix [#164](https://github.com/JimmyDaddy/react-native-image-marker/issues/164) Build Failure on CI Due to CocoaPods 1.1.9 in iOS Project ([d1758e5](https://github.com/JimmyDaddy/react-native-image-marker/commit/d1758e528befba9a9d125bad3c9c1b182865c1a5)) + ## [1.1.9](https://github.com/JimmyDaddy/react-native-image-marker/compare/v1.1.8...v1.1.9) (2023-11-18) ### Bug Fixes @@ -95,4 +102,4 @@ ### Features -* support multiple text and more style options ([#104](https://github.com/JimmyDaddy/react-native-image-marker/issues/104)) ([0b91cd4](https://github.com/JimmyDaddy/react-native-image-marker/commit/0b91cd4baaf2f664f908483b225509e443f9bae7)) +* support multiple text and more style options ([#104](https://github.com/JimmyDaddy/react-native-image-marker/issues/104)) ([0b91cd4](https://github.com/JimmyDaddy/react-native-image-marker/commit/0b91cd4baaf2f664f908483b225509e443f9bae7)) \ No newline at end of file diff --git a/README.MD b/README.MD index df41f280..17b7d249 100644 --- a/README.MD +++ b/README.MD @@ -8,7 +8,8 @@
[![npm version](https://img.shields.io/npm/v/react-native-image-marker.svg?logo=npm)](https://www.npmjs.com/package/react-native-image-marker) [![npm](https://img.shields.io/npm/dm/react-native-image-marker?logo=npm)](https://www.npmjs.com/package/react-native-image-marker) [![stars](https://img.shields.io/github/stars/jimmydaddy/react-native-image-marker?style=social)](https://github.com/JimmyDaddy/react-native-image-marker) [![forks](https://img.shields.io/github/forks/jimmydaddy/react-native-image-marker?style=social)](https://github.com/JimmyDaddy/react-native-image-marker/fork)[![github](https://img.shields.io/badge/github-repo-blue?logo=github)](https://github.com/JimmyDaddy/react-native-image-marker) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?logo=github)](https://github.com/JimmyDaddy/react-native-image-marker/pulls) ![license](https://img.shields.io/npm/l/react-native-image-marker) - ![platform-iOS](https://img.shields.io/badge/iOS-black?logo=Apple) ![platform-Android](https://img.shields.io/badge/Android-black?logo=Android) + ![platform-iOS](https://img.shields.io/badge/iOS-black?logo=Apple) ![platform-Android](https://img.shields.io/badge/Android-black?logo=Android) [![Native Build and Test](https://github.com/JimmyDaddy/react-native-image-marker/actions/workflows/native-ci.yml/badge.svg)](https://github.com/JimmyDaddy/react-native-image-marker/actions/workflows/native-ci.yml) +
*If this library is useful to you, pls give me a ⭐️. 🤩*
diff --git a/android/build.gradle b/android/build.gradle index 8e1223b3..33460f17 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -73,6 +73,9 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.0" implementation "com.facebook.react:react-native:+" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + testImplementation "org.mockito:mockito-core:3.+" } if (isNewArchitectureEnabled()) { diff --git a/android/src/test/java/com/jimmydaddy/imagemarker/base/CornerRadiusTest.kt b/android/src/test/java/com/jimmydaddy/imagemarker/base/CornerRadiusTest.kt new file mode 100644 index 00000000..5bb9a434 --- /dev/null +++ b/android/src/test/java/com/jimmydaddy/imagemarker/base/CornerRadiusTest.kt @@ -0,0 +1,37 @@ +package com.jimmydaddy.imagemarker.base + +import android.graphics.RectF +import com.facebook.react.bridge.ReadableMap +import com.facebook.react.bridge.ReadableMapKeySetIterator +import org.junit.Assert +import org.junit.Test +import org.mockito.Mockito + +class CornerRadiusTest { + + @Test + fun testRadii() { + // 创建一个 mock 的 ReadableMap + val mockMap = Mockito.mock(ReadableMap::class.java) + val mockMapTopLeft = Mockito.mock(ReadableMap::class.java) + + val mockIterator = Mockito.mock(ReadableMapKeySetIterator::class.java) + + // 设置 mock 对象的行为 + Mockito.`when`(mockMap.keySetIterator()).thenReturn(mockIterator) + Mockito.`when`(mockIterator.hasNextKey()).thenReturn(true, false) + Mockito.`when`(mockIterator.nextKey()).thenReturn("topLeft") + Mockito.`when`(mockMap.getMap("topLeft")).thenReturn(mockMapTopLeft) + + // 创建一个 CornerRadius 对象 + val cornerRadius = CornerRadius(mockMap) + + // 测试 radii 方法 + val rect = RectF(0f, 0f, 100f, 100f) + val radii = cornerRadius.radii(rect) + + // 验证结果 + Assert.assertEquals(8, radii.size) + } +} + diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 2bcba373..570595be 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -171,6 +171,9 @@ dependencies { } else { implementation jscFlavor } + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) diff --git a/example/android/app/src/androidTest/java/com/imagemarkerexample/MainActivityTest.kt b/example/android/app/src/androidTest/java/com/imagemarkerexample/MainActivityTest.kt new file mode 100644 index 00000000..f64159c6 --- /dev/null +++ b/example/android/app/src/androidTest/java/com/imagemarkerexample/MainActivityTest.kt @@ -0,0 +1,28 @@ +package com.imagemarkerexample + +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.action.ViewActions.click +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.matcher.ViewMatchers.isDisplayed +import androidx.test.espresso.matcher.ViewMatchers.withText +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Assert +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class MainActivityTest { + @Test + fun test() { + onView(withText("background image format:")).check(matches(isDisplayed())) + onView(withText("topLeft")).perform(click()).check(matches(isDisplayed())) + } + + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + Assert.assertEquals("com.imagemarkerexample", appContext.packageName) + } +} diff --git a/example/android/build.gradle b/example/android/build.gradle index a95a9994..957cf0f0 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -13,6 +13,11 @@ buildscript { repositories { google() mavenCentral() + jcenter() + maven { url 'https://dl.google.com/dl/android/maven2' } + maven { url "https://repository.jboss.org/maven2" } + maven { url 'https://maven.google.com' } + maven { url 'https://maven.fabric.io/public' } } dependencies { classpath('com.android.tools.build:gradle:7.4.2') diff --git a/example/ios/ImageMarkerExample.xcodeproj/project.pbxproj b/example/ios/ImageMarkerExample.xcodeproj/project.pbxproj index 6e2a1d0d..5e8641c0 100644 --- a/example/ios/ImageMarkerExample.xcodeproj/project.pbxproj +++ b/example/ios/ImageMarkerExample.xcodeproj/project.pbxproj @@ -7,17 +7,17 @@ objects = { /* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* ImageMarkerExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ImageMarkerExampleTests.m */; }; 0C80B921A6F3F58F76C31292 /* libPods-ImageMarkerExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-ImageMarkerExample.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; - 7699B88040F8A987B510C191 /* libPods-ImageMarkerExample-ImageMarkerExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-ImageMarkerExample-ImageMarkerExampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; + A119E9E12B162437000C0527 /* ImageMarkerExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A119E9E02B162437000C0527 /* ImageMarkerExampleUITests.swift */; }; + A119E9E32B162437000C0527 /* ImageMarkerExampleUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A119E9E22B162437000C0527 /* ImageMarkerExampleUITestsLaunchTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { + A119E9E42B162437000C0527 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; proxyType = 1; @@ -27,62 +27,41 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 00E356EE1AD99517003FC87E /* ImageMarkerExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageMarkerExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* ImageMarkerExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImageMarkerExampleTests.m; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* ImageMarkerExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageMarkerExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ImageMarkerExample/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = ImageMarkerExample/AppDelegate.mm; sourceTree = ""; }; 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ImageMarkerExample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ImageMarkerExample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ImageMarkerExample/main.m; sourceTree = ""; }; - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-ImageMarkerExample-ImageMarkerExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ImageMarkerExample-ImageMarkerExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 3B4392A12AC88292D35C810B /* Pods-ImageMarkerExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageMarkerExample.debug.xcconfig"; path = "Target Support Files/Pods-ImageMarkerExample/Pods-ImageMarkerExample.debug.xcconfig"; sourceTree = ""; }; 5709B34CF0A7D63546082F79 /* Pods-ImageMarkerExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageMarkerExample.release.xcconfig"; path = "Target Support Files/Pods-ImageMarkerExample/Pods-ImageMarkerExample.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-ImageMarkerExample-ImageMarkerExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageMarkerExample-ImageMarkerExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests.debug.xcconfig"; sourceTree = ""; }; 5DCACB8F33CDC322A6C60F78 /* libPods-ImageMarkerExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ImageMarkerExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ImageMarkerExample/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-ImageMarkerExample-ImageMarkerExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageMarkerExample-ImageMarkerExampleTests.release.xcconfig"; path = "Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests.release.xcconfig"; sourceTree = ""; }; + A119E9DE2B162437000C0527 /* ImageMarkerExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageMarkerExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A119E9E02B162437000C0527 /* ImageMarkerExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageMarkerExampleUITests.swift; sourceTree = ""; }; + A119E9E22B162437000C0527 /* ImageMarkerExampleUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageMarkerExampleUITestsLaunchTests.swift; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 00E356EB1AD99517003FC87E /* Frameworks */ = { + 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7699B88040F8A987B510C191 /* libPods-ImageMarkerExample-ImageMarkerExampleTests.a in Frameworks */, + 0C80B921A6F3F58F76C31292 /* libPods-ImageMarkerExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { + A119E9DB2B162437000C0527 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0C80B921A6F3F58F76C31292 /* libPods-ImageMarkerExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 00E356EF1AD99517003FC87E /* ImageMarkerExampleTests */ = { - isa = PBXGroup; - children = ( - 00E356F21AD99517003FC87E /* ImageMarkerExampleTests.m */, - 00E356F01AD99517003FC87E /* Supporting Files */, - ); - path = ImageMarkerExampleTests; - sourceTree = ""; - }; - 00E356F01AD99517003FC87E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 00E356F11AD99517003FC87E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; 13B07FAE1A68108700A75B9A /* ImageMarkerExample */ = { isa = PBXGroup; children = ( @@ -101,7 +80,7 @@ children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 5DCACB8F33CDC322A6C60F78 /* libPods-ImageMarkerExample.a */, - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-ImageMarkerExample-ImageMarkerExampleTests.a */, + 19F6CBCC0A4E27FBF8BF4A61 /* libPods-ImageMarkerExample-ImageMarkerExampleUITests.a */, ); name = Frameworks; sourceTree = ""; @@ -118,7 +97,7 @@ children = ( 13B07FAE1A68108700A75B9A /* ImageMarkerExample */, 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* ImageMarkerExampleTests */, + A119E9DF2B162437000C0527 /* ImageMarkerExampleUITests */, 83CBBA001A601CBA00E9B192 /* Products */, 2D16E6871FA4F8E400B85C8A /* Frameworks */, BBD78D7AC51CEA395F1C20DB /* Pods */, @@ -132,18 +111,27 @@ isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* ImageMarkerExample.app */, - 00E356EE1AD99517003FC87E /* ImageMarkerExampleTests.xctest */, + A119E9DE2B162437000C0527 /* ImageMarkerExampleUITests.xctest */, ); name = Products; sourceTree = ""; }; + A119E9DF2B162437000C0527 /* ImageMarkerExampleUITests */ = { + isa = PBXGroup; + children = ( + A119E9E02B162437000C0527 /* ImageMarkerExampleUITests.swift */, + A119E9E22B162437000C0527 /* ImageMarkerExampleUITestsLaunchTests.swift */, + ); + path = ImageMarkerExampleUITests; + sourceTree = ""; + }; BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( 3B4392A12AC88292D35C810B /* Pods-ImageMarkerExample.debug.xcconfig */, 5709B34CF0A7D63546082F79 /* Pods-ImageMarkerExample.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-ImageMarkerExample-ImageMarkerExampleTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-ImageMarkerExample-ImageMarkerExampleTests.release.xcconfig */, + 5B7EB9410499542E8C5724F5 /* Pods-ImageMarkerExample-ImageMarkerExampleUITests.debug.xcconfig */, + 89C6BE57DB24E9ADA2F236DE /* Pods-ImageMarkerExample-ImageMarkerExampleUITests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -151,27 +139,6 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* ImageMarkerExampleTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ImageMarkerExampleTests" */; - buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, - 00E356EA1AD99517003FC87E /* Sources */, - 00E356EB1AD99517003FC87E /* Frameworks */, - 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - 00E356F51AD99517003FC87E /* PBXTargetDependency */, - ); - name = ImageMarkerExampleTests; - productName = ImageMarkerExampleTests; - productReference = 00E356EE1AD99517003FC87E /* ImageMarkerExampleTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 13B07F861A680F5B00A75B9A /* ImageMarkerExample */ = { isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ImageMarkerExample" */; @@ -194,21 +161,40 @@ productReference = 13B07F961A680F5B00A75B9A /* ImageMarkerExample.app */; productType = "com.apple.product-type.application"; }; + A119E9DD2B162437000C0527 /* ImageMarkerExampleUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A119E9E62B162437000C0527 /* Build configuration list for PBXNativeTarget "ImageMarkerExampleUITests" */; + buildPhases = ( + A119E9DA2B162437000C0527 /* Sources */, + A119E9DB2B162437000C0527 /* Frameworks */, + A119E9DC2B162437000C0527 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A119E9E52B162437000C0527 /* PBXTargetDependency */, + ); + name = ImageMarkerExampleUITests; + productName = ImageMarkerExampleUITests; + productReference = A119E9DE2B162437000C0527 /* ImageMarkerExampleUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1500; LastUpgradeCheck = 1210; TargetAttributes = { - 00E356ED1AD99517003FC87E = { - CreatedOnToolsVersion = 6.2; - TestTargetID = 13B07F861A680F5B00A75B9A; - }; 13B07F861A680F5B00A75B9A = { LastSwiftMigration = 1120; }; + A119E9DD2B162437000C0527 = { + CreatedOnToolsVersion = 15.0.1; + TestTargetID = 13B07F861A680F5B00A75B9A; + }; }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ImageMarkerExample" */; @@ -225,25 +211,25 @@ projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* ImageMarkerExample */, - 00E356ED1AD99517003FC87E /* ImageMarkerExampleTests */, + A119E9DD2B162437000C0527 /* ImageMarkerExampleUITests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 00E356EC1AD99517003FC87E /* Resources */ = { + 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, + 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 13B07F8E1A680F5B00A75B9A /* Resources */ = { + A119E9DC2B162437000C0527 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, - 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -283,28 +269,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample/Pods-ImageMarkerExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-ImageMarkerExample-ImageMarkerExampleTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -327,23 +291,6 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -361,23 +308,6 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample/Pods-ImageMarkerExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-ImageMarkerExample-ImageMarkerExampleTests/Pods-ImageMarkerExample-ImageMarkerExampleTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -400,85 +330,35 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 00E356EA1AD99517003FC87E /* Sources */ = { + 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 00E356F31AD99517003FC87E /* ImageMarkerExampleTests.m in Sources */, + 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, + 13B07FC11A68108700A75B9A /* main.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 13B07F871A680F5B00A75B9A /* Sources */ = { + A119E9DA2B162437000C0527 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, - 13B07FC11A68108700A75B9A /* main.m in Sources */, + A119E9E12B162437000C0527 /* ImageMarkerExampleUITests.swift in Sources */, + A119E9E32B162437000C0527 /* ImageMarkerExampleUITestsLaunchTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { + A119E9E52B162437000C0527 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 13B07F861A680F5B00A75B9A /* ImageMarkerExample */; - targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; + targetProxy = A119E9E42B162437000C0527 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 00E356F61AD99517003FC87E /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-ImageMarkerExample-ImageMarkerExampleTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = ImageMarkerExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageMarkerExample.app/ImageMarkerExample"; - }; - name = Debug; - }; - 00E356F71AD99517003FC87E /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-ImageMarkerExample-ImageMarkerExampleTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - COPY_PHASE_STRIP = NO; - INFOPLIST_FILE = ImageMarkerExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - "$(inherited)", - ); - PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ImageMarkerExample.app/ImageMarkerExample"; - }; - name = Release; - }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-ImageMarkerExample.debug.xcconfig */; @@ -668,18 +548,72 @@ }; name = Release; }; + A119E9E72B162437000C0527 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.jimmydaddy.ImageMarkerExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = ImageMarkerExample; + }; + name = Debug; + }; + A119E9E82B162437000C0527 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.jimmydaddy.ImageMarkerExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = ImageMarkerExample; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ImageMarkerExampleTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 00E356F61AD99517003FC87E /* Debug */, - 00E356F71AD99517003FC87E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ImageMarkerExample" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -698,6 +632,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + A119E9E62B162437000C0527 /* Build configuration list for PBXNativeTarget "ImageMarkerExampleUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A119E9E72B162437000C0527 /* Debug */, + A119E9E82B162437000C0527 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; diff --git a/example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExample.xcscheme b/example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExample.xcscheme index ebfacfd9..5749b851 100644 --- a/example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExample.xcscheme +++ b/example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExample.xcscheme @@ -29,12 +29,13 @@ shouldUseLaunchSchemeArgsEnv = "YES"> + skipped = "NO" + parallelizable = "YES"> diff --git a/example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExampleUITests.xcscheme b/example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExampleUITests.xcscheme new file mode 100644 index 00000000..3def279a --- /dev/null +++ b/example/ios/ImageMarkerExample.xcodeproj/xcshareddata/xcschemes/ImageMarkerExampleUITests.xcscheme @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/ImageMarkerExampleTests/ImageMarkerExampleTests.m b/example/ios/ImageMarkerExampleTests/ImageMarkerExampleTests.m deleted file mode 100644 index ea8145d7..00000000 --- a/example/ios/ImageMarkerExampleTests/ImageMarkerExampleTests.m +++ /dev/null @@ -1,66 +0,0 @@ -#import -#import - -#import -#import - -#define TIMEOUT_SECONDS 600 -#define TEXT_TO_LOOK_FOR @"Welcome to React" - -@interface ImageMarkerExampleTests : XCTestCase - -@end - -@implementation ImageMarkerExampleTests - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen -{ - UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - - __block NSString *redboxError = nil; -#ifdef DEBUG - RCTSetLogFunction( - ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { - if (level >= RCTLogLevelError) { - redboxError = message; - } - }); -#endif - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - foundElement = [self findSubviewInView:vc.view - matching:^BOOL(UIView *view) { - if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - return NO; - }]; - } - -#ifdef DEBUG - RCTSetLogFunction(RCTDefaultLogFunction); -#endif - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - -@end diff --git a/example/ios/ImageMarkerExampleTests/Info.plist b/example/ios/ImageMarkerExampleTests/Info.plist deleted file mode 100644 index ba72822e..00000000 --- a/example/ios/ImageMarkerExampleTests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITests.swift b/example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITests.swift new file mode 100644 index 00000000..e334a0d2 --- /dev/null +++ b/example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITests.swift @@ -0,0 +1,46 @@ +// +// ImageMarkerExampleUITests.swift +// ImageMarkerExampleUITests +// +// Created by Jimmydaddy on 2023/11/28. +// + +import XCTest + +final class ImageMarkerExampleUITests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + + // 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. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testApp() throws { + // UI tests must launch the application that they test. + let app = XCUIApplication() + app.launch() + sleep(5) + var ele = app.textFields["100"] + XCTAssert(ele.exists) + ele = app.staticTexts["watermark type:"] + XCTAssert(ele.exists) + ele = app.staticTexts["background image format:"] + XCTAssert(ele.exists) + } + + func testLaunchPerformance() throws { + if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { + // This measures how long it takes to launch your application. + measure(metrics: [XCTApplicationLaunchMetric()]) { + XCUIApplication().launch() + } + } + } +} diff --git a/example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITestsLaunchTests.swift b/example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITestsLaunchTests.swift new file mode 100644 index 00000000..b337e5f7 --- /dev/null +++ b/example/ios/ImageMarkerExampleUITests/ImageMarkerExampleUITestsLaunchTests.swift @@ -0,0 +1,32 @@ +// +// ImageMarkerExampleUITestsLaunchTests.swift +// ImageMarkerExampleUITests +// +// Created by Jimmydaddy on 2023/11/28. +// + +import XCTest + +final class ImageMarkerExampleUITestsLaunchTests: XCTestCase { + + override class var runsForEachTargetApplicationUIConfiguration: Bool { + true + } + + override func setUpWithError() throws { + continueAfterFailure = false + } + + func testLaunch() throws { + let app = XCUIApplication() + app.launch() + + // Insert steps here to perform after app launch but before taking a screenshot, + // such as logging into a test account or navigating somewhere in the app + + let attachment = XCTAttachment(screenshot: app.screenshot()) + attachment.name = "Launch Screen" + attachment.lifetime = .keepAlways + add(attachment) + } +} diff --git a/example/ios/Podfile b/example/ios/Podfile index e870c82d..875b165f 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -43,7 +43,7 @@ target 'ImageMarkerExample' do :app_path => "#{Pod::Config.instance.installation_root}/.." ) - target 'ImageMarkerExampleTests' do + target 'ImageMarkerExampleUITests' do inherit! :complete # Pods for testing end diff --git a/ios/Podfile b/ios/Podfile index e870c82d..875b165f 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -43,7 +43,7 @@ target 'ImageMarkerExample' do :app_path => "#{Pod::Config.instance.installation_root}/.." ) - target 'ImageMarkerExampleTests' do + target 'ImageMarkerExampleUITests' do inherit! :complete # Pods for testing end diff --git a/ios/RCTImageMarker/ImageMarker.swift b/ios/RCTImageMarker/ImageMarker.swift index 26f152f8..2605aac4 100644 --- a/ios/RCTImageMarker/ImageMarker.swift +++ b/ios/RCTImageMarker/ImageMarker.swift @@ -25,7 +25,7 @@ public final class ImageMarker: NSObject, RCTBridgeModule { let images = try await withThrowingTaskGroup(of: (Int, UIImage).self) { group in for (index, img) in imageOptions.enumerated() { group.addTask { - try await withUnsafeThrowingContinuation { continuation in + try await withUnsafeThrowingContinuation { continuation -> Void in if Utils.isBase64(img.uri) { if let image = UIImage.transBase64(img.uri) { continuation.resume(returning: (index, image)) diff --git a/ios/RCTImageMarker/RCTConvert+ImageMarker.swift b/ios/RCTImageMarker/RCTConvert+ImageMarker.swift index 47952805..d2360c7b 100644 --- a/ios/RCTImageMarker/RCTConvert+ImageMarker.swift +++ b/ios/RCTImageMarker/RCTConvert+ImageMarker.swift @@ -9,33 +9,34 @@ import Foundation import UIKit import CoreFoundation import React +import CoreGraphics extension RCTConvert { static func CGSize(_ json: Any, offset: Int) -> CGSize { let arr = self.nsArray(json) if arr!.count < offset + 2 { NSLog("Too few elements in array (expected at least %zd): %@", 2 + offset, arr!) - return CoreFoundation.CGSize.zero + return CoreGraphics.CGSize.zero } - return CoreFoundation.CGSize(width: self.cgFloat(arr![offset]), height: self.cgFloat(arr![offset + 1])) + return CoreGraphics.CGSize(width: self.cgFloat(arr![offset]), height: self.cgFloat(arr![offset + 1])) } static func CGPoint(_ json: Any, offset: Int) -> CGPoint { let arr = self.nsArray(json) if arr!.count < offset + 2 { NSLog("Too few elements in array (expected at least %zd): %@", 2 + offset, arr!) - return CoreFoundation.CGPoint.zero + return CoreGraphics.CGPoint.zero } - return CoreFoundation.CGPoint(x: self.cgFloat(arr?[offset]), y: self.cgFloat(arr![offset + 1])) + return CoreGraphics.CGPoint(x: self.cgFloat(arr?[offset]), y: self.cgFloat(arr![offset + 1])) } static func CGRect(_ json: Any, offset: Int) -> CGRect { let arr = self.nsArray(json) if arr!.count < offset + 4 { NSLog("Too few elements in array (expected at least %zd): %@", 4 + offset, arr!) - return CoreFoundation.CGRect.zero + return CoreGraphics.CGRect.zero } - return CoreFoundation.CGRect(x: self.cgFloat(arr![offset]), y: self.cgFloat(arr![offset + 1]), width: self.cgFloat(arr![offset + 2]), height: self.cgFloat(arr![offset + 3])) + return CoreGraphics.CGRect(x: self.cgFloat(arr![offset]), y: self.cgFloat(arr![offset + 1]), width: self.cgFloat(arr![offset + 2]), height: self.cgFloat(arr![offset + 3])) } static func CGColor(_ json: Any, offset: Int) -> CGColor? { diff --git a/package.json b/package.json index 332e3d8f..52c51a8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-image-marker", - "version": "1.1.9", + "version": "1.1.10", "description": "Add text or icon watermark to your images", "main": "lib/commonjs/index", "module": "lib/module/index",