├── .watchmanconfig
├── .gitattributes
├── src
├── package.json
└── App.js
├── app.json
├── .babelrc
├── env
├── node_binary
├── env.release
├── env.dev
└── env.staging
├── android
├── app
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ └── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── assets
│ │ │ └── fonts
│ │ │ │ ├── Entypo.ttf
│ │ │ │ ├── Zocial.ttf
│ │ │ │ ├── EvilIcons.ttf
│ │ │ │ ├── Feather.ttf
│ │ │ │ ├── Ionicons.ttf
│ │ │ │ ├── Octicons.ttf
│ │ │ │ ├── FontAwesome.ttf
│ │ │ │ ├── Foundation.ttf
│ │ │ │ ├── Rubik-Black.ttf
│ │ │ │ ├── Rubik-Bold.ttf
│ │ │ │ ├── Rubik-Light.ttf
│ │ │ │ ├── MaterialIcons.ttf
│ │ │ │ ├── Rubik-Italic.ttf
│ │ │ │ ├── Rubik-Medium.ttf
│ │ │ │ ├── Rubik-Regular.ttf
│ │ │ │ ├── Rubik-BoldItalic.ttf
│ │ │ │ ├── SimpleLineIcons.ttf
│ │ │ │ ├── Rubik-BlackItalic.ttf
│ │ │ │ ├── Rubik-LightItalic.ttf
│ │ │ │ ├── Rubik-MediumItalic.ttf
│ │ │ │ ├── rubicon-icon-font.ttf
│ │ │ │ └── MaterialCommunityIcons.ttf
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── mycoolapp
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── AndroidManifest.xml
│ ├── proguard-rules.pro
│ ├── BUCK
│ └── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── keystores
│ ├── debug.keystore.properties
│ └── BUCK
├── gradle.properties
├── settings.gradle
├── build.gradle
├── gradlew.bat
└── gradlew
├── ios
├── myCoolApp
│ ├── Images.xcassets
│ │ ├── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── AppDelegate.h
│ ├── main.m
│ ├── AppDelegate.m
│ ├── Info.plist
│ └── Base.lproj
│ │ └── LaunchScreen.xib
├── myCoolApp.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── myCoolApp-release.xcscheme
│ │ ├── myCoolApp-staging.xcscheme
│ │ ├── myCoolApp.xcscheme
│ │ └── myCoolApp-tvOS.xcscheme
├── myCoolApp.xcworkspace
│ ├── xcshareddata
│ │ ├── WorkspaceSettings.xcsettings
│ │ └── IDEWorkspaceChecks.plist
│ └── contents.xcworkspacedata
├── Podfile.lock
├── Podfile
├── myCoolAppTests
│ ├── Info.plist
│ └── myCoolAppTests.m
├── myCoolApp-tvOSTests
│ └── Info.plist
└── myCoolApp-tvOS
│ └── Info.plist
├── .buckconfig
├── index.js
├── fastlane
├── Gymfile
├── Matchfile
├── Pluginfile
├── Appfile
├── README.md
├── Deliverfile
├── Common
├── actions
│ ├── codepush_promote.rb
│ ├── bugsnag_sourcemaps.rb
│ └── codepush.rb
└── Fastfile
├── Gemfile
├── README.md
├── .gitignore
├── .flowconfig
├── package.json
├── tools
└── react-native-xcode-custom.sh
└── Gemfile.lock
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {"name": "App"}
2 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "myCoolApp",
3 | "displayName": "myCoolApp"
4 | }
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["module:metro-react-native-babel-preset"]
3 | }
4 |
--------------------------------------------------------------------------------
/env/node_binary:
--------------------------------------------------------------------------------
1 | export NODE_BINARY=$HOME/.nvm/versions/node/v8.11.3/bin/node
2 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | myCoolApp
3 |
4 |
--------------------------------------------------------------------------------
/ios/myCoolApp/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/env/env.release:
--------------------------------------------------------------------------------
1 | API_KEY=prodKey
2 | ANOTHER_CONFIG=prodConfig
3 | API_URI=https://cool-company.com/api
4 | WWW_URI=https://cool-company.com/
5 |
--------------------------------------------------------------------------------
/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Entypo.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Zocial.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Zocial.ttf
--------------------------------------------------------------------------------
/env/env.dev:
--------------------------------------------------------------------------------
1 | API_KEY=devKey
2 | ANOTHER_CONFIG=devConfig
3 | API_URI=https://staging.cool-company.com/api
4 | WWW_URI=https://staging.cool-company.com/
5 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/EvilIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/EvilIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Feather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Feather.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Ionicons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Octicons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Foundation.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Foundation.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-Black.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-Bold.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-Light.ttf
--------------------------------------------------------------------------------
/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/env/env.staging:
--------------------------------------------------------------------------------
1 | API_KEY=stagingKey
2 | ANOTHER_CONFIG=stagingConfig
3 | API_URI=https://staging.cool-company.com/api
4 | WWW_URI=https://staging.cool-company.com/
5 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/MaterialIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/MaterialIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-Italic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-Medium.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-Regular.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-BoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-BoldItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/SimpleLineIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/SimpleLineIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-BlackItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-BlackItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-LightItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-LightItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Rubik-MediumItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/Rubik-MediumItalic.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/rubicon-icon-font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/rubicon-icon-font.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/TGPSKI/react-native-dev-ops-guide/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | /** @format */
2 |
3 | import { AppRegistry } from 'react-native';
4 | import App from 'App/App.js';
5 | import { name as appName } from './app.json';
6 |
7 | AppRegistry.registerComponent(appName, () => App);
8 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/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-4.6-all.zip
6 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/fastlane/Gymfile:
--------------------------------------------------------------------------------
1 | ##############################
2 | ##############################
3 | ##### iOS Build Settings #####
4 | ##############################
5 | ##############################
6 |
7 | workspace 'ios/'
8 | build_path 'ios/Build'
9 | clean true
10 | include_bitcode false
11 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | # Autogenerated by fastlane
2 | #
3 | # Ensure this file is checked in to source control!
4 |
5 | source "https://rubygems.org"
6 |
7 | gem 'fastlane'
8 |
9 | plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
10 | eval_gemfile(plugins_path) if File.exist?(plugins_path)
11 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Native Devops Guide: Sample Project
2 |
3 | This project is a companion repository, showing an example React Native + Fastlane implementation for interoperability with Jenkins.
4 |
5 | See the [React Native DevOps Guide](https://medium.com/@tgpski/react-native-devops-guide-2d8e4755ebee) for more information.
6 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/fastlane/Matchfile:
--------------------------------------------------------------------------------
1 | ###################################################
2 | ###################################################
3 | ##### iOS - Git Profile / Certificate Storage #####
4 | ###################################################
5 | ###################################################
6 |
7 | git_url ''
8 | username '' # Git username
9 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/fastlane/Pluginfile:
--------------------------------------------------------------------------------
1 | # Autogenerated by fastlane
2 | #
3 | # Ensure this file is checked in to source control!
4 |
5 | gem 'fastlane-plugin-get_version_code'
6 | gem 'fastlane-plugin-get_version_name'
7 | gem 'fastlane-plugin-increment_version_code'
8 | gem 'fastlane-plugin-versioning'
9 | gem 'fastlane-plugin-yarn'
10 | gem 'fastlane-plugin-badge'
11 | gem 'cocoapods'
12 |
--------------------------------------------------------------------------------
/ios/myCoolApp/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | @interface AppDelegate : UIResponder
11 |
12 | @property (nonatomic, strong) UIWindow *window;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/ios/myCoolApp/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/mycoolapp/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.mycoolapp;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "myCoolApp";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - TwitterCore (3.1.0)
3 | - TwitterKit (3.3.0):
4 | - TwitterCore (>= 3.1.0)
5 |
6 | DEPENDENCIES:
7 | - TwitterKit
8 |
9 | SPEC REPOS:
10 | https://github.com/cocoapods/specs.git:
11 | - TwitterCore
12 | - TwitterKit
13 |
14 | SPEC CHECKSUMS:
15 | TwitterCore: 644d59e75abccb26cf0a9050d2c4dea0e5412241
16 | TwitterKit: a2e60ddcedbf54091eac6f27685ca7a87681e1d7
17 |
18 | PODFILE CHECKSUM: 27aa3fe5ff1b3ea9c5726a1e055c455d7b6111db
19 |
20 | COCOAPODS: 1.5.3
21 |
--------------------------------------------------------------------------------
/fastlane/Appfile:
--------------------------------------------------------------------------------
1 | ###############
2 | ###############
3 | ##### iOS #####
4 | ###############
5 | ###############
6 |
7 | app_identifier ''
8 | apple_id ''
9 | # Developer Portal Team ID
10 | team_id ''
11 | team_name ''
12 |
13 | ###################
14 | ###################
15 | ##### ANDROID #####
16 | ###################
17 | ###################
18 |
19 | package_name ''
20 |
21 | # Credentials
22 | # https://docs.fastlane.tools/getting-started/android/setup/#collect-your-google-credentials
23 | json_key_file ''
24 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '9.0'
2 | use_frameworks!
3 |
4 | target 'myCoolApp' do
5 | pod 'TwitterKit'
6 | end
7 |
8 | post_install do |installer|
9 | installer.pods_project.build_configurations.each do |config|
10 | config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
11 | end
12 | installer.pods_project.targets.each do |target|
13 | target.build_configurations.each do |config|
14 | config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/ios/myCoolAppTests/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 |
--------------------------------------------------------------------------------
/ios/myCoolApp-tvOSTests/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Custom
2 | .env
3 |
4 | # OSX
5 | #
6 | .DS_Store
7 |
8 | # Xcode
9 | #
10 | build/
11 | Index/
12 | Pods/
13 | *.pbxuser
14 | !default.pbxuser
15 | *.mode1v3
16 | !default.mode1v3
17 | *.mode2v3
18 | !default.mode2v3
19 | *.perspectivev3
20 | !default.perspectivev3
21 | xcuserdata
22 | *.xccheckout
23 | *.moved-aside
24 | DerivedData/
25 | *.hmap
26 | *.ipa
27 | *.xcuserstate
28 |
29 | # Android/IntelliJ
30 | #
31 | build/
32 | .idea
33 | .gradle
34 | local.properties
35 | *.iml
36 |
37 | # node.js
38 | #
39 | node_modules/
40 | npm-debug.log
41 | yarn-error.log
42 |
43 | # BUCK
44 | buck-out/
45 | \.buckd/
46 | *.keystore
47 |
48 | # fastlane
49 | #
50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
51 | # screenshots whenever they are needed.
52 | # For more information about the recommended setup visit:
53 | # https://docs.fastlane.tools/best-practices/source-control/
54 |
55 | fastlane/report.xml
56 | fastlane/Preview.html
57 | fastlane/screenshots
58 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'myCoolApp'
2 | include ':react-native-svg'
3 | project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
4 | include ':react-native-photo-view'
5 | project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')
6 | include ':react-native-linear-gradient'
7 | project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
8 | include ':react-native-vector-icons'
9 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
10 | include ':react-native-spinkit'
11 | project(':react-native-spinkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-spinkit/android')
12 | include ':react-native-config'
13 | project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')
14 |
15 | include ':app'
16 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/myCoolApp/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ios-marketing",
45 | "size" : "1024x1024",
46 | "scale" : "1x"
47 | }
48 | ],
49 | "info" : {
50 | "version" : 1,
51 | "author" : "xcode"
52 | }
53 | }
--------------------------------------------------------------------------------
/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 | maven {
7 | url 'https://maven.google.com/'
8 | name 'Google'
9 | }
10 | }
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:3.2.0'
13 | classpath 'com.google.gms:google-services:3.1.2'
14 |
15 | // NOTE: Do not place your application dependencies here; they belong
16 | // in the individual module build.gradle files
17 | }
18 | }
19 |
20 | allprojects {
21 | repositories {
22 | // Add jitpack repository (added by react-native-spinkit)
23 | maven { url "https://jitpack.io" }
24 | mavenLocal()
25 | jcenter()
26 | maven {
27 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
28 | url "$rootDir/../node_modules/react-native/android"
29 | }
30 | maven {
31 | url 'https://maven.google.com/'
32 | name 'Google'
33 | }
34 | }
35 | }
36 |
37 | ext {
38 | buildToolsVersion = "28.0.2"
39 | minSdkVersion = 16
40 | compileSdkVersion = 26
41 | targetSdkVersion = 26
42 | supportLibVersion = "26.1.0"
43 | }
44 |
--------------------------------------------------------------------------------
/fastlane/README.md:
--------------------------------------------------------------------------------
1 | fastlane documentation
2 | ================
3 | # Installation
4 |
5 | Make sure you have the latest version of the Xcode command line tools installed:
6 |
7 | ```
8 | xcode-select --install
9 | ```
10 |
11 | Install _fastlane_ using
12 | ```
13 | [sudo] gem install fastlane -NV
14 | ```
15 | or alternatively using `brew cask install fastlane`
16 |
17 | # Available Actions
18 | ### fastlane_test
19 | ```
20 | fastlane fastlane_test
21 | ```
22 | Test lane
23 |
24 | ----
25 |
26 | ## iOS
27 | ### ios dev
28 | ```
29 | fastlane ios dev
30 | ```
31 | iOS development build
32 | ### ios staging
33 | ```
34 | fastlane ios staging
35 | ```
36 | iOS staging build
37 | ### ios release
38 | ```
39 | fastlane ios release
40 | ```
41 | iOS release build, upload to App Store
42 |
43 | ----
44 |
45 | ## Android
46 | ### android dev
47 | ```
48 | fastlane android dev
49 | ```
50 | Android development build
51 | ### android staging
52 | ```
53 | fastlane android staging
54 | ```
55 | Android staging build
56 | ### android release
57 | ```
58 | fastlane android release
59 | ```
60 | Android release build, upload to Play Store
61 |
62 | ----
63 |
64 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run.
65 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
66 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).
67 |
--------------------------------------------------------------------------------
/fastlane/Deliverfile:
--------------------------------------------------------------------------------
1 | ####################
2 | ####################
3 | ##### DEV ACCT #####
4 | ####################
5 | ####################
6 |
7 | username ''
8 |
9 | ################
10 | ################
11 | ##### NAME #####
12 | ################
13 | ################
14 |
15 | name ''
16 | app_identifier ''
17 |
18 | ####################################
19 | ####################################
20 | ##### STORE UPLOAD PREFERENCES #####
21 | ####################################
22 | ####################################
23 |
24 | force true
25 | price_tier 0
26 | submit_for_review false
27 | automatic_release false
28 |
29 | app_review_information(
30 | first_name: '',
31 | last_name: '',
32 | phone_number: '',
33 | email_address: '',
34 | demo_user: '',
35 | demo_password: '',
36 | notes: ''
37 | )
38 |
39 | submission_information(
40 | add_id_info_serves_ads: false,
41 | add_id_info_uses_idfa: false,
42 | export_compliance_uses_encryption: false
43 | )
44 |
45 | #######################
46 | #######################
47 | ##### DESCRIPTION #####
48 | #######################
49 | #######################
50 |
51 | description(
52 | 'default' => ''
53 | )
54 |
55 | release_notes ''
56 |
57 | ####################
58 | ####################
59 | ##### METADATA #####
60 | ####################
61 | ####################
62 |
63 | keywords(
64 | 'default' => 'Key1,Key2'
65 | )
66 |
67 | support_url ''
68 | marketing_url ''
69 | privacy_url ''
70 |
71 | copyright "#{Time.now.year}"
72 | primary_category ''
73 | secondary_category ''
74 |
--------------------------------------------------------------------------------
/ios/myCoolApp/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 |
13 | @implementation AppDelegate
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16 | {
17 | NSURL *jsCodeLocation;
18 |
19 | #ifdef DEBUG
20 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
21 | #else
22 | jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
23 | #endif
24 |
25 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
26 | moduleName:@"myCoolApp"
27 | initialProperties:nil
28 | launchOptions:launchOptions];
29 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
30 |
31 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
32 | UIViewController *rootViewController = [UIViewController new];
33 | rootViewController.view = rootView;
34 | self.window.rootViewController = rootViewController;
35 | [self.window makeKeyAndVisible];
36 | return YES;
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/fastlane/Common:
--------------------------------------------------------------------------------
1 | fastlane_require 'JSON'
2 |
3 | #################
4 | #################
5 | ##### CONST #####
6 | #################
7 | #################
8 |
9 | @package_json_path = ''
10 |
11 | #####################
12 | #####################
13 | ##### FUNCTIONS #####
14 | #####################
15 | #####################
16 |
17 | def debug_options(options, print)
18 | # Prints out all options, useful for debugging w/ Jenkins
19 |
20 | if print then
21 | puts options.inspect
22 | end
23 | end
24 |
25 | def copy_env_for_build_type(buildType)
26 | # Copies env files to project root
27 | # filename format: env.[buildType]
28 | #
29 | # example: $PROJECT_ROOT/env/env.release
30 |
31 | dir = File.expand_path('..', Dir.pwd)
32 | sh('cp', '%s/env/env.%s' % [dir, buildType], '%s/.env' % dir)
33 | end
34 |
35 | def handle_env_and_options(environment, options, isString=false, default=nil)
36 | # Tristate selector - env vars, cli options, defaults
37 | # Handles string and boolean types
38 |
39 | output = nil
40 | if isString == true
41 | # Handle strings
42 | if environment != nil
43 | output = environment
44 | elsif options != nil
45 | output = options
46 | elsif default != nil
47 | output = default
48 | else
49 | output = nil
50 | end
51 | else
52 | # Handle bools
53 | if environment == true
54 | output = true
55 | elsif options == true
56 | output = true
57 | else
58 | output = false
59 | end
60 | end
61 | return output
62 | end
63 |
64 | #################
65 | #################
66 | ##### LANES #####
67 | #################
68 | #################
69 |
--------------------------------------------------------------------------------
/src/App.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | * @flow
7 | */
8 |
9 | import React, { Component } from 'react';
10 | import { Platform, StyleSheet, Text, View } from 'react-native';
11 |
12 | import Config from 'react-native-config';
13 |
14 | const instructions = Platform.select({
15 | ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
16 | android: 'Double tap R on your keyboard to reload,\n' + 'Shake or press menu button for dev menu'
17 | });
18 |
19 | type Props = {};
20 | export default class App extends Component {
21 | render() {
22 | return (
23 |
24 | ENV VARS
25 |
26 | API_KEY: {Config.API_KEY ? Config.API_KEY : 'undefined'}
27 |
28 |
29 | ANOTHER_CONFIG: {Config.ANOTHER_CONFIG ? Config.ANOTHER_CONFIG : 'undefined'}
30 |
31 |
32 | API_URI: {Config.ANOTHER_CONFIG ? Config.API_URI : 'undefined'}
33 |
34 |
35 | WWW_URI: {Config.WWW_URI ? Config.WWW_URI : 'undefined'}
36 |
37 |
38 | );
39 | }
40 | }
41 |
42 | const styles = StyleSheet.create({
43 | container: {
44 | flex: 1,
45 | justifyContent: 'center',
46 | alignItems: 'center',
47 | backgroundColor: '#F5FCFF'
48 | },
49 | welcome: {
50 | fontSize: 20,
51 | textAlign: 'center',
52 | margin: 10
53 | },
54 | instructions: {
55 | textAlign: 'center',
56 | color: '#333333',
57 | marginBottom: 5
58 | }
59 | });
60 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/mycoolapp/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.mycoolapp;
2 |
3 | import android.app.Application;
4 |
5 | import com.facebook.react.ReactApplication;
6 | import com.horcrux.svg.SvgPackage;
7 | import com.reactnative.photoview.PhotoViewPackage;
8 | import com.BV.LinearGradient.LinearGradientPackage;
9 | import com.oblador.vectoricons.VectorIconsPackage;
10 | import com.react.rnspinkit.RNSpinkitPackage;
11 | import com.lugg.ReactNativeConfig.ReactNativeConfigPackage;
12 | import com.facebook.react.ReactNativeHost;
13 | import com.facebook.react.ReactPackage;
14 | import com.facebook.react.shell.MainReactPackage;
15 | import com.facebook.soloader.SoLoader;
16 |
17 | import java.util.Arrays;
18 | import java.util.List;
19 |
20 | public class MainApplication extends Application implements ReactApplication {
21 |
22 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
23 | @Override
24 | public boolean getUseDeveloperSupport() {
25 | return BuildConfig.DEBUG;
26 | }
27 |
28 | @Override
29 | protected List getPackages() {
30 | return Arrays.asList(
31 | new MainReactPackage(),
32 | new SvgPackage(),
33 | new PhotoViewPackage(),
34 | new LinearGradientPackage(),
35 | new VectorIconsPackage(),
36 | new RNSpinkitPackage(),
37 | new ReactNativeConfigPackage()
38 | );
39 | }
40 |
41 | @Override
42 | protected String getJSMainModuleName() {
43 | return "index";
44 | }
45 | };
46 |
47 | @Override
48 | public ReactNativeHost getReactNativeHost() {
49 | return mReactNativeHost;
50 | }
51 |
52 | @Override
53 | public void onCreate() {
54 | super.onCreate();
55 | SoLoader.init(this, /* native exopackage */ false);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/ios/myCoolApp-tvOS/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 | NSExceptionDomains
45 |
46 | localhost
47 |
48 | NSExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/android/app/BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15 | lib_deps.append(':' + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.mycoolapp",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.mycoolapp",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/ios/myCoolAppTests/myCoolAppTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | #import
12 | #import
13 |
14 | #define TIMEOUT_SECONDS 600
15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
16 |
17 | @interface myCoolAppTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation myCoolAppTests
22 |
23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
24 | {
25 | if (test(view)) {
26 | return YES;
27 | }
28 | for (UIView *subview in [view subviews]) {
29 | if ([self findSubviewInView:subview matching:test]) {
30 | return YES;
31 | }
32 | }
33 | return NO;
34 | }
35 |
36 | - (void)testRendersWelcomeScreen
37 | {
38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
40 | BOOL foundElement = NO;
41 |
42 | __block NSString *redboxError = nil;
43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
44 | if (level >= RCTLogLevelError) {
45 | redboxError = message;
46 | }
47 | });
48 |
49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
52 |
53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
55 | return YES;
56 | }
57 | return NO;
58 | }];
59 | }
60 |
61 | RCTSetLogFunction(RCTDefaultLogFunction);
62 |
63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
65 | }
66 |
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | ; We fork some components by platform
3 | .*/*[.]android.js
4 |
5 | ; Ignore "BUCK" generated dirs
6 | /\.buckd/
7 |
8 | ; Ignore unexpected extra "@providesModule"
9 | .*/node_modules/.*/node_modules/fbjs/.*
10 |
11 | ; Ignore duplicate module providers
12 | ; For RN Apps installed via npm, "Libraries" folder is inside
13 | ; "node_modules/react-native" but in the source repo it is in the root
14 | .*/Libraries/react-native/React.js
15 |
16 | ; Ignore polyfills
17 | .*/Libraries/polyfills/.*
18 |
19 | ; Ignore metro
20 | .*/node_modules/metro/.*
21 |
22 | [include]
23 |
24 | [libs]
25 | node_modules/react-native/Libraries/react-native/react-native-interface.js
26 | node_modules/react-native/flow/
27 | node_modules/react-native/flow-github/
28 |
29 | [options]
30 | emoji=true
31 |
32 | module.system=haste
33 | module.system.haste.use_name_reducers=true
34 | # get basename
35 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
36 | # strip .js or .js.flow suffix
37 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
38 | # strip .ios suffix
39 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
40 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
41 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
42 | module.system.haste.paths.blacklist=.*/__tests__/.*
43 | module.system.haste.paths.blacklist=.*/__mocks__/.*
44 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.*
45 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.*
46 |
47 | munge_underscores=true
48 |
49 | 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\|pdf\)$' -> 'RelativeImageStub'
50 |
51 | module.file_ext=.js
52 | module.file_ext=.jsx
53 | module.file_ext=.json
54 | module.file_ext=.native.js
55 |
56 | suppress_type=$FlowIssue
57 | suppress_type=$FlowFixMe
58 | suppress_type=$FlowFixMeProps
59 | suppress_type=$FlowFixMeState
60 |
61 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
62 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
63 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
64 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
65 |
66 | [version]
67 | ^0.75.0
68 |
--------------------------------------------------------------------------------
/ios/myCoolApp/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | $(PRODUCT_NAME)
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)$(BUNDLE_ID_SUFFIX)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSRequiresIPhoneOS
26 |
27 | NSAppTransportSecurity
28 |
29 | NSExceptionDomains
30 |
31 | localhost
32 |
33 | NSExceptionAllowsInsecureHTTPLoads
34 |
35 |
36 |
37 |
38 | NSLocationWhenInUseUsageDescription
39 |
40 | UIAppFonts
41 |
42 | Entypo.ttf
43 | EvilIcons.ttf
44 | Feather.ttf
45 | FontAwesome.ttf
46 | Foundation.ttf
47 | Ionicons.ttf
48 | MaterialCommunityIcons.ttf
49 | MaterialIcons.ttf
50 | Octicons.ttf
51 | SimpleLineIcons.ttf
52 | Zocial.ttf
53 | rubicon-icon-font.ttf
54 | Rubik-Black.ttf
55 | Rubik-BlackItalic.ttf
56 | Rubik-Bold.ttf
57 | Rubik-BoldItalic.ttf
58 | Rubik-Italic.ttf
59 | Rubik-Light.ttf
60 | Rubik-LightItalic.ttf
61 | Rubik-Medium.ttf
62 | Rubik-MediumItalic.ttf
63 | Rubik-Regular.ttf
64 |
65 | UILaunchStoryboardName
66 | LaunchScreen
67 | UIRequiredDeviceCapabilities
68 |
69 | armv7
70 |
71 | UISupportedInterfaceOrientations
72 |
73 | UIInterfaceOrientationPortrait
74 | UIInterfaceOrientationLandscapeLeft
75 | UIInterfaceOrientationLandscapeRight
76 |
77 | UIViewControllerBasedStatusBarAppearance
78 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "myCoolApp",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest"
8 | },
9 | "checkmate": {
10 | "verbose": false,
11 | "shellPath": "/bin/zsh",
12 | "silentShell": true,
13 | "programs": [
14 | "fastlane",
15 | "gem",
16 | "pod",
17 | "react-native",
18 | "badge"
19 | ],
20 | "versions": {
21 | "macOS": "10.13.6",
22 | "node": "v8.11.3",
23 | "ruby": "2.5.1p57",
24 | "xcode": "9.4.1",
25 | "yarn": "1.7.0",
26 | "npm": "6.2.0"
27 | },
28 | "envVars": [
29 | "ANDROID_HOME",
30 | "ANDROID_SDK_TOOLS",
31 | "ANDROID_PLATFORM_TOOLS"
32 | ],
33 | "env": {
34 | "dir": "env",
35 | "buildTypes": [
36 | "dev",
37 | "staging",
38 | "release"
39 | ]
40 | },
41 | "node": {
42 | "yarnIntegrity": true,
43 | "dirs": [
44 | "node_modules"
45 | ],
46 | "files": [
47 | "yarn.lock"
48 | ]
49 | },
50 | "android": {
51 | "nodePath": false,
52 | "gradle": true,
53 | "dirs": [],
54 | "files": []
55 | },
56 | "ios": {
57 | "nodePath": false,
58 | "nodePathDir": "env",
59 | "nodePathFilename": "node_binary",
60 | "pods": true,
61 | "dirs": [],
62 | "files": []
63 | }
64 | },
65 | "dependencies": {
66 | "@shoutem/theme": "^0.11.1",
67 | "@shoutem/ui": "^0.23.4",
68 | "bluebird": "^3.5.1",
69 | "react": "16.6.1",
70 | "react-native": "0.57",
71 | "react-native-animatable": "^1.3.0",
72 | "react-native-config": "https://github.com/patrickkempff/react-native-config.git",
73 | "react-native-offline": "^3.11.0",
74 | "react-native-spinkit": "^1.1.1",
75 | "react-native-svg": "^6.4.1",
76 | "react-native-vector-icons": "^4.6.0",
77 | "react-navigation": "^2.6.2",
78 | "react-redux": "^5.0.7",
79 | "redux": "^4.0.0",
80 | "redux-form": "^7.4.2",
81 | "redux-saga": "^0.16.0",
82 | "reselect": "^3.0.1",
83 | "seamless-immutable": "^7.1.3"
84 | },
85 | "devDependencies": {
86 | "@babel/core": "^7.1.6",
87 | "@babel/preset-env": "^7.1.6",
88 | "babel-eslint": "^8.2.5",
89 | "babel-jest": "23.2.0",
90 | "babel-plugin-react-native-config": "^0.0.3",
91 | "eslint": "^5.1.0",
92 | "eslint-config-prettier": "^2.9.0",
93 | "jest": "23.3.0",
94 | "metro-react-native-babel-preset": "^0.49.2",
95 | "prop-types": "^15.6.2",
96 | "react-native-checkmate": "^0.2.0",
97 | "react-test-renderer": "16.4.1",
98 | "remote-redux-devtools": "^0.5.12",
99 | "remotedev-server": "^0.2.4",
100 | "shelljs": "^0.8.2"
101 | },
102 | "jest": {
103 | "preset": "react-native"
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/ios/myCoolApp/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 |
--------------------------------------------------------------------------------
/tools/react-native-xcode-custom.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
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 | # Bundle React Native app's code and image assets.
10 | # This script is supposed to be invoked as part of Xcode build process
11 | # and relies on environment variables (including PWD) set by Xcode
12 |
13 | if [[ "$SKIP_BUNDLING" ]]; then
14 | echo "SKIP_BUNDLING enabled; skipping."
15 | exit 0;
16 | fi
17 |
18 | case "$CONFIGURATION" in
19 | *Debug*)
20 | if [[ "$PLATFORM_NAME" == *simulator ]]; then
21 | if [[ "$FORCE_BUNDLING" ]]; then
22 | echo "FORCE_BUNDLING enabled; continuing to bundle."
23 | DEV=false
24 | else
25 | echo "Skipping bundling in Debug for the Simulator (since the packager bundles for you). Use the FORCE_BUNDLING flag to change this behavior."
26 | DEV=true
27 | fi
28 | else
29 | echo "Bundling for physical device. Use the SKIP_BUNDLING flag to change this behavior."
30 | DEV=false
31 | fi
32 | ;;
33 | *)
34 | DEV=false
35 | ;;
36 | "")
37 | echo "$0 must be invoked by Xcode"
38 | exit 1
39 | ;;
40 | esac
41 |
42 | # Path to react-native folder inside node_modules
43 | REACT_NATIVE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../node_modules/react-native" && pwd)"
44 |
45 | # Xcode project file for React Native apps is located in ios/ subfolder
46 | cd ..
47 |
48 | # Define NVM_DIR and source the nvm.sh setup script
49 | [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
50 |
51 | # Define entry file
52 | if [[ -s "index.ios.js" ]]; then
53 | ENTRY_FILE=${1:-index.ios.js}
54 | else
55 | ENTRY_FILE=${1:-index.js}
56 | fi
57 |
58 | if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
59 | . "$HOME/.nvm/nvm.sh"
60 | elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
61 | . "$(brew --prefix nvm)/nvm.sh"
62 | fi
63 |
64 | # Set up the nodenv node version manager if present
65 | if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then
66 | eval "$("$HOME/.nodenv/bin/nodenv" init -)"
67 | fi
68 |
69 | [ -z "$NODE_BINARY" ] && export NODE_BINARY="node"
70 |
71 | [ -z "$CLI_PATH" ] && export CLI_PATH="$REACT_NATIVE_DIR/local-cli/cli.js"
72 |
73 | nodejs_not_found()
74 | {
75 | echo "error: Can't find '$NODE_BINARY' binary to build React Native bundle" >&2
76 | echo "If you have non-standard nodejs installation, select your project in Xcode," >&2
77 | echo "find 'Build Phases' - 'Bundle React Native code and images'" >&2
78 | echo "and change NODE_BINARY to absolute path to your node executable" >&2
79 | echo "(you can find it by invoking 'which node' in the terminal)" >&2
80 | exit 2
81 | }
82 |
83 | type $NODE_BINARY >/dev/null 2>&1 || nodejs_not_found
84 |
85 | # Print commands before executing them (useful for troubleshooting)
86 | set -x
87 | DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
88 |
89 | if [[ "$CONFIGURATION" = "Debug" && ! "$PLATFORM_NAME" == *simulator ]]; then
90 | PLISTBUDDY='/usr/libexec/PlistBuddy'
91 | PLIST=$TARGET_BUILD_DIR/$INFOPLIST_PATH
92 | IP=$(ipconfig getifaddr en0)
93 | if [ -z "$IP" ]; then
94 | IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\ -f2 | awk 'NR==1{print $1}')
95 | fi
96 |
97 | if [ -z ${DISABLE_XIP+x} ]; then
98 | IP="$IP.xip.io"
99 | fi
100 |
101 | $PLISTBUDDY -c "Add NSAppTransportSecurity:NSExceptionDomains:localhost:NSTemporaryExceptionAllowsInsecureHTTPLoads bool true" "$PLIST"
102 | $PLISTBUDDY -c "Add NSAppTransportSecurity:NSExceptionDomains:$IP:NSTemporaryExceptionAllowsInsecureHTTPLoads bool true" "$PLIST"
103 | echo "$IP" > "$DEST/ip.txt"
104 | fi
105 |
106 | # Verify prod binary
107 | #
108 |
109 | BUNDLE_FILE="$DEST/main.jsbundle"
110 |
111 | $NODE_BINARY "$CLI_PATH" bundle \
112 | --entry-file "$ENTRY_FILE" \
113 | --platform ios \
114 | --dev $DEV \
115 | --reset-cache \
116 | --bundle-output "$BUNDLE_FILE" \
117 | --assets-dest "$DEST"
118 |
119 | if [[ $DEV != true && ! -f "$BUNDLE_FILE" ]]; then
120 | echo "error: File $BUNDLE_FILE does not exist. This must be a bug with" >&2
121 | echo "React Native, please report it here: https://github.com/facebook/react-native/issues"
122 | exit 2
123 | fi
124 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcodeproj/xcshareddata/xcschemes/myCoolApp-release.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
60 |
61 |
67 |
68 |
69 |
70 |
71 |
72 |
82 |
84 |
90 |
91 |
92 |
93 |
94 |
95 |
101 |
102 |
104 |
105 |
108 |
109 |
110 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcodeproj/xcshareddata/xcschemes/myCoolApp-staging.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
60 |
61 |
67 |
68 |
69 |
70 |
71 |
72 |
82 |
84 |
90 |
91 |
92 |
93 |
94 |
95 |
101 |
102 |
108 |
109 |
110 |
111 |
113 |
114 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcodeproj/xcshareddata/xcschemes/myCoolApp.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
60 |
61 |
67 |
68 |
69 |
70 |
71 |
72 |
82 |
84 |
90 |
91 |
92 |
93 |
94 |
95 |
101 |
102 |
108 |
109 |
110 |
111 |
113 |
114 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 | apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
3 |
4 | import com.android.build.OutputFile
5 |
6 | project.ext.react = [
7 | entryFile: "index.js",
8 | nodeExecutableAndArgs: hasProperty('NODE_BINARY')?[NODE_BINARY]:["node"],
9 | bundleInDebug: false,
10 | bundleInStaging: true,
11 | bundleInRelease: true,
12 | jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
13 | resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
14 | jsBundleDirStaging: "$buildDir/intermediates/assets/staging",
15 | resourcesDirStaging:
16 | "$buildDir/intermediates/res/merged/staging",
17 | jsBundleDirRelease: "$buildDir/intermediates/assets/release",
18 | resourcesDirRelease:
19 | "$buildDir/intermediates/res/merged/release",
20 | devDisabledInDebug: false,
21 | devDisabledInStaging: true,
22 | devDisabledInRelease: true,
23 | inputExcludes: ["ios/**", "__tests__/**"]
24 | ];
25 |
26 | apply from: "../../node_modules/react-native/react.gradle"
27 |
28 | /**
29 | * Set this to true to create two separate APKs instead of one:
30 | * - An APK that only works on ARM devices
31 | * - An APK that only works on x86 devices
32 | * The advantage is the size of the APK is reduced by about 4MB.
33 | * Upload all the APKs to the Play Store and people will download
34 | * the correct one based on the CPU architecture of their device.
35 | */
36 | def enableSeparateBuildPerCPUArchitecture = false
37 |
38 | /**
39 | * Run Proguard to shrink the Java bytecode in release builds.
40 | */
41 | def enableProguardInReleaseBuilds = false
42 |
43 | android {
44 | compileSdkVersion rootProject.ext.compileSdkVersion
45 | buildToolsVersion rootProject.ext.buildToolsVersion
46 |
47 | defaultConfig {
48 | applicationId "com.mycoolapp"
49 | minSdkVersion rootProject.ext.minSdkVersion
50 | targetSdkVersion rootProject.ext.targetSdkVersion
51 | versionCode 1
52 | versionName "1.0"
53 | ndk {
54 | abiFilters "armeabi-v7a", "x86"
55 | }
56 | }
57 |
58 | signingConfigs {
59 | release {
60 | // Put variable definitions in ~/.gradle/gradle.properties
61 | if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
62 | storeFile file(MYAPP_RELEASE_STORE_FILE)
63 | storePassword MYAPP_RELEASE_STORE_PASSWORD
64 | keyAlias MYAPP_RELEASE_KEY_ALIAS
65 | keyPassword MYAPP_RELEASE_KEY_PASSWORD
66 | }
67 | }
68 | }
69 |
70 | splits {
71 | abi {
72 | reset()
73 | enable enableSeparateBuildPerCPUArchitecture
74 | universalApk false // If true, also generate a universal APK
75 | include "armeabi-v7a", "x86"
76 | }
77 | }
78 |
79 | buildTypes {
80 | debug {
81 | applicationIdSuffix ".debug"
82 | }
83 |
84 | staging {
85 | applicationIdSuffix ".staging"
86 | matchingFallbacks = ['release']
87 | signingConfig signingConfigs.release
88 | minifyEnabled enableProguardInReleaseBuilds
89 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
90 | }
91 |
92 | release {
93 | signingConfig signingConfigs.release
94 | minifyEnabled enableProguardInReleaseBuilds
95 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
96 | }
97 | }
98 |
99 | // applicationVariants are e.g. debug, release
100 | applicationVariants.all { variant ->
101 | variant.outputs.each { output ->
102 | // For each separate APK per architecture, set a unique version code as described here:
103 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
104 | def versionCodes = ["armeabi-v7a":1, "x86":2]
105 | def abi = output.getFilter(OutputFile.ABI)
106 | if (abi != null) { // null for the universal-debug, universal-release variants
107 | output.versionCodeOverride =
108 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
109 | }
110 | }
111 | }
112 | }
113 |
114 | dependencies {
115 | compile project(':react-native-svg')
116 | compile project(':react-native-photo-view')
117 | compile project(':react-native-linear-gradient')
118 | compile project(':react-native-vector-icons')
119 | compile project(':react-native-spinkit')
120 | compile project(':react-native-config')
121 | compile fileTree(dir: "libs", include: ["*.jar"])
122 | compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
123 | compile "com.facebook.react:react-native:+" // From node_modules
124 | }
125 |
126 | // Run this once to be able to run the application with BUCK
127 | // puts all compile dependencies into folder libs for BUCK to use
128 | task copyDownloadableDepsToLibs(type: Copy) {
129 | from configurations.compile
130 | into 'libs'
131 | }
132 |
--------------------------------------------------------------------------------
/ios/myCoolApp.xcodeproj/xcshareddata/xcschemes/myCoolApp-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/fastlane/actions/codepush_promote.rb:
--------------------------------------------------------------------------------
1 | # Codepush - Fastlane action
2 | # Original implementation by Jeremy Kun (@j2kun)
3 | # Updates by Tyler Pate (@TGPSKI)
4 |
5 | module Fastlane
6 | module Actions
7 | module SharedValues
8 | CODEPUSH_PROMOTE_SOURCE = :CODEPUSH_PROMOTE_SOURCE
9 | CODEPUSH_PROMOTE_TARGET = :CODEPUSH_PROMOTE_TARGET
10 | end
11 |
12 | class CodepushPromoteAction < Action
13 | def self.run(params)
14 | require 'colored'
15 |
16 | rows = []
17 | rows << ["source_deployment", params[:source_deployment]]
18 | rows << ["target_deployment", params[:target_deployment]]
19 | rows << ["mandatory", params[:mandatory]]
20 | rows << ["rollout", params[:rollout]]
21 | rows << ["description", params[:description][0..30].gsub(/\s\w+\s*$/, '...')]
22 | table_params = {
23 | rows: rows,
24 | title: "Codepush".white
25 | }
26 | puts ""
27 | puts Terminal::Table.new(table_params)
28 | puts ""
29 |
30 | # code-push promote [options]
31 | command = "code-push promote #{params[:app_name]} #{params[:source_deployment]} #{params[:target_deployment]} "\
32 | "-r #{params[:rollout]} --des \"#{params[:description]}\" "
33 | if params[:mandatory]
34 | command += "-m "
35 | end
36 |
37 | if params[:dry_run]
38 | UI.message("Dry run!".red + " Would have run: " + command + "\n")
39 | else
40 | sh("cd #{ENV['PWD']} && #{command}")
41 | end
42 |
43 | Actions.lane_context[SharedValues::CODEPUSH_PROMOTE_SOURCE] = params[:source_deployment]
44 | Actions.lane_context[SharedValues::CODEPUSH_PROMOTE_TARGET] = params[:target_deployment]
45 | end
46 |
47 | #####################################################
48 | # @!group Documentation
49 | #####################################################
50 |
51 | def self.description
52 | "Promote a code push deployment using Microsoft CodePush"
53 | end
54 |
55 | def self.details
56 | "Promote one code push deployment to another"
57 | end
58 |
59 | def self.available_options
60 | [
61 | FastlaneCore::ConfigItem.new(
62 | key: :source_deployment,
63 | env_name: "CODEPUSH_PROMOTE_SOURCE",
64 | description: "The deployment name to promote from",
65 | verify_block: proc do |value|
66 | UI.user_error!("No CodePush source_deployment specified! Choose one using `code-push deployment ls APP_NAME` and pass it via deployment") unless (value and not value.empty?)
67 | end,
68 | ),
69 |
70 | FastlaneCore::ConfigItem.new(
71 | key: :target_deployment,
72 | env_name: "CODEPUSH_PROMOTE_TARGET",
73 | description: "The deployment name for the destination of the promotion",
74 | verify_block: proc do |value|
75 | UI.user_error!("No CodePush target_deployment specified! Choose one using `code-push deployment ls APP_NAME` and pass it via deployment") unless (value and not value.empty?)
76 | end,
77 | ),
78 |
79 | FastlaneCore::ConfigItem.new(
80 | key: :mandatory,
81 | env_name: "CODEPUSH_MANDATORY",
82 | description: "Make this codepush mandatory",
83 | is_string: false,
84 | default_value: true
85 | ),
86 |
87 | FastlaneCore::ConfigItem.new(
88 | key: :rollout,
89 | env_name: "CODEPUSH_ROLLOUT",
90 | description: "The percentage of users to roll this codepush out to",
91 | is_string: false,
92 | default_value: 100,
93 | verify_block: proc do |value|
94 | UI.user_error!("Invalid rollout, must be an integer in (0, 100]") unless (0 < value.to_i and value.to_i <= 100)
95 | end,
96 | ),
97 |
98 | FastlaneCore::ConfigItem.new(
99 | key: :description,
100 | env_name: "CODEPUSH_DESCRIPTION",
101 | description: "The description to release with this codepush",
102 | verify_block: proc do |value|
103 | UI.user_error!("Description cannot be empty") unless (value and not value.empty?)
104 | end,
105 | ),
106 |
107 | FastlaneCore::ConfigItem.new(
108 | key: :dry_run,
109 | env_name: "CODEPUSH_DRY_RUN",
110 | description: "Print the command that would be run, and don't run it",
111 | is_string: false,
112 | default_value: false
113 | ),
114 |
115 | FastlaneCore::ConfigItem.new(
116 | key: :app_name,
117 | env_name: "CODEPUSH_APP_NAME",
118 | description: "The name of the app on Codepush",
119 | verify_block: proc do |value|
120 | UI.user_error!("No app_name specified! Choose one using `code-push app ls`") unless (value and not value.empty?)
121 | end,
122 | ),
123 |
124 | ]
125 | end
126 |
127 | def self.output
128 | [
129 | ['CODEPUSH_PROMOTE_SOURCE', 'The source deployment being promoted'],
130 | ['CODEPUSH_PROMOTE_TARGET', 'The target deployment of the promotion'],
131 | ]
132 | end
133 |
134 | def self.return_value
135 | # No return value
136 | end
137 |
138 | def self.authors
139 | ["j2kun", "tgpski"]
140 | end
141 |
142 | def self.is_supported?(platform)
143 | true
144 | end
145 | end
146 | end
147 | end
148 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/fastlane/actions/bugsnag_sourcemaps.rb:
--------------------------------------------------------------------------------
1 | # Bugsnag - Codepush sourcemap upload script
2 | # By TGPSKI
3 |
4 | module Fastlane
5 | module Actions
6 | class BugsnagSourcemapsAction < Action
7 | def self.run(params)
8 | require 'colored'
9 |
10 | rows = []
11 | rows << ["api_key", params[:api_key]]
12 | rows << ["app_version", params[:app_version]]
13 | rows << ["minified_file", params[:minified_file]]
14 | rows << ["source_map", params[:source_map]]
15 | rows << ["minified_url", params[:minified_url]]
16 | rows << ["upload_sources", params[:upload_sources]]
17 | rows << ["add_wildcard_prefix", params[:add_wildcard_prefix]]
18 | rows << ["overwrite", params[:overwrite]]
19 | rows << ["code_bundle_id", params[:code_bundle_id]]
20 | rows << ["dry_run", params[:dry_run]]
21 | table_params = {
22 | rows: rows,
23 | title: "Bugsnag Sourcemap Upload".white
24 | }
25 |
26 | puts ""
27 | puts Terminal::Table.new(table_params)
28 | puts ""
29 |
30 | # cf. bugsnag-sourcemaps --help
31 | command = "bugsnag-sourcemaps upload "\
32 | "--api-key #{params[:api_key]} "\
33 | "--minified-file #{params[:minified_file]} "\
34 | "--minified-url #{params[:minified_url]} "\
35 | "--source-map #{params[:source_map]} "
36 |
37 | if params[:app_version]
38 | command += " --app-version #{params[:app_version]}"
39 | elsif params[:code_bundle_id]
40 | command += " --code-bundle-id #{params[:code_bundle_id]}"
41 | end
42 |
43 | if params[:upload_sources]
44 | command += " --upload-sources"
45 | end
46 |
47 | if params[:add_wildcard_prefix]
48 | command += " --add-wildcard-prefix"
49 | end
50 |
51 | if params[:overwrite]
52 | command += " --overwrite"
53 | end
54 |
55 | if params[:dry_run]
56 | UI.message("Dry run!".red + " Would have run: " + command + "\n")
57 | else
58 | sh("cd #{ENV['PWD']} && #{command}")
59 | end
60 |
61 | end
62 |
63 | #####################################################
64 | # @!group Documentation
65 | #####################################################
66 |
67 | def self.description
68 | "Upload JS sourcemaps to Bugsnag"
69 | end
70 |
71 | def self.details
72 | "Upload JS sourcemaps to Bugsnag"
73 | end
74 |
75 | def self.available_options
76 | [
77 | FastlaneCore::ConfigItem.new(
78 | key: :api_key,
79 | env_name: "BUGSNAG_API_KEY",
80 | description: "Bugsnag api key",
81 | verify_block: proc do |value|
82 | UI.user_error!("No Bugsnag API key provided.") unless (value and not value.empty?)
83 | end,
84 | ),
85 |
86 | FastlaneCore::ConfigItem.new(
87 | key: :app_version,
88 | env_name: "APP_VERSION",
89 | description: "App binary version code",
90 | is_string: true,
91 | optional: true
92 | ),
93 |
94 | FastlaneCore::ConfigItem.new(
95 | key: :minified_file,
96 | env_name: "BUGSNAG_MINIFIED_FILE_PATH",
97 | description: "BUGSNAG MINIFIED FILE PATH",
98 | is_string: true,
99 | verify_block: proc do |value|
100 | UI.user_error!("No minifed file path provided.") unless (value and not value.empty?)
101 | end,
102 | ),
103 |
104 | FastlaneCore::ConfigItem.new(
105 | key: :source_map,
106 | env_name: "BUGSNAG_SOURCE_MAP_PATH",
107 | description: "BUGSNAG SOURCE MAP PATH",
108 | is_string: true,
109 | verify_block: proc do |value|
110 | UI.user_error!("No source map file path provided.") unless (value and not value.empty?)
111 | end,
112 | ),
113 |
114 | FastlaneCore::ConfigItem.new(
115 | key: :minified_url,
116 | env_name: "BUGSNAG_MINIFIED_URL",
117 | description: "BUGSNAG MINIFIED URL",
118 | is_string: true,
119 | verify_block: proc do |value|
120 | UI.user_error!("No minified url provided.") unless (value and not value.empty?)
121 | end,
122 | ),
123 |
124 | FastlaneCore::ConfigItem.new(
125 | key: :upload_sources,
126 | env_name: "BUGSNAG_UPLOAD_SOURCES",
127 | description: "BUGSNAG UPLOAD SOURCES",
128 | is_string: false,
129 | default_value: false
130 | ),
131 |
132 | FastlaneCore::ConfigItem.new(
133 | key: :add_wildcard_prefix,
134 | env_name: "BUGSNAG_WILDCARD_PREFIX",
135 | description: "BUGSNAG WILDCARD PREFIX",
136 | is_string: false,
137 | default_value: false
138 | ),
139 |
140 | FastlaneCore::ConfigItem.new(
141 | key: :overwrite,
142 | env_name: "BUGSNAG_OVERWRITE",
143 | description: "BUGSNAG OVERWRITE",
144 | is_string: false,
145 | default_value: false
146 | ),
147 |
148 | FastlaneCore::ConfigItem.new(
149 | key: :code_bundle_id,
150 | env_name: "BUGSNAG_CODE_BUNDLE_ID",
151 | description: "BUGSNAG CODE BUNDLE ID",
152 | is_string: true,
153 | optional: true
154 | ),
155 |
156 | FastlaneCore::ConfigItem.new(
157 | key: :dry_run,
158 | env_name: "BUGSNAG_DRY_RUN",
159 | description: "Print the command that would be run, and don't run it",
160 | is_string: false,
161 | default_value: false
162 | )
163 | ]
164 | end
165 |
166 | def self.output
167 | [
168 | ['BUGSNAG_MINIFIED_FILE_PATH', 'BUGSNAG MINIFIED FILE PATH']
169 | ]
170 | end
171 |
172 | def self.return_value
173 | # No return value
174 | end
175 |
176 | def self.authors
177 | ["tgpski"]
178 | end
179 |
180 | def self.is_supported?(platform)
181 | true
182 | end
183 | end
184 | end
185 | end
186 |
--------------------------------------------------------------------------------
/fastlane/actions/codepush.rb:
--------------------------------------------------------------------------------
1 | # Codepush - Fastlane action
2 | # Original implementation by Jeremy Kun (@j2kun)
3 | # Updates by Tyler Pate (@TGPSKI)
4 |
5 | module Fastlane
6 | module Actions
7 | module SharedValues
8 | CODEPUSH_DEPLOYMENT = :CODEPUSH_DEPLOYMENT
9 | end
10 |
11 | class CodepushAction < Action
12 | def self.run(params)
13 | require 'colored'
14 |
15 | rows = []
16 | rows << ["deployment", params[:deployment]]
17 | rows << ["target_binary_version", params[:target_binary_version]]
18 | rows << ["platform", params[:platform]]
19 | rows << ["mandatory", params[:mandatory]]
20 | rows << ["rollout", params[:rollout]]
21 | rows << ["description", params[:description][0..30].gsub(/\s\w+\s*$/, '...')]
22 | table_params = {
23 | rows: rows,
24 | title: "Codepush".white
25 | }
26 | puts ""
27 | puts Terminal::Table.new(table_params)
28 | puts ""
29 |
30 | if params[:platform]
31 | platform = params[:platform]
32 | else
33 | platform = Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]
34 | end
35 |
36 | if platform == 'android'
37 | FileUtils.mkdir_p "#{ENV['PWD']}/js_build/android"
38 | output_path = "js_build/android"
39 | elsif platform == 'ios'
40 | FileUtils.mkdir_p "#{ENV['PWD']}/js_build/ios"
41 | output_path = "js_build/ios"
42 | end
43 |
44 | # cf. code-push release-react --help
45 | command = "code-push release-react #{params[:app_name]} #{platform} -d #{params[:deployment]} -t #{params[:target_binary_version]} "\
46 | "-r #{params[:rollout]} --des \"#{params[:description]}\" --outputDir #{output_path}"
47 | if params[:mandatory]
48 | command += " -m"
49 | end
50 |
51 | if params[:dry_run]
52 | UI.message("Dry run!".red + " Would have run: " + command + "\n")
53 | else
54 | sh("cd #{ENV['PWD']} && #{command}")
55 | end
56 |
57 | Actions.lane_context[SharedValues::CODEPUSH_DEPLOYMENT] = params[:deployment]
58 | end
59 |
60 | #####################################################
61 | # @!group Documentation
62 | #####################################################
63 |
64 | def self.description
65 | "Code push to Microsoft CodePush"
66 | end
67 |
68 | def self.details
69 | "Code push javascript updates to the specified codepush deployment"
70 | end
71 |
72 | def self.available_options
73 | [
74 | FastlaneCore::ConfigItem.new(
75 | key: :deployment,
76 | env_name: "CODEPUSH_DEPLOYMENT",
77 | description: "The deployment name to codepush to",
78 | verify_block: proc do |value|
79 | UI.user_error!("No CodePush deployment specified! Choose one using `code-push deployment ls APP_NAME` and pass it via deployment") unless (value and not value.empty?)
80 | end,
81 | ),
82 |
83 | FastlaneCore::ConfigItem.new(
84 | key: :mandatory,
85 | env_name: "CODEPUSH_MANDATORY",
86 | description: "Make this codepush mandatory",
87 | is_string: false,
88 | default_value: true
89 | ),
90 |
91 | FastlaneCore::ConfigItem.new(
92 | key: :platform,
93 | env_name: "CODEPUSH_PLATFORM",
94 | description: "ios/android",
95 | is_string: true,
96 | default_value: "ios"
97 | ),
98 |
99 | FastlaneCore::ConfigItem.new(
100 | key: :target_binary_version,
101 | env_name: "CODEPUSH_TARGET_BINARY_VERSION",
102 | description: "The binary version to target with this codepush",
103 | verify_block: proc do |value|
104 | current_version = Actions.lane_context[SharedValues::VERSION_NUMBER]
105 | UI.user_error!("Must provide target_binary_version! Current value is #{current_version}") unless (value and not value.empty?)
106 | split_value = value.split('.').map{|v| v.to_i}
107 | UI.user_error!("Invalid semantic versioning binary version! Current value is #{current_version}") unless (split_value.length == 3)
108 | end,
109 | ),
110 |
111 | FastlaneCore::ConfigItem.new(
112 | key: :rollout,
113 | env_name: "CODEPUSH_ROLLOUT",
114 | description: "The percentage of users to roll this codepush out to",
115 | is_string: false,
116 | default_value: 100,
117 | verify_block: proc do |value|
118 | UI.user_error!("Invalid rollout, must be an integer in (0, 100]") unless (0 < value.to_i and value.to_i <= 100)
119 | end,
120 | ),
121 |
122 | FastlaneCore::ConfigItem.new(
123 | key: :description,
124 | env_name: "CODEPUSH_DESCRIPTION",
125 | description: "The description to release with this codepush",
126 | verify_block: proc do |value|
127 | UI.user_error!("Description cannot be empty") unless (value and not value.empty?)
128 | end,
129 | ),
130 |
131 | FastlaneCore::ConfigItem.new(
132 | key: :dry_run,
133 | env_name: "CODEPUSH_DRY_RUN",
134 | description: "Print the command that would be run, and don't run it",
135 | is_string: false,
136 | default_value: false
137 | ),
138 |
139 | FastlaneCore::ConfigItem.new(
140 | key: :app_name,
141 | env_name: "CODEPUSH_APP_NAME",
142 | description: "The name of the app on Codepush",
143 | verify_block: proc do |value|
144 | UI.user_error!("No app_name specified! Choose one using `code-push app ls`") unless (value and not value.empty?)
145 | end,
146 | ),
147 |
148 | ]
149 | end
150 |
151 | def self.output
152 | [
153 | ['CODEPUSH_DEPLOYMENT', 'The chosen codepush deployment']
154 | ]
155 | end
156 |
157 | def self.return_value
158 | # No return value
159 | end
160 |
161 | def self.authors
162 | ["j2kun", "tgpski"]
163 | end
164 |
165 | def self.is_supported?(platform)
166 | true
167 | end
168 | end
169 | end
170 | end
171 |
--------------------------------------------------------------------------------
/Gemfile.lock:
--------------------------------------------------------------------------------
1 | GEM
2 | remote: https://rubygems.org/
3 | specs:
4 | CFPropertyList (3.0.0)
5 | activesupport (4.2.10)
6 | i18n (~> 0.7)
7 | minitest (~> 5.1)
8 | thread_safe (~> 0.3, >= 0.3.4)
9 | tzinfo (~> 1.1)
10 | addressable (2.5.2)
11 | public_suffix (>= 2.0.2, < 4.0)
12 | atomos (0.1.3)
13 | babosa (1.0.2)
14 | badge (0.9.1)
15 | curb (~> 0.9)
16 | fastimage (>= 1.6)
17 | fastlane (>= 2.0)
18 | mini_magick (>= 4.5)
19 | claide (1.0.2)
20 | cocoapods (1.5.3)
21 | activesupport (>= 4.0.2, < 5)
22 | claide (>= 1.0.2, < 2.0)
23 | cocoapods-core (= 1.5.3)
24 | cocoapods-deintegrate (>= 1.0.2, < 2.0)
25 | cocoapods-downloader (>= 1.2.0, < 2.0)
26 | cocoapods-plugins (>= 1.0.0, < 2.0)
27 | cocoapods-search (>= 1.0.0, < 2.0)
28 | cocoapods-stats (>= 1.0.0, < 2.0)
29 | cocoapods-trunk (>= 1.3.0, < 2.0)
30 | cocoapods-try (>= 1.1.0, < 2.0)
31 | colored2 (~> 3.1)
32 | escape (~> 0.0.4)
33 | fourflusher (~> 2.0.1)
34 | gh_inspector (~> 1.0)
35 | molinillo (~> 0.6.5)
36 | nap (~> 1.0)
37 | ruby-macho (~> 1.1)
38 | xcodeproj (>= 1.5.7, < 2.0)
39 | cocoapods-core (1.5.3)
40 | activesupport (>= 4.0.2, < 6)
41 | fuzzy_match (~> 2.0.4)
42 | nap (~> 1.0)
43 | cocoapods-deintegrate (1.0.2)
44 | cocoapods-downloader (1.2.1)
45 | cocoapods-plugins (1.0.0)
46 | nap
47 | cocoapods-search (1.0.0)
48 | cocoapods-stats (1.0.0)
49 | cocoapods-trunk (1.3.1)
50 | nap (>= 0.8, < 2.0)
51 | netrc (~> 0.11)
52 | cocoapods-try (1.1.0)
53 | colored (1.2)
54 | colored2 (3.1.2)
55 | commander-fastlane (4.4.6)
56 | highline (~> 1.7.2)
57 | concurrent-ruby (1.0.5)
58 | curb (0.9.6)
59 | declarative (0.0.10)
60 | declarative-option (0.1.0)
61 | domain_name (0.5.20180417)
62 | unf (>= 0.0.5, < 1.0.0)
63 | dotenv (2.5.0)
64 | emoji_regex (0.1.1)
65 | escape (0.0.4)
66 | excon (0.62.0)
67 | faraday (0.15.3)
68 | multipart-post (>= 1.2, < 3)
69 | faraday-cookie_jar (0.0.6)
70 | faraday (>= 0.7.4)
71 | http-cookie (~> 1.0.0)
72 | faraday_middleware (0.12.2)
73 | faraday (>= 0.7.4, < 1.0)
74 | fastimage (2.1.4)
75 | fastlane (2.104.0)
76 | CFPropertyList (>= 2.3, < 4.0.0)
77 | addressable (>= 2.3, < 3.0.0)
78 | babosa (>= 1.0.2, < 2.0.0)
79 | bundler (>= 1.12.0, < 2.0.0)
80 | colored
81 | commander-fastlane (>= 4.4.6, < 5.0.0)
82 | dotenv (>= 2.1.1, < 3.0.0)
83 | emoji_regex (~> 0.1)
84 | excon (>= 0.45.0, < 1.0.0)
85 | faraday (~> 0.9)
86 | faraday-cookie_jar (~> 0.0.6)
87 | faraday_middleware (~> 0.9)
88 | fastimage (>= 2.1.0, < 3.0.0)
89 | gh_inspector (>= 1.1.2, < 2.0.0)
90 | google-api-client (>= 0.21.2, < 0.24.0)
91 | highline (>= 1.7.2, < 2.0.0)
92 | json (< 3.0.0)
93 | mini_magick (~> 4.5.1)
94 | multi_json
95 | multi_xml (~> 0.5)
96 | multipart-post (~> 2.0.0)
97 | plist (>= 3.1.0, < 4.0.0)
98 | public_suffix (~> 2.0.0)
99 | rubyzip (>= 1.2.2, < 2.0.0)
100 | security (= 0.1.3)
101 | simctl (~> 1.6.3)
102 | slack-notifier (>= 2.0.0, < 3.0.0)
103 | terminal-notifier (>= 1.6.2, < 2.0.0)
104 | terminal-table (>= 1.4.5, < 2.0.0)
105 | tty-screen (>= 0.6.3, < 1.0.0)
106 | tty-spinner (>= 0.8.0, < 1.0.0)
107 | word_wrap (~> 1.0.0)
108 | xcodeproj (>= 1.6.0, < 2.0.0)
109 | xcpretty (~> 0.3.0)
110 | xcpretty-travis-formatter (>= 0.0.3)
111 | fastlane-plugin-badge (1.1.0)
112 | badge (~> 0.9.0)
113 | fastlane-plugin-get_version_code (0.2.0)
114 | fastlane-plugin-get_version_name (0.2.2)
115 | fastlane-plugin-increment_version_code (0.4.3)
116 | fastlane-plugin-versioning (0.3.4)
117 | fastlane-plugin-yarn (1.0)
118 | fourflusher (2.0.1)
119 | fuzzy_match (2.0.4)
120 | gh_inspector (1.1.3)
121 | google-api-client (0.23.9)
122 | addressable (~> 2.5, >= 2.5.1)
123 | googleauth (>= 0.5, < 0.7.0)
124 | httpclient (>= 2.8.1, < 3.0)
125 | mime-types (~> 3.0)
126 | representable (~> 3.0)
127 | retriable (>= 2.0, < 4.0)
128 | signet (~> 0.9)
129 | googleauth (0.6.6)
130 | faraday (~> 0.12)
131 | jwt (>= 1.4, < 3.0)
132 | memoist (~> 0.12)
133 | multi_json (~> 1.11)
134 | os (>= 0.9, < 2.0)
135 | signet (~> 0.7)
136 | highline (1.7.10)
137 | http-cookie (1.0.3)
138 | domain_name (~> 0.5)
139 | httpclient (2.8.3)
140 | i18n (0.9.5)
141 | concurrent-ruby (~> 1.0)
142 | json (2.1.0)
143 | jwt (2.1.0)
144 | memoist (0.16.0)
145 | mime-types (3.2.2)
146 | mime-types-data (~> 3.2015)
147 | mime-types-data (3.2018.0812)
148 | mini_magick (4.5.1)
149 | minitest (5.10.3)
150 | molinillo (0.6.6)
151 | multi_json (1.13.1)
152 | multi_xml (0.6.0)
153 | multipart-post (2.0.0)
154 | nanaimo (0.2.6)
155 | nap (1.1.0)
156 | naturally (2.2.0)
157 | netrc (0.11.0)
158 | os (1.0.0)
159 | plist (3.4.0)
160 | public_suffix (2.0.5)
161 | representable (3.0.4)
162 | declarative (< 0.1.0)
163 | declarative-option (< 0.2.0)
164 | uber (< 0.2.0)
165 | retriable (3.1.2)
166 | rouge (2.0.7)
167 | ruby-macho (1.2.0)
168 | rubyzip (1.2.2)
169 | security (0.1.3)
170 | signet (0.9.2)
171 | addressable (~> 2.3)
172 | faraday (~> 0.9)
173 | jwt (>= 1.5, < 3.0)
174 | multi_json (~> 1.10)
175 | simctl (1.6.5)
176 | CFPropertyList
177 | naturally
178 | slack-notifier (2.3.2)
179 | terminal-notifier (1.8.0)
180 | terminal-table (1.8.0)
181 | unicode-display_width (~> 1.1, >= 1.1.1)
182 | thread_safe (0.3.6)
183 | tty-cursor (0.6.0)
184 | tty-screen (0.6.5)
185 | tty-spinner (0.8.0)
186 | tty-cursor (>= 0.5.0)
187 | tzinfo (1.2.5)
188 | thread_safe (~> 0.1)
189 | uber (0.1.0)
190 | unf (0.1.4)
191 | unf_ext
192 | unf_ext (0.0.7.5)
193 | unicode-display_width (1.4.0)
194 | word_wrap (1.0.0)
195 | xcodeproj (1.6.0)
196 | CFPropertyList (>= 2.3.3, < 4.0)
197 | atomos (~> 0.1.3)
198 | claide (>= 1.0.2, < 2.0)
199 | colored2 (~> 3.1)
200 | nanaimo (~> 0.2.6)
201 | xcpretty (0.3.0)
202 | rouge (~> 2.0.7)
203 | xcpretty-travis-formatter (1.0.0)
204 | xcpretty (~> 0.2, >= 0.0.7)
205 |
206 | PLATFORMS
207 | ruby
208 |
209 | DEPENDENCIES
210 | cocoapods
211 | fastlane
212 | fastlane-plugin-badge
213 | fastlane-plugin-get_version_code
214 | fastlane-plugin-get_version_name
215 | fastlane-plugin-increment_version_code
216 | fastlane-plugin-versioning
217 | fastlane-plugin-yarn
218 |
219 | BUNDLED WITH
220 | 1.16.2
221 |
--------------------------------------------------------------------------------
/fastlane/Fastfile:
--------------------------------------------------------------------------------
1 | import './Common'
2 |
3 | # Support ENV variables as options or lane parameters
4 | fastlane_require 'dotenv'
5 |
6 | # dir variable set to react native root directory
7 | dir = File.expand_path('..', Dir.pwd).freeze
8 |
9 | # used for debugging options with Jenkins
10 | print_options = false.freeze
11 |
12 | #################
13 | #################
14 | ##### SETUP #####
15 | #################
16 | #################
17 |
18 | PROJECT_NAME = 'myCoolApp'.freeze
19 |
20 | ## iOS ##
21 | USES_COCOAPODS = true.freeze
22 | USES_MATCH = false.freeze
23 |
24 | IOS_APP_SPECIFIER = 'com.tgpski.myCoolApp'.freeze
25 | XCODE_PROJECT_PATH = "ios/#{PROJECT_NAME}.xcodeproj".freeze
26 | XCODE_WORKSPACE_PATH = "ios/#{PROJECT_NAME}.xcworkspace".freeze
27 |
28 | DEV_PRODUCT_NAME = "#{PROJECT_NAME}-debug.app".freeze
29 | DEV_SCHEME_NAME = "#{PROJECT_NAME}".freeze
30 | DEV_BUNDLE_ID_SUFFIX = '.dev'.freeze
31 |
32 | STAGING_PRODUCT_NAME = "#{PROJECT_NAME}-staging.app".freeze
33 | STAGING_SCHEME_NAME = "#{PROJECT_NAME}-staging".freeze
34 | STAGING_BUNDLE_ID_SUFFIX = '.staging'.freeze
35 |
36 | RELEASE_SCHEME_NAME = "#{PROJECT_NAME}-release".freeze
37 |
38 | DEVELOPMENT_PROVISIONING_PROFILE_NAME = ''.freeze
39 | DEVELOPMENT_CODESIGNING_IDENTITY = ''.freeze
40 | RELEASE_PROVISIONING_PROFILE_NAME = ''.freeze
41 | RELEASE_CODESIGNING_IDENTITY = ''.freeze
42 |
43 | BUILT_PRODUCTS_PATH = "#{dir}/ios/Build/Products".freeze
44 |
45 | ## Android ##
46 | AND_APP_SPECIFIER = 'com.tgpski.myCoolApp'.freeze
47 | APP_BUILD_GRADLE_PATH = 'android/app/build.gradle'.freeze
48 |
49 | AND_DEV_BUNDLE_ID_SUFFIX = 'dev'.freeze
50 | AND_DEV_BUILT_PPRODUCTS_PATH = "#{dir}/android/app/build/outputs/apk/debug/app-debug.apk".freeze
51 |
52 | AND_STAGING_BUNDLE_ID_SUFFIX = 'staging'.freeze
53 | AND_STAGING_BUILT_PPRODUCTS_PATH = "#{dir}/android/app/build/outputs/apk/staging/app-staging-unsigned.apk".freeze
54 |
55 | AND_RELEASE_BUILT_PPRODUCTS_PATH = "#{dir}/android/app/build/outputs/apk/release/app-release.apk".freeze
56 |
57 | ######################
58 | ######################
59 | ##### BEFORE ALL #####
60 | ######################
61 | ######################
62 |
63 | before_all do |lane, options|
64 |
65 | parsed_options = {
66 | :skip_before => handle_env_and_options(
67 | ENV['SKIP_BEFORE'],
68 | options[:skip_before],
69 | false,
70 | false
71 | )
72 | }
73 |
74 | unless parsed_options[:skip_before]
75 | yarn(
76 | command: 'install',
77 | package_path: './package.json'
78 | )
79 |
80 | unless lane_context[SharedValues::PLATFORM_NAME].to_s.eql?('android')
81 | if USES_COCOAPODS
82 | cocoapods(
83 | podfile: 'ios/Podfile',
84 | use_bundle_exec: false
85 | )
86 | end
87 | end
88 |
89 | yarn(
90 | command: 'checkmate',
91 | package_path: './package.json'
92 | )
93 |
94 | ANDROID_VERSION_NAME = get_version_name(
95 | gradle_file_path: APP_BUILD_GRADLE_PATH
96 | ).freeze
97 | ANDROID_VERSION_CODE = get_version_code(
98 | gradle_file_path: APP_BUILD_GRADLE_PATH
99 | ).freeze
100 |
101 | IOS_VERSION_NUMBER = get_version_number(
102 | xcodeproj: XCODE_PROJECT_PATH,
103 | target: PROJECT_NAME
104 | ).freeze
105 | IOS_REVISION_NUMBER = get_build_number_from_plist(
106 | xcodeproj: XCODE_PROJECT_PATH,
107 | target: PROJECT_NAME
108 | ).freeze
109 |
110 | puts "Android: #{ANDROID_VERSION_NAME},#{ANDROID_VERSION_CODE} |" \
111 | " iOS: #{IOS_VERSION_NUMBER},#{IOS_REVISION_NUMBER}"
112 | end
113 | end
114 |
115 | desc 'Test lane'
116 | lane :fastlane_test do |options|
117 | debug_options(options, print_options)
118 | end
119 |
120 | #####################
121 | #####################
122 | ##### iOS LANES #####
123 | #####################
124 | #####################
125 |
126 | platform :ios do
127 | desc 'iOS development build'
128 | lane :dev do |options|
129 | debug_options(options, print_options)
130 | copy_env_for_build_type('dev')
131 |
132 | parsed_options = {
133 | :badge => handle_env_and_options(
134 | ENV['BADGE'],
135 | options[:badge],
136 | false,
137 | false
138 | ),
139 | :simulator => handle_env_and_options(
140 | ENV['SIMULATOR'],
141 | options[:simulator],
142 | false,
143 | false
144 | ),
145 | :clean => handle_env_and_options(
146 | ENV['CLEAN'],
147 | options[:clean],
148 | false,
149 | true
150 | ),
151 | :install => handle_env_and_options(
152 | ENV['INSTALL'],
153 | options[:install],
154 | false,
155 | false
156 | ),
157 | :xcargs => handle_env_and_options(
158 | ENV['XCARGS'],
159 | options[:xcargs],
160 | true,
161 | ''
162 | )
163 | }
164 |
165 | if parsed_options[:badge]
166 | add_badge(
167 | shield: "#{IOS_VERSION_NUMBER}-#{IOS_REVISION_NUMBER}-orange",
168 | alpha: true,
169 | shield_scale: '0.75'
170 | )
171 | end
172 |
173 |
174 | # Enable match action after configuring Matchfile and Github support
175 | if USES_MATCH
176 | match(type: 'development', readonly: true)
177 | end
178 |
179 | xcodebuild(
180 | workspace: XCODE_WORKSPACE_PATH,
181 | scheme: DEV_SCHEME_NAME,
182 | codesigning_identity: DEVELOPMENT_CODESIGNING_IDENTITY,
183 | provisioning_profile: DEVELOPMENT_PROVISIONING_PROFILE_NAME,
184 | destination: (
185 | parsed_options[:simulator] ?
186 | 'generic/platform=iOS Simulator' :
187 | 'generic/platform=iOS'
188 | ),
189 | clean: parsed_options[:clean],
190 | build: true,
191 | xcargs: parsed_options[:xcargs],
192 | )
193 |
194 | if parsed_options[:install]
195 | sh("xcrun simctl uninstall booted '#{IOS_APP_SPECIFIER}#{DEV_BUNDLE_ID_SUFFIX}'")
196 | sh("xcrun simctl install booted #{BUILT_PRODUCTS_PATH}/Debug-iphonesimulator/#{DEV_PRODUCT_NAME}")
197 | sh("xcrun simctl launch booted '#{IOS_APP_SPECIFIER}#{DEV_BUNDLE_ID_SUFFIX}'")
198 | end
199 | end
200 |
201 | desc 'iOS staging build'
202 | lane :staging do |options|
203 | debug_options(options, print_options)
204 | copy_env_for_build_type('staging')
205 |
206 | parsed_options = {
207 | :badge => handle_env_and_options(
208 | ENV['BADGE'],
209 | options[:badge],
210 | false,
211 | false
212 | ),
213 | :simulator => handle_env_and_options(
214 | ENV['SIMULATOR'],
215 | options[:simulator],
216 | false,
217 | false
218 | ),
219 | :clean => handle_env_and_options(
220 | ENV['CLEAN'],
221 | options[:clean],
222 | false,
223 | true
224 | ),
225 | :install => handle_env_and_options(
226 | ENV['INSTALL'],
227 | options[:install],
228 | false,
229 | false
230 | ),
231 | :xcargs => handle_env_and_options(
232 | ENV['XCARGS'],
233 | options[:xcargs],
234 | true,
235 | ''
236 | )
237 | }
238 |
239 | if parsed_options[:badge]
240 | add_badge(
241 | shield: "#{IOS_VERSION_NUMBER}-#{IOS_REVISION_NUMBER}-orange",
242 | alpha: true,
243 | shield_scale: '0.75'
244 | )
245 | end
246 |
247 | if USES_MATCH
248 | match(type: 'development', readonly: true)
249 | end
250 |
251 | xcodebuild(
252 | workspace: XCODE_WORKSPACE_PATH,
253 | scheme: STAGING_SCHEME_NAME,
254 | codesigning_identity: DEVELOPMENT_CODESIGNING_IDENTITY,
255 | provisioning_profile: DEVELOPMENT_PROVISIONING_PROFILE_NAME,
256 | destination: (
257 | parsed_options[:simulator] ?
258 | 'generic/platform=iOS Simulator' :
259 | 'generic/platform=iOS'
260 | ),
261 | clean: parsed_options[:clean],
262 | build: true,
263 | xcargs: parsed_options[:xcargs]
264 | )
265 |
266 | if parsed_options[:install]
267 | sh("xcrun simctl uninstall booted '#{IOS_APP_SPECIFIER}#{STAGING_BUNDLE_ID_SUFFIX}'")
268 | sh("xcrun simctl install booted #{BUILT_PRODUCTS_PATH}/Staging-iphonesimulator/#{STAGING_PRODUCT_NAME}")
269 | sh("xcrun simctl launch booted '#{IOS_APP_SPECIFIER}#{STAGING_BUNDLE_ID_SUFFIX}'")
270 | end
271 | end
272 |
273 | desc 'iOS release build, upload to App Store'
274 | lane :release do |options|
275 | debug_options(options, print_options)
276 | copy_env_for_build_type('release')
277 |
278 | parsed_options = {
279 | :app_store => handle_env_and_options(
280 | ENV['APP_STORE'],
281 | options[:app_store],
282 | false,
283 | false
284 | ),
285 | :xcargs => handle_env_and_options(
286 | ENV['XCARGS'],
287 | options[:xcargs],
288 | true,
289 | ''
290 | )
291 | }
292 |
293 | if USES_MATCH
294 | match(type: 'appstore', readonly: true)
295 | end
296 |
297 | gym(
298 | scheme: RELEASE_SCHEME_NAME,
299 | codesigning_identity: RELEASE_CODESIGNING_IDENTITY,
300 | provisioning_profile: RELEASE_PROVISIONING_PROFILE_NAME,
301 | clean: true,
302 | xcargs: xcargs
303 | )
304 |
305 | if parsed_options[:app_store]
306 | deliver(
307 | submit_for_review: false
308 | )
309 | end
310 | end
311 | end
312 |
313 | #########################
314 | #########################
315 | ##### ANDROID LANES #####
316 | #########################
317 | #########################
318 |
319 | platform :android do
320 | desc 'Android development build'
321 | lane :dev do |options|
322 | debug_options(options, print_options)
323 | copy_env_for_build_type('dev')
324 |
325 | parsed_options = {
326 | :badge => handle_env_and_options(
327 | ENV['BADGE'],
328 | options[:badge],
329 | false,
330 | false
331 | ),
332 | :clean => handle_env_and_options(
333 | ENV['CLEAN'],
334 | options[:clean],
335 | false,
336 | true
337 | ),
338 | :install => handle_env_and_options(
339 | ENV['INSTALL'],
340 | options[:install],
341 | false,
342 | false
343 | )
344 | }
345 |
346 | if parsed_options[:badge]
347 | add_badge(
348 | shield: "#{ANDROID_VERSION_NAME}-#{ANDROID_VERSION_CODE}-orange",
349 | glob: '/android/app/src/main/res/mipmap-*/ic_launcher.png',
350 | alpha: true,
351 | shield_scale: "0.75"
352 | )
353 | end
354 |
355 | if parsed_options[:clean]
356 | gradle(
357 | task: 'clean',
358 | project_dir: './android/'
359 | )
360 | end
361 |
362 | gradle(
363 | task: 'assemble',
364 | build_type: 'debug',
365 | project_dir: './android/'
366 | )
367 |
368 | if parsed_options[:install]
369 | adb(
370 | command: "uninstall #{AND_APP_SPECIFIER}.#{AND_DEV_BUNDLE_ID_SUFFIX}"
371 | )
372 | adb(
373 | command: "install #{AND_DEV_BUILT_PPRODUCTS_PATH}"
374 | )
375 | adb(
376 | command: "shell monkey -p #{AND_APP_SPECIFIER}.#{AND_DEV_BUNDLE_ID_SUFFIX}
377 | -c android.intent.category.LAUNCHER 1"
378 | )
379 | end
380 | end
381 |
382 | desc 'Android staging build'
383 | lane :staging do |options|
384 | debug_options(options, print_options)
385 | copy_env_for_build_type('staging')
386 |
387 | parsed_options = {
388 | :badge => handle_env_and_options(
389 | ENV['BADGE'],
390 | options[:badge],
391 | false,
392 | false
393 | ),
394 | :clean => handle_env_and_options(
395 | ENV['CLEAN'],
396 | options[:clean],
397 | false,
398 | true
399 | ),
400 | :install => handle_env_and_options(
401 | ENV['INSTALL'],
402 | options[:install],
403 | false,
404 | false
405 | )
406 | }
407 |
408 | if parsed_options[:badge]
409 | add_badge(
410 | shield: "#{ANDROID_VERSION_NAME}-#{ANDROID_VERSION_CODE}-orange",
411 | glob: '/android/app/src/main/res/mipmap-*/ic_launcher.png',
412 | alpha: true,
413 | shield_scale: "0.75"
414 | )
415 | end
416 |
417 | if parsed_options[:clean]
418 | gradle(
419 | task: 'clean',
420 | project_dir: './android/'
421 | )
422 | end
423 |
424 | gradle(
425 | task: 'assemble',
426 | build_type: 'staging',
427 | project_dir: './android/'
428 | )
429 |
430 | if parsed_options[:install]
431 | adb(
432 | command: "uninstall #{AND_APP_SPECIFIER}.#{AND_STAGING_BUNDLE_ID_SUFFIX}"
433 | )
434 | adb(
435 | command: "install #{AND_STAGING_BUILT_PPRODUCTS_PATH}"
436 | )
437 | adb(
438 | command: "shell monkey -p #{AND_APP_SPECIFIER}.#{AND_STAGING_BUNDLE_ID_SUFFIX}
439 | -c android.intent.category.LAUNCHER 1"
440 | )
441 | end
442 | end
443 |
444 | desc 'Android release build, upload to Play Store'
445 | lane :release do |options|
446 | debug_options(options, print_options)
447 | copy_env_for_build_type('release')
448 |
449 | parsed_options = {
450 | :play_store => handle_env_and_options(
451 | ENV['PLAY_STORE'],
452 | options[:play_store],
453 | false,
454 | false
455 | )
456 | }
457 |
458 | gradle(task: 'clean', project_dir: "./android/")
459 |
460 | gradle(task: "assemble", build_type: "release", project_dir: "./android/")
461 |
462 | if parsed_options[:play_store]
463 | supply(track: "alpha", apk: AND_RELEASE_BUILT_PPRODUCTS_PATH)
464 | end
465 |
466 | end
467 | end
468 |
469 | ##########################
470 | ##########################
471 | ##### CODEPUSH LANES #####
472 | ##########################
473 | ##########################
474 |
475 | # desc 'Codepush development'
476 | # lane :cp_dev do |options|
477 | # debug_options(options, print_options)
478 | # copy_env_for_build_type('dev')
479 | # end
480 |
481 | # desc 'Codepush pre-release'
482 | # lane :cp_pre_release do |options|
483 | # debug_options(options, print_options)
484 | # copy_env_for_build_type('prod')
485 | # end
486 |
487 | # desc 'Codepush promotion pre-release -> release'
488 | # lane :cp_release do |options|
489 | # debug_options(options, print_options)
490 | # end
491 |
--------------------------------------------------------------------------------