├── .eslintrc ├── .flowconfig ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── package.json ├── src ├── cli.js └── index.js └── test ├── ReactNativeTestApp ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── android │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ ├── react.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── reactnativetestapp │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── ReactNativeTestApp.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── ReactNativeTestApp.xcscheme │ ├── ReactNativeTestApp │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── ReactNativeTestAppTests │ │ ├── Info.plist │ │ └── ReactNativeTestAppTests.m └── package.json ├── objc_test.sh └── simple_xcode_dependency.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "parser": "babel-eslint", 3 | "rules": { 4 | "strict": 0 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/lib/.* 3 | .*/node_modules/.* 4 | 5 | [version] 6 | 0.18.1 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | 28 | npm-debug.log 29 | node_modules 30 | lib 31 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | 3 | osx_image: xcode7.1 4 | 5 | cache: 6 | directories: 7 | - node_modules 8 | - .nvm 9 | 10 | before_install: 11 | - brew update || brew update 12 | - brew outdated xctool || brew upgrade xctool 13 | 14 | install: 15 | - npm install -g flow-bin@`node -p "require('fs').readFileSync('.flowconfig', 'utf8').split('[version]')[1].trim()"` 16 | - npm install 17 | 18 | script: 19 | - npm test 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dima 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 | `npm install react-native-plugin` coming back to React Native. 2 | 3 | [![Build Status](https://travis-ci.org/ptmt/npm-native.svg)](https://travis-ci.org/ptmt/npm-native) 4 | [![npm version](https://badge.fury.io/js/npm-native.svg)](https://badge.fury.io/js/npm-native) 5 | 6 | **This is Obsolete** See https://github.com/rnpm/rnpm 7 | 8 | 9 | ## Usage 10 | 11 | Add `npm-native` and two simple hooks to plugin's `package.json`: 12 | 13 | ``` 14 | { 15 | "scripts" : 16 | { 17 | "postinstall" : "npm-native --install path_to_lib.xcodeproj", 18 | "uninstall" : "npm-native --uninstall path_to_lib.xcodeproj" 19 | }, 20 | dependencies: { 21 | "npm-native": "0.1.x" 22 | } 23 | } 24 | ``` 25 | `--path_to_lib` — where your XCode project is placed. 26 | E.g. `npm-native --install RNGL.xcodeproj` for `gl-react-native`. 27 | 28 | ## TODO 29 | 30 | - [x] Backup before modify .pbxproj; 31 | 32 | - [ ] Validate the final .pbxproj file and if it fails rollback it to the previous state; 33 | 34 | - [ ] Allow to copy resources like font files; 35 | 36 | - [ ] Android projects support; 37 | 38 | ## Plugins includes npm-native 39 | 40 | Nothing here yet :( 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "npm-native", 3 | "version": "0.1.6", 4 | "description": "Manage your XCode dependencies via npm", 5 | "main": "lib/index.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "scripts": { 10 | "build": "babel src --out-dir lib", 11 | "test": "./node_modules/.bin/ava", 12 | "flow": "flow check" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "git+https://github.com/ptmt/npm-native.git" 17 | }, 18 | "bin": { 19 | "npm-native": "src/cli.js" 20 | }, 21 | "author": "Dmitriy Loktev", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/ptmt/npm-native/issues" 25 | }, 26 | "homepage": "https://github.com/ptmt/npm-native#readme", 27 | "keywords": ["react-native", "xcode"], 28 | "devDependencies": { 29 | "ava": "^0.4.2", 30 | "eslint": "^1.9.0" 31 | }, 32 | "dependencies": { 33 | "cli": "^0.11.1", 34 | "xcode": "^0.8.2" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/cli.js: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env node 2 | const cli = require('cli'); 3 | const npmNative = require('./index'); 4 | const path = require('path'); 5 | const fs = require('fs'); 6 | 7 | cli.parse({ 8 | install: ['i', 'Install Xcode project', 'path', false], 9 | uninstall: ['u', 'Uninstall Xcode project', 'path', false], 10 | }); 11 | 12 | cli.main(function(args, options) { 13 | 14 | if (options.install || options.uninstall) { 15 | const targetProject = npmNative.findTargetProject(process.cwd() + '/../..'); // get back from node_modules 16 | if (!targetProject || targetProject.length === 0) { 17 | return this.fatal('target project can not be found'); 18 | } else { 19 | this.debug(targetProject[0]) 20 | } 21 | const depProject = process.cwd() + '/' + (options.install || options.uninstall); 22 | if (!fs.existsSync(depProject)) { 23 | return this.fatal((options.install || options.uninstall) + ' not found'); 24 | } 25 | const targetProjectPath = path.normalize(targetProject[0]); 26 | this.debug('dirname=' + process.cwd()); 27 | this.debug('targetProjectPath=' + targetProjectPath); 28 | this.debug('depProjectPath=' + depProject); 29 | if (options.install) { 30 | if (npmNative.addDependency({ 31 | targetProject: targetProjectPath, 32 | depProject: depProject 33 | })) { 34 | this.ok('Successfully installed!') 35 | } else { 36 | this.info('Already installed') 37 | } 38 | } else { 39 | if (npmNative.removeDependency({ 40 | targetProject: targetProjectPath, 41 | depProject: depProject 42 | })) { 43 | this.ok('Successfully uninstalled!') 44 | } else { 45 | this.info('Already uninstalled') 46 | } 47 | } 48 | 49 | } else { 50 | this.fatal('run npm-native --help'); 51 | } 52 | 53 | }); 54 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | const xcode = require('xcode'); 4 | const pbxFile = require('xcode/lib/pbxFile'); 5 | const fs = require('fs'); 6 | const path = require('path'); 7 | 8 | /*:: 9 | type XCodeProjectPath = string; 10 | type DependencyOptions = { 11 | targetProject: XCodeProjectPath, 12 | dependencyProject: XCodeProjectPath 13 | } 14 | 15 | type PbxFile = any; 16 | 17 | */ 18 | 19 | /* 20 | * Firstly we should find xcode project. 21 | * Should we do it recursively? 22 | * What if there are more than one instance? 23 | */ 24 | module.exports.findTargetProject = function(startPath/*:string*/)/*: Array*/ { 25 | const search = dir => { 26 | var results = []; 27 | const list = fs.readdirSync(dir); 28 | 29 | list.forEach(file => { 30 | file = dir + '/' + file; 31 | const stat = fs.statSync(file); 32 | const relative = file.replace(startPath, ''); 33 | if (stat && stat.isDirectory() 34 | && relative.indexOf('node_modules') === -1 35 | && relative.indexOf('.git') === -1) { 36 | results = results.concat(search(file)); 37 | } else { 38 | if (file.indexOf('.pbxproj') > -1) { 39 | results.push(dir); 40 | } 41 | } 42 | }); 43 | return results; 44 | } 45 | return search(startPath); // TODO: more stable way 46 | } 47 | 48 | function getRelativeDepPath(dependency/*: DependencyOptions*/) { 49 | return path.relative(dependency.targetProject, dependency.depProject).slice(3); // remove ../ 50 | } 51 | 52 | function getProducts(parsedProject)/*: Array */ { 53 | return parsedProject 54 | .pbxGroupByName('Products') 55 | .children 56 | .map(c => c.comment) 57 | .filter(c => c.indexOf('.a') > -1); 58 | } 59 | 60 | /* 61 | * Then we should do something like a transaction: 62 | * If one operation fails, all operations should be rollback 63 | */ 64 | module.exports.addDependency = function(dependency/*: DependencyOptions*/)/*: boolean*/ { 65 | const targetProjectPath = dependency.targetProject + '/project.pbxproj'; 66 | const parsedTarget = xcode.project(targetProjectPath).parseSync(); 67 | const parsedDependency = xcode.project(dependency.depProject + '/project.pbxproj').parseSync(); 68 | const pbxGroup = parsedTarget.pbxGroupByName('Libraries'); 69 | 70 | if (pbxGroup.children.filter(c => c.comment.indexOf(dependency.depProject.split('/').slice(-1)[0]) > -1).length > 0) { 71 | return false; 72 | } 73 | 74 | fs.writeFileSync(targetProjectPath + '.backup', parsedTarget.writeSync()); 75 | 76 | const products = getProducts(parsedDependency); 77 | 78 | var file = new pbxFile(getRelativeDepPath(dependency)); 79 | file.uuid = parsedTarget.generateUuid(); 80 | file.fileRef = parsedTarget.generateUuid(); 81 | parsedTarget.addToPbxFileReferenceSection(file); // PBXFileReference 82 | pbxGroup.children.push(pbxGroupChild(file)); 83 | products.forEach(p => parsedTarget.addStaticLibrary(p)); 84 | products.forEach(p => parsedTarget.addToPbxBuildFileSection(new pbxFile(p))); // why add this 85 | fs.writeFileSync(targetProjectPath, parsedTarget.writeSync()); 86 | return true; 87 | } 88 | 89 | module.exports.removeDependency = function(dependency/*: DependencyOptions*/)/*: boolean*/ { 90 | const targetProjectPath = dependency.targetProject + '/project.pbxproj'; 91 | const parsedTarget = xcode.project(targetProjectPath).parseSync(); 92 | const parsedDependency = xcode.project(dependency.depProject + '/project.pbxproj').parseSync(); 93 | const refSection = parsedTarget.pbxFileReferenceSection(); 94 | const pbxGroup = parsedTarget.pbxGroupByName('Libraries'); 95 | const relativePath = getRelativeDepPath(dependency); 96 | 97 | const fileKey = Object.keys(refSection) 98 | .filter(k => refSection[k].path && refSection[k].path.indexOf(relativePath) > -1); 99 | 100 | if (!fileKey || fileKey.length === 0) { 101 | return false; 102 | } 103 | 104 | const file = refSection[fileKey[0]]; 105 | file.basename = path.basename(file.path); 106 | 107 | // remove PBXFileReference & static refs 108 | parsedTarget.removeFromPbxFileReferenceSection(file); 109 | const products = getProducts(parsedDependency); 110 | products.forEach(p => parsedTarget.removeFromPbxFileReferenceSection(new pbxFile(p))); 111 | products.forEach(p => parsedTarget.removeFromPbxFrameworksBuildPhase(new pbxFile(p))); 112 | products.forEach(p => parsedTarget.removeFromPbxBuildFileSection(new pbxFile(p))); 113 | 114 | // remove from Libraries pbxGroup 115 | pbxGroup.children = pbxGroup.children.filter(c => c.comment.indexOf(relativePath.split('/').slice(-1)[0]) === -1); 116 | 117 | fs.writeFileSync(targetProjectPath, parsedTarget.writeSync()); 118 | return true; 119 | } 120 | 121 | function pbxGroupChild(file) { 122 | const obj = Object.create(null); 123 | obj.value = file.fileRef; 124 | obj.comment = file.basename; 125 | return obj; 126 | } 127 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ignore react-tools where there are overlaps, but don't ignore anything that 11 | # react-native relies on 12 | .*/node_modules/react-tools/src/React.js 13 | .*/node_modules/react-tools/src/renderers/shared/event/EventPropagators.js 14 | .*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js 15 | .*/node_modules/react-tools/src/shared/vendor/core/ExecutionEnvironment.js 16 | 17 | # Ignore commoner tests 18 | .*/node_modules/commoner/test/.* 19 | 20 | # See https://github.com/facebook/flow/issues/442 21 | .*/react-tools/node_modules/commoner/lib/reader.js 22 | 23 | # Ignore jest 24 | .*/node_modules/jest-cli/.* 25 | 26 | # Ignore Website 27 | .*/website/.* 28 | 29 | [include] 30 | 31 | [libs] 32 | node_modules/react-native/Libraries/react-native/react-native-interface.js 33 | 34 | [options] 35 | module.system=haste 36 | 37 | munge_underscores=true 38 | 39 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 40 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub' 41 | 42 | suppress_type=$FlowIssue 43 | suppress_type=$FlowFixMe 44 | suppress_type=$FixMe 45 | 46 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-7]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 47 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-7]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 49 | 50 | [version] 51 | 0.17.0 52 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/.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 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | /** 4 | * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets. 5 | * These basically call `react-native bundle` with the correct arguments during the Android build 6 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 7 | * bundle directly from the development server. Below you can see all the possible configurations 8 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 9 | * `apply from: "react.gradle"` line. 10 | * 11 | * project.ext.react = [ 12 | * // the name of the generated asset file containing your JS bundle 13 | * bundleAssetName: "index.android.bundle", 14 | * 15 | * // the entry file for bundle generation 16 | * entryFile: "index.android.js", 17 | * 18 | * // whether to bundle JS and assets in debug mode 19 | * bundleInDebug: false, 20 | * 21 | * // whether to bundle JS and assets in release mode 22 | * bundleInRelease: true, 23 | * 24 | * // the root of your project, i.e. where "package.json" lives 25 | * root: "../../", 26 | * 27 | * // where to put the JS bundle asset in debug mode 28 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 29 | * 30 | * // where to put the JS bundle asset in release mode 31 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 32 | * 33 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 34 | * // require('./image.png')), in debug mode 35 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 36 | * 37 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 38 | * // require('./image.png')), in release mode 39 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 40 | * 41 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 42 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 43 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 44 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 45 | * // for example, you might want to remove it from here. 46 | * inputExcludes: ["android/**", "ios/**"] 47 | * ] 48 | */ 49 | 50 | apply from: "react.gradle" 51 | 52 | android { 53 | compileSdkVersion 23 54 | buildToolsVersion "23.0.1" 55 | 56 | defaultConfig { 57 | applicationId "com.reactnativetestapp" 58 | minSdkVersion 16 59 | targetSdkVersion 22 60 | versionCode 1 61 | versionName "1.0" 62 | ndk { 63 | abiFilters "armeabi-v7a", "x86" 64 | } 65 | } 66 | buildTypes { 67 | release { 68 | minifyEnabled false // Set this to true to enable Proguard 69 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 70 | } 71 | } 72 | } 73 | 74 | dependencies { 75 | compile fileTree(dir: "libs", include: ["*.jar"]) 76 | compile "com.android.support:appcompat-v7:23.0.1" 77 | compile "com.facebook.react:react-native:0.14.+" 78 | } 79 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/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 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | 30 | # Do not strip any method/class that is annotated with @DoNotStrip 31 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 32 | -keepclassmembers class * { 33 | @com.facebook.proguard.annotations.DoNotStrip *; 34 | } 35 | 36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 37 | void set*(***); 38 | *** get*(); 39 | } 40 | 41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 43 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 44 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; } 45 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; } 46 | 47 | # okhttp 48 | 49 | -keepattributes Signature 50 | -keepattributes *Annotation* 51 | -keep class com.squareup.okhttp.** { *; } 52 | -keep interface com.squareup.okhttp.** { *; } 53 | -dontwarn com.squareup.okhttp.** 54 | 55 | # okio 56 | 57 | -keep class sun.misc.Unsafe { *; } 58 | -dontwarn java.nio.file.* 59 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 60 | -dontwarn okio.** 61 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/react.gradle: -------------------------------------------------------------------------------- 1 | def config = project.hasProperty("react") ? project.react : []; 2 | 3 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" 4 | def entryFile = config.entryFile ?: "index.android.js" 5 | 6 | // because elvis operator 7 | def elvisFile(thing) { 8 | return thing ? file(thing) : null; 9 | } 10 | 11 | def reactRoot = elvisFile(config.root) ?: file("../../") 12 | def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?: 13 | file("$buildDir/intermediates/assets/debug") 14 | def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?: 15 | file("$buildDir/intermediates/assets/release") 16 | def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?: 17 | file("$buildDir/intermediates/res/merged/debug") 18 | def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?: 19 | file("$buildDir/intermediates/res/merged/release") 20 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] 21 | 22 | def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName") 23 | def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName") 24 | 25 | task bundleDebugJsAndAssets(type: Exec) { 26 | // create dirs if they are not there (e.g. the "clean" task just ran) 27 | doFirst { 28 | jsBundleDirDebug.mkdirs() 29 | resourcesDirDebug.mkdirs() 30 | } 31 | 32 | // set up inputs and outputs so gradle can cache the result 33 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 34 | outputs.dir jsBundleDirDebug 35 | outputs.dir resourcesDirDebug 36 | 37 | // set up the call to the react-native cli 38 | workingDir reactRoot 39 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 40 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 41 | 42 | enabled config.bundleInDebug ?: false 43 | } 44 | 45 | task bundleReleaseJsAndAssets(type: Exec) { 46 | // create dirs if they are not there (e.g. the "clean" task just ran) 47 | doFirst { 48 | jsBundleDirRelease.mkdirs() 49 | resourcesDirRelease.mkdirs() 50 | } 51 | 52 | // set up inputs and outputs so gradle can cache the result 53 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 54 | outputs.dir jsBundleDirRelease 55 | outputs.dir resourcesDirRelease 56 | 57 | // set up the call to the react-native cli 58 | workingDir reactRoot 59 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 60 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 61 | 62 | enabled config.bundleInRelease ?: true 63 | } 64 | 65 | gradle.projectsEvaluated { 66 | // hook bundleDebugJsAndAssets into the android build process 67 | bundleDebugJsAndAssets.dependsOn mergeDebugResources 68 | bundleDebugJsAndAssets.dependsOn mergeDebugAssets 69 | processDebugResources.dependsOn bundleDebugJsAndAssets 70 | 71 | // hook bundleReleaseJsAndAssets into the android build process 72 | bundleReleaseJsAndAssets.dependsOn mergeReleaseResources 73 | bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets 74 | processReleaseResources.dependsOn bundleReleaseJsAndAssets 75 | } 76 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/java/com/reactnativetestapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reactnativetestapp; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.KeyEvent; 6 | 7 | import com.facebook.react.LifecycleState; 8 | import com.facebook.react.ReactInstanceManager; 9 | import com.facebook.react.ReactRootView; 10 | import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; 11 | import com.facebook.react.shell.MainReactPackage; 12 | import com.facebook.soloader.SoLoader; 13 | 14 | public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { 15 | 16 | private ReactInstanceManager mReactInstanceManager; 17 | private ReactRootView mReactRootView; 18 | 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | mReactRootView = new ReactRootView(this); 23 | 24 | mReactInstanceManager = ReactInstanceManager.builder() 25 | .setApplication(getApplication()) 26 | .setBundleAssetName("index.android.bundle") 27 | .setJSMainModuleName("index.android") 28 | .addPackage(new MainReactPackage()) 29 | .setUseDeveloperSupport(BuildConfig.DEBUG) 30 | .setInitialLifecycleState(LifecycleState.RESUMED) 31 | .build(); 32 | 33 | mReactRootView.startReactApplication(mReactInstanceManager, "ReactNativeTestApp", null); 34 | 35 | setContentView(mReactRootView); 36 | } 37 | 38 | @Override 39 | public boolean onKeyUp(int keyCode, KeyEvent event) { 40 | if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { 41 | mReactInstanceManager.showDevOptionsDialog(); 42 | return true; 43 | } 44 | return super.onKeyUp(keyCode, event); 45 | } 46 | 47 | @Override 48 | public void onBackPressed() { 49 | if (mReactInstanceManager != null) { 50 | mReactInstanceManager.onBackPressed(); 51 | } else { 52 | super.onBackPressed(); 53 | } 54 | } 55 | 56 | @Override 57 | public void invokeDefaultOnBackPressed() { 58 | super.onBackPressed(); 59 | } 60 | 61 | @Override 62 | protected void onPause() { 63 | super.onPause(); 64 | 65 | if (mReactInstanceManager != null) { 66 | mReactInstanceManager.onPause(); 67 | } 68 | } 69 | 70 | @Override 71 | protected void onResume() { 72 | super.onResume(); 73 | 74 | if (mReactInstanceManager != null) { 75 | mReactInstanceManager.onResume(this); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptmt/npm-native/a229a5e8d81d4ea8e4ddaa56eb9295ff0289b2fc/test/ReactNativeTestApp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptmt/npm-native/a229a5e8d81d4ea8e4ddaa56eb9295ff0289b2fc/test/ReactNativeTestApp/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptmt/npm-native/a229a5e8d81d4ea8e4ddaa56eb9295ff0289b2fc/test/ReactNativeTestApp/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptmt/npm-native/a229a5e8d81d4ea8e4ddaa56eb9295ff0289b2fc/test/ReactNativeTestApp/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ReactNativeTestApp 3 | 4 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/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: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 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 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ptmt/npm-native/a229a5e8d81d4ea8e4ddaa56eb9295ff0289b2fc/test/ReactNativeTestApp/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ReactNativeTestApp' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | var React = require('react-native'); 8 | var { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View, 13 | } = React; 14 | 15 | var ReactNativeTestApp = React.createClass({ 16 | render: function() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.android.js 24 | 25 | 26 | Shake or press menu button for dev menu 27 | 28 | 29 | ); 30 | } 31 | }); 32 | 33 | var styles = StyleSheet.create({ 34 | container: { 35 | flex: 1, 36 | justifyContent: 'center', 37 | alignItems: 'center', 38 | backgroundColor: '#F5FCFF', 39 | }, 40 | welcome: { 41 | fontSize: 20, 42 | textAlign: 'center', 43 | margin: 10, 44 | }, 45 | instructions: { 46 | textAlign: 'center', 47 | color: '#333333', 48 | marginBottom: 5, 49 | }, 50 | }); 51 | 52 | AppRegistry.registerComponent('ReactNativeTestApp', () => ReactNativeTestApp); 53 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | var React = require('react-native'); 8 | var { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View, 13 | } = React; 14 | 15 | const GL = require("gl-react-native"); 16 | 17 | const shaders = GL.Shaders.create({ 18 | helloGL: { 19 | frag: ` 20 | precision highp float; 21 | varying vec2 uv; // This variable vary in all pixel position (normalized from vec2(0.0,0.0) to vec2(1.0,1.0)) 22 | 23 | void main () { // This function is called FOR EACH PIXEL 24 | gl_FragColor = vec4(uv.x, uv.y, 0.5, 1.0); // red vary over X, green vary over Y, blue is 50%, alpha is 100%. 25 | } 26 | ` 27 | } 28 | }); 29 | 30 | class HelloGL extends React.Component { 31 | render () { 32 | const { width, height } = this.props; 33 | return ; 39 | } 40 | } 41 | 42 | var ReactNativeTestApp = React.createClass({ 43 | render: function() { 44 | return ( 45 | 46 | 47 | 48 | ); 49 | } 50 | }); 51 | 52 | var styles = StyleSheet.create({ 53 | container: { 54 | flex: 1, 55 | justifyContent: 'center', 56 | alignItems: 'center', 57 | backgroundColor: '#F5FCFF', 58 | }, 59 | welcome: { 60 | fontSize: 20, 61 | textAlign: 'center', 62 | margin: 10, 63 | }, 64 | instructions: { 65 | textAlign: 'center', 66 | color: '#333333', 67 | marginBottom: 5, 68 | }, 69 | }); 70 | 71 | AppRegistry.registerComponent('ReactNativeTestApp', () => ReactNativeTestApp); 72 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | /* Begin PBXBuildFile section */ 9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 14 | 00E356F31AD99517003FC87E /* ReactNativeTestAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactNativeTestAppTests.m */; }; 15 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 22 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXContainerItemProxy section */ 27 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 30 | proxyType = 2; 31 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 32 | remoteInfo = RCTActionSheet; 33 | }; 34 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 39 | remoteInfo = RCTGeolocation; 40 | }; 41 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 44 | proxyType = 2; 45 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 46 | remoteInfo = RCTImage; 47 | }; 48 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 49 | isa = PBXContainerItemProxy; 50 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 51 | proxyType = 2; 52 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 53 | remoteInfo = RCTNetwork; 54 | }; 55 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 56 | isa = PBXContainerItemProxy; 57 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 58 | proxyType = 2; 59 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 60 | remoteInfo = RCTVibration; 61 | }; 62 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 63 | isa = PBXContainerItemProxy; 64 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 65 | proxyType = 1; 66 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 67 | remoteInfo = ReactNativeTestApp; 68 | }; 69 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 70 | isa = PBXContainerItemProxy; 71 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 72 | proxyType = 2; 73 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 74 | remoteInfo = RCTSettings; 75 | }; 76 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 77 | isa = PBXContainerItemProxy; 78 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 79 | proxyType = 2; 80 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 81 | remoteInfo = RCTWebSocket; 82 | }; 83 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 84 | isa = PBXContainerItemProxy; 85 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 86 | proxyType = 2; 87 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 88 | remoteInfo = React; 89 | }; 90 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 91 | isa = PBXContainerItemProxy; 92 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 93 | proxyType = 2; 94 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 95 | remoteInfo = RCTLinking; 96 | }; 97 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 98 | isa = PBXContainerItemProxy; 99 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 100 | proxyType = 2; 101 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 102 | remoteInfo = RCTText; 103 | }; 104 | /* End PBXContainerItemProxy section */ 105 | 106 | /* Begin PBXFileReference section */ 107 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 108 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 109 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 110 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 111 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 112 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 113 | 00E356EE1AD99517003FC87E /* ReactNativeTestAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactNativeTestAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 114 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 115 | 00E356F21AD99517003FC87E /* ReactNativeTestAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeTestAppTests.m; sourceTree = ""; }; 116 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 117 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 118 | 13B07F961A680F5B00A75B9A /* ReactNativeTestApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactNativeTestApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 119 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ReactNativeTestApp/AppDelegate.h; sourceTree = ""; }; 120 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ReactNativeTestApp/AppDelegate.m; sourceTree = ""; }; 121 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 122 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ReactNativeTestApp/Images.xcassets; sourceTree = ""; }; 123 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeTestApp/Info.plist; sourceTree = ""; }; 124 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ReactNativeTestApp/main.m; sourceTree = ""; }; 125 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 126 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 127 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 128 | /* End PBXFileReference section */ 129 | 130 | /* Begin PBXFrameworksBuildPhase section */ 131 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 132 | isa = PBXFrameworksBuildPhase; 133 | buildActionMask = 2147483647; 134 | files = ( 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 139 | isa = PBXFrameworksBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 143 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 144 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 145 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 146 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 147 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 148 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 149 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 150 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 151 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXFrameworksBuildPhase section */ 156 | 157 | /* Begin PBXGroup section */ 158 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 162 | ); 163 | name = Products; 164 | sourceTree = ""; 165 | }; 166 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 170 | ); 171 | name = Products; 172 | sourceTree = ""; 173 | }; 174 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 178 | ); 179 | name = Products; 180 | sourceTree = ""; 181 | }; 182 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 186 | ); 187 | name = Products; 188 | sourceTree = ""; 189 | }; 190 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 194 | ); 195 | name = Products; 196 | sourceTree = ""; 197 | }; 198 | 00E356EF1AD99517003FC87E /* ReactNativeTestAppTests */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | 00E356F21AD99517003FC87E /* ReactNativeTestAppTests.m */, 202 | 00E356F01AD99517003FC87E /* Supporting Files */, 203 | ); 204 | path = ReactNativeTestAppTests; 205 | sourceTree = ""; 206 | }; 207 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | 00E356F11AD99517003FC87E /* Info.plist */, 211 | ); 212 | name = "Supporting Files"; 213 | sourceTree = ""; 214 | }; 215 | 139105B71AF99BAD00B5F7CC /* Products */ = { 216 | isa = PBXGroup; 217 | children = ( 218 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 219 | ); 220 | name = Products; 221 | sourceTree = ""; 222 | }; 223 | 139FDEE71B06529A00C62182 /* Products */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 227 | ); 228 | name = Products; 229 | sourceTree = ""; 230 | }; 231 | 13B07FAE1A68108700A75B9A /* ReactNativeTestApp */ = { 232 | isa = PBXGroup; 233 | children = ( 234 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 235 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 236 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 237 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 238 | 13B07FB61A68108700A75B9A /* Info.plist */, 239 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 240 | 13B07FB71A68108700A75B9A /* main.m */, 241 | ); 242 | name = ReactNativeTestApp; 243 | sourceTree = ""; 244 | }; 245 | 146834001AC3E56700842450 /* Products */ = { 246 | isa = PBXGroup; 247 | children = ( 248 | 146834041AC3E56700842450 /* libReact.a */, 249 | ); 250 | name = Products; 251 | sourceTree = ""; 252 | }; 253 | 78C398B11ACF4ADC00677621 /* Products */ = { 254 | isa = PBXGroup; 255 | children = ( 256 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 257 | ); 258 | name = Products; 259 | sourceTree = ""; 260 | }; 261 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 262 | isa = PBXGroup; 263 | children = ( 264 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 265 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 266 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 267 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 268 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 269 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 270 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 271 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 272 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 273 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 274 | ); 275 | name = Libraries; 276 | sourceTree = ""; 277 | }; 278 | 832341B11AAA6A8300B99B32 /* Products */ = { 279 | isa = PBXGroup; 280 | children = ( 281 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 282 | ); 283 | name = Products; 284 | sourceTree = ""; 285 | }; 286 | 83CBB9F61A601CBA00E9B192 = { 287 | isa = PBXGroup; 288 | children = ( 289 | 13B07FAE1A68108700A75B9A /* ReactNativeTestApp */, 290 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 291 | 00E356EF1AD99517003FC87E /* ReactNativeTestAppTests */, 292 | 83CBBA001A601CBA00E9B192 /* Products */, 293 | ); 294 | indentWidth = 2; 295 | sourceTree = ""; 296 | tabWidth = 2; 297 | }; 298 | 83CBBA001A601CBA00E9B192 /* Products */ = { 299 | isa = PBXGroup; 300 | children = ( 301 | 13B07F961A680F5B00A75B9A /* ReactNativeTestApp.app */, 302 | 00E356EE1AD99517003FC87E /* ReactNativeTestAppTests.xctest */, 303 | ); 304 | name = Products; 305 | sourceTree = ""; 306 | }; 307 | /* End PBXGroup section */ 308 | 309 | /* Begin PBXNativeTarget section */ 310 | 00E356ED1AD99517003FC87E /* ReactNativeTestAppTests */ = { 311 | isa = PBXNativeTarget; 312 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeTestAppTests" */; 313 | buildPhases = ( 314 | 00E356EA1AD99517003FC87E /* Sources */, 315 | 00E356EB1AD99517003FC87E /* Frameworks */, 316 | 00E356EC1AD99517003FC87E /* Resources */, 317 | ); 318 | buildRules = ( 319 | ); 320 | dependencies = ( 321 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 322 | ); 323 | name = ReactNativeTestAppTests; 324 | productName = ReactNativeTestAppTests; 325 | productReference = 00E356EE1AD99517003FC87E /* ReactNativeTestAppTests.xctest */; 326 | productType = "com.apple.product-type.bundle.unit-test"; 327 | }; 328 | 13B07F861A680F5B00A75B9A /* ReactNativeTestApp */ = { 329 | isa = PBXNativeTarget; 330 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeTestApp" */; 331 | buildPhases = ( 332 | 13B07F871A680F5B00A75B9A /* Sources */, 333 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 334 | 13B07F8E1A680F5B00A75B9A /* Resources */, 335 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 336 | ); 337 | buildRules = ( 338 | ); 339 | dependencies = ( 340 | ); 341 | name = ReactNativeTestApp; 342 | productName = "Hello World"; 343 | productReference = 13B07F961A680F5B00A75B9A /* ReactNativeTestApp.app */; 344 | productType = "com.apple.product-type.application"; 345 | }; 346 | /* End PBXNativeTarget section */ 347 | 348 | /* Begin PBXProject section */ 349 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 350 | isa = PBXProject; 351 | attributes = { 352 | LastUpgradeCheck = 610; 353 | ORGANIZATIONNAME = Facebook; 354 | TargetAttributes = { 355 | 00E356ED1AD99517003FC87E = { 356 | CreatedOnToolsVersion = 6.2; 357 | TestTargetID = 13B07F861A680F5B00A75B9A; 358 | }; 359 | }; 360 | }; 361 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeTestApp" */; 362 | compatibilityVersion = "Xcode 3.2"; 363 | developmentRegion = English; 364 | hasScannedForEncodings = 0; 365 | knownRegions = ( 366 | en, 367 | Base, 368 | ); 369 | mainGroup = 83CBB9F61A601CBA00E9B192; 370 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 371 | projectDirPath = ""; 372 | projectReferences = ( 373 | { 374 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 375 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 376 | }, 377 | { 378 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 379 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 380 | }, 381 | { 382 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 383 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 384 | }, 385 | { 386 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 387 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 388 | }, 389 | { 390 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 391 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 392 | }, 393 | { 394 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 395 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 396 | }, 397 | { 398 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 399 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 400 | }, 401 | { 402 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 403 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 404 | }, 405 | { 406 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 407 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 408 | }, 409 | { 410 | ProductGroup = 146834001AC3E56700842450 /* Products */; 411 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 412 | }, 413 | ); 414 | projectRoot = ""; 415 | targets = ( 416 | 13B07F861A680F5B00A75B9A /* ReactNativeTestApp */, 417 | 00E356ED1AD99517003FC87E /* ReactNativeTestAppTests */, 418 | ); 419 | }; 420 | /* End PBXProject section */ 421 | 422 | /* Begin PBXReferenceProxy section */ 423 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 424 | isa = PBXReferenceProxy; 425 | fileType = archive.ar; 426 | path = libRCTActionSheet.a; 427 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 428 | sourceTree = BUILT_PRODUCTS_DIR; 429 | }; 430 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 431 | isa = PBXReferenceProxy; 432 | fileType = archive.ar; 433 | path = libRCTGeolocation.a; 434 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 435 | sourceTree = BUILT_PRODUCTS_DIR; 436 | }; 437 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 438 | isa = PBXReferenceProxy; 439 | fileType = archive.ar; 440 | path = libRCTImage.a; 441 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 442 | sourceTree = BUILT_PRODUCTS_DIR; 443 | }; 444 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 445 | isa = PBXReferenceProxy; 446 | fileType = archive.ar; 447 | path = libRCTNetwork.a; 448 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 449 | sourceTree = BUILT_PRODUCTS_DIR; 450 | }; 451 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 452 | isa = PBXReferenceProxy; 453 | fileType = archive.ar; 454 | path = libRCTVibration.a; 455 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 456 | sourceTree = BUILT_PRODUCTS_DIR; 457 | }; 458 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 459 | isa = PBXReferenceProxy; 460 | fileType = archive.ar; 461 | path = libRCTSettings.a; 462 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 463 | sourceTree = BUILT_PRODUCTS_DIR; 464 | }; 465 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 466 | isa = PBXReferenceProxy; 467 | fileType = archive.ar; 468 | path = libRCTWebSocket.a; 469 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 470 | sourceTree = BUILT_PRODUCTS_DIR; 471 | }; 472 | 146834041AC3E56700842450 /* libReact.a */ = { 473 | isa = PBXReferenceProxy; 474 | fileType = archive.ar; 475 | path = libReact.a; 476 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 477 | sourceTree = BUILT_PRODUCTS_DIR; 478 | }; 479 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 480 | isa = PBXReferenceProxy; 481 | fileType = archive.ar; 482 | path = libRCTLinking.a; 483 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 484 | sourceTree = BUILT_PRODUCTS_DIR; 485 | }; 486 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 487 | isa = PBXReferenceProxy; 488 | fileType = archive.ar; 489 | path = libRCTText.a; 490 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 491 | sourceTree = BUILT_PRODUCTS_DIR; 492 | }; 493 | /* End PBXReferenceProxy section */ 494 | 495 | /* Begin PBXResourcesBuildPhase section */ 496 | 00E356EC1AD99517003FC87E /* Resources */ = { 497 | isa = PBXResourcesBuildPhase; 498 | buildActionMask = 2147483647; 499 | files = ( 500 | ); 501 | runOnlyForDeploymentPostprocessing = 0; 502 | }; 503 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 504 | isa = PBXResourcesBuildPhase; 505 | buildActionMask = 2147483647; 506 | files = ( 507 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 508 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 509 | ); 510 | runOnlyForDeploymentPostprocessing = 0; 511 | }; 512 | /* End PBXResourcesBuildPhase section */ 513 | 514 | /* Begin PBXShellScriptBuildPhase section */ 515 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 516 | isa = PBXShellScriptBuildPhase; 517 | buildActionMask = 2147483647; 518 | files = ( 519 | ); 520 | inputPaths = ( 521 | ); 522 | name = "Bundle React Native code and images"; 523 | outputPaths = ( 524 | ); 525 | runOnlyForDeploymentPostprocessing = 0; 526 | shellPath = /bin/sh; 527 | shellScript = "../node_modules/react-native/packager/react-native-xcode.sh"; 528 | }; 529 | /* End PBXShellScriptBuildPhase section */ 530 | 531 | /* Begin PBXSourcesBuildPhase section */ 532 | 00E356EA1AD99517003FC87E /* Sources */ = { 533 | isa = PBXSourcesBuildPhase; 534 | buildActionMask = 2147483647; 535 | files = ( 536 | 00E356F31AD99517003FC87E /* ReactNativeTestAppTests.m in Sources */, 537 | ); 538 | runOnlyForDeploymentPostprocessing = 0; 539 | }; 540 | 13B07F871A680F5B00A75B9A /* Sources */ = { 541 | isa = PBXSourcesBuildPhase; 542 | buildActionMask = 2147483647; 543 | files = ( 544 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 545 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 546 | ); 547 | runOnlyForDeploymentPostprocessing = 0; 548 | }; 549 | /* End PBXSourcesBuildPhase section */ 550 | 551 | /* Begin PBXTargetDependency section */ 552 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 553 | isa = PBXTargetDependency; 554 | target = 13B07F861A680F5B00A75B9A /* ReactNativeTestApp */; 555 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 556 | }; 557 | /* End PBXTargetDependency section */ 558 | 559 | /* Begin PBXVariantGroup section */ 560 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 561 | isa = PBXVariantGroup; 562 | children = ( 563 | 13B07FB21A68108700A75B9A /* Base */, 564 | ); 565 | name = LaunchScreen.xib; 566 | path = ReactNativeTestApp; 567 | sourceTree = ""; 568 | }; 569 | /* End PBXVariantGroup section */ 570 | 571 | /* Begin XCBuildConfiguration section */ 572 | 00E356F61AD99517003FC87E /* Debug */ = { 573 | isa = XCBuildConfiguration; 574 | buildSettings = { 575 | BUNDLE_LOADER = "$(TEST_HOST)"; 576 | FRAMEWORK_SEARCH_PATHS = ( 577 | "$(SDKROOT)/Developer/Library/Frameworks", 578 | "$(inherited)", 579 | ); 580 | GCC_PREPROCESSOR_DEFINITIONS = ( 581 | "DEBUG=1", 582 | "$(inherited)", 583 | ); 584 | INFOPLIST_FILE = ReactNativeTestAppTests/Info.plist; 585 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 586 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 587 | LIBRARY_SEARCH_PATHS = ( 588 | "$(inherited)", 589 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 590 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 591 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 592 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 593 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 594 | ); 595 | PRODUCT_NAME = "$(TARGET_NAME)"; 596 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeTestApp.app/ReactNativeTestApp"; 597 | }; 598 | name = Debug; 599 | }; 600 | 00E356F71AD99517003FC87E /* Release */ = { 601 | isa = XCBuildConfiguration; 602 | buildSettings = { 603 | BUNDLE_LOADER = "$(TEST_HOST)"; 604 | COPY_PHASE_STRIP = NO; 605 | FRAMEWORK_SEARCH_PATHS = ( 606 | "$(SDKROOT)/Developer/Library/Frameworks", 607 | "$(inherited)", 608 | ); 609 | INFOPLIST_FILE = ReactNativeTestAppTests/Info.plist; 610 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 611 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 612 | LIBRARY_SEARCH_PATHS = ( 613 | "$(inherited)", 614 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 615 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 616 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 617 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 618 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 619 | ); 620 | PRODUCT_NAME = "$(TARGET_NAME)"; 621 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeTestApp.app/ReactNativeTestApp"; 622 | }; 623 | name = Release; 624 | }; 625 | 13B07F941A680F5B00A75B9A /* Debug */ = { 626 | isa = XCBuildConfiguration; 627 | buildSettings = { 628 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 629 | DEAD_CODE_STRIPPING = NO; 630 | HEADER_SEARCH_PATHS = ( 631 | "$(inherited)", 632 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 633 | "$(SRCROOT)/../node_modules/react-native/React/**", 634 | ); 635 | INFOPLIST_FILE = ReactNativeTestApp/Info.plist; 636 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 637 | OTHER_LDFLAGS = "-ObjC"; 638 | PRODUCT_NAME = ReactNativeTestApp; 639 | }; 640 | name = Debug; 641 | }; 642 | 13B07F951A680F5B00A75B9A /* Release */ = { 643 | isa = XCBuildConfiguration; 644 | buildSettings = { 645 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 646 | HEADER_SEARCH_PATHS = ( 647 | "$(inherited)", 648 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 649 | "$(SRCROOT)/../node_modules/react-native/React/**", 650 | ); 651 | INFOPLIST_FILE = ReactNativeTestApp/Info.plist; 652 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 653 | OTHER_LDFLAGS = "-ObjC"; 654 | PRODUCT_NAME = ReactNativeTestApp; 655 | }; 656 | name = Release; 657 | }; 658 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 659 | isa = XCBuildConfiguration; 660 | buildSettings = { 661 | ALWAYS_SEARCH_USER_PATHS = NO; 662 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 663 | CLANG_CXX_LIBRARY = "libc++"; 664 | CLANG_ENABLE_MODULES = YES; 665 | CLANG_ENABLE_OBJC_ARC = YES; 666 | CLANG_WARN_BOOL_CONVERSION = YES; 667 | CLANG_WARN_CONSTANT_CONVERSION = YES; 668 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 669 | CLANG_WARN_EMPTY_BODY = YES; 670 | CLANG_WARN_ENUM_CONVERSION = YES; 671 | CLANG_WARN_INT_CONVERSION = YES; 672 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 673 | CLANG_WARN_UNREACHABLE_CODE = YES; 674 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 675 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 676 | COPY_PHASE_STRIP = NO; 677 | ENABLE_STRICT_OBJC_MSGSEND = YES; 678 | GCC_C_LANGUAGE_STANDARD = gnu99; 679 | GCC_DYNAMIC_NO_PIC = NO; 680 | GCC_OPTIMIZATION_LEVEL = 0; 681 | GCC_PREPROCESSOR_DEFINITIONS = ( 682 | "DEBUG=1", 683 | "$(inherited)", 684 | ); 685 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 686 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 687 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 688 | GCC_WARN_UNDECLARED_SELECTOR = YES; 689 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 690 | GCC_WARN_UNUSED_FUNCTION = YES; 691 | GCC_WARN_UNUSED_VARIABLE = YES; 692 | HEADER_SEARCH_PATHS = ( 693 | "$(inherited)", 694 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 695 | "$(SRCROOT)/../node_modules/react-native/React/**", 696 | ); 697 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 698 | MTL_ENABLE_DEBUG_INFO = YES; 699 | ONLY_ACTIVE_ARCH = YES; 700 | SDKROOT = iphoneos; 701 | }; 702 | name = Debug; 703 | }; 704 | 83CBBA211A601CBA00E9B192 /* Release */ = { 705 | isa = XCBuildConfiguration; 706 | buildSettings = { 707 | ALWAYS_SEARCH_USER_PATHS = NO; 708 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 709 | CLANG_CXX_LIBRARY = "libc++"; 710 | CLANG_ENABLE_MODULES = YES; 711 | CLANG_ENABLE_OBJC_ARC = YES; 712 | CLANG_WARN_BOOL_CONVERSION = YES; 713 | CLANG_WARN_CONSTANT_CONVERSION = YES; 714 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 715 | CLANG_WARN_EMPTY_BODY = YES; 716 | CLANG_WARN_ENUM_CONVERSION = YES; 717 | CLANG_WARN_INT_CONVERSION = YES; 718 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 719 | CLANG_WARN_UNREACHABLE_CODE = YES; 720 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 721 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 722 | COPY_PHASE_STRIP = YES; 723 | ENABLE_NS_ASSERTIONS = NO; 724 | ENABLE_STRICT_OBJC_MSGSEND = YES; 725 | GCC_C_LANGUAGE_STANDARD = gnu99; 726 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 727 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 728 | GCC_WARN_UNDECLARED_SELECTOR = YES; 729 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 730 | GCC_WARN_UNUSED_FUNCTION = YES; 731 | GCC_WARN_UNUSED_VARIABLE = YES; 732 | HEADER_SEARCH_PATHS = ( 733 | "$(inherited)", 734 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 735 | "$(SRCROOT)/../node_modules/react-native/React/**", 736 | ); 737 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 738 | MTL_ENABLE_DEBUG_INFO = NO; 739 | SDKROOT = iphoneos; 740 | VALIDATE_PRODUCT = YES; 741 | }; 742 | name = Release; 743 | }; 744 | /* End XCBuildConfiguration section */ 745 | 746 | /* Begin XCConfigurationList section */ 747 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeTestAppTests" */ = { 748 | isa = XCConfigurationList; 749 | buildConfigurations = ( 750 | 00E356F61AD99517003FC87E /* Debug */, 751 | 00E356F71AD99517003FC87E /* Release */, 752 | ); 753 | defaultConfigurationIsVisible = 0; 754 | defaultConfigurationName = Release; 755 | }; 756 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeTestApp" */ = { 757 | isa = XCConfigurationList; 758 | buildConfigurations = ( 759 | 13B07F941A680F5B00A75B9A /* Debug */, 760 | 13B07F951A680F5B00A75B9A /* Release */, 761 | ); 762 | defaultConfigurationIsVisible = 0; 763 | defaultConfigurationName = Release; 764 | }; 765 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeTestApp" */ = { 766 | isa = XCConfigurationList; 767 | buildConfigurations = ( 768 | 83CBBA201A601CBA00E9B192 /* Debug */, 769 | 83CBBA211A601CBA00E9B192 /* Release */, 770 | ); 771 | defaultConfigurationIsVisible = 0; 772 | defaultConfigurationName = Release; 773 | }; 774 | /* End XCConfigurationList section */ 775 | }; 776 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 777 | } 778 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp.xcodeproj/xcshareddata/xcschemes/ReactNativeTestApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | /** 21 | * Loading JavaScript code - uncomment the one you want. 22 | * 23 | * OPTION 1 24 | * Load from development server. Start the server from the repository root: 25 | * 26 | * $ npm start 27 | * 28 | * To run on device, change `localhost` to the IP address of your computer 29 | * (you can get this by typing `ifconfig` into the terminal and selecting the 30 | * `inet` value under `en0:`) and make sure your computer and iOS device are 31 | * on the same Wi-Fi network. 32 | */ 33 | 34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 35 | 36 | /** 37 | * OPTION 2 38 | * Load from pre-bundled file on disk. The static bundle is automatically 39 | * generated by "Bundle React Native code and images" build step. 40 | */ 41 | 42 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 43 | 44 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 45 | moduleName:@"ReactNativeTestApp" 46 | initialProperties:nil 47 | launchOptions:launchOptions]; 48 | 49 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 50 | UIViewController *rootViewController = [[UIViewController alloc] init]; 51 | rootViewController.view = rootView; 52 | self.window.rootViewController = rootViewController; 53 | [self.window makeKeyAndVisible]; 54 | return YES; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSAllowsArbitraryLoads 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestApp/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 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 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/ios/ReactNativeTestAppTests/ReactNativeTestAppTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 240 17 | #define TEXT_TO_LOOK_FOR @"GL_VIEW" 18 | 19 | @interface ReactNativeTestAppTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation ReactNativeTestAppTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /test/ReactNativeTestApp/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ReactNativeTestApp", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node_modules/react-native/packager/packager.sh" 7 | }, 8 | "dependencies": { 9 | "gl-react-native": "^1.2.7", 10 | "react-native": "^0.14.2" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/objc_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export REACT_PACKAGER_LOG="server.log" 6 | 7 | function cleanup { 8 | echo "cleanup before exit" 9 | EXIT_CODE=$? 10 | set +e 11 | 12 | if [ $EXIT_CODE -ne 0 ]; 13 | then 14 | WATCHMAN_LOGS=/usr/local/Cellar/watchman/3.1/var/run/watchman/$USER.log 15 | [ -f $WATCHMAN_LOGS ] && cat $WATCHMAN_LOGS 16 | 17 | [ -f $REACT_PACKAGER_LOG ] && cat $REACT_PACKAGER_LOG 18 | fi 19 | [ $SERVER_PID ] && kill -9 $SERVER_PID 20 | } 21 | trap cleanup EXIT 22 | 23 | ./ReactNativeTestApp/node_modules/react-native/packager/packager.sh --nonPersistent & 24 | SERVER_PID=$! 25 | 26 | xctool test \ 27 | -project ReactNativeTestApp/ios/ReactNativeTestApp.xcodeproj \ 28 | -scheme ReactNativeTestApp \ 29 | -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 5,OS=9.1' 30 | -------------------------------------------------------------------------------- /test/simple_xcode_dependency.js: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | import childProcess from 'child_process'; 3 | import { addDependency, removeDependency } from '../src/index'; 4 | 5 | const targetProject = './ReactNativeTestApp/ios/ReactNativeTestApp.xcodeproj'; 6 | const depProject = './ReactNativeTestApp/node_modules/gl-react-native/RNGL.xcodeproj'; 7 | 8 | test.before('cleanup before', t => { 9 | removeDependency({ 10 | targetProject, 11 | depProject 12 | }); 13 | t.end(); 14 | }); 15 | 16 | test.after('cleanup after', t => { 17 | removeDependency({ 18 | targetProject, 19 | depProject 20 | }); 21 | t.end(); 22 | }); 23 | 24 | 25 | test('Build without added dependency should fail', t => { 26 | childProcess.exec('./objc_test.sh', (error, stdout, stderr) => { 27 | t.is(error, null); 28 | t.is(stderr, null); 29 | t.is(stdout.indexOf('Couldn\'t find element with text GL_VIEW') > -1, true); 30 | t.end(); 31 | }); 32 | }); 33 | 34 | 35 | test('If we add required dependency then build should pass', t => { 36 | // add dependency 37 | addDependency({ 38 | targetProject, 39 | depProject 40 | }); 41 | // check if build is ok 42 | childProcess.exec('./objc_test.sh', (error, stdout, stderr) => { 43 | t.is(error, null); 44 | t.is(stderr, null); 45 | t.is(stdout.indexOf('Couldn\'t find element with text GL_VIEW') === -1, true); 46 | t.end(); 47 | }); 48 | 49 | }); 50 | --------------------------------------------------------------------------------