├── .gitattributes
├── .github
└── workflows
│ ├── deploy.yml
│ └── tests.yml
├── .gitignore
├── .node-version
├── .prettierrc
├── Example
├── .bundle
│ └── config
├── .eslintrc.js
├── .gitignore
├── .node-version
├── .prettierrc.js
├── .ruby-version
├── .watchmanconfig
├── App.tsx
├── Gemfile
├── Gemfile.lock
├── __tests__
│ └── App-test.tsx
├── android
│ ├── app
│ │ ├── build.gradle
│ │ ├── debug.keystore
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── ReactNativeFlipper.java
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ │ ├── drawable-night
│ │ │ │ └── react_svg_d0ad45.xml
│ │ │ │ ├── drawable
│ │ │ │ ├── react_svg_d0ad45.xml
│ │ │ │ └── rn_edit_text_material.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── values
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ └── release
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── ReactNativeFlipper.java
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── app.json
├── babel.config.js
├── index.js
├── ios
│ ├── .xcode.env
│ ├── Example.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Example.xcscheme
│ ├── Example.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── Example
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.mm
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ └── react_svg_d0ad45.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── dark.pdf
│ │ │ │ └── light.pdf
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── main.m
│ ├── ExampleTests
│ │ ├── ExampleTests.m
│ │ └── Info.plist
│ ├── Podfile
│ └── Podfile.lock
├── metro.config.js
├── package.json
├── react.dark.svg
├── react.svg
├── tsconfig.json
└── yarn.lock
├── LICENSE
├── README.md
├── bin
├── react-native-vector-image.js
└── svg2vd-0.1.jar
├── package.json
├── scripts
└── build-svg2vd.sh
├── src
├── VectorImageCompat.android.js
├── VectorImageCompat.ios.js
├── cli
│ ├── convertSvgToPdf.js
│ ├── convertSvgToPdf.spec.js
│ ├── convertSvgToVd.js
│ ├── convertSvgToVd.spec.js
│ ├── errors.js
│ ├── fixtures
│ │ ├── current-color.svg
│ │ ├── drop-shadow.svg
│ │ ├── index.js
│ │ ├── react-logo.svg
│ │ └── rectangle.svg
│ ├── generateAndroidAsset.js
│ ├── generateAssets.js
│ ├── generateIosAsset.js
│ ├── getAssets.js
│ ├── index.js
│ ├── readSvgAsset.js
│ ├── readSvgAsset.spec.js
│ ├── resolveAssetSources.js
│ └── streams.js
├── getResourceName.js
├── getResourceName.spec.js
├── index.d.ts
└── index.js
├── strip_svgs.gradle
├── strip_svgs.sh
├── tests
└── ensure-svgs-stripped-ios.sh
└── yarn.lock
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.jar filter=lfs diff=lfs merge=lfs -text
2 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 |
3 | on:
4 | push:
5 | branches:
6 | - master
7 |
8 | jobs:
9 | publish:
10 | runs-on: ubuntu-latest
11 | permissions:
12 | id-token: write
13 | steps:
14 | - uses: actions/checkout@v4
15 | with:
16 | lfs: true
17 | - name: Use Node.js
18 | uses: actions/setup-node@v3
19 | with:
20 | node-version-file: '.node-version'
21 | - name: Publish
22 | uses: JS-DevTools/npm-publish@v3
23 | with:
24 | token: ${{ secrets.NPM_PUBLISH_TOKEN }}
25 | provenance: true
26 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: Tests
2 |
3 | on:
4 | - push
5 | - pull_request
6 |
7 | jobs:
8 | unit:
9 | name: Unit tests
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/checkout@v4
14 | with:
15 | lfs: true
16 | - name: Use Node.js
17 | uses: actions/setup-node@v3
18 | with:
19 | node-version-file: '.node-version'
20 | - name: Install dependencies
21 | run: yarn --frozen-lockfile --non-interactive --silent --ignore-scripts
22 | - name: Run tests
23 | run: yarn test
24 |
25 | ios:
26 | name: iOS integration tests
27 | runs-on: macos-latest
28 |
29 | steps:
30 | - uses: actions/checkout@v4
31 | with:
32 | lfs: true
33 | - name: Use Node.js
34 | uses: actions/setup-node@v3
35 | with:
36 | node-version-file: '.node-version'
37 | - name: Install dependencies
38 | run: yarn --frozen-lockfile --non-interactive --silent
39 | - name: Install example project dependencies
40 | run: yarn --frozen-lockfile --non-interactive --silent
41 | working-directory: Example
42 | - name: Install example project cocoapods
43 | run: pod install --project-directory=ios
44 | working-directory: Example
45 | - name: Ensure SVG files are stripped
46 | run: ./tests/ensure-svgs-stripped-ios.sh
47 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # node.js
6 | #
7 | node_modules/
8 |
9 | # Logs
10 | *.log
11 |
--------------------------------------------------------------------------------
/.node-version:
--------------------------------------------------------------------------------
1 | 20.8.1
2 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 80,
3 | "singleQuote": true,
4 | "trailingComma": "es5"
5 | }
6 |
--------------------------------------------------------------------------------
/Example/.bundle/config:
--------------------------------------------------------------------------------
1 | BUNDLE_PATH: "vendor/bundle"
2 | BUNDLE_FORCE_RUBY_PLATFORM: 1
3 |
--------------------------------------------------------------------------------
/Example/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: '@react-native-community',
4 | };
5 |
--------------------------------------------------------------------------------
/Example/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | ios/.xcode.env.local
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 | *.hprof
33 | .cxx/
34 | *.keystore
35 | !debug.keystore
36 |
37 | # node.js
38 | #
39 | node_modules/
40 | npm-debug.log
41 | yarn-error.log
42 |
43 | # fastlane
44 | #
45 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46 | # screenshots whenever they are needed.
47 | # For more information about the recommended setup visit:
48 | # https://docs.fastlane.tools/best-practices/source-control/
49 |
50 | **/fastlane/report.xml
51 | **/fastlane/Preview.html
52 | **/fastlane/screenshots
53 | **/fastlane/test_output
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
58 | # Ruby / CocoaPods
59 | /ios/Pods/
60 | /vendor/bundle/
61 |
62 | # Temporary files created by Metro to check the health of the file watcher
63 | .metro-health-check*
64 |
--------------------------------------------------------------------------------
/Example/.node-version:
--------------------------------------------------------------------------------
1 | 18.15.0
2 |
--------------------------------------------------------------------------------
/Example/.prettierrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | arrowParens: 'avoid',
3 | bracketSameLine: true,
4 | bracketSpacing: false,
5 | singleQuote: true,
6 | trailingComma: 'all',
7 | };
8 |
--------------------------------------------------------------------------------
/Example/.ruby-version:
--------------------------------------------------------------------------------
1 | 2.7.6
2 |
--------------------------------------------------------------------------------
/Example/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/Example/App.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {ScrollView} from 'react-native';
3 | import VectorImage from 'react-native-vector-image';
4 |
5 | const App = () => (
6 |
9 |
10 |
11 | );
12 |
13 | export default App;
14 |
--------------------------------------------------------------------------------
/Example/Gemfile:
--------------------------------------------------------------------------------
1 | source 'https://rubygems.org'
2 |
3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4 | ruby File.read(File.join(__dir__, '.ruby-version')).strip
5 |
6 | gem 'cocoapods', '~> 1.11', '>= 1.11.3'
7 |
--------------------------------------------------------------------------------
/Example/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.6)
5 | rexml
6 | activesupport (7.0.4.3)
7 | concurrent-ruby (~> 1.0, >= 1.0.2)
8 | i18n (>= 1.6, < 2)
9 | minitest (>= 5.1)
10 | tzinfo (~> 2.0)
11 | addressable (2.8.1)
12 | public_suffix (>= 2.0.2, < 6.0)
13 | algoliasearch (1.27.5)
14 | httpclient (~> 2.8, >= 2.8.3)
15 | json (>= 1.5.1)
16 | atomos (0.1.3)
17 | claide (1.1.0)
18 | cocoapods (1.12.0)
19 | addressable (~> 2.8)
20 | claide (>= 1.0.2, < 2.0)
21 | cocoapods-core (= 1.12.0)
22 | cocoapods-deintegrate (>= 1.0.3, < 2.0)
23 | cocoapods-downloader (>= 1.6.0, < 2.0)
24 | cocoapods-plugins (>= 1.0.0, < 2.0)
25 | cocoapods-search (>= 1.0.0, < 2.0)
26 | cocoapods-trunk (>= 1.6.0, < 2.0)
27 | cocoapods-try (>= 1.1.0, < 2.0)
28 | colored2 (~> 3.1)
29 | escape (~> 0.0.4)
30 | fourflusher (>= 2.3.0, < 3.0)
31 | gh_inspector (~> 1.0)
32 | molinillo (~> 0.8.0)
33 | nap (~> 1.0)
34 | ruby-macho (>= 2.3.0, < 3.0)
35 | xcodeproj (>= 1.21.0, < 2.0)
36 | cocoapods-core (1.12.0)
37 | activesupport (>= 5.0, < 8)
38 | addressable (~> 2.8)
39 | algoliasearch (~> 1.0)
40 | concurrent-ruby (~> 1.1)
41 | fuzzy_match (~> 2.0.4)
42 | nap (~> 1.0)
43 | netrc (~> 0.11)
44 | public_suffix (~> 4.0)
45 | typhoeus (~> 1.0)
46 | cocoapods-deintegrate (1.0.5)
47 | cocoapods-downloader (1.6.3)
48 | cocoapods-plugins (1.0.0)
49 | nap
50 | cocoapods-search (1.0.1)
51 | cocoapods-trunk (1.6.0)
52 | nap (>= 0.8, < 2.0)
53 | netrc (~> 0.11)
54 | cocoapods-try (1.2.0)
55 | colored2 (3.1.2)
56 | concurrent-ruby (1.2.2)
57 | escape (0.0.4)
58 | ethon (0.16.0)
59 | ffi (>= 1.15.0)
60 | ffi (1.15.5)
61 | fourflusher (2.3.1)
62 | fuzzy_match (2.0.4)
63 | gh_inspector (1.1.3)
64 | httpclient (2.8.3)
65 | i18n (1.12.0)
66 | concurrent-ruby (~> 1.0)
67 | json (2.6.3)
68 | minitest (5.18.0)
69 | molinillo (0.8.0)
70 | nanaimo (0.3.0)
71 | nap (1.1.0)
72 | netrc (0.11.0)
73 | public_suffix (4.0.7)
74 | rexml (3.2.5)
75 | ruby-macho (2.5.1)
76 | typhoeus (1.4.0)
77 | ethon (>= 0.9.0)
78 | tzinfo (2.0.6)
79 | concurrent-ruby (~> 1.0)
80 | xcodeproj (1.22.0)
81 | CFPropertyList (>= 2.3.3, < 4.0)
82 | atomos (~> 0.1.3)
83 | claide (>= 1.0.2, < 2.0)
84 | colored2 (~> 3.1)
85 | nanaimo (~> 0.3.0)
86 | rexml (~> 3.2.4)
87 |
88 | PLATFORMS
89 | ruby
90 |
91 | DEPENDENCIES
92 | cocoapods (~> 1.11, >= 1.11.3)
93 |
94 | RUBY VERSION
95 | ruby 2.7.6p219
96 |
97 | BUNDLED WITH
98 | 2.1.4
99 |
--------------------------------------------------------------------------------
/Example/__tests__/App-test.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import 'react-native';
6 | import React from 'react';
7 | import App from '../App';
8 |
9 | // Note: test renderer must be required after react-native.
10 | import renderer from 'react-test-renderer';
11 |
12 | it('renders correctly', () => {
13 | renderer.create();
14 | });
15 |
--------------------------------------------------------------------------------
/Example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 | apply plugin: "com.facebook.react"
3 | apply from: "../../node_modules/react-native-vector-image/strip_svgs.gradle"
4 |
5 | import com.android.build.OutputFile
6 |
7 | /**
8 | * This is the configuration block to customize your React Native Android app.
9 | * By default you don't need to apply any configuration, just uncomment the lines you need.
10 | */
11 | react {
12 | /* Folders */
13 | // The root of your project, i.e. where "package.json" lives. Default is '..'
14 | // root = file("../")
15 | // The folder where the react-native NPM package is. Default is ../node_modules/react-native
16 | // reactNativeDir = file("../node_modules/react-native")
17 | // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
18 | // codegenDir = file("../node_modules/react-native-codegen")
19 | // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
20 | // cliFile = file("../node_modules/react-native/cli.js")
21 |
22 | /* Variants */
23 | // The list of variants to that are debuggable. For those we're going to
24 | // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
25 | // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
26 | // debuggableVariants = ["liteDebug", "prodDebug"]
27 |
28 | /* Bundling */
29 | // A list containing the node command and its flags. Default is just 'node'.
30 | // nodeExecutableAndArgs = ["node"]
31 | //
32 | // The command to run when bundling. By default is 'bundle'
33 | // bundleCommand = "ram-bundle"
34 | //
35 | // The path to the CLI configuration file. Default is empty.
36 | // bundleConfig = file(../rn-cli.config.js)
37 | //
38 | // The name of the generated asset file containing your JS bundle
39 | // bundleAssetName = "MyApplication.android.bundle"
40 | //
41 | // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
42 | // entryFile = file("../js/MyApplication.android.js")
43 | //
44 | // A list of extra flags to pass to the 'bundle' commands.
45 | // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
46 | // extraPackagerArgs = []
47 |
48 | /* Hermes Commands */
49 | // The hermes compiler command to run. By default it is 'hermesc'
50 | // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
51 | //
52 | // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
53 | // hermesFlags = ["-O", "-output-source-map"]
54 | }
55 |
56 | /**
57 | * Set this to true to create four separate APKs instead of one,
58 | * one for each native architecture. This is useful if you don't
59 | * use App Bundles (https://developer.android.com/guide/app-bundle/)
60 | * and want to have separate APKs to upload to the Play Store.
61 | */
62 | def enableSeparateBuildPerCPUArchitecture = false
63 |
64 | /**
65 | * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
66 | */
67 | def enableProguardInReleaseBuilds = false
68 |
69 | /**
70 | * The preferred build flavor of JavaScriptCore (JSC)
71 | *
72 | * For example, to use the international variant, you can use:
73 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
74 | *
75 | * The international variant includes ICU i18n library and necessary data
76 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
77 | * give correct results when using with locales other than en-US. Note that
78 | * this variant is about 6MiB larger per architecture than default.
79 | */
80 | def jscFlavor = 'org.webkit:android-jsc:+'
81 |
82 | /**
83 | * Private function to get the list of Native Architectures you want to build.
84 | * This reads the value from reactNativeArchitectures in your gradle.properties
85 | * file and works together with the --active-arch-only flag of react-native run-android.
86 | */
87 | def reactNativeArchitectures() {
88 | def value = project.getProperties().get("reactNativeArchitectures")
89 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
90 | }
91 |
92 | android {
93 | ndkVersion rootProject.ext.ndkVersion
94 |
95 | compileSdkVersion rootProject.ext.compileSdkVersion
96 |
97 | namespace "com.example"
98 | defaultConfig {
99 | applicationId "com.example"
100 | minSdkVersion rootProject.ext.minSdkVersion
101 | targetSdkVersion rootProject.ext.targetSdkVersion
102 | versionCode 1
103 | versionName "1.0"
104 | }
105 |
106 | splits {
107 | abi {
108 | reset()
109 | enable enableSeparateBuildPerCPUArchitecture
110 | universalApk false // If true, also generate a universal APK
111 | include (*reactNativeArchitectures())
112 | }
113 | }
114 | signingConfigs {
115 | debug {
116 | storeFile file('debug.keystore')
117 | storePassword 'android'
118 | keyAlias 'androiddebugkey'
119 | keyPassword 'android'
120 | }
121 | }
122 | buildTypes {
123 | debug {
124 | signingConfig signingConfigs.debug
125 | }
126 | release {
127 | // Caution! In production, you need to generate your own keystore file.
128 | // see https://reactnative.dev/docs/signed-apk-android.
129 | signingConfig signingConfigs.debug
130 | minifyEnabled enableProguardInReleaseBuilds
131 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
132 | }
133 | }
134 |
135 | // applicationVariants are e.g. debug, release
136 | applicationVariants.all { variant ->
137 | variant.outputs.each { output ->
138 | // For each separate APK per architecture, set a unique version code as described here:
139 | // https://developer.android.com/studio/build/configure-apk-splits.html
140 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
141 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
142 | def abi = output.getFilter(OutputFile.ABI)
143 | if (abi != null) { // null for the universal-debug, universal-release variants
144 | output.versionCodeOverride =
145 | defaultConfig.versionCode * 1000 + versionCodes.get(abi)
146 | }
147 |
148 | }
149 | }
150 | }
151 |
152 | dependencies {
153 | // The version of react-native is set by the React Native Gradle Plugin
154 | implementation("com.facebook.react:react-android")
155 |
156 | implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
157 |
158 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
159 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
160 | exclude group:'com.squareup.okhttp3', module:'okhttp'
161 | }
162 |
163 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
164 | if (hermesEnabled.toBoolean()) {
165 | implementation("com.facebook.react:hermes-android")
166 | } else {
167 | implementation jscFlavor
168 | }
169 | }
170 |
171 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
172 |
--------------------------------------------------------------------------------
/Example/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/debug.keystore
--------------------------------------------------------------------------------
/Example/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/Example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Example/android/app/src/debug/java/com/example/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | *
This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
21 | import com.facebook.react.ReactInstanceEventListener;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | /**
28 | * Class responsible of loading Flipper inside your React Native application. This is the debug
29 | * flavor of it. Here you can add your own plugins and customize the Flipper setup.
30 | */
31 | public class ReactNativeFlipper {
32 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
33 | if (FlipperUtils.shouldEnableFlipper(context)) {
34 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
35 |
36 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
37 | client.addPlugin(new DatabasesFlipperPlugin(context));
38 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
39 | client.addPlugin(CrashReporterPlugin.getInstance());
40 |
41 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
42 | NetworkingModule.setCustomClientBuilder(
43 | new NetworkingModule.CustomClientBuilder() {
44 | @Override
45 | public void apply(OkHttpClient.Builder builder) {
46 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
47 | }
48 | });
49 | client.addPlugin(networkFlipperPlugin);
50 | client.start();
51 |
52 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
53 | // Hence we run if after all native modules have been initialized
54 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
55 | if (reactContext == null) {
56 | reactInstanceManager.addReactInstanceEventListener(
57 | new ReactInstanceEventListener() {
58 | @Override
59 | public void onReactContextInitialized(ReactContext reactContext) {
60 | reactInstanceManager.removeReactInstanceEventListener(this);
61 | reactContext.runOnNativeModulesQueueThread(
62 | new Runnable() {
63 | @Override
64 | public void run() {
65 | client.addPlugin(new FrescoFlipperPlugin());
66 | }
67 | });
68 | }
69 | });
70 | } else {
71 | client.addPlugin(new FrescoFlipperPlugin());
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/java/com/example/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | import com.facebook.react.ReactActivity;
4 | import com.facebook.react.ReactActivityDelegate;
5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
6 | import com.facebook.react.defaults.DefaultReactActivityDelegate;
7 |
8 | public class MainActivity extends ReactActivity {
9 |
10 | /**
11 | * Returns the name of the main component registered from JavaScript. This is used to schedule
12 | * rendering of the component.
13 | */
14 | @Override
15 | protected String getMainComponentName() {
16 | return "Example";
17 | }
18 |
19 | /**
20 | * Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
21 | * DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
22 | * (aka React 18) with two boolean flags.
23 | */
24 | @Override
25 | protected ReactActivityDelegate createReactActivityDelegate() {
26 | return new DefaultReactActivityDelegate(
27 | this,
28 | getMainComponentName(),
29 | // If you opted-in for the New Architecture, we enable the Fabric Renderer.
30 | DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
31 | // If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
32 | DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
33 | );
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/java/com/example/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.example;
2 |
3 | import android.app.Application;
4 | import com.facebook.react.PackageList;
5 | import com.facebook.react.ReactApplication;
6 | import com.facebook.react.ReactNativeHost;
7 | import com.facebook.react.ReactPackage;
8 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
9 | import com.facebook.react.defaults.DefaultReactNativeHost;
10 | import com.facebook.soloader.SoLoader;
11 | import java.util.List;
12 |
13 | public class MainApplication extends Application implements ReactApplication {
14 |
15 | private final ReactNativeHost mReactNativeHost =
16 | new DefaultReactNativeHost(this) {
17 | @Override
18 | public boolean getUseDeveloperSupport() {
19 | return BuildConfig.DEBUG;
20 | }
21 |
22 | @Override
23 | protected List getPackages() {
24 | @SuppressWarnings("UnnecessaryLocalVariable")
25 | List packages = new PackageList(this).getPackages();
26 | // Packages that cannot be autolinked yet can be added manually here, for example:
27 | // packages.add(new MyReactNativePackage());
28 | return packages;
29 | }
30 |
31 | @Override
32 | protected String getJSMainModuleName() {
33 | return "index";
34 | }
35 |
36 | @Override
37 | protected boolean isNewArchEnabled() {
38 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
39 | }
40 |
41 | @Override
42 | protected Boolean isHermesEnabled() {
43 | return BuildConfig.IS_HERMES_ENABLED;
44 | }
45 | };
46 |
47 | @Override
48 | public ReactNativeHost getReactNativeHost() {
49 | return mReactNativeHost;
50 | }
51 |
52 | @Override
53 | public void onCreate() {
54 | super.onCreate();
55 | SoLoader.init(this, /* native exopackage */ false);
56 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
57 | // If you opted-in for the New Architecture, we load the native entry point for this app.
58 | DefaultNewArchitectureEntryPoint.load();
59 | }
60 | ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/drawable-night/react_svg_d0ad45.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/drawable/react_svg_d0ad45.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/drawable/rn_edit_text_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
21 |
22 |
23 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Example
3 |
4 |
--------------------------------------------------------------------------------
/Example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Example/android/app/src/release/java/com/example/ReactNativeFlipper.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Meta Platforms, Inc. and affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example;
8 |
9 | import android.content.Context;
10 | import com.facebook.react.ReactInstanceManager;
11 |
12 | /**
13 | * Class responsible of loading Flipper inside your React Native application. This is the release
14 | * flavor of it so it's empty as we don't want to load Flipper.
15 | */
16 | public class ReactNativeFlipper {
17 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
18 | // Do nothing as we don't want to initialize Flipper on Release.
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "33.0.0"
6 | minSdkVersion = 21
7 | compileSdkVersion = 33
8 | targetSdkVersion = 33
9 |
10 | // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
11 | ndkVersion = "23.1.7779620"
12 | }
13 | repositories {
14 | google()
15 | mavenCentral()
16 | }
17 | dependencies {
18 | classpath("com.android.tools.build:gradle:7.3.1")
19 | classpath("com.facebook.react:react-native-gradle-plugin")
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 | # Automatically convert third-party libraries to use AndroidX
25 | android.enableJetifier=true
26 |
27 | # Version of flipper SDK to use with React Native
28 | FLIPPER_VERSION=0.125.0
29 |
30 | # Use this property to specify which architecture you want to build.
31 | # You can also override it from the CLI using
32 | # ./gradlew -PreactNativeArchitectures=x86_64
33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
34 |
35 | # Use this property to enable support to the new architecture.
36 | # This will allow you to use TurboModules and the Fabric render in
37 | # your application. You should enable this flag either if you want
38 | # to write custom TurboModules/Fabric components OR use libraries that
39 | # are providing them.
40 | newArchEnabled=false
41 |
42 | # Use this property to enable or disable the Hermes JS engine.
43 | # If set to false, you will be using JSC instead.
44 | hermesEnabled=true
45 |
--------------------------------------------------------------------------------
/Example/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:575098db54a998ff1c6770b352c3b16766c09848bee7555dab09afc34e8cf590
3 | size 59821
4 |
--------------------------------------------------------------------------------
/Example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/Example/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | #
21 | # Gradle start up script for POSIX generated by Gradle.
22 | #
23 | # Important for running:
24 | #
25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
26 | # noncompliant, but you have some other compliant shell such as ksh or
27 | # bash, then to run this script, type that shell name before the whole
28 | # command line, like:
29 | #
30 | # ksh Gradle
31 | #
32 | # Busybox and similar reduced shells will NOT work, because this script
33 | # requires all of these POSIX shell features:
34 | # * functions;
35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37 | # * compound commands having a testable exit status, especially «case»;
38 | # * various built-in commands including «command», «set», and «ulimit».
39 | #
40 | # Important for patching:
41 | #
42 | # (2) This script targets any POSIX shell, so it avoids extensions provided
43 | # by Bash, Ksh, etc; in particular arrays are avoided.
44 | #
45 | # The "traditional" practice of packing multiple parameters into a
46 | # space-separated string is a well documented source of bugs and security
47 | # problems, so this is (mostly) avoided, by progressively accumulating
48 | # options in "$@", and eventually passing that to Java.
49 | #
50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
52 | # see the in-line comments for details.
53 | #
54 | # There are tweaks for specific operating systems such as AIX, CygWin,
55 | # Darwin, MinGW, and NonStop.
56 | #
57 | # (3) This script is generated from the Groovy template
58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59 | # within the Gradle project.
60 | #
61 | # You can find Gradle at https://github.com/gradle/gradle/.
62 | #
63 | ##############################################################################
64 |
65 | # Attempt to set APP_HOME
66 |
67 | # Resolve links: $0 may be a link
68 | app_path=$0
69 |
70 | # Need this for daisy-chained symlinks.
71 | while
72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
73 | [ -h "$app_path" ]
74 | do
75 | ls=$( ls -ld "$app_path" )
76 | link=${ls#*' -> '}
77 | case $link in #(
78 | /*) app_path=$link ;; #(
79 | *) app_path=$APP_HOME$link ;;
80 | esac
81 | done
82 |
83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84 |
85 | APP_NAME="Gradle"
86 | APP_BASE_NAME=${0##*/}
87 |
88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137 |
138 | Please set the JAVA_HOME variable in your environment to match the
139 | location of your Java installation."
140 | fi
141 |
142 | # Increase the maximum file descriptors if we can.
143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144 | case $MAX_FD in #(
145 | max*)
146 | MAX_FD=$( ulimit -H -n ) ||
147 | warn "Could not query maximum file descriptor limit"
148 | esac
149 | case $MAX_FD in #(
150 | '' | soft) :;; #(
151 | *)
152 | ulimit -n "$MAX_FD" ||
153 | warn "Could not set maximum file descriptor limit to $MAX_FD"
154 | esac
155 | fi
156 |
157 | # Collect all arguments for the java command, stacking in reverse order:
158 | # * args from the command line
159 | # * the main class name
160 | # * -classpath
161 | # * -D...appname settings
162 | # * --module-path (only if needed)
163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
164 |
165 | # For Cygwin or MSYS, switch paths to Windows format before running java
166 | if "$cygwin" || "$msys" ; then
167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
169 |
170 | JAVACMD=$( cygpath --unix "$JAVACMD" )
171 |
172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
173 | for arg do
174 | if
175 | case $arg in #(
176 | -*) false ;; # don't mess with options #(
177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
178 | [ -e "$t" ] ;; #(
179 | *) false ;;
180 | esac
181 | then
182 | arg=$( cygpath --path --ignore --mixed "$arg" )
183 | fi
184 | # Roll the args list around exactly as many times as the number of
185 | # args, so each arg winds up back in the position where it started, but
186 | # possibly modified.
187 | #
188 | # NB: a `for` loop captures its iteration list before it begins, so
189 | # changing the positional parameters here affects neither the number of
190 | # iterations, nor the values presented in `arg`.
191 | shift # remove old arg
192 | set -- "$@" "$arg" # push replacement arg
193 | done
194 | fi
195 |
196 | # Collect all arguments for the java command;
197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198 | # shell script including quotes and variable substitutions, so put them in
199 | # double quotes to make sure that they get re-expanded; and
200 | # * put everything else in single quotes, so that it's not re-expanded.
201 |
202 | set -- \
203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
204 | -classpath "$CLASSPATH" \
205 | org.gradle.wrapper.GradleWrapperMain \
206 | "$@"
207 |
208 | # Use "xargs" to parse quoted args.
209 | #
210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
211 | #
212 | # In Bash we could simply go:
213 | #
214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
215 | # set -- "${ARGS[@]}" "$@"
216 | #
217 | # but POSIX shell has neither arrays nor command substitution, so instead we
218 | # post-process each arg (as a line of input to sed) to backslash-escape any
219 | # character that might be a shell metacharacter, then use eval to reverse
220 | # that process (while maintaining the separation between arguments), and wrap
221 | # the whole thing up as a single "set" statement.
222 | #
223 | # This will of course break if any of these variables contains a newline or
224 | # an unmatched quote.
225 | #
226 |
227 | eval "set -- $(
228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
229 | xargs -n1 |
230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
231 | tr '\n' ' '
232 | )" '"$@"'
233 |
234 | exec "$JAVACMD" "$@"
235 |
--------------------------------------------------------------------------------
/Example/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/Example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'Example'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 | includeBuild('../node_modules/react-native-gradle-plugin')
5 |
--------------------------------------------------------------------------------
/Example/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Example",
3 | "displayName": "Example"
4 | }
--------------------------------------------------------------------------------
/Example/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset'],
3 | };
4 |
--------------------------------------------------------------------------------
/Example/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import {AppRegistry} from 'react-native';
6 | import App from './App';
7 | import {name as appName} from './app.json';
8 |
9 | AppRegistry.registerComponent(appName, () => App);
10 |
--------------------------------------------------------------------------------
/Example/ios/.xcode.env:
--------------------------------------------------------------------------------
1 | # This `.xcode.env` file is versioned and is used to source the environment
2 | # used when running script phases inside Xcode.
3 | # To customize your local environment, you can create an `.xcode.env.local`
4 | # file that is not versioned.
5 |
6 | # Set up asdf-vm if present
7 | if [[ -f "$HOME/.asdf/asdf.sh" ]]; then
8 | # shellcheck source=/dev/null
9 | . "$HOME/.asdf/asdf.sh"
10 | elif [[ -x "$(command -v brew)" && -f "$(brew --prefix asdf)/asdf.sh" ]]; then
11 | # shellcheck source=/dev/null
12 | . "$(brew --prefix asdf)/asdf.sh"
13 | fi
14 |
15 | # NODE_BINARY variable contains the PATH to the node executable.
16 | #
17 | # Customize the NODE_BINARY variable here.
18 | # For example, to use nvm with brew, add the following line
19 | # . "$(brew --prefix nvm)/nvm.sh" --no-use
20 | export NODE_BINARY=$(command -v node)
21 |
--------------------------------------------------------------------------------
/Example/ios/Example.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00E356F31AD99517003FC87E /* ExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ExampleTests.m */; };
11 | 0C80B921A6F3F58F76C31292 /* libPods-Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-Example.a */; };
12 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
15 | 7699B88040F8A987B510C191 /* libPods-Example-ExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-Example-ExampleTests.a */; };
16 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXContainerItemProxy section */
20 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
21 | isa = PBXContainerItemProxy;
22 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
23 | proxyType = 1;
24 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
25 | remoteInfo = Example;
26 | };
27 | /* End PBXContainerItemProxy section */
28 |
29 | /* Begin PBXFileReference section */
30 | 00E356EE1AD99517003FC87E /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
31 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
32 | 00E356F21AD99517003FC87E /* ExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleTests.m; sourceTree = ""; };
33 | 13B07F961A680F5B00A75B9A /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
34 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = Example/AppDelegate.h; sourceTree = ""; };
35 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = Example/AppDelegate.mm; sourceTree = ""; };
36 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Example/Images.xcassets; sourceTree = ""; };
37 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Example/Info.plist; sourceTree = ""; };
38 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Example/main.m; sourceTree = ""; };
39 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-Example-ExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-ExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
40 | 3B4392A12AC88292D35C810B /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; };
41 | 5709B34CF0A7D63546082F79 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; };
42 | 5B7EB9410499542E8C5724F5 /* Pods-Example-ExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.debug.xcconfig"; sourceTree = ""; };
43 | 5DCACB8F33CDC322A6C60F78 /* libPods-Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example.a"; sourceTree = BUILT_PRODUCTS_DIR; };
44 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = Example/LaunchScreen.storyboard; sourceTree = ""; };
45 | 89C6BE57DB24E9ADA2F236DE /* Pods-Example-ExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-ExampleTests.release.xcconfig"; path = "Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests.release.xcconfig"; sourceTree = ""; };
46 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
47 | /* End PBXFileReference section */
48 |
49 | /* Begin PBXFrameworksBuildPhase section */
50 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
51 | isa = PBXFrameworksBuildPhase;
52 | buildActionMask = 2147483647;
53 | files = (
54 | 7699B88040F8A987B510C191 /* libPods-Example-ExampleTests.a in Frameworks */,
55 | );
56 | runOnlyForDeploymentPostprocessing = 0;
57 | };
58 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
59 | isa = PBXFrameworksBuildPhase;
60 | buildActionMask = 2147483647;
61 | files = (
62 | 0C80B921A6F3F58F76C31292 /* libPods-Example.a in Frameworks */,
63 | );
64 | runOnlyForDeploymentPostprocessing = 0;
65 | };
66 | /* End PBXFrameworksBuildPhase section */
67 |
68 | /* Begin PBXGroup section */
69 | 00E356EF1AD99517003FC87E /* ExampleTests */ = {
70 | isa = PBXGroup;
71 | children = (
72 | 00E356F21AD99517003FC87E /* ExampleTests.m */,
73 | 00E356F01AD99517003FC87E /* Supporting Files */,
74 | );
75 | path = ExampleTests;
76 | sourceTree = "";
77 | };
78 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 00E356F11AD99517003FC87E /* Info.plist */,
82 | );
83 | name = "Supporting Files";
84 | sourceTree = "";
85 | };
86 | 13B07FAE1A68108700A75B9A /* Example */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
90 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */,
91 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
92 | 13B07FB61A68108700A75B9A /* Info.plist */,
93 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
94 | 13B07FB71A68108700A75B9A /* main.m */,
95 | );
96 | name = Example;
97 | sourceTree = "";
98 | };
99 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
100 | isa = PBXGroup;
101 | children = (
102 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
103 | 5DCACB8F33CDC322A6C60F78 /* libPods-Example.a */,
104 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-Example-ExampleTests.a */,
105 | );
106 | name = Frameworks;
107 | sourceTree = "";
108 | };
109 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
110 | isa = PBXGroup;
111 | children = (
112 | );
113 | name = Libraries;
114 | sourceTree = "";
115 | };
116 | 83CBB9F61A601CBA00E9B192 = {
117 | isa = PBXGroup;
118 | children = (
119 | 13B07FAE1A68108700A75B9A /* Example */,
120 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
121 | 00E356EF1AD99517003FC87E /* ExampleTests */,
122 | 83CBBA001A601CBA00E9B192 /* Products */,
123 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
124 | BBD78D7AC51CEA395F1C20DB /* Pods */,
125 | );
126 | indentWidth = 2;
127 | sourceTree = "";
128 | tabWidth = 2;
129 | usesTabs = 0;
130 | };
131 | 83CBBA001A601CBA00E9B192 /* Products */ = {
132 | isa = PBXGroup;
133 | children = (
134 | 13B07F961A680F5B00A75B9A /* Example.app */,
135 | 00E356EE1AD99517003FC87E /* ExampleTests.xctest */,
136 | );
137 | name = Products;
138 | sourceTree = "";
139 | };
140 | BBD78D7AC51CEA395F1C20DB /* Pods */ = {
141 | isa = PBXGroup;
142 | children = (
143 | 3B4392A12AC88292D35C810B /* Pods-Example.debug.xcconfig */,
144 | 5709B34CF0A7D63546082F79 /* Pods-Example.release.xcconfig */,
145 | 5B7EB9410499542E8C5724F5 /* Pods-Example-ExampleTests.debug.xcconfig */,
146 | 89C6BE57DB24E9ADA2F236DE /* Pods-Example-ExampleTests.release.xcconfig */,
147 | );
148 | path = Pods;
149 | sourceTree = "";
150 | };
151 | /* End PBXGroup section */
152 |
153 | /* Begin PBXNativeTarget section */
154 | 00E356ED1AD99517003FC87E /* ExampleTests */ = {
155 | isa = PBXNativeTarget;
156 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleTests" */;
157 | buildPhases = (
158 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
159 | 00E356EA1AD99517003FC87E /* Sources */,
160 | 00E356EB1AD99517003FC87E /* Frameworks */,
161 | 00E356EC1AD99517003FC87E /* Resources */,
162 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
163 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
164 | );
165 | buildRules = (
166 | );
167 | dependencies = (
168 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
169 | );
170 | name = ExampleTests;
171 | productName = ExampleTests;
172 | productReference = 00E356EE1AD99517003FC87E /* ExampleTests.xctest */;
173 | productType = "com.apple.product-type.bundle.unit-test";
174 | };
175 | 13B07F861A680F5B00A75B9A /* Example */ = {
176 | isa = PBXNativeTarget;
177 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */;
178 | buildPhases = (
179 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
180 | FD10A7F022414F080027D42C /* Start Packager */,
181 | 13B07F871A680F5B00A75B9A /* Sources */,
182 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
183 | 13B07F8E1A680F5B00A75B9A /* Resources */,
184 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
185 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
186 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
187 | );
188 | buildRules = (
189 | );
190 | dependencies = (
191 | );
192 | name = Example;
193 | productName = Example;
194 | productReference = 13B07F961A680F5B00A75B9A /* Example.app */;
195 | productType = "com.apple.product-type.application";
196 | };
197 | /* End PBXNativeTarget section */
198 |
199 | /* Begin PBXProject section */
200 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
201 | isa = PBXProject;
202 | attributes = {
203 | LastUpgradeCheck = 1210;
204 | TargetAttributes = {
205 | 00E356ED1AD99517003FC87E = {
206 | CreatedOnToolsVersion = 6.2;
207 | TestTargetID = 13B07F861A680F5B00A75B9A;
208 | };
209 | 13B07F861A680F5B00A75B9A = {
210 | LastSwiftMigration = 1120;
211 | };
212 | };
213 | };
214 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */;
215 | compatibilityVersion = "Xcode 12.0";
216 | developmentRegion = en;
217 | hasScannedForEncodings = 0;
218 | knownRegions = (
219 | en,
220 | Base,
221 | );
222 | mainGroup = 83CBB9F61A601CBA00E9B192;
223 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
224 | projectDirPath = "";
225 | projectRoot = "";
226 | targets = (
227 | 13B07F861A680F5B00A75B9A /* Example */,
228 | 00E356ED1AD99517003FC87E /* ExampleTests */,
229 | );
230 | };
231 | /* End PBXProject section */
232 |
233 | /* Begin PBXResourcesBuildPhase section */
234 | 00E356EC1AD99517003FC87E /* Resources */ = {
235 | isa = PBXResourcesBuildPhase;
236 | buildActionMask = 2147483647;
237 | files = (
238 | );
239 | runOnlyForDeploymentPostprocessing = 0;
240 | };
241 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
242 | isa = PBXResourcesBuildPhase;
243 | buildActionMask = 2147483647;
244 | files = (
245 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
246 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
247 | );
248 | runOnlyForDeploymentPostprocessing = 0;
249 | };
250 | /* End PBXResourcesBuildPhase section */
251 |
252 | /* Begin PBXShellScriptBuildPhase section */
253 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
254 | isa = PBXShellScriptBuildPhase;
255 | buildActionMask = 2147483647;
256 | files = (
257 | );
258 | inputPaths = (
259 | "$(SRCROOT)/.xcode.env.local",
260 | "$(SRCROOT)/.xcode.env",
261 | );
262 | name = "Bundle React Native code and images";
263 | outputPaths = (
264 | );
265 | runOnlyForDeploymentPostprocessing = 0;
266 | shellPath = /bin/sh;
267 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n/bin/sh -c \"$WITH_ENVIRONMENT ../node_modules/react-native-vector-image/strip_svgs.sh\"\n";
268 | };
269 | 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
270 | isa = PBXShellScriptBuildPhase;
271 | buildActionMask = 2147483647;
272 | files = (
273 | );
274 | inputFileListPaths = (
275 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-input-files.xcfilelist",
276 | );
277 | name = "[CP] Embed Pods Frameworks";
278 | outputFileListPaths = (
279 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks-${CONFIGURATION}-output-files.xcfilelist",
280 | );
281 | runOnlyForDeploymentPostprocessing = 0;
282 | shellPath = /bin/sh;
283 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n";
284 | showEnvVarsInLog = 0;
285 | };
286 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
287 | isa = PBXShellScriptBuildPhase;
288 | buildActionMask = 2147483647;
289 | files = (
290 | );
291 | inputFileListPaths = (
292 | );
293 | inputPaths = (
294 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
295 | "${PODS_ROOT}/Manifest.lock",
296 | );
297 | name = "[CP] Check Pods Manifest.lock";
298 | outputFileListPaths = (
299 | );
300 | outputPaths = (
301 | "$(DERIVED_FILE_DIR)/Pods-Example-ExampleTests-checkManifestLockResult.txt",
302 | );
303 | runOnlyForDeploymentPostprocessing = 0;
304 | shellPath = /bin/sh;
305 | 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";
306 | showEnvVarsInLog = 0;
307 | };
308 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
309 | isa = PBXShellScriptBuildPhase;
310 | buildActionMask = 2147483647;
311 | files = (
312 | );
313 | inputFileListPaths = (
314 | );
315 | inputPaths = (
316 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
317 | "${PODS_ROOT}/Manifest.lock",
318 | );
319 | name = "[CP] Check Pods Manifest.lock";
320 | outputFileListPaths = (
321 | );
322 | outputPaths = (
323 | "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt",
324 | );
325 | runOnlyForDeploymentPostprocessing = 0;
326 | shellPath = /bin/sh;
327 | 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";
328 | showEnvVarsInLog = 0;
329 | };
330 | C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = {
331 | isa = PBXShellScriptBuildPhase;
332 | buildActionMask = 2147483647;
333 | files = (
334 | );
335 | inputFileListPaths = (
336 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
337 | );
338 | name = "[CP] Embed Pods Frameworks";
339 | outputFileListPaths = (
340 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
341 | );
342 | runOnlyForDeploymentPostprocessing = 0;
343 | shellPath = /bin/sh;
344 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-frameworks.sh\"\n";
345 | showEnvVarsInLog = 0;
346 | };
347 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
348 | isa = PBXShellScriptBuildPhase;
349 | buildActionMask = 2147483647;
350 | files = (
351 | );
352 | inputFileListPaths = (
353 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-input-files.xcfilelist",
354 | );
355 | name = "[CP] Copy Pods Resources";
356 | outputFileListPaths = (
357 | "${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources-${CONFIGURATION}-output-files.xcfilelist",
358 | );
359 | runOnlyForDeploymentPostprocessing = 0;
360 | shellPath = /bin/sh;
361 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n";
362 | showEnvVarsInLog = 0;
363 | };
364 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = {
365 | isa = PBXShellScriptBuildPhase;
366 | buildActionMask = 2147483647;
367 | files = (
368 | );
369 | inputFileListPaths = (
370 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist",
371 | );
372 | name = "[CP] Copy Pods Resources";
373 | outputFileListPaths = (
374 | "${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist",
375 | );
376 | runOnlyForDeploymentPostprocessing = 0;
377 | shellPath = /bin/sh;
378 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Example-ExampleTests/Pods-Example-ExampleTests-resources.sh\"\n";
379 | showEnvVarsInLog = 0;
380 | };
381 | FD10A7F022414F080027D42C /* Start Packager */ = {
382 | isa = PBXShellScriptBuildPhase;
383 | buildActionMask = 2147483647;
384 | files = (
385 | );
386 | inputFileListPaths = (
387 | );
388 | inputPaths = (
389 | );
390 | name = "Start Packager";
391 | outputFileListPaths = (
392 | );
393 | outputPaths = (
394 | );
395 | runOnlyForDeploymentPostprocessing = 0;
396 | shellPath = /bin/sh;
397 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
398 | showEnvVarsInLog = 0;
399 | };
400 | /* End PBXShellScriptBuildPhase section */
401 |
402 | /* Begin PBXSourcesBuildPhase section */
403 | 00E356EA1AD99517003FC87E /* Sources */ = {
404 | isa = PBXSourcesBuildPhase;
405 | buildActionMask = 2147483647;
406 | files = (
407 | 00E356F31AD99517003FC87E /* ExampleTests.m in Sources */,
408 | );
409 | runOnlyForDeploymentPostprocessing = 0;
410 | };
411 | 13B07F871A680F5B00A75B9A /* Sources */ = {
412 | isa = PBXSourcesBuildPhase;
413 | buildActionMask = 2147483647;
414 | files = (
415 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
416 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
417 | );
418 | runOnlyForDeploymentPostprocessing = 0;
419 | };
420 | /* End PBXSourcesBuildPhase section */
421 |
422 | /* Begin PBXTargetDependency section */
423 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
424 | isa = PBXTargetDependency;
425 | target = 13B07F861A680F5B00A75B9A /* Example */;
426 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
427 | };
428 | /* End PBXTargetDependency section */
429 |
430 | /* Begin XCBuildConfiguration section */
431 | 00E356F61AD99517003FC87E /* Debug */ = {
432 | isa = XCBuildConfiguration;
433 | baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-Example-ExampleTests.debug.xcconfig */;
434 | buildSettings = {
435 | BUNDLE_LOADER = "$(TEST_HOST)";
436 | GCC_PREPROCESSOR_DEFINITIONS = (
437 | "DEBUG=1",
438 | "$(inherited)",
439 | );
440 | INFOPLIST_FILE = ExampleTests/Info.plist;
441 | IPHONEOS_DEPLOYMENT_TARGET = 12.4;
442 | LD_RUNPATH_SEARCH_PATHS = (
443 | "$(inherited)",
444 | "@executable_path/Frameworks",
445 | "@loader_path/Frameworks",
446 | );
447 | OTHER_LDFLAGS = (
448 | "-ObjC",
449 | "-lc++",
450 | "$(inherited)",
451 | );
452 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
453 | PRODUCT_NAME = "$(TARGET_NAME)";
454 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
455 | };
456 | name = Debug;
457 | };
458 | 00E356F71AD99517003FC87E /* Release */ = {
459 | isa = XCBuildConfiguration;
460 | baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-Example-ExampleTests.release.xcconfig */;
461 | buildSettings = {
462 | BUNDLE_LOADER = "$(TEST_HOST)";
463 | COPY_PHASE_STRIP = NO;
464 | INFOPLIST_FILE = ExampleTests/Info.plist;
465 | IPHONEOS_DEPLOYMENT_TARGET = 12.4;
466 | LD_RUNPATH_SEARCH_PATHS = (
467 | "$(inherited)",
468 | "@executable_path/Frameworks",
469 | "@loader_path/Frameworks",
470 | );
471 | OTHER_LDFLAGS = (
472 | "-ObjC",
473 | "-lc++",
474 | "$(inherited)",
475 | );
476 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
477 | PRODUCT_NAME = "$(TARGET_NAME)";
478 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
479 | };
480 | name = Release;
481 | };
482 | 13B07F941A680F5B00A75B9A /* Debug */ = {
483 | isa = XCBuildConfiguration;
484 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-Example.debug.xcconfig */;
485 | buildSettings = {
486 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
487 | CLANG_ENABLE_MODULES = YES;
488 | CURRENT_PROJECT_VERSION = 1;
489 | ENABLE_BITCODE = NO;
490 | INFOPLIST_FILE = Example/Info.plist;
491 | LD_RUNPATH_SEARCH_PATHS = (
492 | "$(inherited)",
493 | "@executable_path/Frameworks",
494 | );
495 | MARKETING_VERSION = 1.0;
496 | OTHER_LDFLAGS = (
497 | "$(inherited)",
498 | "-ObjC",
499 | "-lc++",
500 | );
501 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
502 | PRODUCT_NAME = Example;
503 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
504 | SWIFT_VERSION = 5.0;
505 | VERSIONING_SYSTEM = "apple-generic";
506 | };
507 | name = Debug;
508 | };
509 | 13B07F951A680F5B00A75B9A /* Release */ = {
510 | isa = XCBuildConfiguration;
511 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-Example.release.xcconfig */;
512 | buildSettings = {
513 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
514 | CLANG_ENABLE_MODULES = YES;
515 | CURRENT_PROJECT_VERSION = 1;
516 | INFOPLIST_FILE = Example/Info.plist;
517 | LD_RUNPATH_SEARCH_PATHS = (
518 | "$(inherited)",
519 | "@executable_path/Frameworks",
520 | );
521 | MARKETING_VERSION = 1.0;
522 | OTHER_LDFLAGS = (
523 | "$(inherited)",
524 | "-ObjC",
525 | "-lc++",
526 | );
527 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
528 | PRODUCT_NAME = Example;
529 | SWIFT_VERSION = 5.0;
530 | VERSIONING_SYSTEM = "apple-generic";
531 | };
532 | name = Release;
533 | };
534 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
535 | isa = XCBuildConfiguration;
536 | buildSettings = {
537 | ALWAYS_SEARCH_USER_PATHS = NO;
538 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
539 | CLANG_CXX_LANGUAGE_STANDARD = "c++17";
540 | CLANG_CXX_LIBRARY = "libc++";
541 | CLANG_ENABLE_MODULES = YES;
542 | CLANG_ENABLE_OBJC_ARC = YES;
543 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
544 | CLANG_WARN_BOOL_CONVERSION = YES;
545 | CLANG_WARN_COMMA = YES;
546 | CLANG_WARN_CONSTANT_CONVERSION = YES;
547 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
548 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
549 | CLANG_WARN_EMPTY_BODY = YES;
550 | CLANG_WARN_ENUM_CONVERSION = YES;
551 | CLANG_WARN_INFINITE_RECURSION = YES;
552 | CLANG_WARN_INT_CONVERSION = YES;
553 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
554 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
555 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
556 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
557 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
558 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
559 | CLANG_WARN_STRICT_PROTOTYPES = YES;
560 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
561 | CLANG_WARN_UNREACHABLE_CODE = YES;
562 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
563 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
564 | COPY_PHASE_STRIP = NO;
565 | ENABLE_STRICT_OBJC_MSGSEND = YES;
566 | ENABLE_TESTABILITY = YES;
567 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
568 | GCC_C_LANGUAGE_STANDARD = gnu99;
569 | GCC_DYNAMIC_NO_PIC = NO;
570 | GCC_NO_COMMON_BLOCKS = YES;
571 | GCC_OPTIMIZATION_LEVEL = 0;
572 | GCC_PREPROCESSOR_DEFINITIONS = (
573 | "DEBUG=1",
574 | "$(inherited)",
575 | );
576 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
577 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
578 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
579 | GCC_WARN_UNDECLARED_SELECTOR = YES;
580 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
581 | GCC_WARN_UNUSED_FUNCTION = YES;
582 | GCC_WARN_UNUSED_VARIABLE = YES;
583 | IPHONEOS_DEPLOYMENT_TARGET = 12.4;
584 | LD_RUNPATH_SEARCH_PATHS = (
585 | /usr/lib/swift,
586 | "$(inherited)",
587 | );
588 | LIBRARY_SEARCH_PATHS = (
589 | "\"$(SDKROOT)/usr/lib/swift\"",
590 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
591 | "\"$(inherited)\"",
592 | );
593 | MTL_ENABLE_DEBUG_INFO = YES;
594 | ONLY_ACTIVE_ARCH = YES;
595 | OTHER_CPLUSPLUSFLAGS = (
596 | "$(OTHER_CFLAGS)",
597 | "-DFOLLY_NO_CONFIG",
598 | "-DFOLLY_MOBILE=1",
599 | "-DFOLLY_USE_LIBCPP=1",
600 | );
601 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
602 | SDKROOT = iphoneos;
603 | };
604 | name = Debug;
605 | };
606 | 83CBBA211A601CBA00E9B192 /* Release */ = {
607 | isa = XCBuildConfiguration;
608 | buildSettings = {
609 | ALWAYS_SEARCH_USER_PATHS = NO;
610 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
611 | CLANG_CXX_LANGUAGE_STANDARD = "c++17";
612 | CLANG_CXX_LIBRARY = "libc++";
613 | CLANG_ENABLE_MODULES = YES;
614 | CLANG_ENABLE_OBJC_ARC = YES;
615 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
616 | CLANG_WARN_BOOL_CONVERSION = YES;
617 | CLANG_WARN_COMMA = YES;
618 | CLANG_WARN_CONSTANT_CONVERSION = YES;
619 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
620 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
621 | CLANG_WARN_EMPTY_BODY = YES;
622 | CLANG_WARN_ENUM_CONVERSION = YES;
623 | CLANG_WARN_INFINITE_RECURSION = YES;
624 | CLANG_WARN_INT_CONVERSION = YES;
625 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
626 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
627 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
628 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
629 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
630 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
631 | CLANG_WARN_STRICT_PROTOTYPES = YES;
632 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
633 | CLANG_WARN_UNREACHABLE_CODE = YES;
634 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
635 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
636 | COPY_PHASE_STRIP = YES;
637 | ENABLE_NS_ASSERTIONS = NO;
638 | ENABLE_STRICT_OBJC_MSGSEND = YES;
639 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
640 | GCC_C_LANGUAGE_STANDARD = gnu99;
641 | GCC_NO_COMMON_BLOCKS = YES;
642 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
643 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
644 | GCC_WARN_UNDECLARED_SELECTOR = YES;
645 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
646 | GCC_WARN_UNUSED_FUNCTION = YES;
647 | GCC_WARN_UNUSED_VARIABLE = YES;
648 | IPHONEOS_DEPLOYMENT_TARGET = 12.4;
649 | LD_RUNPATH_SEARCH_PATHS = (
650 | /usr/lib/swift,
651 | "$(inherited)",
652 | );
653 | LIBRARY_SEARCH_PATHS = (
654 | "\"$(SDKROOT)/usr/lib/swift\"",
655 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
656 | "\"$(inherited)\"",
657 | );
658 | MTL_ENABLE_DEBUG_INFO = NO;
659 | OTHER_CPLUSPLUSFLAGS = (
660 | "$(OTHER_CFLAGS)",
661 | "-DFOLLY_NO_CONFIG",
662 | "-DFOLLY_MOBILE=1",
663 | "-DFOLLY_USE_LIBCPP=1",
664 | );
665 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
666 | SDKROOT = iphoneos;
667 | VALIDATE_PRODUCT = YES;
668 | };
669 | name = Release;
670 | };
671 | /* End XCBuildConfiguration section */
672 |
673 | /* Begin XCConfigurationList section */
674 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleTests" */ = {
675 | isa = XCConfigurationList;
676 | buildConfigurations = (
677 | 00E356F61AD99517003FC87E /* Debug */,
678 | 00E356F71AD99517003FC87E /* Release */,
679 | );
680 | defaultConfigurationIsVisible = 0;
681 | defaultConfigurationName = Release;
682 | };
683 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "Example" */ = {
684 | isa = XCConfigurationList;
685 | buildConfigurations = (
686 | 13B07F941A680F5B00A75B9A /* Debug */,
687 | 13B07F951A680F5B00A75B9A /* Release */,
688 | );
689 | defaultConfigurationIsVisible = 0;
690 | defaultConfigurationName = Release;
691 | };
692 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "Example" */ = {
693 | isa = XCConfigurationList;
694 | buildConfigurations = (
695 | 83CBBA201A601CBA00E9B192 /* Debug */,
696 | 83CBBA211A601CBA00E9B192 /* Release */,
697 | );
698 | defaultConfigurationIsVisible = 0;
699 | defaultConfigurationName = Release;
700 | };
701 | /* End XCConfigurationList section */
702 | };
703 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
704 | }
705 |
--------------------------------------------------------------------------------
/Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
55 |
61 |
62 |
63 |
64 |
70 |
72 |
78 |
79 |
80 |
81 |
83 |
84 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/Example/ios/Example.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/ios/Example/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : RCTAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/Example/ios/Example/AppDelegate.mm:
--------------------------------------------------------------------------------
1 | #import "AppDelegate.h"
2 |
3 | #import
4 |
5 | @implementation AppDelegate
6 |
7 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
8 | {
9 | self.moduleName = @"Example";
10 | // You can add your custom initial props in the dictionary below.
11 | // They will be passed down to the ViewController used by React Native.
12 | self.initialProps = @{};
13 |
14 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
15 | }
16 |
17 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18 | {
19 | #if DEBUG
20 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
21 | #else
22 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
23 | #endif
24 | }
25 |
26 | /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
27 | ///
28 | /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
29 | /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
30 | /// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
31 | - (BOOL)concurrentRootEnabled
32 | {
33 | return true;
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "scale" : "2x",
6 | "size" : "20x20"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "scale" : "3x",
11 | "size" : "20x20"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "scale" : "2x",
16 | "size" : "29x29"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "scale" : "3x",
21 | "size" : "29x29"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "scale" : "2x",
26 | "size" : "40x40"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "scale" : "3x",
31 | "size" : "40x40"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "scale" : "2x",
36 | "size" : "60x60"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "scale" : "3x",
41 | "size" : "60x60"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "scale" : "1x",
46 | "size" : "1024x1024"
47 | }
48 | ],
49 | "info" : {
50 | "author" : "xcode",
51 | "version" : 1
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Example/ios/Example/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/ios/Example/Images.xcassets/react_svg_d0ad45.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "filename": "light.pdf",
5 | "idiom": "universal"
6 | },
7 | {
8 | "appearances": [
9 | {
10 | "appearance": "luminosity",
11 | "value": "dark"
12 | }
13 | ],
14 | "filename": "dark.pdf",
15 | "idiom": "universal"
16 | }
17 | ],
18 | "info": {
19 | "author": "xcode",
20 | "version": 1
21 | },
22 | "properties": {
23 | "preserves-vector-representation": true
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Example/ios/Example/Images.xcassets/react_svg_d0ad45.imageset/dark.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/ios/Example/Images.xcassets/react_svg_d0ad45.imageset/dark.pdf
--------------------------------------------------------------------------------
/Example/ios/Example/Images.xcassets/react_svg_d0ad45.imageset/light.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oblador/react-native-vector-image/db0a8dd9828fbbfdbcdfdf283924bd32186244aa/Example/ios/Example/Images.xcassets/react_svg_d0ad45.imageset/light.pdf
--------------------------------------------------------------------------------
/Example/ios/Example/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Example
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(MARKETING_VERSION)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(CURRENT_PROJECT_VERSION)
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSExceptionDomains
30 |
31 | localhost
32 |
33 | NSExceptionAllowsInsecureHTTPLoads
34 |
35 |
36 |
37 |
38 | NSLocationWhenInUseUsageDescription
39 |
40 | UILaunchStoryboardName
41 | LaunchScreen
42 | UIRequiredDeviceCapabilities
43 |
44 | armv7
45 |
46 | UISupportedInterfaceOrientations
47 |
48 | UIInterfaceOrientationPortrait
49 | UIInterfaceOrientationLandscapeLeft
50 | UIInterfaceOrientationLandscapeRight
51 |
52 | UIViewControllerBasedStatusBarAppearance
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/Example/ios/Example/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/Example/ios/Example/main.m:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char *argv[])
6 | {
7 | @autoreleasepool {
8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Example/ios/ExampleTests/ExampleTests.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | #import
5 | #import
6 |
7 | #define TIMEOUT_SECONDS 600
8 | #define TEXT_TO_LOOK_FOR @"Welcome to React"
9 |
10 | @interface ExampleTests : XCTestCase
11 |
12 | @end
13 |
14 | @implementation ExampleTests
15 |
16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test
17 | {
18 | if (test(view)) {
19 | return YES;
20 | }
21 | for (UIView *subview in [view subviews]) {
22 | if ([self findSubviewInView:subview matching:test]) {
23 | return YES;
24 | }
25 | }
26 | return NO;
27 | }
28 |
29 | - (void)testRendersWelcomeScreen
30 | {
31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
33 | BOOL foundElement = NO;
34 |
35 | __block NSString *redboxError = nil;
36 | #ifdef DEBUG
37 | RCTSetLogFunction(
38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
39 | if (level >= RCTLogLevelError) {
40 | redboxError = message;
41 | }
42 | });
43 | #endif
44 |
45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
48 |
49 | foundElement = [self findSubviewInView:vc.view
50 | matching:^BOOL(UIView *view) {
51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
52 | return YES;
53 | }
54 | return NO;
55 | }];
56 | }
57 |
58 | #ifdef DEBUG
59 | RCTSetLogFunction(RCTDefaultLogFunction);
60 | #endif
61 |
62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
64 | }
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Example/ios/ExampleTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Example/ios/Podfile:
--------------------------------------------------------------------------------
1 | require_relative '../node_modules/react-native/scripts/react_native_pods'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | platform :ios, min_ios_version_supported
5 | prepare_react_native_project!
6 |
7 | # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
8 | # because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
9 | #
10 | # To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
11 | # ```js
12 | # module.exports = {
13 | # dependencies: {
14 | # ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
15 | # ```
16 | flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
17 |
18 | linkage = ENV['USE_FRAMEWORKS']
19 | if linkage != nil
20 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
21 | use_frameworks! :linkage => linkage.to_sym
22 | end
23 |
24 | target 'Example' do
25 | config = use_native_modules!
26 |
27 | # Flags change depending on the env values.
28 | flags = get_default_flags()
29 |
30 | use_react_native!(
31 | :path => config[:reactNativePath],
32 | # Hermes is now enabled by default. Disable by setting this flag to false.
33 | # Upcoming versions of React Native may rely on get_default_flags(), but
34 | # we make it explicit here to aid in the React Native upgrade process.
35 | :hermes_enabled => flags[:hermes_enabled],
36 | :fabric_enabled => flags[:fabric_enabled],
37 | # Enables Flipper.
38 | #
39 | # Note that if you have use_frameworks! enabled, Flipper will not work and
40 | # you should disable the next line.
41 | :flipper_configuration => flipper_config,
42 | # An absolute path to your application root.
43 | :app_path => "#{Pod::Config.instance.installation_root}/.."
44 | )
45 |
46 | target 'ExampleTests' do
47 | inherit! :complete
48 | # Pods for testing
49 | end
50 |
51 | post_install do |installer|
52 | react_native_post_install(
53 | installer,
54 | # Set `mac_catalyst_enabled` to `true` in order to apply patches
55 | # necessary for Mac Catalyst builds
56 | :mac_catalyst_enabled => false
57 | )
58 | __apply_Xcode_12_5_M1_post_install_workaround(installer)
59 | end
60 | end
61 |
--------------------------------------------------------------------------------
/Example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - boost (1.76.0)
3 | - CocoaAsyncSocket (7.6.5)
4 | - DoubleConversion (1.1.6)
5 | - FBLazyVector (0.71.4)
6 | - FBReactNativeSpec (0.71.4):
7 | - RCT-Folly (= 2021.07.22.00)
8 | - RCTRequired (= 0.71.4)
9 | - RCTTypeSafety (= 0.71.4)
10 | - React-Core (= 0.71.4)
11 | - React-jsi (= 0.71.4)
12 | - ReactCommon/turbomodule/core (= 0.71.4)
13 | - Flipper (0.125.0):
14 | - Flipper-Folly (~> 2.6)
15 | - Flipper-RSocket (~> 1.4)
16 | - Flipper-Boost-iOSX (1.76.0.1.11)
17 | - Flipper-DoubleConversion (3.2.0.1)
18 | - Flipper-Fmt (7.1.7)
19 | - Flipper-Folly (2.6.10):
20 | - Flipper-Boost-iOSX
21 | - Flipper-DoubleConversion
22 | - Flipper-Fmt (= 7.1.7)
23 | - Flipper-Glog
24 | - libevent (~> 2.1.12)
25 | - OpenSSL-Universal (= 1.1.1100)
26 | - Flipper-Glog (0.5.0.5)
27 | - Flipper-PeerTalk (0.0.4)
28 | - Flipper-RSocket (1.4.3):
29 | - Flipper-Folly (~> 2.6)
30 | - FlipperKit (0.125.0):
31 | - FlipperKit/Core (= 0.125.0)
32 | - FlipperKit/Core (0.125.0):
33 | - Flipper (~> 0.125.0)
34 | - FlipperKit/CppBridge
35 | - FlipperKit/FBCxxFollyDynamicConvert
36 | - FlipperKit/FBDefines
37 | - FlipperKit/FKPortForwarding
38 | - SocketRocket (~> 0.6.0)
39 | - FlipperKit/CppBridge (0.125.0):
40 | - Flipper (~> 0.125.0)
41 | - FlipperKit/FBCxxFollyDynamicConvert (0.125.0):
42 | - Flipper-Folly (~> 2.6)
43 | - FlipperKit/FBDefines (0.125.0)
44 | - FlipperKit/FKPortForwarding (0.125.0):
45 | - CocoaAsyncSocket (~> 7.6)
46 | - Flipper-PeerTalk (~> 0.0.4)
47 | - FlipperKit/FlipperKitHighlightOverlay (0.125.0)
48 | - FlipperKit/FlipperKitLayoutHelpers (0.125.0):
49 | - FlipperKit/Core
50 | - FlipperKit/FlipperKitHighlightOverlay
51 | - FlipperKit/FlipperKitLayoutTextSearchable
52 | - FlipperKit/FlipperKitLayoutIOSDescriptors (0.125.0):
53 | - FlipperKit/Core
54 | - FlipperKit/FlipperKitHighlightOverlay
55 | - FlipperKit/FlipperKitLayoutHelpers
56 | - YogaKit (~> 1.18)
57 | - FlipperKit/FlipperKitLayoutPlugin (0.125.0):
58 | - FlipperKit/Core
59 | - FlipperKit/FlipperKitHighlightOverlay
60 | - FlipperKit/FlipperKitLayoutHelpers
61 | - FlipperKit/FlipperKitLayoutIOSDescriptors
62 | - FlipperKit/FlipperKitLayoutTextSearchable
63 | - YogaKit (~> 1.18)
64 | - FlipperKit/FlipperKitLayoutTextSearchable (0.125.0)
65 | - FlipperKit/FlipperKitNetworkPlugin (0.125.0):
66 | - FlipperKit/Core
67 | - FlipperKit/FlipperKitReactPlugin (0.125.0):
68 | - FlipperKit/Core
69 | - FlipperKit/FlipperKitUserDefaultsPlugin (0.125.0):
70 | - FlipperKit/Core
71 | - FlipperKit/SKIOSNetworkPlugin (0.125.0):
72 | - FlipperKit/Core
73 | - FlipperKit/FlipperKitNetworkPlugin
74 | - fmt (6.2.1)
75 | - glog (0.3.5)
76 | - hermes-engine (0.71.4):
77 | - hermes-engine/Pre-built (= 0.71.4)
78 | - hermes-engine/Pre-built (0.71.4)
79 | - libevent (2.1.12)
80 | - OpenSSL-Universal (1.1.1100)
81 | - RCT-Folly (2021.07.22.00):
82 | - boost
83 | - DoubleConversion
84 | - fmt (~> 6.2.1)
85 | - glog
86 | - RCT-Folly/Default (= 2021.07.22.00)
87 | - RCT-Folly/Default (2021.07.22.00):
88 | - boost
89 | - DoubleConversion
90 | - fmt (~> 6.2.1)
91 | - glog
92 | - RCT-Folly/Futures (2021.07.22.00):
93 | - boost
94 | - DoubleConversion
95 | - fmt (~> 6.2.1)
96 | - glog
97 | - libevent
98 | - RCTRequired (0.71.4)
99 | - RCTTypeSafety (0.71.4):
100 | - FBLazyVector (= 0.71.4)
101 | - RCTRequired (= 0.71.4)
102 | - React-Core (= 0.71.4)
103 | - React (0.71.4):
104 | - React-Core (= 0.71.4)
105 | - React-Core/DevSupport (= 0.71.4)
106 | - React-Core/RCTWebSocket (= 0.71.4)
107 | - React-RCTActionSheet (= 0.71.4)
108 | - React-RCTAnimation (= 0.71.4)
109 | - React-RCTBlob (= 0.71.4)
110 | - React-RCTImage (= 0.71.4)
111 | - React-RCTLinking (= 0.71.4)
112 | - React-RCTNetwork (= 0.71.4)
113 | - React-RCTSettings (= 0.71.4)
114 | - React-RCTText (= 0.71.4)
115 | - React-RCTVibration (= 0.71.4)
116 | - React-callinvoker (0.71.4)
117 | - React-Codegen (0.71.4):
118 | - FBReactNativeSpec
119 | - hermes-engine
120 | - RCT-Folly
121 | - RCTRequired
122 | - RCTTypeSafety
123 | - React-Core
124 | - React-jsi
125 | - React-jsiexecutor
126 | - ReactCommon/turbomodule/bridging
127 | - ReactCommon/turbomodule/core
128 | - React-Core (0.71.4):
129 | - glog
130 | - hermes-engine
131 | - RCT-Folly (= 2021.07.22.00)
132 | - React-Core/Default (= 0.71.4)
133 | - React-cxxreact (= 0.71.4)
134 | - React-hermes
135 | - React-jsi (= 0.71.4)
136 | - React-jsiexecutor (= 0.71.4)
137 | - React-perflogger (= 0.71.4)
138 | - Yoga
139 | - React-Core/CoreModulesHeaders (0.71.4):
140 | - glog
141 | - hermes-engine
142 | - RCT-Folly (= 2021.07.22.00)
143 | - React-Core/Default
144 | - React-cxxreact (= 0.71.4)
145 | - React-hermes
146 | - React-jsi (= 0.71.4)
147 | - React-jsiexecutor (= 0.71.4)
148 | - React-perflogger (= 0.71.4)
149 | - Yoga
150 | - React-Core/Default (0.71.4):
151 | - glog
152 | - hermes-engine
153 | - RCT-Folly (= 2021.07.22.00)
154 | - React-cxxreact (= 0.71.4)
155 | - React-hermes
156 | - React-jsi (= 0.71.4)
157 | - React-jsiexecutor (= 0.71.4)
158 | - React-perflogger (= 0.71.4)
159 | - Yoga
160 | - React-Core/DevSupport (0.71.4):
161 | - glog
162 | - hermes-engine
163 | - RCT-Folly (= 2021.07.22.00)
164 | - React-Core/Default (= 0.71.4)
165 | - React-Core/RCTWebSocket (= 0.71.4)
166 | - React-cxxreact (= 0.71.4)
167 | - React-hermes
168 | - React-jsi (= 0.71.4)
169 | - React-jsiexecutor (= 0.71.4)
170 | - React-jsinspector (= 0.71.4)
171 | - React-perflogger (= 0.71.4)
172 | - Yoga
173 | - React-Core/RCTActionSheetHeaders (0.71.4):
174 | - glog
175 | - hermes-engine
176 | - RCT-Folly (= 2021.07.22.00)
177 | - React-Core/Default
178 | - React-cxxreact (= 0.71.4)
179 | - React-hermes
180 | - React-jsi (= 0.71.4)
181 | - React-jsiexecutor (= 0.71.4)
182 | - React-perflogger (= 0.71.4)
183 | - Yoga
184 | - React-Core/RCTAnimationHeaders (0.71.4):
185 | - glog
186 | - hermes-engine
187 | - RCT-Folly (= 2021.07.22.00)
188 | - React-Core/Default
189 | - React-cxxreact (= 0.71.4)
190 | - React-hermes
191 | - React-jsi (= 0.71.4)
192 | - React-jsiexecutor (= 0.71.4)
193 | - React-perflogger (= 0.71.4)
194 | - Yoga
195 | - React-Core/RCTBlobHeaders (0.71.4):
196 | - glog
197 | - hermes-engine
198 | - RCT-Folly (= 2021.07.22.00)
199 | - React-Core/Default
200 | - React-cxxreact (= 0.71.4)
201 | - React-hermes
202 | - React-jsi (= 0.71.4)
203 | - React-jsiexecutor (= 0.71.4)
204 | - React-perflogger (= 0.71.4)
205 | - Yoga
206 | - React-Core/RCTImageHeaders (0.71.4):
207 | - glog
208 | - hermes-engine
209 | - RCT-Folly (= 2021.07.22.00)
210 | - React-Core/Default
211 | - React-cxxreact (= 0.71.4)
212 | - React-hermes
213 | - React-jsi (= 0.71.4)
214 | - React-jsiexecutor (= 0.71.4)
215 | - React-perflogger (= 0.71.4)
216 | - Yoga
217 | - React-Core/RCTLinkingHeaders (0.71.4):
218 | - glog
219 | - hermes-engine
220 | - RCT-Folly (= 2021.07.22.00)
221 | - React-Core/Default
222 | - React-cxxreact (= 0.71.4)
223 | - React-hermes
224 | - React-jsi (= 0.71.4)
225 | - React-jsiexecutor (= 0.71.4)
226 | - React-perflogger (= 0.71.4)
227 | - Yoga
228 | - React-Core/RCTNetworkHeaders (0.71.4):
229 | - glog
230 | - hermes-engine
231 | - RCT-Folly (= 2021.07.22.00)
232 | - React-Core/Default
233 | - React-cxxreact (= 0.71.4)
234 | - React-hermes
235 | - React-jsi (= 0.71.4)
236 | - React-jsiexecutor (= 0.71.4)
237 | - React-perflogger (= 0.71.4)
238 | - Yoga
239 | - React-Core/RCTSettingsHeaders (0.71.4):
240 | - glog
241 | - hermes-engine
242 | - RCT-Folly (= 2021.07.22.00)
243 | - React-Core/Default
244 | - React-cxxreact (= 0.71.4)
245 | - React-hermes
246 | - React-jsi (= 0.71.4)
247 | - React-jsiexecutor (= 0.71.4)
248 | - React-perflogger (= 0.71.4)
249 | - Yoga
250 | - React-Core/RCTTextHeaders (0.71.4):
251 | - glog
252 | - hermes-engine
253 | - RCT-Folly (= 2021.07.22.00)
254 | - React-Core/Default
255 | - React-cxxreact (= 0.71.4)
256 | - React-hermes
257 | - React-jsi (= 0.71.4)
258 | - React-jsiexecutor (= 0.71.4)
259 | - React-perflogger (= 0.71.4)
260 | - Yoga
261 | - React-Core/RCTVibrationHeaders (0.71.4):
262 | - glog
263 | - hermes-engine
264 | - RCT-Folly (= 2021.07.22.00)
265 | - React-Core/Default
266 | - React-cxxreact (= 0.71.4)
267 | - React-hermes
268 | - React-jsi (= 0.71.4)
269 | - React-jsiexecutor (= 0.71.4)
270 | - React-perflogger (= 0.71.4)
271 | - Yoga
272 | - React-Core/RCTWebSocket (0.71.4):
273 | - glog
274 | - hermes-engine
275 | - RCT-Folly (= 2021.07.22.00)
276 | - React-Core/Default (= 0.71.4)
277 | - React-cxxreact (= 0.71.4)
278 | - React-hermes
279 | - React-jsi (= 0.71.4)
280 | - React-jsiexecutor (= 0.71.4)
281 | - React-perflogger (= 0.71.4)
282 | - Yoga
283 | - React-CoreModules (0.71.4):
284 | - RCT-Folly (= 2021.07.22.00)
285 | - RCTTypeSafety (= 0.71.4)
286 | - React-Codegen (= 0.71.4)
287 | - React-Core/CoreModulesHeaders (= 0.71.4)
288 | - React-jsi (= 0.71.4)
289 | - React-RCTBlob
290 | - React-RCTImage (= 0.71.4)
291 | - ReactCommon/turbomodule/core (= 0.71.4)
292 | - React-cxxreact (0.71.4):
293 | - boost (= 1.76.0)
294 | - DoubleConversion
295 | - glog
296 | - hermes-engine
297 | - RCT-Folly (= 2021.07.22.00)
298 | - React-callinvoker (= 0.71.4)
299 | - React-jsi (= 0.71.4)
300 | - React-jsinspector (= 0.71.4)
301 | - React-logger (= 0.71.4)
302 | - React-perflogger (= 0.71.4)
303 | - React-runtimeexecutor (= 0.71.4)
304 | - React-hermes (0.71.4):
305 | - DoubleConversion
306 | - glog
307 | - hermes-engine
308 | - RCT-Folly (= 2021.07.22.00)
309 | - RCT-Folly/Futures (= 2021.07.22.00)
310 | - React-cxxreact (= 0.71.4)
311 | - React-jsi
312 | - React-jsiexecutor (= 0.71.4)
313 | - React-jsinspector (= 0.71.4)
314 | - React-perflogger (= 0.71.4)
315 | - React-jsi (0.71.4):
316 | - boost (= 1.76.0)
317 | - DoubleConversion
318 | - glog
319 | - hermes-engine
320 | - RCT-Folly (= 2021.07.22.00)
321 | - React-jsiexecutor (0.71.4):
322 | - DoubleConversion
323 | - glog
324 | - hermes-engine
325 | - RCT-Folly (= 2021.07.22.00)
326 | - React-cxxreact (= 0.71.4)
327 | - React-jsi (= 0.71.4)
328 | - React-perflogger (= 0.71.4)
329 | - React-jsinspector (0.71.4)
330 | - React-logger (0.71.4):
331 | - glog
332 | - React-perflogger (0.71.4)
333 | - React-RCTActionSheet (0.71.4):
334 | - React-Core/RCTActionSheetHeaders (= 0.71.4)
335 | - React-RCTAnimation (0.71.4):
336 | - RCT-Folly (= 2021.07.22.00)
337 | - RCTTypeSafety (= 0.71.4)
338 | - React-Codegen (= 0.71.4)
339 | - React-Core/RCTAnimationHeaders (= 0.71.4)
340 | - React-jsi (= 0.71.4)
341 | - ReactCommon/turbomodule/core (= 0.71.4)
342 | - React-RCTAppDelegate (0.71.4):
343 | - RCT-Folly
344 | - RCTRequired
345 | - RCTTypeSafety
346 | - React-Core
347 | - ReactCommon/turbomodule/core
348 | - React-RCTBlob (0.71.4):
349 | - hermes-engine
350 | - RCT-Folly (= 2021.07.22.00)
351 | - React-Codegen (= 0.71.4)
352 | - React-Core/RCTBlobHeaders (= 0.71.4)
353 | - React-Core/RCTWebSocket (= 0.71.4)
354 | - React-jsi (= 0.71.4)
355 | - React-RCTNetwork (= 0.71.4)
356 | - ReactCommon/turbomodule/core (= 0.71.4)
357 | - React-RCTImage (0.71.4):
358 | - RCT-Folly (= 2021.07.22.00)
359 | - RCTTypeSafety (= 0.71.4)
360 | - React-Codegen (= 0.71.4)
361 | - React-Core/RCTImageHeaders (= 0.71.4)
362 | - React-jsi (= 0.71.4)
363 | - React-RCTNetwork (= 0.71.4)
364 | - ReactCommon/turbomodule/core (= 0.71.4)
365 | - React-RCTLinking (0.71.4):
366 | - React-Codegen (= 0.71.4)
367 | - React-Core/RCTLinkingHeaders (= 0.71.4)
368 | - React-jsi (= 0.71.4)
369 | - ReactCommon/turbomodule/core (= 0.71.4)
370 | - React-RCTNetwork (0.71.4):
371 | - RCT-Folly (= 2021.07.22.00)
372 | - RCTTypeSafety (= 0.71.4)
373 | - React-Codegen (= 0.71.4)
374 | - React-Core/RCTNetworkHeaders (= 0.71.4)
375 | - React-jsi (= 0.71.4)
376 | - ReactCommon/turbomodule/core (= 0.71.4)
377 | - React-RCTSettings (0.71.4):
378 | - RCT-Folly (= 2021.07.22.00)
379 | - RCTTypeSafety (= 0.71.4)
380 | - React-Codegen (= 0.71.4)
381 | - React-Core/RCTSettingsHeaders (= 0.71.4)
382 | - React-jsi (= 0.71.4)
383 | - ReactCommon/turbomodule/core (= 0.71.4)
384 | - React-RCTText (0.71.4):
385 | - React-Core/RCTTextHeaders (= 0.71.4)
386 | - React-RCTVibration (0.71.4):
387 | - RCT-Folly (= 2021.07.22.00)
388 | - React-Codegen (= 0.71.4)
389 | - React-Core/RCTVibrationHeaders (= 0.71.4)
390 | - React-jsi (= 0.71.4)
391 | - ReactCommon/turbomodule/core (= 0.71.4)
392 | - React-runtimeexecutor (0.71.4):
393 | - React-jsi (= 0.71.4)
394 | - ReactCommon/turbomodule/bridging (0.71.4):
395 | - DoubleConversion
396 | - glog
397 | - hermes-engine
398 | - RCT-Folly (= 2021.07.22.00)
399 | - React-callinvoker (= 0.71.4)
400 | - React-Core (= 0.71.4)
401 | - React-cxxreact (= 0.71.4)
402 | - React-jsi (= 0.71.4)
403 | - React-logger (= 0.71.4)
404 | - React-perflogger (= 0.71.4)
405 | - ReactCommon/turbomodule/core (0.71.4):
406 | - DoubleConversion
407 | - glog
408 | - hermes-engine
409 | - RCT-Folly (= 2021.07.22.00)
410 | - React-callinvoker (= 0.71.4)
411 | - React-Core (= 0.71.4)
412 | - React-cxxreact (= 0.71.4)
413 | - React-jsi (= 0.71.4)
414 | - React-logger (= 0.71.4)
415 | - React-perflogger (= 0.71.4)
416 | - SocketRocket (0.6.0)
417 | - Yoga (1.14.0)
418 | - YogaKit (1.18.1):
419 | - Yoga (~> 1.14)
420 |
421 | DEPENDENCIES:
422 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`)
423 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`)
424 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
425 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
426 | - Flipper (= 0.125.0)
427 | - Flipper-Boost-iOSX (= 1.76.0.1.11)
428 | - Flipper-DoubleConversion (= 3.2.0.1)
429 | - Flipper-Fmt (= 7.1.7)
430 | - Flipper-Folly (= 2.6.10)
431 | - Flipper-Glog (= 0.5.0.5)
432 | - Flipper-PeerTalk (= 0.0.4)
433 | - Flipper-RSocket (= 1.4.3)
434 | - FlipperKit (= 0.125.0)
435 | - FlipperKit/Core (= 0.125.0)
436 | - FlipperKit/CppBridge (= 0.125.0)
437 | - FlipperKit/FBCxxFollyDynamicConvert (= 0.125.0)
438 | - FlipperKit/FBDefines (= 0.125.0)
439 | - FlipperKit/FKPortForwarding (= 0.125.0)
440 | - FlipperKit/FlipperKitHighlightOverlay (= 0.125.0)
441 | - FlipperKit/FlipperKitLayoutPlugin (= 0.125.0)
442 | - FlipperKit/FlipperKitLayoutTextSearchable (= 0.125.0)
443 | - FlipperKit/FlipperKitNetworkPlugin (= 0.125.0)
444 | - FlipperKit/FlipperKitReactPlugin (= 0.125.0)
445 | - FlipperKit/FlipperKitUserDefaultsPlugin (= 0.125.0)
446 | - FlipperKit/SKIOSNetworkPlugin (= 0.125.0)
447 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
448 | - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
449 | - libevent (~> 2.1.12)
450 | - OpenSSL-Universal (= 1.1.1100)
451 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
452 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
453 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
454 | - React (from `../node_modules/react-native/`)
455 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`)
456 | - React-Codegen (from `build/generated/ios`)
457 | - React-Core (from `../node_modules/react-native/`)
458 | - React-Core/DevSupport (from `../node_modules/react-native/`)
459 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`)
460 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`)
461 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`)
462 | - React-hermes (from `../node_modules/react-native/ReactCommon/hermes`)
463 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`)
464 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
465 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
466 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`)
467 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
468 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
469 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`)
470 | - React-RCTAppDelegate (from `../node_modules/react-native/Libraries/AppDelegate`)
471 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`)
472 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`)
473 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`)
474 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`)
475 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`)
476 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`)
477 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
478 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
479 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
480 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
481 |
482 | SPEC REPOS:
483 | trunk:
484 | - CocoaAsyncSocket
485 | - Flipper
486 | - Flipper-Boost-iOSX
487 | - Flipper-DoubleConversion
488 | - Flipper-Fmt
489 | - Flipper-Folly
490 | - Flipper-Glog
491 | - Flipper-PeerTalk
492 | - Flipper-RSocket
493 | - FlipperKit
494 | - fmt
495 | - libevent
496 | - OpenSSL-Universal
497 | - SocketRocket
498 | - YogaKit
499 |
500 | EXTERNAL SOURCES:
501 | boost:
502 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec"
503 | DoubleConversion:
504 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec"
505 | FBLazyVector:
506 | :path: "../node_modules/react-native/Libraries/FBLazyVector"
507 | FBReactNativeSpec:
508 | :path: "../node_modules/react-native/React/FBReactNativeSpec"
509 | glog:
510 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
511 | hermes-engine:
512 | :podspec: "../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec"
513 | RCT-Folly:
514 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
515 | RCTRequired:
516 | :path: "../node_modules/react-native/Libraries/RCTRequired"
517 | RCTTypeSafety:
518 | :path: "../node_modules/react-native/Libraries/TypeSafety"
519 | React:
520 | :path: "../node_modules/react-native/"
521 | React-callinvoker:
522 | :path: "../node_modules/react-native/ReactCommon/callinvoker"
523 | React-Codegen:
524 | :path: build/generated/ios
525 | React-Core:
526 | :path: "../node_modules/react-native/"
527 | React-CoreModules:
528 | :path: "../node_modules/react-native/React/CoreModules"
529 | React-cxxreact:
530 | :path: "../node_modules/react-native/ReactCommon/cxxreact"
531 | React-hermes:
532 | :path: "../node_modules/react-native/ReactCommon/hermes"
533 | React-jsi:
534 | :path: "../node_modules/react-native/ReactCommon/jsi"
535 | React-jsiexecutor:
536 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor"
537 | React-jsinspector:
538 | :path: "../node_modules/react-native/ReactCommon/jsinspector"
539 | React-logger:
540 | :path: "../node_modules/react-native/ReactCommon/logger"
541 | React-perflogger:
542 | :path: "../node_modules/react-native/ReactCommon/reactperflogger"
543 | React-RCTActionSheet:
544 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS"
545 | React-RCTAnimation:
546 | :path: "../node_modules/react-native/Libraries/NativeAnimation"
547 | React-RCTAppDelegate:
548 | :path: "../node_modules/react-native/Libraries/AppDelegate"
549 | React-RCTBlob:
550 | :path: "../node_modules/react-native/Libraries/Blob"
551 | React-RCTImage:
552 | :path: "../node_modules/react-native/Libraries/Image"
553 | React-RCTLinking:
554 | :path: "../node_modules/react-native/Libraries/LinkingIOS"
555 | React-RCTNetwork:
556 | :path: "../node_modules/react-native/Libraries/Network"
557 | React-RCTSettings:
558 | :path: "../node_modules/react-native/Libraries/Settings"
559 | React-RCTText:
560 | :path: "../node_modules/react-native/Libraries/Text"
561 | React-RCTVibration:
562 | :path: "../node_modules/react-native/Libraries/Vibration"
563 | React-runtimeexecutor:
564 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
565 | ReactCommon:
566 | :path: "../node_modules/react-native/ReactCommon"
567 | Yoga:
568 | :path: "../node_modules/react-native/ReactCommon/yoga"
569 |
570 | SPEC CHECKSUMS:
571 | boost: 57d2868c099736d80fcd648bf211b4431e51a558
572 | CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
573 | DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54
574 | FBLazyVector: 446e84642979fff0ba57f3c804c2228a473aeac2
575 | FBReactNativeSpec: 241709e132e3bf1526c1c4f00bc5384dd39dfba9
576 | Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
577 | Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c
578 | Flipper-DoubleConversion: 2dc99b02f658daf147069aad9dbd29d8feb06d30
579 | Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b
580 | Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3
581 | Flipper-Glog: 70c50ce58ddaf67dc35180db05f191692570f446
582 | Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9
583 | Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541
584 | FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86
585 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
586 | glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
587 | hermes-engine: a1f157c49ea579c28b0296bda8530e980c45bdb3
588 | libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
589 | OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
590 | RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
591 | RCTRequired: 5a024fdf458fa8c0d82fc262e76f982d4dcdecdd
592 | RCTTypeSafety: b6c253064466411c6810b45f66bc1e43ce0c54ba
593 | React: 715292db5bd46989419445a5547954b25d2090f0
594 | React-callinvoker: 105392d1179058585b564d35b4592fe1c46d6fba
595 | React-Codegen: b75333b93d835afce84b73472927cccaef2c9f8c
596 | React-Core: 88838ed1724c64905fc6c0811d752828a92e395b
597 | React-CoreModules: cd238b4bb8dc8529ccc8b34ceae7267b04ce1882
598 | React-cxxreact: 291bfab79d8098dc5ebab98f62e6bdfe81b3955a
599 | React-hermes: b1e67e9a81c71745704950516f40ee804349641c
600 | React-jsi: c9d5b563a6af6bb57034a82c2b0d39d0a7483bdc
601 | React-jsiexecutor: d6b7fa9260aa3cb40afee0507e3bc1d17ecaa6f2
602 | React-jsinspector: 1f51e775819199d3fe9410e69ee8d4c4161c7b06
603 | React-logger: 0d58569ec51d30d1792c5e86a8e3b78d24b582c6
604 | React-perflogger: 0bb0522a12e058f6eb69d888bc16f40c16c4b907
605 | React-RCTActionSheet: bfd675a10f06a18728ea15d82082d48f228a213a
606 | React-RCTAnimation: 2fa220b2052ec75b733112aca39143d34546a941
607 | React-RCTAppDelegate: 8564f93c1d9274e95e3b0c746d08a87ff5a621b2
608 | React-RCTBlob: d0336111f46301ae8aba2e161817e451aad72dd6
609 | React-RCTImage: fec592c46edb7c12a9cde08780bdb4a688416c62
610 | React-RCTLinking: 14eccac5d2a3b34b89dbfa29e8ef6219a153fe2d
611 | React-RCTNetwork: 1fbce92e772e39ca3687a2ebb854501ff6226dd7
612 | React-RCTSettings: 1abea36c9bb16d9979df6c4b42e2ea281b4bbcc5
613 | React-RCTText: 15355c41561a9f43dfd23616d0a0dd40ba05ed61
614 | React-RCTVibration: ad17efcfb2fa8f6bfd8ac0cf48d96668b8b28e0b
615 | React-runtimeexecutor: 8fa50b38df6b992c76537993a2b0553d3b088004
616 | ReactCommon: b49a4b00ca6d181ff74b17c12b2d59ac4add0bde
617 | SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
618 | Yoga: 79dd7410de6f8ad73a77c868d3d368843f0c93e0
619 | YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
620 |
621 | PODFILE CHECKSUM: 7a8744a891d3c676c79bc3e24186195715a948c2
622 |
623 | COCOAPODS: 1.12.0
624 |
--------------------------------------------------------------------------------
/Example/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | module.exports = {
9 | transformer: {
10 | getTransformOptions: async () => ({
11 | transform: {
12 | experimentalImportSupport: false,
13 | inlineRequires: true,
14 | },
15 | }),
16 | },
17 | };
18 |
--------------------------------------------------------------------------------
/Example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Example",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "android": "react-native run-android",
7 | "ios": "react-native run-ios",
8 | "lint": "eslint .",
9 | "start": "react-native start",
10 | "postinstall": "DESTINATION='node_modules/react-native-vector-image' LIB_FILE=`cd .. && echo \\`pwd\\`/\\`npm pack\\`` && (rm -rf $DESTINATION || true) && mkdir -p $DESTINATION && tar -xvzf $LIB_FILE -C $DESTINATION --strip-components 1 && rm $LIB_FILE",
11 | "assets": "react-native-vector-image generate",
12 | "test": "jest"
13 | },
14 | "dependencies": {
15 | "@klarna/react-native-vector-drawable": "^0.1.0",
16 | "react": "18.2.0",
17 | "react-native": "0.71.4",
18 | "react-native-vector-image": "^0.3.2"
19 | },
20 | "devDependencies": {
21 | "@babel/core": "^7.20.0",
22 | "@babel/preset-env": "^7.20.0",
23 | "@babel/runtime": "^7.20.0",
24 | "@react-native-community/eslint-config": "^3.2.0",
25 | "@tsconfig/react-native": "^2.0.2",
26 | "@types/jest": "^29.2.1",
27 | "@types/react": "^18.0.24",
28 | "@types/react-test-renderer": "^18.0.0",
29 | "babel-jest": "^29.2.1",
30 | "eslint": "^8.19.0",
31 | "jest": "^29.2.1",
32 | "metro-react-native-babel-preset": "0.73.8",
33 | "prettier": "^2.4.1",
34 | "react-test-renderer": "18.2.0",
35 | "typescript": "4.8.4"
36 | },
37 | "jest": {
38 | "preset": "react-native"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Example/react.dark.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Example/react.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Example/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "@tsconfig/react-native/tsconfig.json"
3 | }
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2021 Joel Arvidsson
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
React Native Vector Image
3 | iOS/Android native vector assets generated from SVG.
4 |
5 |
6 | [](https://github.com/oblador/react-native-vector-image/actions/workflows/tests.yml) [](https://npmjs.com/package/react-native-vector-image)
7 |
8 | - Faster render – ~5x faster than `react-native-svg`.
9 | - Smaller JS bundle = faster startup.
10 | - Native support for dark mode.
11 |
12 | ## Installation
13 |
14 | ```sh
15 | yarn add react-native-vector-image @klarna/react-native-vector-drawable
16 | ```
17 |
18 | For expo, see [`@zamplyy/react-native-vector-image-plugin`](https://github.com/zamplyy/react-native-vector-image-plugin).
19 |
20 | ### Android
21 |
22 | Edit `android/app/build.gradle` to look like this (without the +):
23 |
24 | ```diff
25 | project.ext.react = [
26 | enableHermes: false, // clean and rebuild if changing
27 | ]
28 |
29 | apply from: "../../node_modules/react-native/react.gradle"
30 | + apply from: "../../node_modules/react-native-vector-image/strip_svgs.gradle"
31 | ```
32 |
33 | ### iOS
34 |
35 | Open your project in Xcode, select the _Build Phases_ tab, and edit the `Bundle React Native code and images` script to look like this (without the +):
36 |
37 | ```diff
38 | set -e
39 |
40 | export NODE_BINARY=node
41 | ../node_modules/react-native/scripts/react-native-xcode.sh
42 | + ../node_modules/react-native-vector-image/strip_svgs.sh
43 | ```
44 |
45 |
46 |
47 | ## Usage
48 |
49 | Since native vector assets cannot be served over http via metro dev server, they must be generated and compiled into the app bundle.
50 |
51 | ### Step 1: import an .svg file
52 |
53 | ```js
54 | import VectorImage from 'react-native-vector-image';
55 |
56 | const App = () => ;
57 | ```
58 |
59 | To add dark mode to your image, create a new file with an `.dark.svg` extension, ie `image.svg` = light and `image.dark.svg` = dark.
60 |
61 | ### Step 2: generate native assets
62 |
63 | This takes a while as metro has to go through all the code to find the imported SVGs.
64 |
65 | ```sh
66 | yarn react-native-vector-image generate
67 | ```
68 |
69 | | Argument | Description | Default |
70 | | ---------------------- | ---------------------------------------------------------------- | ----------------------------- |
71 | | `--entry-file` | Path to the app entrypoint file. | `index.js` |
72 | | `--config` | Path to the metro config file. | `metro.config.js` |
73 | | `--reset-cache` | Reset metro cache before extracting SVG assets. | `false` |
74 | | `--ios-output` | Path to an iOS `.xcassets` folder. | `ios/AppName/Images.xcassets` |
75 | | `--no-ios-output` | Disable iOS output. | `false` |
76 | | `--android-output` | Path to an Android `res` folder. | `android/app/src/main/res` |
77 | | `--no-android-output` | Disable Android output. | `false` |
78 | | `--current-color` | Replace any `currentColor` color references in SVGs. | `#000000` |
79 | | `--current-color-dark` | Replace any `currentColor` color references in `.dark.svg` SVGs. | `#ffffff` |
80 |
81 | ### Step 3: recompile
82 |
83 | ```sh
84 | yarn react-native run-ios
85 | # or
86 | yarn react-native run-android
87 | ```
88 |
89 | ## Troubleshooting
90 |
91 | ### `generate` command outputs "Error while parsing image.svg"
92 |
93 | Some optimizations applied by SVGO are not compatible with the SVG parser on Android. Try to re-export the SVG without optimizing it.
94 |
95 | ### `` warns "Could not find image"
96 |
97 | It means that the native vector asset does not exist or is out of sync with the SVG. Simply generate the files and recompile the app.
98 |
99 | ### the `generate` command does not generate any new assets
100 |
101 | Make sure your image component is used (imported) somewhere in your code, otherwise the asset generator won't find it.
102 |
103 | ## License
104 |
105 | [MIT License](http://opensource.org/licenses/mit-license.html). © Joel Arvidsson 2021
106 |
107 | [`svg2vd`](https://github.com/Shopify/svg2vd): MIT © 2020 Shopify
108 |
--------------------------------------------------------------------------------
/bin/react-native-vector-image.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | require('../src/cli/index')(process.argv.slice(2));
4 |
--------------------------------------------------------------------------------
/bin/svg2vd-0.1.jar:
--------------------------------------------------------------------------------
1 | version https://git-lfs.github.com/spec/v1
2 | oid sha256:029d5ec3e1c087b1f5603dbdc96c55618bab5d797bd3bb12a4b69852d74ec472
3 | size 25914172
4 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-vector-image",
3 | "version": "0.4.5",
4 | "description": "Native vector images generated from SVG",
5 | "main": "src/index.js",
6 | "types": "src/index.d.ts",
7 | "homepage": "https://github.com/oblador/react-native-vector-image",
8 | "repository": {
9 | "type": "git",
10 | "url": "git+https://github.com/oblador/react-native-vector-image.git"
11 | },
12 | "scripts": {
13 | "test": "jest src"
14 | },
15 | "bin": {
16 | "react-native-vector-image": "bin/react-native-vector-image.js"
17 | },
18 | "files": [
19 | "bin",
20 | "src",
21 | "strip_svgs.sh",
22 | "strip_svgs.gradle",
23 | "!*.spec.js",
24 | "!fixtures",
25 | "!.DS_Store"
26 | ],
27 | "keywords": [
28 | "react-native",
29 | "image",
30 | "svg",
31 | "vector"
32 | ],
33 | "author": "Joel Arvidsson",
34 | "license": "MIT",
35 | "dependencies": {
36 | "chalk": "^4.1.1",
37 | "chroma-js": "^2.1.1",
38 | "execa": "^5.0.0",
39 | "fs-extra": "^9.1.0",
40 | "pdfkit": "^0.12.1",
41 | "svg-to-pdfkit": "^0.1.8",
42 | "tempy": "^1.0.1",
43 | "yargs": "^16.2.0"
44 | },
45 | "peerDependencies": {
46 | "@klarna/react-native-vector-drawable": ">=0.4.0"
47 | },
48 | "devDependencies": {
49 | "jest": "^26.6.3",
50 | "metro": ">=0.58.0",
51 | "metro-config": ">=0.58.0",
52 | "prettier": "^2.2.1"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/scripts/build-svg2vd.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash -e
2 |
3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4 | BIN_DIR="$DIR/../bin"
5 | CHECKOUT_DIR="$TMPDIR/svg2vd-build"
6 | GRADLE_CONFIG="$CHECKOUT_DIR/build.gradle.kts"
7 | SDK_VERSION="27.1.3"
8 |
9 | rm -rf $CHECKOUT_DIR || true
10 | mkdir -p $CHECKOUT_DIR
11 |
12 | git clone git@github.com:Shopify/svg2vd.git $CHECKOUT_DIR
13 | cd $CHECKOUT_DIR
14 |
15 | # Apply a newer version of the SDK that works better
16 | sed -i '' "s/common:26.3.2/common:$SDK_VERSION/" "$GRADLE_CONFIG"
17 | ./gradlew jar
18 | mv build/libs/svg2vd-0.1.jar $BIN_DIR
19 | rm -rf $CHECKOUT_DIR
20 |
--------------------------------------------------------------------------------
/src/VectorImageCompat.android.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import VectorDrawable from '@klarna/react-native-vector-drawable';
3 |
4 | export function VectorImageCompat({ source, ...props }) {
5 | return ;
6 | }
7 |
--------------------------------------------------------------------------------
/src/VectorImageCompat.ios.js:
--------------------------------------------------------------------------------
1 | export { Image as VectorImageCompat } from 'react-native';
2 |
--------------------------------------------------------------------------------
/src/cli/convertSvgToPdf.js:
--------------------------------------------------------------------------------
1 | const { PassThrough } = require('stream');
2 | const PDFDocument = require('pdfkit');
3 | const SVGtoPDF = require('svg-to-pdfkit');
4 |
5 | function convertSvgToPdf(svgSource, size) {
6 | const doc = new PDFDocument({
7 | size,
8 | margin: 0,
9 | info: {
10 | // To make builds deterministic we need to set a static
11 | // creation date (and file descriptors are not content
12 | // reliable in this regard)
13 | // https://www.nasa.gov/mission_pages/apollo/apollo11.html
14 | CreationDate: new Date('July 20, 69 00:20:18 GMT+00:00'),
15 | },
16 | });
17 | const stream = new PassThrough();
18 |
19 | SVGtoPDF(doc, svgSource, 0, 0, {
20 | assumePt: 1,
21 | });
22 | doc.pipe(stream);
23 | doc.end();
24 |
25 | return stream;
26 | }
27 |
28 | module.exports = convertSvgToPdf;
29 |
--------------------------------------------------------------------------------
/src/cli/convertSvgToPdf.spec.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const convertSvgToPdf = require('./convertSvgToPdf');
3 | const { reactLogo } = require('./fixtures');
4 | const { readStream } = require('./streams');
5 |
6 | const convert = (fixture, size) => readStream(convertSvgToPdf(fixture, size));
7 |
8 | describe('convertSvgToPdf', () => {
9 | it('is deterministic', async () => {
10 | const size = [300, 267];
11 | const file1 = await convert(reactLogo, size);
12 | const file2 = await convert(reactLogo, size);
13 | expect(file1.equals(file2)).toBe(true);
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/src/cli/convertSvgToVd.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs-extra');
2 | const path = require('path');
3 | const { PassThrough } = require('stream');
4 | const execa = require('execa');
5 | const tempy = require('tempy');
6 | const chroma = require('chroma-js');
7 | const { TransformationError, InputError } = require('./errors');
8 |
9 | const svg2VdErrorPattern = /^Command failed.*: java -jar/;
10 | const illegalStateMarker =
11 | 'Exception in thread "main" java.lang.IllegalStateException: ';
12 | const illegalElementMarker = 'ERROR @ line';
13 |
14 | const transformCliError = (error) => {
15 | if ('message' in error && svg2VdErrorPattern.test(error.message)) {
16 | const stack = error.message.split('\n').slice(1);
17 | const [message] = stack;
18 | if (message.startsWith(illegalStateMarker)) {
19 | return new InputError(message.substr(illegalStateMarker.length).trim());
20 | }
21 | if (message.startsWith(illegalElementMarker)) {
22 | return new TransformationError(
23 | stack
24 | .map((m) => m.trim().replace(/^ERROR @ /, ''))
25 | .filter(Boolean)
26 | .join('; ')
27 | );
28 | }
29 | }
30 |
31 | return error;
32 | };
33 |
34 | function convertSvgToVd(svgSource) {
35 | const svg2vdBin = path.join(
36 | path.dirname(path.dirname(__dirname)),
37 | 'bin',
38 | 'svg2vd-0.1.jar'
39 | );
40 |
41 | // svg2vd doesn't support output path, so we will have to emulate it
42 | const outputDir = tempy.directory({ prefix: 'vd_' });
43 | const sourcePath = path.join(outputDir, 'image.svg');
44 | const outputPath = path.join(outputDir, 'image.xml');
45 |
46 | fs.writeFileSync(
47 | sourcePath,
48 | svgSource.replace(
49 | /rgba\([0-9]+,\s*[0-9]+,\s*[0-9]+,\s*(1|[0-9]*\.[0-9]+)\)/g,
50 | (match) => chroma(match).hex()
51 | )
52 | );
53 |
54 | const stream = new PassThrough();
55 | execa('java', ['-jar', svg2vdBin, sourcePath, outputDir])
56 | .then(() => {
57 | const readStream = fs.createReadStream(outputPath);
58 | readStream.on('open', () => {
59 | readStream.pipe(stream);
60 | });
61 | readStream.on('close', () => {
62 | fs.removeSync(outputDir);
63 | });
64 | })
65 | .catch((error) => {
66 | try {
67 | fs.removeSync(outputDir);
68 | } finally {
69 | stream.emit('error', transformCliError(error));
70 | stream.resume();
71 | stream.end();
72 | }
73 | return null;
74 | });
75 | return stream;
76 | }
77 |
78 | module.exports = convertSvgToVd;
79 |
--------------------------------------------------------------------------------
/src/cli/convertSvgToVd.spec.js:
--------------------------------------------------------------------------------
1 | const convertSvgToVd = require('./convertSvgToVd');
2 | const { reactLogo, rectangle, dropShadow } = require('./fixtures');
3 | const { readStream } = require('./streams');
4 |
5 | const convert = (fixture) => readStream(convertSvgToVd(fixture));
6 |
7 | describe('convertSvgToVd', () => {
8 | it('is deterministic', async () => {
9 | const file1 = await convert(reactLogo);
10 | const file2 = await convert(reactLogo);
11 | expect(file1.equals(file2)).toBe(true);
12 | });
13 |
14 | it('supports rgba colors', async () => {
15 | const result = (await convert(rectangle)).toString();
16 | expect(result).toEqual(
17 | expect.stringContaining('android:fillColor="#d8d8d880"')
18 | );
19 | expect(result).toEqual(
20 | expect.stringContaining('android:strokeColor="#979797"')
21 | );
22 | });
23 |
24 | it('throws for non-svg files', async () => {
25 | await expect(convert('garbage')).rejects.toThrowErrorMatchingInlineSnapshot(
26 | `"Not a proper SVG file"`
27 | );
28 | });
29 |
30 | it('throws for unsupported elements like feGaussianBlur', async () => {
31 | await expect(
32 | convert(dropShadow)
33 | ).rejects.toThrowErrorMatchingInlineSnapshot(
34 | `"line 4: is not supported; line 5: is not supported; line 6: is not supported; line 7: is not supported; line 8: is not supported"`
35 | );
36 | });
37 | });
38 |
--------------------------------------------------------------------------------
/src/cli/errors.js:
--------------------------------------------------------------------------------
1 | class VectorImageError extends Error {}
2 |
3 | class TransformationError extends VectorImageError {}
4 |
5 | class InputError extends VectorImageError {}
6 |
7 | class ArgumentError extends VectorImageError {}
8 |
9 | module.exports = {
10 | VectorImageError,
11 | TransformationError,
12 | InputError,
13 | ArgumentError,
14 | };
15 |
--------------------------------------------------------------------------------
/src/cli/fixtures/current-color.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/cli/fixtures/drop-shadow.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/cli/fixtures/index.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs-extra');
2 | const path = require('path');
3 |
4 | const readFixture = (file) =>
5 | fs.readFileSync(path.join(__dirname, file), 'utf8').toString();
6 |
7 | module.exports = {
8 | dropShadow: readFixture('drop-shadow.svg'),
9 | reactLogo: readFixture('react-logo.svg'),
10 | rectangle: readFixture('rectangle.svg'),
11 | };
12 |
--------------------------------------------------------------------------------
/src/cli/fixtures/react-logo.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/cli/fixtures/rectangle.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/cli/generateAndroidAsset.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const convertSvgToVd = require('./convertSvgToVd');
3 | const { outputStream } = require('./streams');
4 |
5 | async function generateAndroidAsset(source, resourceName, outputDir) {
6 | const { light, dark } = source;
7 |
8 | await outputStream(
9 | convertSvgToVd(light),
10 | path.join(outputDir, 'drawable', `${resourceName}.xml`)
11 | );
12 | if (dark) {
13 | await outputStream(
14 | convertSvgToVd(dark),
15 | path.join(outputDir, 'drawable-night', `${resourceName}.xml`)
16 | );
17 | }
18 | }
19 |
20 | module.exports = generateAndroidAsset;
21 |
--------------------------------------------------------------------------------
/src/cli/generateAssets.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs-extra');
2 | const path = require('path');
3 | const generateIosAsset = require('./generateIosAsset');
4 | const generateAndroidAsset = require('./generateAndroidAsset');
5 | const getAssets = require('./getAssets');
6 | const getResourceName = require('../getResourceName');
7 | const resolveAssetSources = require('./resolveAssetSources');
8 | const readSvgAsset = require('./readSvgAsset');
9 | const { InputError, TransformationError } = require('./errors');
10 |
11 | async function removeGeneratedAssets(directory) {
12 | const exists = await fs.exists(directory);
13 | if (!exists) {
14 | return;
15 | }
16 | const contents = await fs.readdir(directory);
17 | await Promise.all(
18 | contents
19 | .filter((name) =>
20 | /._(svg|codegen)_[a-z0-9]{6}\.(imageset|xml)$/.test(name)
21 | )
22 | .map((name) => fs.remove(path.join(directory, name)))
23 | );
24 | }
25 |
26 | async function generateAssets({
27 | iosOutput,
28 | androidOutput,
29 | config,
30 | entryFile,
31 | resetCache,
32 | currentColor,
33 | currentColorDark,
34 | }) {
35 | const assets = await getAssets({ config, entryFile, resetCache });
36 |
37 | if (iosOutput) {
38 | await removeGeneratedAssets(iosOutput);
39 | }
40 | if (androidOutput) {
41 | await removeGeneratedAssets(path.join(androidOutput, 'drawable'));
42 | await removeGeneratedAssets(path.join(androidOutput, 'drawable-night'));
43 | }
44 |
45 | await Promise.all(
46 | assets
47 | .filter((asset) => asset.type === 'svg')
48 | .map(async (asset) => {
49 | const { light, dark } = resolveAssetSources(asset);
50 | try {
51 | const [scale] = asset.scales;
52 | if (scale !== 1) {
53 | throw new InputError(
54 | `Unexpected scale, expected 1 got ${JSON.stringify(scale)}`
55 | );
56 | }
57 |
58 | const resourceName = getResourceName(asset);
59 | const source = {
60 | light: readSvgAsset(light, currentColor),
61 | dark: dark && readSvgAsset(dark, currentColorDark),
62 | width: asset.width,
63 | height: asset.height,
64 | };
65 | if (iosOutput) {
66 | await generateIosAsset(source, resourceName, iosOutput);
67 | }
68 | if (androidOutput) {
69 | await generateAndroidAsset(source, resourceName, androidOutput);
70 | }
71 | } catch (error) {
72 | if (
73 | error instanceof InputError ||
74 | error instanceof TransformationError
75 | ) {
76 | error.file = light;
77 | }
78 | throw error;
79 | }
80 | })
81 | );
82 | }
83 |
84 | module.exports = generateAssets;
85 |
--------------------------------------------------------------------------------
/src/cli/generateIosAsset.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs-extra');
2 | const path = require('path');
3 | const convertSvgToPdf = require('./convertSvgToPdf');
4 | const { outputStream } = require('./streams');
5 |
6 | async function generateIosAsset(source, resourceName, output) {
7 | const { light, dark, width, height } = source;
8 | const xcassetPath = path.join(output, `${resourceName}.imageset`);
9 |
10 | const xcasset = {
11 | images: [
12 | {
13 | filename: 'light.pdf',
14 | idiom: 'universal',
15 | },
16 | dark && {
17 | appearances: [
18 | {
19 | appearance: 'luminosity',
20 | value: 'dark',
21 | },
22 | ],
23 | filename: 'dark.pdf',
24 | idiom: 'universal',
25 | },
26 | ].filter(Boolean),
27 | info: {
28 | author: 'xcode',
29 | version: 1,
30 | },
31 | properties: {
32 | 'preserves-vector-representation': true,
33 | },
34 | };
35 |
36 | fs.outputJsonSync(path.join(xcassetPath, 'Contents.json'), xcasset, {
37 | spaces: 2,
38 | });
39 | const size = [width, height];
40 |
41 | await outputStream(
42 | convertSvgToPdf(light, size),
43 | path.join(xcassetPath, 'light.pdf')
44 | );
45 | if (dark) {
46 | await outputStream(
47 | convertSvgToPdf(dark, size),
48 | path.join(xcassetPath, 'dark.pdf')
49 | );
50 | }
51 | }
52 |
53 | module.exports = generateIosAsset;
54 |
--------------------------------------------------------------------------------
/src/cli/getAssets.js:
--------------------------------------------------------------------------------
1 | const Server = require('metro/src/Server');
2 | const { loadConfig } = require('metro-config');
3 | const output = require('metro/src/shared/output/bundle');
4 |
5 | const getBabelTransformerPath = () => {
6 | try {
7 | // for RN 73+
8 | return require.resolve('@react-native/metro-babel-transformer');
9 | } catch (e) {
10 | // to ensure backwards compatibility with old RN versions (RN < 73)
11 | return require.resolve('metro-react-native-babel-transformer');
12 | }
13 | }
14 |
15 | async function getAssets(options) {
16 | const args = {
17 | entryFile: options.entryFile,
18 | dev: false,
19 | minify: false,
20 | platform: 'ios',
21 | };
22 |
23 | const config = await loadConfig(
24 | {
25 | cwd: process.cwd(),
26 | config: options.config,
27 | resetCache: options.resetCache,
28 | },
29 | {
30 | resolver: {
31 | resolverMainFields: ['react-native', 'browser', 'main'],
32 | },
33 | transformer: {
34 | allowOptionalDependencies: true,
35 | babelTransformerPath: getBabelTransformerPath(),
36 | assetRegistryPath: 'react-native/Libraries/Image/AssetRegistry',
37 | },
38 | }
39 | );
40 |
41 | process.env.NODE_ENV = 'production';
42 |
43 | const requestOpts = {
44 | entryFile: args.entryFile,
45 | dev: args.dev,
46 | minify: false,
47 | platform: args.platform,
48 | unstable_transformProfile: args.unstableTransformProfile,
49 | };
50 | const server = new Server(config);
51 |
52 | try {
53 | await output.build(server, requestOpts);
54 |
55 | return await server.getAssets({
56 | ...Server.DEFAULT_BUNDLE_OPTIONS,
57 | ...requestOpts,
58 | bundleType: 'todo',
59 | });
60 | } finally {
61 | server.end();
62 | }
63 | }
64 |
65 | module.exports = getAssets;
66 |
--------------------------------------------------------------------------------
/src/cli/index.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs-extra');
2 | const path = require('path');
3 | const yargs = require('yargs/yargs');
4 | const chalk = require('chalk');
5 | const generateAssets = require('./generateAssets');
6 | const { VectorImageError, ArgumentError } = require('./errors');
7 |
8 | const detectReactNativeAppName = () => {
9 | try {
10 | const config = fs.readJsonSync(path.resolve('app.json'));
11 | if (config && config.name) {
12 | return config.name;
13 | }
14 | } catch {}
15 | return 'YourApp';
16 | };
17 |
18 | function main(argv) {
19 | const options = yargs(argv)
20 | .command(
21 | 'generate',
22 | 'generate native vector assets',
23 | {
24 | 'entry-file': {
25 | description: 'Path to the app entrypoint file',
26 | default: 'index.js',
27 | demandOption: true,
28 | type: 'string',
29 | },
30 | config: {
31 | description: 'Path to the metro config file',
32 | type: 'string',
33 | },
34 | 'reset-cache': {
35 | description: 'Reset metro cache before extracting SVG assets',
36 | default: false,
37 | type: 'boolean',
38 | },
39 | 'ios-output': {
40 | description: 'Path to an iOS `.xcassets` folder',
41 | default: `ios/${detectReactNativeAppName()}/Images.xcassets`,
42 | },
43 | 'android-output': {
44 | description: 'Path to an Android `res` folder',
45 | default: 'android/app/src/main/res',
46 | },
47 | 'current-color': {
48 | description: 'Replace any `current` color references in SVGs.',
49 | default: '#000000',
50 | type: 'string',
51 | },
52 | 'current-color-dark': {
53 | description: 'Replace any `current` color references in `.dark.svg` SVGs.',
54 | default: '#ffffff',
55 | type: 'string',
56 | },
57 | },
58 | async (options) => {
59 | try {
60 | if (options.iosOutput && !fs.existsSync(options.iosOutput)) {
61 | throw new ArgumentError(
62 | "Invalid --ios-output argument, folder doesn't exist"
63 | );
64 | }
65 | if (options.androidOutput && !fs.existsSync(options.androidOutput)) {
66 | throw new ArgumentError(
67 | "Invalid --android-output argument, folder doesn't exist"
68 | );
69 | }
70 | if (!options.iosOutput && !options.androidOutput) {
71 | throw new ArgumentError(
72 | 'At least one output option must be passed'
73 | );
74 | }
75 | await generateAssets(options);
76 | } catch (error) {
77 | if (error instanceof VectorImageError) {
78 | if (error instanceof ArgumentError) {
79 | console.error(chalk.bold.red(error.message));
80 | } else {
81 | console.error(chalk.bold.red('Failed to generate vector assets'));
82 | if (error.file) {
83 | console.error(
84 | `${chalk.bold(path.relative(process.cwd(), error.file))}: ${
85 | error.message
86 | }`
87 | );
88 | } else {
89 | console.error(error.message);
90 | }
91 | }
92 | } else {
93 | console.error(error.stack || error.message);
94 | }
95 | process.exit(1);
96 | }
97 | }
98 | )
99 | .strict()
100 | .help().argv;
101 | }
102 |
103 | module.exports = main;
104 |
--------------------------------------------------------------------------------
/src/cli/readSvgAsset.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | const readSvgAsset = (path, currentColor) =>
4 | fs
5 | .readFileSync(path)
6 | .toString()
7 | .replace(
8 | /\s(fill|stroke|stop-color|flood-color|lighting-color)=["']currentColor["']/g,
9 | (_, attribute) => ` ${attribute}="${currentColor}"`
10 | );
11 |
12 | module.exports = readSvgAsset;
13 |
--------------------------------------------------------------------------------
/src/cli/readSvgAsset.spec.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const readSvgAsset = require('./readSvgAsset');
3 |
4 | describe('readSvgAsset', () => {
5 | it('replaces fill="current" with supplied currentColor', () => {
6 | const svg = readSvgAsset(
7 | path.join(__dirname, 'fixtures', 'current-color.svg'),
8 | 'red'
9 | );
10 | expect(svg).toContain('fill="red"');
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/src/cli/resolveAssetSources.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function resolveAssetSources(asset) {
4 | const [light] = asset.files;
5 | const dark = light.replace(/\.svg$/, '.dark.svg');
6 | if (fs.existsSync(dark)) {
7 | return { light, dark };
8 | }
9 | return { light };
10 | }
11 |
12 | module.exports = resolveAssetSources;
13 |
--------------------------------------------------------------------------------
/src/cli/streams.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs-extra');
2 | const path = require('path');
3 |
4 | const awaitStream = (stream) =>
5 | new Promise((resolve, reject) => {
6 | stream.on('finish', resolve);
7 | stream.on('error', reject);
8 | });
9 |
10 | const outputStream = async (stream, targetPath) => {
11 | fs.ensureDirSync(path.dirname(targetPath));
12 | const output = fs.createWriteStream(targetPath);
13 | stream.pipe(output);
14 | await Promise.all([stream, output].map(awaitStream));
15 | };
16 |
17 | const readStream = async (stream) => {
18 | const bufs = [];
19 | stream.on('data', (d) => bufs.push(d));
20 | await awaitStream(stream);
21 | return Buffer.concat(bufs);
22 | };
23 |
24 | module.exports = {
25 | outputStream,
26 | readStream,
27 | };
28 |
--------------------------------------------------------------------------------
/src/getResourceName.js:
--------------------------------------------------------------------------------
1 | function getResourceName(asset) {
2 | return `${asset.name
3 | .toLowerCase()
4 | .replace(/[^a-z0-9_]+/g, '_')}_svg_${asset.hash.substr(0, 6)}`;
5 | }
6 |
7 | module.exports = getResourceName;
8 |
--------------------------------------------------------------------------------
/src/getResourceName.spec.js:
--------------------------------------------------------------------------------
1 | const getResourceName = require('./getResourceName');
2 |
3 | describe('getResourceName', () => {
4 | it('replaces unsafe characters with _', () => {
5 | expect(
6 | getResourceName({ name: 'spaces and - dashes', hash: 'abc' })
7 | ).toEqual(expect.stringMatching(/^spaces_and_dashes/));
8 | });
9 |
10 | it('returns lower case string', () => {
11 | expect(getResourceName({ name: 'Snel Hest', hash: 'abc' })).toEqual(
12 | expect.stringMatching(/^snel_hest/)
13 | );
14 | });
15 |
16 | it('appends hash', () => {
17 | expect(getResourceName({ name: 'lol', hash: 'abc' })).toEqual(
18 | expect.stringMatching(/_abc$/)
19 | );
20 | });
21 |
22 | it('has the pattern of name_svg_hash', () => {
23 | expect(getResourceName({ name: 'lol', hash: 'abc' })).toBe('lol_svg_abc');
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/src/index.d.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import { ImageProps, ImageRequireSource } from 'react-native';
3 |
4 | export interface VectorImageProps extends ImageProps {
5 | /**
6 | * The image source, must be a local .svg asset.
7 | */
8 | source: ImageRequireSource;
9 | }
10 |
11 | declare const VectorImage: React.FunctionComponent;
12 |
13 | export default VectorImage;
14 |
--------------------------------------------------------------------------------
/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import AssetRegistry from 'react-native/Libraries/Image/AssetRegistry';
3 | import { VectorImageCompat } from './VectorImageCompat';
4 | import getResourceName from './getResourceName';
5 |
6 | export default function VectorImage({ source, style, ...props }) {
7 | const asset = AssetRegistry.getAssetByID(source);
8 | if (!asset) {
9 | console.warn(
10 | `No asset registered for source "${source}", you may have to generate assets and recompile`
11 | );
12 | return null;
13 | }
14 | const resourceName = getResourceName(asset);
15 | return (
16 |
21 | );
22 | }
23 |
--------------------------------------------------------------------------------
/strip_svgs.gradle:
--------------------------------------------------------------------------------
1 | // This script removes .svg files generated by metro.
2 |
3 | gradle.projectsEvaluated {
4 | android.applicationVariants.all { def variant ->
5 | def targetName = variant.name.capitalize()
6 | def targetPath = variant.dirName
7 | def bundleTask = tasks.findByName("createBundle${targetName}Resources") ?: tasks.findByName("bundle${targetName}Resources")
8 | def mergeResourcesTask = tasks.findByName("merge${targetName}Resources")
9 | def cleanUpTask = tasks.create(name: "${bundleTask.name}_VectorImageCleanUp", type: Delete) {
10 | description = "strip generated svg assets"
11 | group = 'react'
12 | delete fileTree("$buildDir/generated/res/react/${targetPath}/raw").matching {
13 | include "*.svg"
14 | }
15 | enabled(targetName != "Debug" && bundleTask.enabled)
16 | }
17 | mergeResourcesTask.dependsOn(cleanUpTask)
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/strip_svgs.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash -e
2 |
3 | # This script removes .svg files generated by metro.
4 | # For use in Xcode.
5 |
6 | RN_ASSETS_PATH="$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/assets"
7 |
8 | if [ -d "$RN_ASSETS_PATH" ]; then
9 | find "$RN_ASSETS_PATH" -type f -name "*.svg" -delete
10 | fi
11 |
--------------------------------------------------------------------------------
/tests/ensure-svgs-stripped-ios.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash -e
2 |
3 | OUTPUT_PATH=`mktemp -d -t 'rnvi-build-'`
4 |
5 | xcodebuild clean build \
6 | -quiet \
7 | -workspace Example/ios/Example.xcworkspace \
8 | -scheme Example \
9 | -configuration Release \
10 | -derivedDataPath $OUTPUT_PATH \
11 | CODE_SIGN_IDENTITY="" \
12 | CODE_SIGNING_REQUIRED=NO \
13 | CODE_SIGN_ENTITLEMENTS="" \
14 | CODE_SIGNING_ALLOWED=NO
15 |
16 | ASSETS_PATH="$OUTPUT_PATH/Build/Products/Release-iphoneos/Example.app/assets"
17 |
18 | if [ ! -d "$ASSETS_PATH" ]; then
19 | echo "Assets folder not found!"
20 | exit 1
21 | fi
22 |
23 | if [ -f "$ASSETS_PATH/react.svg" ]; then
24 | echo "react.svg not stripped!"
25 | exit 1
26 | fi
27 |
--------------------------------------------------------------------------------