diff --git a/Examples/AnimatedGradient/.buckconfig b/Examples/AnimatedGradient/.buckconfig new file mode 100644 index 0000000..934256c --- /dev/null +++ b/Examples/AnimatedGradient/.buckconfig @@ -0,0 +1,6 @@ + +[android] + target = Google Inc.:Google APIs:23 + +[maven_repositories] + central = https://repo1.maven.org/maven2 diff --git a/Examples/AnimatedGradient/.flowconfig b/Examples/AnimatedGradient/.flowconfig index 8eadd33..f56848d 100644 --- a/Examples/AnimatedGradient/.flowconfig +++ b/Examples/AnimatedGradient/.flowconfig @@ -14,17 +14,21 @@ # Ignore react and fbjs where there are overlaps, but don't ignore # anything that react-native relies on -.*/node_modules/fbjs-haste/.*/__tests__/.* -.*/node_modules/fbjs-haste/__forks__/Map.js -.*/node_modules/fbjs-haste/__forks__/Promise.js -.*/node_modules/fbjs-haste/__forks__/fetch.js -.*/node_modules/fbjs-haste/core/ExecutionEnvironment.js -.*/node_modules/fbjs-haste/core/isEmpty.js -.*/node_modules/fbjs-haste/crypto/crc32.js -.*/node_modules/fbjs-haste/stubs/ErrorUtils.js -.*/node_modules/react-haste/React.js -.*/node_modules/react-haste/renderers/dom/ReactDOM.js -.*/node_modules/react-haste/renderers/shared/event/eventPlugins/ResponderEventPlugin.js +.*/node_modules/fbjs/lib/Map.js +.*/node_modules/fbjs/lib/fetch.js +.*/node_modules/fbjs/lib/ExecutionEnvironment.js +.*/node_modules/fbjs/lib/ErrorUtils.js + +# Flow has a built-in definition for the 'react' module which we prefer to use +# over the currently-untyped source +.*/node_modules/react/react.js +.*/node_modules/react/lib/React.js +.*/node_modules/react/lib/ReactDOM.js + +.*/__mocks__/.* +.*/__tests__/.* + +.*/commoner/test/source/widget/share.js # Ignore commoner tests .*/node_modules/commoner/test/.* @@ -38,26 +42,55 @@ # Ignore Website .*/website/.* +# Ignore generators +.*/local-cli/generator.* + +# Ignore BUCK generated folders +.*\.buckd/ + +.*/node_modules/is-my-json-valid/test/.*\.json +.*/node_modules/iconv-lite/encodings/tables/.*\.json +.*/node_modules/y18n/test/.*\.json +.*/node_modules/spdx-license-ids/spdx-license-ids.json +.*/node_modules/spdx-exceptions/index.json +.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json +.*/node_modules/resolve/lib/core.json +.*/node_modules/jsonparse/samplejson/.*\.json +.*/node_modules/json5/test/.*\.json +.*/node_modules/ua-parser-js/test/.*\.json +.*/node_modules/builtin-modules/builtin-modules.json +.*/node_modules/binary-extensions/binary-extensions.json +.*/node_modules/url-regex/tlds.json +.*/node_modules/joi/.*\.json +.*/node_modules/isemail/.*\.json +.*/node_modules/tr46/.*\.json + + [include] [libs] node_modules/react-native/Libraries/react-native/react-native-interface.js +node_modules/react-native/flow +flow/ [options] module.system=haste +esproposal.class_static_fields=enable +esproposal.class_instance_fields=enable + munge_underscores=true module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' -module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub' +module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub' suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-3]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-3]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy [version] -0.18.1 +0.23.0 diff --git a/Examples/AnimatedGradient/.gitignore b/Examples/AnimatedGradient/.gitignore index 07e4fe7..e2694b1 100644 --- a/Examples/AnimatedGradient/.gitignore +++ b/Examples/AnimatedGradient/.gitignore @@ -1 +1,41 @@ -node_modules/**/* +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +project.xcworkspace + +# Android/IJ +# +.idea +.gradle +local.properties + +# node.js +# +node_modules/ +npm-debug.log +*.jsbundle + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index d39c9b0..0000000 --- a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcshareddata/AnimatedGradient.xccheckout b/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcshareddata/AnimatedGradient.xccheckout deleted file mode 100644 index b0cec9c..0000000 --- a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcshareddata/AnimatedGradient.xccheckout +++ /dev/null @@ -1,41 +0,0 @@ - - - - - IDESourceControlProjectFavoriteDictionaryKey - - IDESourceControlProjectIdentifier - 439833FD-A58F-4243-8AD6-E877313B0F6A - IDESourceControlProjectName - AnimatedGradient - IDESourceControlProjectOriginsDictionary - - C854EADF02A501C352F1C31CE594A07F661B2A78 - github.com:brentvatne/react-native-linear-gradient.git - - IDESourceControlProjectPath - Examples/AnimatedGradient/AnimatedGradient.xcodeproj - IDESourceControlProjectRelativeInstallPathDictionary - - C854EADF02A501C352F1C31CE594A07F661B2A78 - ../../../.. - - IDESourceControlProjectURL - github.com:brentvatne/react-native-linear-gradient.git - IDESourceControlProjectVersion - 111 - IDESourceControlProjectWCCIdentifier - C854EADF02A501C352F1C31CE594A07F661B2A78 - IDESourceControlProjectWCConfigurations - - - IDESourceControlRepositoryExtensionIdentifierKey - public.vcs.git - IDESourceControlWCCIdentifierKey - C854EADF02A501C352F1C31CE594A07F661B2A78 - IDESourceControlWCCName - react-native-linear-gradient - - - - diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcshareddata/AnimatedGradient.xcscmblueprint b/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcshareddata/AnimatedGradient.xcscmblueprint deleted file mode 100644 index 29931f9..0000000 --- a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcshareddata/AnimatedGradient.xcscmblueprint +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "C854EADF02A501C352F1C31CE594A07F661B2A78", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "16CE14A2D81CCE323D476004724594AEF6B38C0A" : 0, - "C854EADF02A501C352F1C31CE594A07F661B2A78" : 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "439833FD-A58F-4243-8AD6-E877313B0F6A", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "16CE14A2D81CCE323D476004724594AEF6B38C0A" : "", - "C854EADF02A501C352F1C31CE594A07F661B2A78" : "react-native-linear-gradient" - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "AnimatedGradient", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Examples\/AnimatedGradient\/AnimatedGradient.xcodeproj", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:exponentjs\/react-native.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "16CE14A2D81CCE323D476004724594AEF6B38C0A" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:brentvatne\/react-native-linear-gradient.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C854EADF02A501C352F1C31CE594A07F661B2A78" - } - ] -} \ No newline at end of file diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcuserdata/brent.xcuserdatad/UserInterfaceState.xcuserstate b/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcuserdata/brent.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index ffc02fe..0000000 Binary files a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcuserdata/brent.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcuserdata/brentvatne.xcuserdatad/UserInterfaceState.xcuserstate b/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcuserdata/brentvatne.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index dc2398c..0000000 Binary files a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.xcworkspace/xcuserdata/brentvatne.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcuserdata/brent.xcuserdatad/xcschemes/xcschememanagement.plist b/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcuserdata/brent.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index c69a54d..0000000 --- a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcuserdata/brent.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - AnimatedGradient.xcscheme_^#shared#^_ - - orderHint - 0 - - - SuppressBuildableAutocreation - - 13B07F861A680F5B00A75B9A - - primary - - - - - diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcuserdata/brentvatne.xcuserdatad/xcschemes/xcschememanagement.plist b/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcuserdata/brentvatne.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index c69a54d..0000000 --- a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcuserdata/brentvatne.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - SchemeUserState - - AnimatedGradient.xcscheme_^#shared#^_ - - orderHint - 0 - - - SuppressBuildableAutocreation - - 13B07F861A680F5B00A75B9A - - primary - - - - - diff --git a/Examples/AnimatedGradient/android/app/BUCK b/Examples/AnimatedGradient/android/app/BUCK new file mode 100644 index 0000000..f833a08 --- /dev/null +++ b/Examples/AnimatedGradient/android/app/BUCK @@ -0,0 +1,66 @@ +import re + +# To learn about Buck see [Docs](https://buckbuild.com/). +# To run your application with Buck: +# - install Buck +# - `npm start` - to start the packager +# - `cd android` +# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US` +# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck +# - `buck install -r android/app` - compile, install and run application +# + +lib_deps = [] +for jarfile in glob(['libs/*.jar']): + name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) + lib_deps.append(':' + name) + prebuilt_jar( + name = name, + binary_jar = jarfile, + ) + +for aarfile in glob(['libs/*.aar']): + name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) + lib_deps.append(':' + name) + android_prebuilt_aar( + name = name, + aar = aarfile, + ) + +android_library( + name = 'all-libs', + exported_deps = lib_deps +) + +android_library( + name = 'app-code', + srcs = glob([ + 'src/main/java/**/*.java', + ]), + deps = [ + ':all-libs', + ':build_config', + ':res', + ], +) + +android_build_config( + name = 'build_config', + package = 'com.animatedgradient', +) + +android_resource( + name = 'res', + res = 'src/main/res', + package = 'com.animatedgradient', +) + +android_binary( + name = 'app', + package_type = 'debug', + manifest = 'src/main/AndroidManifest.xml', + keystore = '//android/keystores:debug', + deps = [ + ':app-code', + ], +) diff --git a/Examples/AnimatedGradient/android/app/build.gradle b/Examples/AnimatedGradient/android/app/build.gradle index 0ca9bf4..cda4905 100644 --- a/Examples/AnimatedGradient/android/app/build.gradle +++ b/Examples/AnimatedGradient/android/app/build.gradle @@ -1,12 +1,15 @@ apply plugin: "com.android.application" +import com.android.build.OutputFile + /** - * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets. + * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets + * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "react.gradle"` line. + * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ * // the name of the generated asset file containing your JS bundle @@ -21,6 +24,15 @@ apply plugin: "com.android.application" * // whether to bundle JS and assets in release mode * bundleInRelease: true, * + * // whether to bundle JS and assets in another build variant (if configured). + * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants + * // The configuration property can be in the following formats + * // 'bundleIn${productFlavor}${buildType}' + * // 'bundleIn${buildType}' + * // bundleInFreeDebug: true, + * // bundleInPaidRelease: true, + * // bundleInBeta: true, + * * // the root of your project, i.e. where "package.json" lives * root: "../../", * @@ -47,7 +59,22 @@ apply plugin: "com.android.application" * ] */ -apply from: "react.gradle" +apply from: "../../node_modules/react-native/react.gradle" + +/** + * Set this to true to create two separate APKs instead of one: + * - An APK that only works on ARM devices + * - An APK that only works on x86 devices + * The advantage is the size of the APK is reduced by about 4MB. + * Upload all the APKs to the Play Store and people will download + * the correct one based on the CPU architecture of their device. + */ +def enableSeparateBuildPerCPUArchitecture = false + +/** + * Run Proguard to shrink the Java bytecode in release builds. + */ +def enableProguardInReleaseBuilds = false android { compileSdkVersion 23 @@ -63,17 +90,45 @@ android { abiFilters "armeabi-v7a", "x86" } } + splits { + abi { + reset() + enable enableSeparateBuildPerCPUArchitecture + universalApk false // If true, also generate a universal APK + include "armeabi-v7a", "x86" + } + } buildTypes { release { - minifyEnabled false // Set this to true to enable Proguard + minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } + // applicationVariants are e.g. debug, release + applicationVariants.all { variant -> + variant.outputs.each { output -> + // For each separate APK per architecture, set a unique version code as described here: + // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits + def versionCodes = ["armeabi-v7a":1, "x86":2] + def abi = output.getFilter(OutputFile.ABI) + if (abi != null) { // null for the universal-debug, universal-release variants + output.versionCodeOverride = + versionCodes.get(abi) * 1048576 + defaultConfig.versionCode + } + } + } } dependencies { compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" - compile "com.facebook.react:react-native:0.16.+" - compile project(':react-native-linear-gradient') + compile "com.facebook.react:react-native:+" // From node_modules + compile(project(':react-native-linear-gradient')) +} + +// Run this once to be able to run the application with BUCK +// puts all compile dependencies into folder libs for BUCK to use +task copyDownloadableDepsToLibs(type: Copy) { + from configurations.compile + into 'libs' } diff --git a/Examples/AnimatedGradient/android/app/proguard-rules.pro b/Examples/AnimatedGradient/android/app/proguard-rules.pro index ffa8c9f..347a13c 100644 --- a/Examples/AnimatedGradient/android/app/proguard-rules.pro +++ b/Examples/AnimatedGradient/android/app/proguard-rules.pro @@ -40,9 +40,12 @@ -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } -keep class * extends com.facebook.react.bridge.NativeModule { *; } +-keepclassmembers,includedescriptorclasses class * { native ; } -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } + +-dontwarn com.facebook.react.** # okhttp diff --git a/Examples/AnimatedGradient/android/app/react.gradle b/Examples/AnimatedGradient/android/app/react.gradle deleted file mode 100644 index 1e08b00..0000000 --- a/Examples/AnimatedGradient/android/app/react.gradle +++ /dev/null @@ -1,87 +0,0 @@ -import org.apache.tools.ant.taskdefs.condition.Os - -def config = project.hasProperty("react") ? project.react : []; - -def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" -def entryFile = config.entryFile ?: "index.android.js" - -// because elvis operator -def elvisFile(thing) { - return thing ? file(thing) : null; -} - -def reactRoot = elvisFile(config.root) ?: file("../../") -def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?: - file("$buildDir/intermediates/assets/debug") -def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?: - file("$buildDir/intermediates/assets/release") -def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?: - file("$buildDir/intermediates/res/merged/debug") -def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?: - file("$buildDir/intermediates/res/merged/release") -def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] - -def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName") -def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName") - -task bundleDebugJsAndAssets(type: Exec) { - // create dirs if they are not there (e.g. the "clean" task just ran) - doFirst { - jsBundleDirDebug.mkdirs() - resourcesDirDebug.mkdirs() - } - - // set up inputs and outputs so gradle can cache the result - inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) - outputs.dir jsBundleDirDebug - outputs.dir resourcesDirDebug - - // set up the call to the react-native cli - workingDir reactRoot - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", - entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug - } else { - commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", - entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug - } - - enabled config.bundleInDebug ?: false -} - -task bundleReleaseJsAndAssets(type: Exec) { - // create dirs if they are not there (e.g. the "clean" task just ran) - doFirst { - jsBundleDirRelease.mkdirs() - resourcesDirRelease.mkdirs() - } - - // set up inputs and outputs so gradle can cache the result - inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) - outputs.dir jsBundleDirRelease - outputs.dir resourcesDirRelease - - // set up the call to the react-native cli - workingDir reactRoot - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine "cmd","/c", "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", - entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease - } else { - commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", - entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease - } - - enabled config.bundleInRelease ?: true -} - -gradle.projectsEvaluated { - // hook bundleDebugJsAndAssets into the android build process - bundleDebugJsAndAssets.dependsOn mergeDebugResources - bundleDebugJsAndAssets.dependsOn mergeDebugAssets - processDebugResources.dependsOn bundleDebugJsAndAssets - - // hook bundleReleaseJsAndAssets into the android build process - bundleReleaseJsAndAssets.dependsOn mergeReleaseResources - bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets - processReleaseResources.dependsOn bundleReleaseJsAndAssets -} diff --git a/Examples/AnimatedGradient/android/app/src/main/AndroidManifest.xml b/Examples/AnimatedGradient/android/app/src/main/AndroidManifest.xml index 645a381..27fae07 100644 --- a/Examples/AnimatedGradient/android/app/src/main/AndroidManifest.xml +++ b/Examples/AnimatedGradient/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,14 @@ + package="com.animatedgradient" + android:versionCode="1" + android:versionName="1.0"> + + + getPackages() { + return Arrays.asList( + new MainReactPackage(), + new LinearGradientPackage() + ); } } diff --git a/Examples/AnimatedGradient/android/build.gradle b/Examples/AnimatedGradient/android/build.gradle index bdb0fcc..403a007 100644 --- a/Examples/AnimatedGradient/android/build.gradle +++ b/Examples/AnimatedGradient/android/build.gradle @@ -16,8 +16,9 @@ allprojects { repositories { mavenLocal() jcenter() - jcenter { - url "http://dl.bintray.com/mkonicek/maven" + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$projectDir/../../node_modules/react-native/android" } } } diff --git a/Examples/AnimatedGradient/android/keystores/BUCK b/Examples/AnimatedGradient/android/keystores/BUCK new file mode 100644 index 0000000..15da20e --- /dev/null +++ b/Examples/AnimatedGradient/android/keystores/BUCK @@ -0,0 +1,8 @@ +keystore( + name = 'debug', + store = 'debug.keystore', + properties = 'debug.keystore.properties', + visibility = [ + 'PUBLIC', + ], +) diff --git a/Examples/AnimatedGradient/android/settings.gradle b/Examples/AnimatedGradient/android/settings.gradle index bb0ddd2..0b75b05 100644 --- a/Examples/AnimatedGradient/android/settings.gradle +++ b/Examples/AnimatedGradient/android/settings.gradle @@ -1,6 +1,5 @@ rootProject.name = 'AnimatedGradient' include ':app' - -include ':app', ':react-native-linear-gradient' +include ':react-native-linear-gradient' project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') diff --git a/Examples/AnimatedGradient/iOS/main.jsbundle b/Examples/AnimatedGradient/iOS/main.jsbundle deleted file mode 100644 index 4f50ea3..0000000 --- a/Examples/AnimatedGradient/iOS/main.jsbundle +++ /dev/null @@ -1,5 +0,0 @@ -// Offline JS -// To re-generate the offline bundle, run this from root of your project -// $ curl 'http://localhost:8081/index.ios.bundle?dev=false&minify=true' -o iOS/main.jsbundle - -throw new Error('Offline JS file is empty. See iOS/main.jsbundle for instructions'); diff --git a/Examples/AnimatedGradient/incrementColor.js b/Examples/AnimatedGradient/incrementColor.js deleted file mode 100644 index 75b7f60..0000000 --- a/Examples/AnimatedGradient/incrementColor.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = function(color, step){ - var colorToInt = parseInt(color.substr(1), 16), // Convert HEX color to integer - nstep = parseInt(step); // Convert step to integer - if(!isNaN(colorToInt) && !isNaN(nstep)){ // Make sure that color has been converted to integer - colorToInt += nstep; // Increment integer with step - var ncolor = colorToInt.toString(16); // Convert back integer to HEX - ncolor = '#' + (new Array(7-ncolor.length).join(0)) + ncolor; // Left pad "0" to make HEX look like a color - if(/^#[0-9a-f]{6}$/i.test(ncolor)){ // Make sure that HEX is a valid color - return ncolor; - } - } - return color; -}; diff --git a/Examples/AnimatedGradient/index.android.js b/Examples/AnimatedGradient/index.android.js index d7254cd..0c062e5 100644 --- a/Examples/AnimatedGradient/index.android.js +++ b/Examples/AnimatedGradient/index.android.js @@ -1,63 +1,4 @@ -'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { - AppRegistry, - StyleSheet, - Text, - View, -} = ReactNative; +import { AppRegistry } from 'react-native'; +import App from './src'; -var TimerMixin = require('react-timer-mixin'); -var LinearGradient = require('react-native-linear-gradient'); -var incrementColor = require('./incrementColor'); - -var AnimatedGradient = React.createClass({ - mixins: [TimerMixin], - - getInitialState: function() { - return { - count: 0, - colorTop: '#000000', - colorBottom: '#cccccc', - } - }, - - componentDidMount: function() { - this.setInterval(() => { - this.setState({ - count: this.state.count + 1, - colorTop: incrementColor(this.state.colorTop, 1), - colorBottom: incrementColor(this.state.colorBottom, -1), - }); - }, 20); - }, - - render: function() { - return ( - - - - {this.state.colorTop} - {this.state.colorBottom} - - ); - } -}); - -var styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: '#F5FCFF', - }, - gradient: { - width: 200, - height: 200, - }, -}); - -AppRegistry.registerComponent('AnimatedGradient', () => AnimatedGradient); +AppRegistry.registerComponent('AnimatedGradient', () => App); diff --git a/Examples/AnimatedGradient/index.ios.js b/Examples/AnimatedGradient/index.ios.js index d7254cd..0c062e5 100644 --- a/Examples/AnimatedGradient/index.ios.js +++ b/Examples/AnimatedGradient/index.ios.js @@ -1,63 +1,4 @@ -'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { - AppRegistry, - StyleSheet, - Text, - View, -} = ReactNative; +import { AppRegistry } from 'react-native'; +import App from './src'; -var TimerMixin = require('react-timer-mixin'); -var LinearGradient = require('react-native-linear-gradient'); -var incrementColor = require('./incrementColor'); - -var AnimatedGradient = React.createClass({ - mixins: [TimerMixin], - - getInitialState: function() { - return { - count: 0, - colorTop: '#000000', - colorBottom: '#cccccc', - } - }, - - componentDidMount: function() { - this.setInterval(() => { - this.setState({ - count: this.state.count + 1, - colorTop: incrementColor(this.state.colorTop, 1), - colorBottom: incrementColor(this.state.colorBottom, -1), - }); - }, 20); - }, - - render: function() { - return ( - - - - {this.state.colorTop} - {this.state.colorBottom} - - ); - } -}); - -var styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: '#F5FCFF', - }, - gradient: { - width: 200, - height: 200, - }, -}); - -AppRegistry.registerComponent('AnimatedGradient', () => AnimatedGradient); +AppRegistry.registerComponent('AnimatedGradient', () => App); diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.pbxproj b/Examples/AnimatedGradient/ios/AnimatedGradient.xcodeproj/project.pbxproj similarity index 63% rename from Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.pbxproj rename to Examples/AnimatedGradient/ios/AnimatedGradient.xcodeproj/project.pbxproj index 49a2a23..a8aa0f0 100644 --- a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/project.pbxproj +++ b/Examples/AnimatedGradient/ios/AnimatedGradient.xcodeproj/project.pbxproj @@ -7,21 +7,22 @@ objects = { /* Begin PBXBuildFile section */ - 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; }; 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; - 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; + 00E356F31AD99517003FC87E /* AnimatedGradientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* AnimatedGradientTests.m */; }; + 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; + 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; + 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; - 84B328261C16040D00DE4E08 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84B328251C1603EE00DE4E08 /* libRCTWebSocket.a */; }; - BB6109EF1AD326EA00563A76 /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BB6109EE1AD326E400563A76 /* libBVLinearGradient.a */; }; + EFA9F1911CDCD7720027F044 /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = EFA9F1861CDCD7610027F044 /* libBVLinearGradient.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -32,13 +33,6 @@ remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = RCTActionSheet; }; - 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; - remoteInfo = RCTAdSupport; - }; 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; @@ -67,6 +61,27 @@ remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; remoteInfo = RCTVibration; }; + 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 13B07F861A680F5B00A75B9A; + remoteInfo = AnimatedGradient; + }; + 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTSettings; + }; + 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3C86DF461ADF2C930047B81A; + remoteInfo = RCTWebSocket; + }; 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; @@ -74,6 +89,13 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; + 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTLinking; + }; 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; @@ -81,16 +103,9 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - 84B328241C1603EE00DE4E08 /* PBXContainerItemProxy */ = { + EFA9F1851CDCD7610027F044 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = 84B328201C1603ED00DE4E08 /* RCTWebSocket.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 3C86DF461ADF2C930047B81A; - remoteInfo = RCTWebSocket; - }; - BB6109ED1AD326E400563A76 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = BB6109E91AD326E400563A76 /* BVLinearGradient.xcodeproj */; + containerPortal = EFA9F1811CDCD7610027F044 /* BVLinearGradient.xcodeproj */; proxyType = 2; remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = BVLinearGradient; @@ -98,41 +113,53 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; - 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; - 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = "node_modules/react-native/Libraries/AdSupport/RCTAdSupport.xcodeproj"; sourceTree = ""; }; - 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; - 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; - 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; - 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; + 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; + 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; + 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; + 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; + 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; + 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; + 00E356EE1AD99517003FC87E /* AnimatedGradientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AnimatedGradientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 00E356F21AD99517003FC87E /* AnimatedGradientTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnimatedGradientTests.m; sourceTree = ""; }; + 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; + 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* AnimatedGradient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AnimatedGradient.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = AnimatedGradient/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = AnimatedGradient/AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; - 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; - 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; - 84B328201C1603ED00DE4E08 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; - BB6109E91AD326E400563A76 /* BVLinearGradient.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = BVLinearGradient.xcodeproj; path = "node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj"; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = AnimatedGradient/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = AnimatedGradient/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = AnimatedGradient/main.m; sourceTree = ""; }; + 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; + EFA9F1811CDCD7610027F044 /* BVLinearGradient.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = BVLinearGradient.xcodeproj; path = "../node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 00E356EB1AD99517003FC87E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 84B328261C16040D00DE4E08 /* libRCTWebSocket.a in Frameworks */, + EFA9F1911CDCD7720027F044 /* libBVLinearGradient.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, - 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */, 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, + 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, - 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, + 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, - BB6109EF1AD326EA00563A76 /* libBVLinearGradient.a in Frameworks */, + 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, + 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -147,14 +174,6 @@ name = Products; sourceTree = ""; }; - 00C302B01ABCB8E700DB3ED1 /* Products */ = { - isa = PBXGroup; - children = ( - 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */, - ); - name = Products; - sourceTree = ""; - }; 00C302B61ABCB90400DB3ED1 /* Products */ = { isa = PBXGroup; children = ( @@ -187,6 +206,39 @@ name = Products; sourceTree = ""; }; + 00E356EF1AD99517003FC87E /* AnimatedGradientTests */ = { + isa = PBXGroup; + children = ( + 00E356F21AD99517003FC87E /* AnimatedGradientTests.m */, + 00E356F01AD99517003FC87E /* Supporting Files */, + ); + path = AnimatedGradientTests; + sourceTree = ""; + }; + 00E356F01AD99517003FC87E /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 00E356F11AD99517003FC87E /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 139105B71AF99BAD00B5F7CC /* Products */ = { + isa = PBXGroup; + children = ( + 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, + ); + name = Products; + sourceTree = ""; + }; + 139FDEE71B06529A00C62182 /* Products */ = { + isa = PBXGroup; + children = ( + 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, + ); + name = Products; + sourceTree = ""; + }; 13B07FAE1A68108700A75B9A /* AnimatedGradient */ = { isa = PBXGroup; children = ( @@ -209,19 +261,28 @@ name = Products; sourceTree = ""; }; + 78C398B11ACF4ADC00677621 /* Products */ = { + isa = PBXGroup; + children = ( + 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, + ); + name = Products; + sourceTree = ""; + }; 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( - 84B328201C1603ED00DE4E08 /* RCTWebSocket.xcodeproj */, - BB6109E91AD326E400563A76 /* BVLinearGradient.xcodeproj */, + EFA9F1811CDCD7610027F044 /* BVLinearGradient.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, - 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, - 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, + 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, + 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, + 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, + 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -239,6 +300,7 @@ children = ( 13B07FAE1A68108700A75B9A /* AnimatedGradient */, 832341AE1AAA6A7D00B99B32 /* Libraries */, + 00E356EF1AD99517003FC87E /* AnimatedGradientTests */, 83CBBA001A601CBA00E9B192 /* Products */, ); indentWidth = 2; @@ -249,22 +311,15 @@ isa = PBXGroup; children = ( 13B07F961A680F5B00A75B9A /* AnimatedGradient.app */, + 00E356EE1AD99517003FC87E /* AnimatedGradientTests.xctest */, ); name = Products; sourceTree = ""; }; - 84B328211C1603ED00DE4E08 /* Products */ = { + EFA9F1821CDCD7610027F044 /* Products */ = { isa = PBXGroup; children = ( - 84B328251C1603EE00DE4E08 /* libRCTWebSocket.a */, - ); - name = Products; - sourceTree = ""; - }; - BB6109EA1AD326E400563A76 /* Products */ = { - isa = PBXGroup; - children = ( - BB6109EE1AD326E400563A76 /* libBVLinearGradient.a */, + EFA9F1861CDCD7610027F044 /* libBVLinearGradient.a */, ); name = Products; sourceTree = ""; @@ -272,6 +327,24 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ + 00E356ED1AD99517003FC87E /* AnimatedGradientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AnimatedGradientTests" */; + buildPhases = ( + 00E356EA1AD99517003FC87E /* Sources */, + 00E356EB1AD99517003FC87E /* Frameworks */, + 00E356EC1AD99517003FC87E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 00E356F51AD99517003FC87E /* PBXTargetDependency */, + ); + name = AnimatedGradientTests; + productName = AnimatedGradientTests; + productReference = 00E356EE1AD99517003FC87E /* AnimatedGradientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 13B07F861A680F5B00A75B9A /* AnimatedGradient */ = { isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "AnimatedGradient" */; @@ -279,6 +352,7 @@ 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, ); buildRules = ( ); @@ -297,6 +371,12 @@ attributes = { LastUpgradeCheck = 0610; ORGANIZATIONNAME = Facebook; + TargetAttributes = { + 00E356ED1AD99517003FC87E = { + CreatedOnToolsVersion = 6.2; + TestTargetID = 13B07F861A680F5B00A75B9A; + }; + }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "AnimatedGradient" */; compatibilityVersion = "Xcode 3.2"; @@ -311,17 +391,13 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = BB6109EA1AD326E400563A76 /* Products */; - ProjectRef = BB6109E91AD326E400563A76 /* BVLinearGradient.xcodeproj */; + ProductGroup = EFA9F1821CDCD7610027F044 /* Products */; + ProjectRef = EFA9F1811CDCD7610027F044 /* BVLinearGradient.xcodeproj */; }, { ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; }, - { - ProductGroup = 00C302B01ABCB8E700DB3ED1 /* Products */; - ProjectRef = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; - }, { ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; @@ -330,10 +406,18 @@ ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; }, + { + ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; + ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + }, { ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; }, + { + ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; + ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + }, { ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; @@ -343,8 +427,8 @@ ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; }, { - ProductGroup = 84B328211C1603ED00DE4E08 /* Products */; - ProjectRef = 84B328201C1603ED00DE4E08 /* RCTWebSocket.xcodeproj */; + ProductGroup = 139FDEE71B06529A00C62182 /* Products */; + ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; }, { ProductGroup = 146834001AC3E56700842450 /* Products */; @@ -354,6 +438,7 @@ projectRoot = ""; targets = ( 13B07F861A680F5B00A75B9A /* AnimatedGradient */, + 00E356ED1AD99517003FC87E /* AnimatedGradientTests */, ); }; /* End PBXProject section */ @@ -366,13 +451,6 @@ remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTAdSupport.a; - remoteRef = 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -401,6 +479,20 @@ remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTSettings.a; + remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTWebSocket.a; + remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 146834041AC3E56700842450 /* libReact.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -408,6 +500,13 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTLinking.a; + remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -415,28 +514,27 @@ remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - 84B328251C1603EE00DE4E08 /* libRCTWebSocket.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libRCTWebSocket.a; - remoteRef = 84B328241C1603EE00DE4E08 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - BB6109EE1AD326E400563A76 /* libBVLinearGradient.a */ = { + EFA9F1861CDCD7610027F044 /* libBVLinearGradient.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libBVLinearGradient.a; - remoteRef = BB6109ED1AD326E400563A76 /* PBXContainerItemProxy */; + remoteRef = EFA9F1851CDCD7610027F044 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ + 00E356EC1AD99517003FC87E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 13B07F8E1A680F5B00A75B9A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */, 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, ); @@ -444,7 +542,32 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Bundle React Native code and images"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ + 00E356EA1AD99517003FC87E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 00E356F31AD99517003FC87E /* AnimatedGradientTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 13B07F871A680F5B00A75B9A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -456,6 +579,14 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 13B07F861A680F5B00A75B9A /* AnimatedGradient */; + targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { isa = PBXVariantGroup; @@ -463,22 +594,60 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; - path = iOS; + path = AnimatedGradient; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 00E356F61AD99517003FC87E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = AnimatedGradientTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AnimatedGradient.app/AnimatedGradient"; + }; + name = Debug; + }; + 00E356F71AD99517003FC87E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = AnimatedGradientTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AnimatedGradient.app/AnimatedGradient"; + }; + name = Release; + }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEAD_CODE_STRIPPING = NO; HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native/React/**", ); - INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; + INFOPLIST_FILE = AnimatedGradient/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = AnimatedGradient; @@ -492,9 +661,9 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native/React/**", ); - INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; + INFOPLIST_FILE = AnimatedGradient/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = AnimatedGradient; @@ -538,7 +707,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native/React/**", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; @@ -578,7 +747,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, - "$(SRCROOT)/node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native/React/**", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -590,6 +759,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "AnimatedGradientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 00E356F61AD99517003FC87E /* Debug */, + 00E356F71AD99517003FC87E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "AnimatedGradient" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcshareddata/xcschemes/AnimatedGradient.xcscheme b/Examples/AnimatedGradient/ios/AnimatedGradient.xcodeproj/xcshareddata/xcschemes/AnimatedGradient.xcscheme similarity index 75% rename from Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcshareddata/xcschemes/AnimatedGradient.xcscheme rename to Examples/AnimatedGradient/ios/AnimatedGradient.xcodeproj/xcshareddata/xcschemes/AnimatedGradient.xcscheme index 23df058..fbb809d 100644 --- a/Examples/AnimatedGradient/AnimatedGradient.xcodeproj/xcshareddata/xcschemes/AnimatedGradient.xcscheme +++ b/Examples/AnimatedGradient/ios/AnimatedGradient.xcodeproj/xcshareddata/xcschemes/AnimatedGradient.xcscheme @@ -20,6 +20,20 @@ ReferencedContainer = "container:AnimatedGradient.xcodeproj"> + + + + + + + + - + - + diff --git a/Examples/AnimatedGradient/iOS/Images.xcassets/AppIcon.appiconset/Contents.json b/Examples/AnimatedGradient/ios/AnimatedGradient/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Examples/AnimatedGradient/iOS/Images.xcassets/AppIcon.appiconset/Contents.json rename to Examples/AnimatedGradient/ios/AnimatedGradient/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/Examples/AnimatedGradient/iOS/Info.plist b/Examples/AnimatedGradient/ios/AnimatedGradient/Info.plist similarity index 82% rename from Examples/AnimatedGradient/iOS/Info.plist rename to Examples/AnimatedGradient/ios/AnimatedGradient/Info.plist index dcc5a33..91963b2 100644 --- a/Examples/AnimatedGradient/iOS/Info.plist +++ b/Examples/AnimatedGradient/ios/AnimatedGradient/Info.plist @@ -22,11 +22,6 @@ 1 LSRequiresIPhoneOS - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities @@ -41,5 +36,13 @@ UIViewControllerBasedStatusBarAppearance + NSLocationWhenInUseUsageDescription + + NSAppTransportSecurity + + + NSAllowsArbitraryLoads + + diff --git a/Examples/AnimatedGradient/iOS/main.m b/Examples/AnimatedGradient/ios/AnimatedGradient/main.m similarity index 100% rename from Examples/AnimatedGradient/iOS/main.m rename to Examples/AnimatedGradient/ios/AnimatedGradient/main.m diff --git a/Examples/AnimatedGradient/ios/AnimatedGradientTests/AnimatedGradientTests.m b/Examples/AnimatedGradient/ios/AnimatedGradientTests/AnimatedGradientTests.m new file mode 100644 index 0000000..2596d33 --- /dev/null +++ b/Examples/AnimatedGradient/ios/AnimatedGradientTests/AnimatedGradientTests.m @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import + +#import "RCTLog.h" +#import "RCTRootView.h" + +#define TIMEOUT_SECONDS 600 +#define TEXT_TO_LOOK_FOR @"Welcome to React Native!" + +@interface AnimatedGradientTests : XCTestCase + +@end + +@implementation AnimatedGradientTests + +- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test +{ + if (test(view)) { + return YES; + } + for (UIView *subview in [view subviews]) { + if ([self findSubviewInView:subview matching:test]) { + return YES; + } + } + return NO; +} + +- (void)testRendersWelcomeScreen +{ + UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; + BOOL foundElement = NO; + + __block NSString *redboxError = nil; + RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { + if (level >= RCTLogLevelError) { + redboxError = message; + } + }); + + while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { + [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; + [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; + + foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { + if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { + return YES; + } + return NO; + }]; + } + + RCTSetLogFunction(RCTDefaultLogFunction); + + XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); + XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); +} + + +@end diff --git a/Examples/AnimatedGradient/ios/AnimatedGradientTests/Info.plist b/Examples/AnimatedGradient/ios/AnimatedGradientTests/Info.plist new file mode 100644 index 0000000..886825c --- /dev/null +++ b/Examples/AnimatedGradient/ios/AnimatedGradientTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Examples/AnimatedGradient/node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj/project.pbxproj b/Examples/AnimatedGradient/node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj/project.pbxproj index 89f34dc..4cf1a5a 100644 --- a/Examples/AnimatedGradient/node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj/project.pbxproj +++ b/Examples/AnimatedGradient/node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj/project.pbxproj @@ -7,8 +7,8 @@ objects = { /* Begin PBXBuildFile section */ - BBD49E3F1AC8DEF000610F8E /* BVLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD49E3A1AC8DEF000610F8E /* BVLinearGradient.m */; }; - BBD49E401AC8DEF000610F8E /* BVLinearGradientManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BBD49E3C1AC8DEF000610F8E /* BVLinearGradientManager.m */; }; + EF6045F01C4E5D290001F552 /* BVLinearGradient.m in Sources */ = {isa = PBXBuildFile; fileRef = EF6045ED1C4E5D290001F552 /* BVLinearGradient.m */; }; + EF6045F11C4E5D290001F552 /* BVLinearGradientManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EF6045EF1C4E5D290001F552 /* BVLinearGradientManager.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -25,10 +25,10 @@ /* Begin PBXFileReference section */ 134814201AA4EA6300B7C361 /* libBVLinearGradient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBVLinearGradient.a; sourceTree = BUILT_PRODUCTS_DIR; }; - BBD49E391AC8DEF000610F8E /* BVLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVLinearGradient.h; sourceTree = ""; }; - BBD49E3A1AC8DEF000610F8E /* BVLinearGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVLinearGradient.m; sourceTree = ""; }; - BBD49E3B1AC8DEF000610F8E /* BVLinearGradientManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVLinearGradientManager.h; sourceTree = ""; }; - BBD49E3C1AC8DEF000610F8E /* BVLinearGradientManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVLinearGradientManager.m; sourceTree = ""; }; + EF6045EC1C4E5D290001F552 /* BVLinearGradient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVLinearGradient.h; sourceTree = ""; }; + EF6045ED1C4E5D290001F552 /* BVLinearGradient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVLinearGradient.m; sourceTree = ""; }; + EF6045EE1C4E5D290001F552 /* BVLinearGradientManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BVLinearGradientManager.h; sourceTree = ""; }; + EF6045EF1C4E5D290001F552 /* BVLinearGradientManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BVLinearGradientManager.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -53,14 +53,22 @@ 58B511D21A9E6C8500147676 = { isa = PBXGroup; children = ( - BBD49E391AC8DEF000610F8E /* BVLinearGradient.h */, - BBD49E3A1AC8DEF000610F8E /* BVLinearGradient.m */, - BBD49E3B1AC8DEF000610F8E /* BVLinearGradientManager.h */, - BBD49E3C1AC8DEF000610F8E /* BVLinearGradientManager.m */, + EF6045EB1C4E5D290001F552 /* BVLinearGradient */, 134814211AA4EA7D00B7C361 /* Products */, ); sourceTree = ""; }; + EF6045EB1C4E5D290001F552 /* BVLinearGradient */ = { + isa = PBXGroup; + children = ( + EF6045EC1C4E5D290001F552 /* BVLinearGradient.h */, + EF6045ED1C4E5D290001F552 /* BVLinearGradient.m */, + EF6045EE1C4E5D290001F552 /* BVLinearGradientManager.h */, + EF6045EF1C4E5D290001F552 /* BVLinearGradientManager.m */, + ); + path = BVLinearGradient; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -117,8 +125,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - BBD49E3F1AC8DEF000610F8E /* BVLinearGradient.m in Sources */, - BBD49E401AC8DEF000610F8E /* BVLinearGradientManager.m in Sources */, + EF6045F11C4E5D290001F552 /* BVLinearGradientManager.m in Sources */, + EF6045F01C4E5D290001F552 /* BVLinearGradient.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Examples/AnimatedGradient/package.json b/Examples/AnimatedGradient/package.json index f7d0d2e..36fc425 100644 --- a/Examples/AnimatedGradient/package.json +++ b/Examples/AnimatedGradient/package.json @@ -3,11 +3,12 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node_modules/react-native/packager/packager.sh" + "start": "node node_modules/react-native/local-cli/cli.js start" }, "dependencies": { - "react-native": "0.16.0", - "react-native-linear-gradient": "../../", - "react-timer-mixin": "^0.13.3" + "react": "0.14.8", + "react-native": "0.25.1", + "react-native-linear-gradient": "file:../../", + "react-timer-mixin": "0.13.3" } } diff --git a/Examples/AnimatedGradient/src/index.js b/Examples/AnimatedGradient/src/index.js new file mode 100644 index 0000000..0080ad3 --- /dev/null +++ b/Examples/AnimatedGradient/src/index.js @@ -0,0 +1,63 @@ +import React from 'react'; +import { + StyleSheet, + Text, + View, +} from 'react-native'; +import TimerMixin from 'react-timer-mixin'; +import LinearGradient from 'react-native-linear-gradient'; + +function incrementColor(color, step) { + const intColor = parseInt(color.substr(1), 16); + const newIntColor = (intColor + step).toString(16); + return `#${'0'.repeat(6 - newIntColor.length)}${newIntColor}`; +}; + +const AnimatedGradient = React.createClass({ + mixins: [TimerMixin], + + getInitialState() { + return { + count: 0, + colorTop: '#000000', + colorBottom: '#cccccc', + } + }, + + componentDidMount() { + this.setInterval(() => { + this.setState({ + count: this.state.count + 1, + colorTop: incrementColor(this.state.colorTop, 1), + colorBottom: incrementColor(this.state.colorBottom, -1), + }); + }, 20); + }, + + render() { + return ( + + + {this.state.colorTop} + {this.state.colorBottom} + + ); + } +}); + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: '#F5FCFF', + }, + gradient: { + width: 200, + height: 200, + }, +}); + +export default AnimatedGradient;