@regulaforensics/face-sdk 6.3.3-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/RNFaceSDK.podspec +21 -0
- package/android/CVDFaceSDK.kt +34 -0
- package/android/build.gradle +48 -0
- package/android/cordova.gradle +18 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/java/com/regula/plugin/facesdk/Config.kt +165 -0
- package/android/src/main/java/com/regula/plugin/facesdk/JSONConstructor.kt +904 -0
- package/android/src/main/java/com/regula/plugin/facesdk/Main.kt +370 -0
- package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiModule.kt +54 -0
- package/android/src/main/java/com/regula/plugin/facesdk/RNFaceApiPackage.kt +11 -0
- package/android/src/main/java/com/regula/plugin/facesdk/Utils.kt +287 -0
- package/examples/capacitor/.browserslistrc +6 -0
- package/examples/capacitor/.eslintrc.js +17 -0
- package/examples/capacitor/README.md +27 -0
- package/examples/capacitor/android/app/build.gradle +54 -0
- package/examples/capacitor/android/app/capacitor.build.gradle +22 -0
- package/examples/capacitor/android/app/proguard-rules.pro +21 -0
- package/examples/capacitor/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +26 -0
- package/examples/capacitor/android/app/src/main/AndroidManifest.xml +43 -0
- package/examples/capacitor/android/app/src/main/java/com/regula/faceapi/MainActivity.java +5 -0
- package/examples/capacitor/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/examples/capacitor/android/app/src/main/res/drawable/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-hdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-mdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-xhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-xxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-land-xxxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-hdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-mdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-xhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-xxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-port-xxxhdpi/splash.png +0 -0
- package/examples/capacitor/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
- package/examples/capacitor/android/app/src/main/res/layout/activity_main.xml +12 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
- package/examples/capacitor/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/examples/capacitor/android/app/src/main/res/values/ic_launcher_background.xml +4 -0
- package/examples/capacitor/android/app/src/main/res/values/strings.xml +7 -0
- package/examples/capacitor/android/app/src/main/res/values/styles.xml +22 -0
- package/examples/capacitor/android/app/src/main/res/xml/file_paths.xml +5 -0
- package/examples/capacitor/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +18 -0
- package/examples/capacitor/android/build.gradle +30 -0
- package/examples/capacitor/android/capacitor.settings.gradle +15 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/capacitor/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/examples/capacitor/android/gradle.properties +22 -0
- package/examples/capacitor/android/gradlew +244 -0
- package/examples/capacitor/android/gradlew.bat +92 -0
- package/examples/capacitor/android/settings.gradle +5 -0
- package/examples/capacitor/android/variables.gradle +16 -0
- package/examples/capacitor/capacitor.config.ts +12 -0
- package/examples/capacitor/cypress/e2e/test.cy.ts +6 -0
- package/examples/capacitor/cypress/fixtures/example.json +5 -0
- package/examples/capacitor/cypress/support/commands.ts +37 -0
- package/examples/capacitor/cypress/support/e2e.ts +20 -0
- package/examples/capacitor/cypress.config.ts +10 -0
- package/examples/capacitor/index.html +106 -0
- package/examples/capacitor/ionic.config.json +7 -0
- package/examples/capacitor/ios/App/App/App.entitlements +5 -0
- package/examples/capacitor/ios/App/App/AppDelegate.swift +49 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/AppIcon-512@2x.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/AppIcon.appiconset/Contents.json +14 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Contents.json +6 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/Contents.json +23 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-1.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732-2.png +0 -0
- package/examples/capacitor/ios/App/App/Assets.xcassets/Splash.imageset/splash-2732x2732.png +0 -0
- package/examples/capacitor/ios/App/App/Base.lproj/LaunchScreen.storyboard +32 -0
- package/examples/capacitor/ios/App/App/Base.lproj/Main.storyboard +19 -0
- package/examples/capacitor/ios/App/App/Info.plist +53 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.pbxproj +410 -0
- package/examples/capacitor/ios/App/App.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/examples/capacitor/ios/App/App.xcworkspace/contents.xcworkspacedata +10 -0
- package/examples/capacitor/ios/App/App.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/examples/capacitor/ios/App/Podfile +27 -0
- package/examples/capacitor/package.json +64 -0
- package/examples/capacitor/public/assets/.gitkeep +0 -0
- package/examples/capacitor/public/assets/img/id.png +0 -0
- package/examples/capacitor/public/assets/img/portrait.png +0 -0
- package/examples/capacitor/public/favicon.png +0 -0
- package/examples/capacitor/public/manifest.json +21 -0
- package/examples/capacitor/src/App.test.tsx +8 -0
- package/examples/capacitor/src/App.tsx +42 -0
- package/examples/capacitor/src/components/ExploreContainer.css +24 -0
- package/examples/capacitor/src/components/ExploreContainer.tsx +14 -0
- package/examples/capacitor/src/main.tsx +11 -0
- package/examples/capacitor/src/pages/Home.tsx +159 -0
- package/examples/capacitor/src/setupTests.ts +14 -0
- package/examples/capacitor/src/theme/variables.css +242 -0
- package/examples/capacitor/src/vite-env.d.ts +1 -0
- package/examples/capacitor/tsconfig.json +21 -0
- package/examples/capacitor/tsconfig.node.json +9 -0
- package/examples/capacitor/vite.config.ts +16 -0
- package/examples/cordova/.vscode/launch.json +28 -0
- package/examples/cordova/config.xml +37 -0
- package/examples/cordova/jsconfig.json +1 -0
- package/examples/cordova/package.json +40 -0
- package/examples/cordova/www/css/index.css +107 -0
- package/examples/cordova/www/img/id.png +0 -0
- package/examples/cordova/www/img/logo.png +0 -0
- package/examples/cordova/www/img/portrait.png +0 -0
- package/examples/cordova/www/index.html +94 -0
- package/examples/cordova/www/js/index.js +154 -0
- package/examples/ionic/angular.json +187 -0
- package/examples/ionic/browserslist +12 -0
- package/examples/ionic/config.xml +114 -0
- package/examples/ionic/e2e/protractor.conf.js +28 -0
- package/examples/ionic/e2e/src/app.e2e-spec.ts +14 -0
- package/examples/ionic/e2e/src/app.po.ts +11 -0
- package/examples/ionic/e2e/tsconfig.json +13 -0
- package/examples/ionic/ionic.config.json +7 -0
- package/examples/ionic/karma.conf.js +31 -0
- package/examples/ionic/package.json +97 -0
- package/examples/ionic/resources/README.md +8 -0
- package/examples/ionic/resources/android/icon/drawable-hdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-ldpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-mdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-xhdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-xxhdpi-icon.png +0 -0
- package/examples/ionic/resources/android/icon/drawable-xxxhdpi-icon.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-hdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-ldpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-mdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-xhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-xxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-land-xxxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-hdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-ldpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-mdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-xhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-xxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/splash/drawable-port-xxxhdpi-screen.png +0 -0
- package/examples/ionic/resources/android/xml/network_security_config.xml +6 -0
- package/examples/ionic/resources/icon.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-1024.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-20.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-20@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-20@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-24@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-27.5@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-29.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-29@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-29@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-40.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-40@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-40@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-44@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-50.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-50@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-60.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-60@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-60@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-72.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-72@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-76.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-76@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-83.5@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-86@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-98@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-small.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-small@2x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon-small@3x.png +0 -0
- package/examples/ionic/resources/ios/icon/icon.png +0 -0
- package/examples/ionic/resources/ios/icon/icon@2x.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-2436h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-568h@2x~iphone.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-667h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-736h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape-2436h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape-736h.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape@2x~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape@~ipadpro.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Landscape~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Portrait@2x~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Portrait@~ipadpro.png +0 -0
- package/examples/ionic/resources/ios/splash/Default-Portrait~ipad.png +0 -0
- package/examples/ionic/resources/ios/splash/Default@2x~iphone.png +0 -0
- package/examples/ionic/resources/ios/splash/Default@2x~universal~anyany.png +0 -0
- package/examples/ionic/resources/ios/splash/Default~iphone.png +0 -0
- package/examples/ionic/resources/splash.png +0 -0
- package/examples/ionic/src/app/app-routing.module.ts +15 -0
- package/examples/ionic/src/app/app.component.html +3 -0
- package/examples/ionic/src/app/app.component.scss +0 -0
- package/examples/ionic/src/app/app.component.spec.ts +47 -0
- package/examples/ionic/src/app/app.component.ts +27 -0
- package/examples/ionic/src/app/app.module.ts +23 -0
- package/examples/ionic/src/app/home/home.module.ts +29 -0
- package/examples/ionic/src/app/home/home.page.html +75 -0
- package/examples/ionic/src/app/home/home.page.scss +1 -0
- package/examples/ionic/src/app/home/home.page.spec.ts +24 -0
- package/examples/ionic/src/app/home/home.page.ts +166 -0
- package/examples/ionic/src/assets/icon/favicon.png +0 -0
- package/examples/ionic/src/assets/img/portrait.png +0 -0
- package/examples/ionic/src/assets/shapes.svg +1 -0
- package/examples/ionic/src/environments/environment.prod.ts +3 -0
- package/examples/ionic/src/environments/environment.ts +16 -0
- package/examples/ionic/src/global.scss +31 -0
- package/examples/ionic/src/index.html +25 -0
- package/examples/ionic/src/main.ts +12 -0
- package/examples/ionic/src/polyfills.ts +66 -0
- package/examples/ionic/src/test.ts +20 -0
- package/examples/ionic/src/theme/variables.scss +77 -0
- package/examples/ionic/src/zone-flags.ts +5 -0
- package/examples/ionic/tsconfig.app.json +14 -0
- package/examples/ionic/tsconfig.json +26 -0
- package/examples/ionic/tsconfig.spec.json +19 -0
- package/examples/ionic/tslint.json +88 -0
- package/examples/react-native/.vscode/launch.json +26 -0
- package/examples/react-native/.watchmanconfig +1 -0
- package/examples/react-native/App.tsx +206 -0
- package/examples/react-native/Gemfile +8 -0
- package/examples/react-native/Gemfile.lock +134 -0
- package/examples/react-native/android/app/build.gradle +123 -0
- package/examples/react-native/android/app/debug.keystore +0 -0
- package/examples/react-native/android/app/proguard-rules.pro +10 -0
- package/examples/react-native/android/app/src/debug/AndroidManifest.xml +9 -0
- package/examples/react-native/android/app/src/main/AndroidManifest.xml +27 -0
- package/examples/react-native/android/app/src/main/assets/.gitkeep +0 -0
- package/examples/react-native/android/app/src/main/java/com/regula/face/api/MainActivity.kt +22 -0
- package/examples/react-native/android/app/src/main/java/com/regula/face/api/MainApplication.kt +43 -0
- package/examples/react-native/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/examples/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/examples/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/examples/react-native/android/app/src/main/res/values/strings.xml +3 -0
- package/examples/react-native/android/app/src/main/res/values/styles.xml +9 -0
- package/examples/react-native/android/build.gradle +21 -0
- package/examples/react-native/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/examples/react-native/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/examples/react-native/android/gradle.properties +39 -0
- package/examples/react-native/android/gradlew +249 -0
- package/examples/react-native/android/gradlew.bat +92 -0
- package/examples/react-native/android/settings.gradle +6 -0
- package/examples/react-native/images/portrait.png +0 -0
- package/examples/react-native/index.js +4 -0
- package/examples/react-native/ios/.xcode.env +11 -0
- package/examples/react-native/ios/FaceSDK/AppDelegate.h +6 -0
- package/examples/react-native/ios/FaceSDK/AppDelegate.mm +31 -0
- package/examples/react-native/ios/FaceSDK/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/examples/react-native/ios/FaceSDK/Images.xcassets/Contents.json +6 -0
- package/examples/react-native/ios/FaceSDK/Info.plist +51 -0
- package/examples/react-native/ios/FaceSDK/LaunchScreen.storyboard +47 -0
- package/examples/react-native/ios/FaceSDK/PrivacyInfo.xcprivacy +38 -0
- package/examples/react-native/ios/FaceSDK/main.m +10 -0
- package/examples/react-native/ios/FaceSDK.xcodeproj/project.pbxproj +719 -0
- package/examples/react-native/ios/FaceSDK.xcodeproj/xcshareddata/xcschemes/FaceSDK.xcscheme +88 -0
- package/examples/react-native/ios/FaceSDK.xcworkspace/contents.xcworkspacedata +10 -0
- package/examples/react-native/ios/FaceSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/examples/react-native/ios/FaceSDKTests/FaceSDKTests.m +66 -0
- package/examples/react-native/ios/FaceSDKTests/Info.plist +24 -0
- package/examples/react-native/ios/Podfile +40 -0
- package/examples/react-native/ios/Podfile.lock +1822 -0
- package/examples/react-native/ios/license/.gitkeep +0 -0
- package/examples/react-native/metro.config.js +15 -0
- package/examples/react-native/package-lock.json +13098 -0
- package/examples/react-native/package.json +42 -0
- package/ios/CVDFaceSDK.h +7 -0
- package/ios/CVDFaceSDK.m +34 -0
- package/ios/RFSWConfig.h +27 -0
- package/ios/RFSWConfig.m +189 -0
- package/ios/RFSWJSONConstructor.h +134 -0
- package/ios/RFSWJSONConstructor.m +977 -0
- package/ios/RFSWMain.h +23 -0
- package/ios/RFSWMain.m +352 -0
- package/ios/RNFaceSDK.h +8 -0
- package/ios/RNFaceSDK.m +42 -0
- package/ios-ci/.gitlab-ci.yml +41 -0
- package/ios-ci/.sample-env +22 -0
- package/ios-ci/README.md +97 -0
- package/ios-ci/RegulaDanger/Package.swift +34 -0
- package/ios-ci/RegulaDanger/Sources/RegulaDanger/RegulaDanger.swift +44 -0
- package/ios-ci/RegulaDanger/Tests/LinuxMain.swift +7 -0
- package/ios-ci/RegulaDanger/Tests/RegulaDangerTests/RegulaDangerTests.swift +15 -0
- package/ios-ci/RegulaDanger/Tests/RegulaDangerTests/XCTestManifests.swift +9 -0
- package/ios-ci/install.sh +9 -0
- package/ios-ci/ios_ci/__init__.py +8 -0
- package/ios-ci/ios_ci/cli.py +408 -0
- package/ios-ci/ios_ci/common/__init__.py +0 -0
- package/ios-ci/ios_ci/common/build_index.py +70 -0
- package/ios-ci/ios_ci/common/clean_cocoapod.sh +13 -0
- package/ios-ci/ios_ci/common/dependency.py +466 -0
- package/ios-ci/ios_ci/common/ftp.py +314 -0
- package/ios-ci/ios_ci/common/searchpod.sh +6 -0
- package/ios-ci/ios_ci/common/wait_for_cocopod.sh +21 -0
- package/ios-ci/ios_ci/inject.py +145 -0
- package/ios-ci/ios_ci/podspec/__init__.py +0 -0
- package/ios-ci/ios_ci/podspec/podspec.py +88 -0
- package/ios-ci/ios_ci/podspec/templates/BTDevice.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/Core.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/DocumentReader.podspec +19 -0
- package/ios-ci/ios_ci/podspec/templates/FaceCore.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/FaceSDK.podspec +18 -0
- package/ios-ci/ios_ci/podspec/templates/IRS.podspec +17 -0
- package/ios-ci/ios_ci/podspec/templates/RegulaCommon.podspec +17 -0
- package/ios-ci/ios_ci/resolve_podfile_common.py +76 -0
- package/ios-ci/ios_ci/spm/AppleRootCA-G3.cer +0 -0
- package/ios-ci/ios_ci/spm/AppleWWDRCAG3.cer +0 -0
- package/ios-ci/ios_ci/spm/SwiftPackageGenerator+Common.sh +48 -0
- package/ios-ci/ios_ci/spm/SwiftPackageGenerator.sh +33 -0
- package/ios-ci/ios_ci/spm/XcodeSPMCollection.json +29 -0
- package/ios-ci/ios_ci/spm/__init__.py +0 -0
- package/ios-ci/ios_ci/spm/askpass.py +19 -0
- package/ios-ci/ios_ci/spm/spm.py +227 -0
- package/ios-ci/ios_ci/upload_build.py +158 -0
- package/ios-ci/ios_ci/version.py +14 -0
- package/ios-ci/poetry.lock +342 -0
- package/ios-ci/pyproject.toml +26 -0
- package/ios-ci/scripts.py +9 -0
- package/ios-ci/tests/__init__.py +0 -0
- package/ios-ci/tests/podspec/fixtures/BTDevice.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/BTDeviceBeta.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderBeta_RegulaCommon_Beta.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderBeta_RegulaCommon_Release.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderFullRFID.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReaderFullRFIDBeta.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReader_RegulaCommon_Beta.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/DocumentReader_RegulaCommon_Release.podspec +19 -0
- package/ios-ci/tests/podspec/fixtures/FaceSDK.podspec +18 -0
- package/ios-ci/tests/podspec/fixtures/FaceSDKBeta.podspec +18 -0
- package/ios-ci/tests/podspec/fixtures/IRS.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/IRSBeta.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/RegulaCommon.podspec +17 -0
- package/ios-ci/tests/podspec/fixtures/RegulaCommonBeta.podspec +17 -0
- package/ios-ci/tests/podspec/test_podspec.py +188 -0
- package/ios-ci/tests/test_build_index.py +117 -0
- package/ios-ci/tests/test_dependency.py +139 -0
- package/ios-ci/tests/test_ios_ci.py +5 -0
- package/package.json +36 -0
- package/plugin.xml +48 -0
- package/www/capacitor/customization/camera_position.js +4 -0
- package/www/capacitor/customization/customization.js +66 -0
- package/www/capacitor/customization/customization_colors.js +233 -0
- package/www/capacitor/customization/customization_fonts.js +106 -0
- package/www/capacitor/customization/customization_images.js +129 -0
- package/www/capacitor/customization/font.js +23 -0
- package/www/capacitor/customization/screen_orientation.js +4 -0
- package/www/capacitor/detect_faces/detect_face_result.js +38 -0
- package/www/capacitor/detect_faces/detect_faces_attribute.js +15 -0
- package/www/capacitor/detect_faces/detect_faces_attribute_result.js +20 -0
- package/www/capacitor/detect_faces/detect_faces_backend_exception.js +23 -0
- package/www/capacitor/detect_faces/detect_faces_config.js +14 -0
- package/www/capacitor/detect_faces/detect_faces_exception.js +30 -0
- package/www/capacitor/detect_faces/detect_faces_request.js +67 -0
- package/www/capacitor/detect_faces/detect_faces_response.js +24 -0
- package/www/capacitor/detect_faces/detect_faces_scenario.js +10 -0
- package/www/capacitor/face_capture/face_capture_config.js +28 -0
- package/www/capacitor/face_capture/face_capture_exception.js +25 -0
- package/www/capacitor/face_capture/face_capture_image.js +26 -0
- package/www/capacitor/face_capture/face_capture_response.js +17 -0
- package/www/capacitor/image_params/output_image_crop.js +21 -0
- package/www/capacitor/image_params/output_image_params.js +9 -0
- package/www/capacitor/image_params/point.js +14 -0
- package/www/capacitor/image_params/rect.js +18 -0
- package/www/capacitor/image_params/size.js +9 -0
- package/www/capacitor/image_quality/image_quality_characteristic.js +24 -0
- package/www/capacitor/image_quality/image_quality_characteristic_name.js +58 -0
- package/www/capacitor/image_quality/image_quality_group.js +332 -0
- package/www/capacitor/image_quality/image_quality_range.js +26 -0
- package/www/capacitor/image_quality/image_quality_result.js +40 -0
- package/www/capacitor/index.js +219 -0
- package/www/capacitor/init/face_sdk_version.js +16 -0
- package/www/capacitor/init/init_config.js +9 -0
- package/www/capacitor/init/init_exception.js +29 -0
- package/www/capacitor/init/license_exception.js +29 -0
- package/www/capacitor/internal/bridge.js +39 -0
- package/www/capacitor/internal/cordova.js +17 -0
- package/www/capacitor/internal/webpack.config.js +11 -0
- package/www/capacitor/liveness/liveness_backend_exception.js +38 -0
- package/www/capacitor/liveness/liveness_config.js +54 -0
- package/www/capacitor/liveness/liveness_exception.js +35 -0
- package/www/capacitor/liveness/liveness_notification.js +34 -0
- package/www/capacitor/liveness/liveness_response.js +30 -0
- package/www/capacitor/match_faces/compared_face.js +21 -0
- package/www/capacitor/match_faces/compared_faces_pair.js +23 -0
- package/www/capacitor/match_faces/compared_faces_split.js +22 -0
- package/www/capacitor/match_faces/match_faces_backend_exception.js +14 -0
- package/www/capacitor/match_faces/match_faces_config.js +12 -0
- package/www/capacitor/match_faces/match_faces_detection.js +25 -0
- package/www/capacitor/match_faces/match_faces_detection_face.js +28 -0
- package/www/capacitor/match_faces/match_faces_exception.js +30 -0
- package/www/capacitor/match_faces/match_faces_image.js +25 -0
- package/www/capacitor/match_faces/match_faces_request.js +13 -0
- package/www/capacitor/match_faces/match_faces_response.js +28 -0
- package/www/capacitor/person_database/edit_group_persons_request.js +9 -0
- package/www/capacitor/person_database/image_upload.js +16 -0
- package/www/capacitor/person_database/pageable_item_list.js +22 -0
- package/www/capacitor/person_database/person.js +22 -0
- package/www/capacitor/person_database/person_database.js +145 -0
- package/www/capacitor/person_database/person_group.js +18 -0
- package/www/capacitor/person_database/person_image.js +22 -0
- package/www/capacitor/person_database/search_person.js +31 -0
- package/www/capacitor/person_database/search_person_detection.js +22 -0
- package/www/capacitor/person_database/search_person_image.js +26 -0
- package/www/capacitor/person_database/search_person_request.js +17 -0
- package/www/cordova.js +3738 -0
- package/www/react-native/customization/camera_position.js +4 -0
- package/www/react-native/customization/customization.js +66 -0
- package/www/react-native/customization/customization_colors.js +233 -0
- package/www/react-native/customization/customization_fonts.js +106 -0
- package/www/react-native/customization/customization_images.js +129 -0
- package/www/react-native/customization/font.js +23 -0
- package/www/react-native/customization/screen_orientation.js +4 -0
- package/www/react-native/detect_faces/detect_face_result.js +38 -0
- package/www/react-native/detect_faces/detect_faces_attribute.js +15 -0
- package/www/react-native/detect_faces/detect_faces_attribute_result.js +20 -0
- package/www/react-native/detect_faces/detect_faces_backend_exception.js +23 -0
- package/www/react-native/detect_faces/detect_faces_config.js +14 -0
- package/www/react-native/detect_faces/detect_faces_exception.js +30 -0
- package/www/react-native/detect_faces/detect_faces_request.js +67 -0
- package/www/react-native/detect_faces/detect_faces_response.js +24 -0
- package/www/react-native/detect_faces/detect_faces_scenario.js +10 -0
- package/www/react-native/face_capture/face_capture_config.js +28 -0
- package/www/react-native/face_capture/face_capture_exception.js +25 -0
- package/www/react-native/face_capture/face_capture_image.js +26 -0
- package/www/react-native/face_capture/face_capture_response.js +17 -0
- package/www/react-native/image_params/output_image_crop.js +21 -0
- package/www/react-native/image_params/output_image_params.js +9 -0
- package/www/react-native/image_params/point.js +14 -0
- package/www/react-native/image_params/rect.js +18 -0
- package/www/react-native/image_params/size.js +9 -0
- package/www/react-native/image_quality/image_quality_characteristic.js +24 -0
- package/www/react-native/image_quality/image_quality_characteristic_name.js +58 -0
- package/www/react-native/image_quality/image_quality_group.js +332 -0
- package/www/react-native/image_quality/image_quality_range.js +26 -0
- package/www/react-native/image_quality/image_quality_result.js +40 -0
- package/www/react-native/index.js +219 -0
- package/www/react-native/init/face_sdk_version.js +16 -0
- package/www/react-native/init/init_config.js +9 -0
- package/www/react-native/init/init_exception.js +29 -0
- package/www/react-native/init/license_exception.js +29 -0
- package/www/react-native/internal/bridge.js +39 -0
- package/www/react-native/liveness/liveness_backend_exception.js +38 -0
- package/www/react-native/liveness/liveness_config.js +54 -0
- package/www/react-native/liveness/liveness_exception.js +35 -0
- package/www/react-native/liveness/liveness_notification.js +34 -0
- package/www/react-native/liveness/liveness_response.js +30 -0
- package/www/react-native/match_faces/compared_face.js +21 -0
- package/www/react-native/match_faces/compared_faces_pair.js +23 -0
- package/www/react-native/match_faces/compared_faces_split.js +22 -0
- package/www/react-native/match_faces/match_faces_backend_exception.js +14 -0
- package/www/react-native/match_faces/match_faces_config.js +12 -0
- package/www/react-native/match_faces/match_faces_detection.js +25 -0
- package/www/react-native/match_faces/match_faces_detection_face.js +28 -0
- package/www/react-native/match_faces/match_faces_exception.js +30 -0
- package/www/react-native/match_faces/match_faces_image.js +25 -0
- package/www/react-native/match_faces/match_faces_request.js +13 -0
- package/www/react-native/match_faces/match_faces_response.js +28 -0
- package/www/react-native/person_database/edit_group_persons_request.js +9 -0
- package/www/react-native/person_database/image_upload.js +16 -0
- package/www/react-native/person_database/pageable_item_list.js +22 -0
- package/www/react-native/person_database/person.js +22 -0
- package/www/react-native/person_database/person_database.js +145 -0
- package/www/react-native/person_database/person_group.js +18 -0
- package/www/react-native/person_database/person_image.js +22 -0
- package/www/react-native/person_database/search_person.js +31 -0
- package/www/react-native/person_database/search_person_detection.js +22 -0
- package/www/react-native/person_database/search_person_image.js +26 -0
- package/www/react-native/person_database/search_person_request.js +17 -0
- package/www/types/customization/camera_position.d.ts +4 -0
- package/www/types/customization/customization.d.ts +24 -0
- package/www/types/customization/customization_colors.d.ts +31 -0
- package/www/types/customization/customization_fonts.d.ts +17 -0
- package/www/types/customization/customization_images.d.ts +18 -0
- package/www/types/customization/font.d.ts +14 -0
- package/www/types/customization/screen_orientation.d.ts +4 -0
- package/www/types/detect_faces/detect_face_result.d.ts +16 -0
- package/www/types/detect_faces/detect_faces_attribute.d.ts +15 -0
- package/www/types/detect_faces/detect_faces_attribute_result.d.ts +11 -0
- package/www/types/detect_faces/detect_faces_backend_exception.d.ts +15 -0
- package/www/types/detect_faces/detect_faces_config.d.ts +19 -0
- package/www/types/detect_faces/detect_faces_exception.d.ts +21 -0
- package/www/types/detect_faces/detect_faces_request.d.ts +27 -0
- package/www/types/detect_faces/detect_faces_response.d.ts +12 -0
- package/www/types/detect_faces/detect_faces_scenario.d.ts +10 -0
- package/www/types/face_capture/face_capture_config.d.ts +30 -0
- package/www/types/face_capture/face_capture_exception.d.ts +17 -0
- package/www/types/face_capture/face_capture_image.d.ts +15 -0
- package/www/types/face_capture/face_capture_response.d.ts +9 -0
- package/www/types/image_params/output_image_crop.d.ts +25 -0
- package/www/types/image_params/output_image_params.d.ts +13 -0
- package/www/types/image_params/point.d.ts +6 -0
- package/www/types/image_params/rect.d.ts +8 -0
- package/www/types/image_params/size.d.ts +6 -0
- package/www/types/image_quality/image_quality_characteristic.d.ts +4 -0
- package/www/types/image_quality/image_quality_characteristic_name.d.ts +58 -0
- package/www/types/image_quality/image_quality_group.d.ts +155 -0
- package/www/types/image_quality/image_quality_range.d.ts +8 -0
- package/www/types/image_quality/image_quality_result.d.ts +30 -0
- package/www/types/index.d.ts +159 -0
- package/www/types/init/face_sdk_version.d.ts +7 -0
- package/www/types/init/init_config.d.ts +7 -0
- package/www/types/init/init_exception.d.ts +20 -0
- package/www/types/init/license_exception.d.ts +21 -0
- package/www/types/liveness/liveness_backend_exception.d.ts +30 -0
- package/www/types/liveness/liveness_config.d.ts +56 -0
- package/www/types/liveness/liveness_exception.d.ts +26 -0
- package/www/types/liveness/liveness_notification.d.ts +28 -0
- package/www/types/liveness/liveness_response.d.ts +18 -0
- package/www/types/match_faces/compared_face.d.ts +11 -0
- package/www/types/match_faces/compared_faces_pair.d.ts +12 -0
- package/www/types/match_faces/compared_faces_split.d.ts +8 -0
- package/www/types/match_faces/match_faces_backend_exception.d.ts +6 -0
- package/www/types/match_faces/match_faces_config.d.ts +14 -0
- package/www/types/match_faces/match_faces_detection.d.ts +12 -0
- package/www/types/match_faces/match_faces_detection_face.d.ts +13 -0
- package/www/types/match_faces/match_faces_exception.d.ts +21 -0
- package/www/types/match_faces/match_faces_image.d.ts +16 -0
- package/www/types/match_faces/match_faces_request.d.ts +18 -0
- package/www/types/match_faces/match_faces_response.d.ts +12 -0
- package/www/types/person_database/edit_group_persons_request.d.ts +8 -0
- package/www/types/person_database/image_upload.d.ts +6 -0
- package/www/types/person_database/pageable_item_list.d.ts +7 -0
- package/www/types/person_database/person.d.ts +10 -0
- package/www/types/person_database/person_database.d.ts +92 -0
- package/www/types/person_database/person_group.d.ts +8 -0
- package/www/types/person_database/person_image.d.ts +10 -0
- package/www/types/person_database/search_person.d.ts +15 -0
- package/www/types/person_database/search_person_detection.d.ts +11 -0
- package/www/types/person_database/search_person_image.d.ts +12 -0
- package/www/types/person_database/search_person_request.d.ts +15 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = '<POD_NAME>'
|
|
3
|
+
s.version = '<VERSION>'
|
|
4
|
+
s.summary = 'Databases of travel documents, banknotes, driver\'s licenses and vehicle registration certificates'
|
|
5
|
+
s.license = {
|
|
6
|
+
type: 'commercial',
|
|
7
|
+
text: <<-LICENSE
|
|
8
|
+
© <YEAR> RegulaForensics. All rights reserved.
|
|
9
|
+
LICENSE
|
|
10
|
+
}
|
|
11
|
+
s.homepage = 'https://mobile.regulaforensics.com'
|
|
12
|
+
s.author = { 'RegulaForensics' => 'support@regulaforensics.com' }
|
|
13
|
+
s.source = { http: '<FTP_SOURCE_URL>' }
|
|
14
|
+
s.platform = :ios
|
|
15
|
+
s.ios.deployment_target = '13.0.0'
|
|
16
|
+
s.ios.vendored_frameworks = 'IRS.xcframework'
|
|
17
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Pod::Spec.new do |s|
|
|
2
|
+
s.name = '<POD_NAME>'
|
|
3
|
+
s.version = '<VERSION>'
|
|
4
|
+
s.summary = 'Collection of shared code and modules for Regula solutions.'
|
|
5
|
+
s.license = {
|
|
6
|
+
type: 'commercial',
|
|
7
|
+
text: <<-LICENSE
|
|
8
|
+
© <YEAR> RegulaForensics. All rights reserved.
|
|
9
|
+
LICENSE
|
|
10
|
+
}
|
|
11
|
+
s.homepage = 'https://mobile.regulaforensics.com'
|
|
12
|
+
s.author = { 'RegulaForensics' => 'support@regulaforensics.com' }
|
|
13
|
+
s.source = { http: '<FTP_SOURCE_URL>' }
|
|
14
|
+
s.platform = :ios
|
|
15
|
+
s.ios.deployment_target = '11.0.0'
|
|
16
|
+
s.ios.vendored_frameworks = 'RegulaCommon.xcframework'
|
|
17
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from ios_ci import DependencyBuildType
|
|
3
|
+
from ios_ci import Dependency
|
|
4
|
+
from ios_ci import VersionResolver
|
|
5
|
+
|
|
6
|
+
ENV = os.environ
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def main():
|
|
10
|
+
print(f"[log] check if any dependency needs to modify Podfile.")
|
|
11
|
+
api = Dependency(
|
|
12
|
+
"DocumentReader",
|
|
13
|
+
ENV["ApiVersion"],
|
|
14
|
+
ENV["ApiBranchName"],
|
|
15
|
+
ENV["ApiType"],
|
|
16
|
+
"xcframework",
|
|
17
|
+
)
|
|
18
|
+
face_sdk = Dependency(
|
|
19
|
+
"FaceSDK",
|
|
20
|
+
ENV["FaceSDKVersion"],
|
|
21
|
+
ENV["FaceSDKBranchName"],
|
|
22
|
+
ENV["FaceSDKType"],
|
|
23
|
+
"xcframework",
|
|
24
|
+
)
|
|
25
|
+
dependencies = [api, face_sdk]
|
|
26
|
+
|
|
27
|
+
version_resolver = VersionResolver()
|
|
28
|
+
overridables: list[Dependency] = []
|
|
29
|
+
dependency_version_map = {}
|
|
30
|
+
for dependency in dependencies:
|
|
31
|
+
version = version_resolver.fetch_version(dependency)
|
|
32
|
+
pod_name = dependency.make_pod_full_name()
|
|
33
|
+
print(f"[log] {pod_name} {version}")
|
|
34
|
+
if dependency.type != DependencyBuildType.TEMP:
|
|
35
|
+
overridables.append(dependency)
|
|
36
|
+
dependency_version_map[pod_name] = version
|
|
37
|
+
|
|
38
|
+
if len(overridables) == 0:
|
|
39
|
+
print(f"[log] There are no dependencies to modify Podfile.")
|
|
40
|
+
exit(0)
|
|
41
|
+
|
|
42
|
+
updated_podfile_lines: list[str] = []
|
|
43
|
+
with open("Podfile") as podfile:
|
|
44
|
+
lines = podfile.readlines()
|
|
45
|
+
for line in lines:
|
|
46
|
+
for dependency in overridables:
|
|
47
|
+
pod_name = dependency.make_pod_full_name()
|
|
48
|
+
version = dependency_version_map.get(pod_name)
|
|
49
|
+
if version is None or version == "":
|
|
50
|
+
print(f"[error] failed to fetch version for {pod_name}")
|
|
51
|
+
exit(1)
|
|
52
|
+
|
|
53
|
+
find_dependency_name = line.find(f"pod '{dependency.dependency_name}'")
|
|
54
|
+
find_pod_name = line.find(f"pod '{pod_name}'")
|
|
55
|
+
start_index = max(find_dependency_name, find_pod_name)
|
|
56
|
+
if start_index != -1:
|
|
57
|
+
padding = line[0:start_index]
|
|
58
|
+
line = f"{padding}pod '{pod_name}', '{version}'\n"
|
|
59
|
+
print(f"[log] replaced line with {line}")
|
|
60
|
+
|
|
61
|
+
updated_podfile_lines.append(line)
|
|
62
|
+
|
|
63
|
+
with open("Podfile.temp", "w") as podfile_output:
|
|
64
|
+
for line in updated_podfile_lines:
|
|
65
|
+
podfile_output.write(line)
|
|
66
|
+
podfile_output.close()
|
|
67
|
+
|
|
68
|
+
os.replace("Podfile.temp", "Podfile")
|
|
69
|
+
|
|
70
|
+
with open("Podfile") as test:
|
|
71
|
+
content = test.read()
|
|
72
|
+
print(f"[log] resulting podfile: {content}")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
if __name__ == "__main__":
|
|
76
|
+
main()
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Check if four arguments are passed
|
|
4
|
+
if [ "$#" -ne 4 ]; then
|
|
5
|
+
echo "Usage: $0 <package_name> <packageUrl> <package_checksum> <common_version>"
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
packageName=$1
|
|
10
|
+
packageUrl=$2
|
|
11
|
+
packageChecksum=$3
|
|
12
|
+
commonVersion=$4
|
|
13
|
+
|
|
14
|
+
# Create Package.swift file
|
|
15
|
+
cat <<EOF > Package.swift
|
|
16
|
+
// swift-tools-version:5.3
|
|
17
|
+
import PackageDescription
|
|
18
|
+
|
|
19
|
+
let packageName = "$packageName"
|
|
20
|
+
|
|
21
|
+
let package = Package(
|
|
22
|
+
name: "$packageName",
|
|
23
|
+
platforms: [.iOS(.v11)],
|
|
24
|
+
products: [
|
|
25
|
+
.library(
|
|
26
|
+
name: "$packageName",
|
|
27
|
+
targets: ["\(packageName)Common"]),
|
|
28
|
+
],
|
|
29
|
+
dependencies: [
|
|
30
|
+
.package(name: "RegulaCommon", url: "https://github.com/regulaforensics/RegulaCommon-Swift-Package.git", .exact(Version(stringLiteral: "$commonVersion"))),
|
|
31
|
+
],
|
|
32
|
+
targets: [
|
|
33
|
+
.binaryTarget(name: "$packageName", url: "$packageUrl", checksum: "$packageChecksum"),
|
|
34
|
+
.target(
|
|
35
|
+
name: "\(packageName)Common",
|
|
36
|
+
dependencies: [
|
|
37
|
+
.target(name: "$packageName"),
|
|
38
|
+
.product(name: "RegulaCommon", package: "RegulaCommon")
|
|
39
|
+
],
|
|
40
|
+
path: "Sources",
|
|
41
|
+
sources: ["dummy.swift"]
|
|
42
|
+
)
|
|
43
|
+
]
|
|
44
|
+
)
|
|
45
|
+
EOF
|
|
46
|
+
|
|
47
|
+
# Print success message
|
|
48
|
+
echo "Swift Package created successfully!"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Check if three arguments are passed
|
|
4
|
+
if [ "$#" -ne 3 ]; then
|
|
5
|
+
echo "Usage: $0 <package_name> <packageUrl> <package_checksum>"
|
|
6
|
+
exit 1
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
packageName=$1
|
|
10
|
+
packageUrl=$2
|
|
11
|
+
packageChecksum=$3
|
|
12
|
+
|
|
13
|
+
# Create Package.swift file
|
|
14
|
+
cat <<EOF > Package.swift
|
|
15
|
+
// swift-tools-version:5.3
|
|
16
|
+
import PackageDescription
|
|
17
|
+
|
|
18
|
+
let package = Package(
|
|
19
|
+
name: "$packageName",
|
|
20
|
+
platforms: [.iOS(.v11)],
|
|
21
|
+
products: [
|
|
22
|
+
.library(
|
|
23
|
+
name: "$packageName",
|
|
24
|
+
targets: ["$packageName"]),
|
|
25
|
+
],
|
|
26
|
+
targets: [
|
|
27
|
+
.binaryTarget(name: "$packageName", url: "$packageUrl", checksum: "$packageChecksum"),
|
|
28
|
+
]
|
|
29
|
+
)
|
|
30
|
+
EOF
|
|
31
|
+
|
|
32
|
+
# Print success message
|
|
33
|
+
echo "Swift Package created successfully!"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Regula SPM collection",
|
|
3
|
+
"overview": "Contains all Regula packages in one SPM collection",
|
|
4
|
+
"keywords": ["face", "document", "reader", "documentreader", "regula", "regulaforensics"],
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Regula Forensics"
|
|
7
|
+
},
|
|
8
|
+
"packages": [
|
|
9
|
+
{ "url": "https://github.com/regulaforensics/RegulaCommon-Swift-Package.git" },
|
|
10
|
+
{ "url": "https://github.com/regulaforensics/BTDevice-Swift-Package.git" },
|
|
11
|
+
{ "url": "https://github.com/regulaforensics/FaceCoreMatch-Swift-Package.git" },
|
|
12
|
+
{ "url": "https://github.com/regulaforensics/FaceCoreBasic-Swift-Package.git" },
|
|
13
|
+
{ "url": "https://github.com/regulaforensics/DocumentReader-Swift-Package.git" },
|
|
14
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderBarcodeMRZRFID-Swift-Package.git" },
|
|
15
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderBounds-Swift-Package.git" },
|
|
16
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderFullAuth-Swift-Package.git" },
|
|
17
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderOCRRFID-Swift-Package.git" },
|
|
18
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderMRZRFID-Swift-Package.git" },
|
|
19
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderDocType-Swift-Package.git" },
|
|
20
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderMRZBarcode-Swift-Package.git" },
|
|
21
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderFullAuthRFID-Swift-Package.git" },
|
|
22
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderBarcode-Swift-Package.git" },
|
|
23
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderMRZ-Swift-Package.git" },
|
|
24
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderOCR-Swift-Package.git" },
|
|
25
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderFull-Swift-Package.git" },
|
|
26
|
+
{ "url": "https://github.com/regulaforensics/DocumentReaderFullRFID-Swift-Package.git" },
|
|
27
|
+
{ "url": "https://github.com/regulaforensics/FaceSDK-Swift-Package.git" },
|
|
28
|
+
]
|
|
29
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
#
|
|
3
|
+
# Short script for use with git clone and fetch credentials.
|
|
4
|
+
# Requires GITHUB_USERNAME and GITHUB_PASSWORD environment variables,
|
|
5
|
+
# intended to be called by git via GIT_ASKPASS.
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
from sys import argv
|
|
9
|
+
from os import environ
|
|
10
|
+
|
|
11
|
+
if "username" in argv[1].lower():
|
|
12
|
+
print(environ["GITHUB_USERNAME"])
|
|
13
|
+
exit()
|
|
14
|
+
|
|
15
|
+
if "password" in argv[1].lower():
|
|
16
|
+
print(environ["GITHUB_PASSWORD"])
|
|
17
|
+
exit()
|
|
18
|
+
|
|
19
|
+
exit(1)
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import subprocess
|
|
4
|
+
import shutil
|
|
5
|
+
|
|
6
|
+
from getpass import getpass
|
|
7
|
+
|
|
8
|
+
from typing import Optional
|
|
9
|
+
|
|
10
|
+
from ios_ci.common import dependency
|
|
11
|
+
from ios_ci.common import ftp
|
|
12
|
+
|
|
13
|
+
REPLACE_SDK_VERSION_TOKEN = "sdkVersion ="
|
|
14
|
+
REPLACE_SDK_CHECKSUM_TOKEN = "sdkChecksum ="
|
|
15
|
+
REPLACE_COMMON_VERSION_TOKEN = "commonSDKVersion ="
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# Uses GITHUB_USERNAME and GITHUB_PASSWORD environment variables for github interactions.
|
|
19
|
+
# If the varaiables are not provided the script will prompt the user from the console.
|
|
20
|
+
#
|
|
21
|
+
# 1. Fetches SPM public repository from `spm_repo_url`.
|
|
22
|
+
# 2. Checks if there is a release tag `build_version` already exists. If so - cancells the operation.
|
|
23
|
+
# 3. Calculates the hash directly from the link using `curl`.
|
|
24
|
+
# 4. Generates spm package using `version`, `name` and `hash`.
|
|
25
|
+
# 5. Creates release tag `build_version`.
|
|
26
|
+
# 6. Creates release on GitHub.
|
|
27
|
+
# 7. Pushes changes and tag to the `spm_repo_url` repository.
|
|
28
|
+
# 8. Generates a collection using Swift Package Collection Generator and digitally signs it.
|
|
29
|
+
# 9. Uploads the generated collection to `https://pods.regulaforensics.com/SPM/`
|
|
30
|
+
# 10. Removes fetched repository from disk.
|
|
31
|
+
#
|
|
32
|
+
def update_spm(
|
|
33
|
+
package_name: str,
|
|
34
|
+
build_version: str,
|
|
35
|
+
collection_update: str,
|
|
36
|
+
common_version: Optional[str],
|
|
37
|
+
zipped_build_filepath: str,
|
|
38
|
+
spm_repo_url: str,
|
|
39
|
+
spm_repo_template_branch: str
|
|
40
|
+
):
|
|
41
|
+
if not os.path.isfile(zipped_build_filepath):
|
|
42
|
+
print(f"[error] Build archive does not exist at: {zipped_build_filepath}")
|
|
43
|
+
sys.exit(0)
|
|
44
|
+
|
|
45
|
+
lowercase_core_name = package_name
|
|
46
|
+
uppercase_core_name = dependency._core_full_name_from_short_name(package_name)
|
|
47
|
+
uppercase_sdk_name = dependency._other_full_name_from_short_name(package_name)
|
|
48
|
+
spm_repo_url = dependency._spm_git_url(package_name)
|
|
49
|
+
|
|
50
|
+
project_dir = os.path.dirname(os.path.abspath(__file__))
|
|
51
|
+
spm_repo_template_dir = f"{project_dir}/manifest_repository"
|
|
52
|
+
os.environ["GIT_ASKPASS"] = os.path.join(project_dir, "askpass.py")
|
|
53
|
+
|
|
54
|
+
# replace with token auth
|
|
55
|
+
#if "GITHUB_USERNAME" not in os.environ:
|
|
56
|
+
# os.environ["GITHUB_USERNAME"] = input("GITHUB_USERNAME: ")
|
|
57
|
+
#if "GITHUB_PASSWORD" not in os.environ:
|
|
58
|
+
# os.environ["GITHUB_PASSWORD"] = getpass("GITHUB_PASSWORD: ")
|
|
59
|
+
|
|
60
|
+
subprocess.run(["rm", "-rf", spm_repo_template_dir], check=True, text=True)
|
|
61
|
+
subprocess.run(
|
|
62
|
+
["git", "clone", spm_repo_url, "--single-branch", spm_repo_template_dir],
|
|
63
|
+
check=True,
|
|
64
|
+
text=True,
|
|
65
|
+
)
|
|
66
|
+
spm_repo_dir = f"{project_dir}/spm_repository"
|
|
67
|
+
subprocess.run(["rm", "-rf", spm_repo_dir], check=True, text=True)
|
|
68
|
+
subprocess.run(
|
|
69
|
+
["git", "clone", spm_repo_url, "--single-branch", spm_repo_dir],
|
|
70
|
+
check=True,
|
|
71
|
+
text=True,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
try:
|
|
75
|
+
tags = subprocess.run(
|
|
76
|
+
["git", "show-ref", "--tags", build_version],
|
|
77
|
+
cwd=spm_repo_dir,
|
|
78
|
+
stdout=subprocess.PIPE,
|
|
79
|
+
check=True,
|
|
80
|
+
text=True,
|
|
81
|
+
).stdout
|
|
82
|
+
except subprocess.CalledProcessError as e:
|
|
83
|
+
if e.returncode == 1:
|
|
84
|
+
print(f"[log] there is no {build_version} tag. continue.")
|
|
85
|
+
tags = ""
|
|
86
|
+
else:
|
|
87
|
+
print(f"[error] faild to fetch tags for {build_version}. error: {e}")
|
|
88
|
+
sys.exit(1)
|
|
89
|
+
|
|
90
|
+
if tags.find(build_version) != -1:
|
|
91
|
+
print(f"[error]: Release tag: {build_version} already exits at: {tags}")
|
|
92
|
+
subprocess.run(["rm", "-rf", spm_repo_dir], check=True, text=True)
|
|
93
|
+
sys.exit(1)
|
|
94
|
+
|
|
95
|
+
manifest_filepath = f"{spm_repo_template_dir}/Package.swift" #template path
|
|
96
|
+
temp_dir = f"{spm_repo_template_dir}/" #dir for package.swift
|
|
97
|
+
release_name = ""
|
|
98
|
+
|
|
99
|
+
if uppercase_core_name:
|
|
100
|
+
release_name = uppercase_core_name
|
|
101
|
+
coreUrl = f"https://pods.regulaforensics.com/{uppercase_core_name}/{build_version}/DocumentReaderCore_{lowercase_core_name}_{build_version}.zip"
|
|
102
|
+
checksum = calculate_sha256(coreUrl)
|
|
103
|
+
generate_spm_package(temp_dir, uppercase_core_name, coreUrl, checksum, common_version)
|
|
104
|
+
|
|
105
|
+
if uppercase_sdk_name:
|
|
106
|
+
release_name = uppercase_sdk_name
|
|
107
|
+
sdkUrl = f"https://pods.regulaforensics.com/{uppercase_sdk_name}/{build_version}/{uppercase_sdk_name}-{build_version}.zip"
|
|
108
|
+
checksum = calculate_sha256(sdkUrl)
|
|
109
|
+
generate_spm_package(temp_dir, uppercase_sdk_name, sdkUrl, checksum, common_version)
|
|
110
|
+
|
|
111
|
+
shutil.copyfile(manifest_filepath, f"{spm_repo_dir}/Package.swift")
|
|
112
|
+
|
|
113
|
+
subprocess.run(["git", "add", "Package.swift"], cwd=spm_repo_dir)
|
|
114
|
+
subprocess.run(
|
|
115
|
+
["git", "commit", "-m", f"Release {build_version}"],
|
|
116
|
+
cwd=spm_repo_dir,
|
|
117
|
+
check=True,
|
|
118
|
+
text=True,
|
|
119
|
+
)
|
|
120
|
+
subprocess.run(["git", "push", "origin"], cwd=spm_repo_dir, check=True, text=True)
|
|
121
|
+
subprocess.run(
|
|
122
|
+
["git", "tag", build_version], cwd=spm_repo_dir, check=True, text=True
|
|
123
|
+
)
|
|
124
|
+
subprocess.run(
|
|
125
|
+
["git", "push", "origin", "--tags"], cwd=spm_repo_dir, check=True, text=True
|
|
126
|
+
)
|
|
127
|
+
subprocess.run(
|
|
128
|
+
["gh", "release", "create", build_version, "--title", build_version, "--notes", f'Release for {release_name} {build_version} for iOS.'], cwd=spm_repo_dir, check=True, text=True
|
|
129
|
+
)
|
|
130
|
+
update_collection(collection_update)
|
|
131
|
+
subprocess.run(["rm", "-rf", spm_repo_dir], check=True, text=True)
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def generate_spm_package(
|
|
135
|
+
manifest_filepath: str,
|
|
136
|
+
framework_name: str,
|
|
137
|
+
framework_url: str,
|
|
138
|
+
framework_checksum: str,
|
|
139
|
+
common_version: Optional[str],
|
|
140
|
+
):
|
|
141
|
+
script_abspath=os.path.abspath("ios_ci/spm/SwiftPackageGenerator.sh")
|
|
142
|
+
common_script_abspath=os.path.abspath("ios_ci/spm/SwiftPackageGenerator+Common.sh")
|
|
143
|
+
if common_version is not None:
|
|
144
|
+
subprocess.run(
|
|
145
|
+
["sh", common_script_abspath, framework_name, framework_url, framework_checksum, common_version], cwd=manifest_filepath, check=True, text=True
|
|
146
|
+
)
|
|
147
|
+
else:
|
|
148
|
+
subprocess.run(
|
|
149
|
+
["sh", script_abspath, framework_name, framework_url, framework_checksum], cwd=manifest_filepath, check=True, text=True
|
|
150
|
+
)
|
|
151
|
+
# Check if the file exists after executing the command
|
|
152
|
+
if not os.path.exists(os.path.join(manifest_filepath, "Package.swift")):
|
|
153
|
+
print("The file was not saved at the specified location.")
|
|
154
|
+
else:
|
|
155
|
+
print("The file was successfully saved at", manifest_filepath)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def calculate_sha256(url):
|
|
159
|
+
try:
|
|
160
|
+
# Execute curl command to download the file and shasum to calculate the hash
|
|
161
|
+
curl_process = subprocess.Popen(['curl', '-s', url], stdout=subprocess.PIPE)
|
|
162
|
+
shasum_process = subprocess.Popen(['shasum', '-a', '256'], stdin=curl_process.stdout, stdout=subprocess.PIPE, text=True)
|
|
163
|
+
|
|
164
|
+
# Get output data from shasum and process it
|
|
165
|
+
stdout, _ = shasum_process.communicate()
|
|
166
|
+
sha256_hash = stdout.split()[0] # Take the first word from the shasum output
|
|
167
|
+
|
|
168
|
+
return sha256_hash
|
|
169
|
+
|
|
170
|
+
except Exception as e:
|
|
171
|
+
print(f"Error executing command: {e}")
|
|
172
|
+
return None
|
|
173
|
+
|
|
174
|
+
def update_collection(collection_update: str):
|
|
175
|
+
if collection_update == "true":
|
|
176
|
+
|
|
177
|
+
repo_path = "swift-package-collection-generator"
|
|
178
|
+
json_path = os.path.abspath("ios_ci/spm/XcodeSPMCollection.json")
|
|
179
|
+
root_cert_path = os.path.abspath("ios_ci/spm/AppleRootCA-G3.cer")
|
|
180
|
+
ca_cert_path = os.path.abspath("ios_ci/spm/AppleWWDRCAG3.cer")
|
|
181
|
+
|
|
182
|
+
# Generator cloning
|
|
183
|
+
if not os.path.exists(repo_path) or not os.listdir(repo_path):
|
|
184
|
+
subprocess.run(
|
|
185
|
+
["git", "clone", "https://github.com/Darkzwer/swift-package-collection-generator"],
|
|
186
|
+
check=True,
|
|
187
|
+
text=True,
|
|
188
|
+
)
|
|
189
|
+
else:
|
|
190
|
+
print(f"Directory {repo_path} is not empty. Skipping cloning.")
|
|
191
|
+
|
|
192
|
+
# Building the generator source code
|
|
193
|
+
subprocess.run(
|
|
194
|
+
["swift", "build", "--configuration", "release"],
|
|
195
|
+
cwd="swift-package-collection-generator",
|
|
196
|
+
check=True,
|
|
197
|
+
text=True
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
# Generating a collection of packages
|
|
201
|
+
subprocess.run(
|
|
202
|
+
["swift", "run", "package-collection-generate", "--verbose", json_path, "PodsCollection-nonsigned.json"],
|
|
203
|
+
cwd="swift-package-collection-generator",
|
|
204
|
+
check=True,
|
|
205
|
+
text=True
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
# Sign collection
|
|
209
|
+
key_path = os.path.abspath("/Volumes/Masters/Programmers_tools/Mobile/SPM/swift_package_rsa.pem")
|
|
210
|
+
cert_path = os.path.abspath("/Volumes/Masters/Programmers_tools/Mobile/SPM/swift_package.cer")
|
|
211
|
+
subprocess.run(
|
|
212
|
+
["swift", "run", "package-collection-sign", "PodsCollection-nonsigned.json", "PodsCollection-signed.json", key_path, cert_path, root_cert_path, ca_cert_path, "--verbose"],
|
|
213
|
+
cwd="swift-package-collection-generator",
|
|
214
|
+
check=True,
|
|
215
|
+
text=True
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
# Uploading the collection to an ftp server
|
|
219
|
+
ftp.upload_collection_json("https://pods.regulaforensics.com/SPM")
|
|
220
|
+
|
|
221
|
+
# Describe collection
|
|
222
|
+
subprocess.run(
|
|
223
|
+
["swift", "package-collection", "describe", "https://pods.regulaforensics.com/SPM/PodsCollection-signed.json"],
|
|
224
|
+
cwd="swift-package-collection-generator",
|
|
225
|
+
check=True,
|
|
226
|
+
text=True
|
|
227
|
+
)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import plistlib
|
|
3
|
+
import shutil
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from ios_ci.common.dependency import DependencyBuildType
|
|
8
|
+
from ios_ci.common.dependency import make_dependency
|
|
9
|
+
from ios_ci.common.dependency import clean_coaopod
|
|
10
|
+
|
|
11
|
+
from ios_ci.common import ftp
|
|
12
|
+
from ios_ci.common.build_index import BuildIndex
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def _find_framework_plist_filepaths(build_location: str) -> list:
|
|
16
|
+
framework_path = Path(build_location)
|
|
17
|
+
framework_name = framework_path.stem + ".framework"
|
|
18
|
+
|
|
19
|
+
plistst = list()
|
|
20
|
+
for dirpath, dirnames, filenames in os.walk(build_location):
|
|
21
|
+
plistst += [
|
|
22
|
+
os.path.join(dirpath, file) for file in filenames if file == "Info.plist"
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
framework_plists = list()
|
|
26
|
+
for plist_path in plistst:
|
|
27
|
+
path = Path(plist_path)
|
|
28
|
+
if path.parent.name == framework_name:
|
|
29
|
+
framework_plists.append(plist_path)
|
|
30
|
+
|
|
31
|
+
return framework_plists
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def upload_build(
|
|
35
|
+
name: str, version: str, dependency_type: str, branch: str, build_location: str
|
|
36
|
+
):
|
|
37
|
+
framework_path = Path(build_location)
|
|
38
|
+
|
|
39
|
+
plist_filepaths = _find_framework_plist_filepaths(build_location)
|
|
40
|
+
for plist_path in plist_filepaths:
|
|
41
|
+
print(f"[log] updating Info.plist at {plist_path} with version: {version}")
|
|
42
|
+
with open(plist_path, "rb") as f_input:
|
|
43
|
+
plist = plistlib.load(f_input)
|
|
44
|
+
plist["CFBundleShortVersionString"] = version
|
|
45
|
+
|
|
46
|
+
with open(plist_path, "wb") as f_output:
|
|
47
|
+
plistlib.dump(plist, f_output)
|
|
48
|
+
|
|
49
|
+
temp_folder_name = f"_temp_{name}"
|
|
50
|
+
framework_name = framework_path.name
|
|
51
|
+
temp_framework_path = framework_path.parent / temp_folder_name / framework_name
|
|
52
|
+
temp_framework_path.parent
|
|
53
|
+
|
|
54
|
+
try:
|
|
55
|
+
print(f"[log] trying cleanup temp folder: {temp_framework_path.parent}")
|
|
56
|
+
shutil.rmtree(temp_framework_path.parent)
|
|
57
|
+
except Exception as e:
|
|
58
|
+
print(f"[warning] error while removing temp folder. error: {e}")
|
|
59
|
+
|
|
60
|
+
print(f"[log] copying framework content to {temp_framework_path}")
|
|
61
|
+
shutil.copytree(framework_path, temp_framework_path)
|
|
62
|
+
print(f"[log] making archive at: {temp_framework_path.parent}")
|
|
63
|
+
shutil.make_archive(
|
|
64
|
+
temp_framework_path, "zip", temp_framework_path.parent, temp_framework_path.name
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
build_type = DependencyBuildType(dependency_type)
|
|
68
|
+
dependency = make_dependency(name=name, build_type=build_type)
|
|
69
|
+
upload_url = ftp.make_ftp_build_archive_url(dependency=dependency, version=version)
|
|
70
|
+
the_archive_filepath = str(temp_framework_path) + ".zip"
|
|
71
|
+
|
|
72
|
+
if (build_type == dependency.build_type.STAGE or build_type == dependency.build_type.NIGHTLY) and (name == 'RegulaCommon' or name == 'DocumentReader' or name == 'FullAuthRFID'
|
|
73
|
+
or name == 'FaceCoreBasic' or name == 'FaceSDK'):
|
|
74
|
+
ftp.clean_old_data(ftp.make_ftp_project_url(dependency=dependency))
|
|
75
|
+
clean_coaopod(dependency.pod_name)
|
|
76
|
+
|
|
77
|
+
print(f"[log] uploading archive at: {upload_url}")
|
|
78
|
+
ftp.upload_build(
|
|
79
|
+
upload_url=upload_url,
|
|
80
|
+
build_version=version,
|
|
81
|
+
the_archive_filepath=the_archive_filepath,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
os.remove(the_archive_filepath)
|
|
85
|
+
shutil.rmtree(temp_framework_path)
|
|
86
|
+
|
|
87
|
+
print(f"[log] the archive uploaded successfully at: {upload_url}")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def update_index_toml(name: str, version: str, branch: str):
|
|
91
|
+
dependency = make_dependency(name=name, build_type=DependencyBuildType.TEMP)
|
|
92
|
+
project_url = ftp.make_ftp_project_url(dependency=dependency)
|
|
93
|
+
index = ftp.fetch_build_index(project_url=project_url)
|
|
94
|
+
if not index:
|
|
95
|
+
print(f"[log] there is no index.toml. Creating empty.")
|
|
96
|
+
index = BuildIndex.empty()
|
|
97
|
+
index.add_version(version=version, branch=branch)
|
|
98
|
+
print(f"[log] updating build index.toml file.")
|
|
99
|
+
ftp.upload_build_index(index=index, project_url=project_url)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def upload_wrapper(name: str, version: str, wrapper: str, build_location: str):
|
|
103
|
+
plugin_path = Path(build_location)
|
|
104
|
+
|
|
105
|
+
temp_folder_name = f"_temp_{wrapper}_{name}"
|
|
106
|
+
plugin_name = plugin_path.name
|
|
107
|
+
temp_plugin_path = plugin_path.parent / temp_folder_name / plugin_name
|
|
108
|
+
temp_plugin_path.parent
|
|
109
|
+
|
|
110
|
+
try:
|
|
111
|
+
print(f"[log] trying cleanup temp folder: {temp_plugin_path.parent}")
|
|
112
|
+
shutil.rmtree(temp_plugin_path.parent)
|
|
113
|
+
except Exception as e:
|
|
114
|
+
print(f"[warning] error while removing temp folder. error: {e}")
|
|
115
|
+
|
|
116
|
+
print(f"[log] copying plugin content to {temp_plugin_path}")
|
|
117
|
+
shutil.copytree(plugin_path, temp_plugin_path)
|
|
118
|
+
print(f"[log] making archive at: {temp_plugin_path.parent}")
|
|
119
|
+
shutil.make_archive(
|
|
120
|
+
temp_plugin_path, "zip", temp_plugin_path.parent, temp_plugin_path.name
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
upload_url = f"http://ftp.regula.local/Wrapper/{name}/{wrapper}/{version}/plugin-{version}.zip"
|
|
124
|
+
the_archive_filepath = str(temp_plugin_path) + ".zip"
|
|
125
|
+
|
|
126
|
+
project_url = f"http://ftp.regula.local/Wrapper/{name}/{wrapper}"
|
|
127
|
+
print(f"[log] updating latest_version.txt file.")
|
|
128
|
+
print(
|
|
129
|
+
f"[log] doing it before uploading build because build has to be the latest modified file."
|
|
130
|
+
)
|
|
131
|
+
ftp.upload_latest_version(version=version, project_url=project_url)
|
|
132
|
+
|
|
133
|
+
print(f"[log] uploading archive at: {upload_url}")
|
|
134
|
+
|
|
135
|
+
try:
|
|
136
|
+
ftp.upload_build(
|
|
137
|
+
upload_url=upload_url,
|
|
138
|
+
build_version=version,
|
|
139
|
+
the_archive_filepath=the_archive_filepath,
|
|
140
|
+
)
|
|
141
|
+
except Exception as e:
|
|
142
|
+
target_dir = f"http://ftp.regula.local/Wrapper/{name}/{wrapper}"
|
|
143
|
+
print(f"[warning] Upload failed. Will retry in few seconds.")
|
|
144
|
+
print(f"[log] Fixing ftp cleanup: deleting folder {target_dir}")
|
|
145
|
+
ftp.delete_dir(dir_url=target_dir)
|
|
146
|
+
|
|
147
|
+
print(f"[log] Folder deleted, retrying")
|
|
148
|
+
ftp.upload_build(
|
|
149
|
+
upload_url=upload_url,
|
|
150
|
+
build_version=version,
|
|
151
|
+
the_archive_filepath=the_archive_filepath,
|
|
152
|
+
)
|
|
153
|
+
ftp.upload_latest_version(version=version, project_url=project_url)
|
|
154
|
+
|
|
155
|
+
os.remove(the_archive_filepath)
|
|
156
|
+
shutil.rmtree(temp_plugin_path)
|
|
157
|
+
|
|
158
|
+
print(f"[log] the archive uploaded successfully at: {upload_url}")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from ios_ci.common.dependency import DependencyBuildType
|
|
2
|
+
from ios_ci.common.dependency import VersionResolver
|
|
3
|
+
from ios_ci.common.dependency import make_dependency
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def fetch_version(name: str, type: str, branch: str) -> str:
|
|
7
|
+
build_type = DependencyBuildType(type)
|
|
8
|
+
dependency = make_dependency(name, build_type)
|
|
9
|
+
resolver = VersionResolver()
|
|
10
|
+
dependency_version = resolver.resolve_dependency_version(
|
|
11
|
+
dependency=dependency, version_selector="+", branch=branch
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
return dependency_version.version
|