Skip to content

Commit

Permalink
[ios] misc podspec changes
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
Salakar committed May 20, 2019
1 parent 930ee4e commit ab1c8c7
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 32 deletions.
2 changes: 1 addition & 1 deletion packages/analytics/RNFBAnalytics.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/invertase/react-native-firebase.git", :tag => "v#{s.version}" }
s.social_media_url = 'http://twitter.com/invertaseio'
s.platform = :ios, "10.0"
s.source_files = 'ios/RNFBAnalytics/**/*.{h,m}'
s.source_files = 'ios/**/*.{h,m}'
s.dependency 'React'
s.dependency 'Firebase/Core', '~> 5.20.2'
s.dependency 'RNFBApp'
Expand Down
3 changes: 1 addition & 2 deletions packages/app/pod_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def react_native_firebase!(config = {})
existing_dep.name.split('/').first == module_spec.name
end


pod module_spec.name, :path => module_dir
pod module_podspec_name, :path => module_dir

module_build_script = File.join(module_dir, 'ios_config.sh')
module_package_json = JSON.parse(File.read(File.join(module_dir, 'package.json')))
Expand Down
5 changes: 3 additions & 2 deletions packages/template/project/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';

import FirebaseAnalytics from '@react-native-firebase/analytics';
import firebase from '@react-native-firebase/app';
import '@react-native-firebase/analytics';

const instructions = Platform.select({
ios: 'Press Cmd+R to reload,\nCmd+D or shake for dev menu',
Expand All @@ -20,7 +21,7 @@ type Props = {};

export default class App extends Component<Props> {
async componentDidMount() {
await FirebaseAnalytics().setCurrentScreen('HomeScreen', 'RootView');
await firebase.analytics().setCurrentScreen('HomeScreen', 'RootView');
}

render() {
Expand Down
10 changes: 5 additions & 5 deletions packages/template/project/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HelloWorld",
"version": "6.0.0-alpha.10",
"version": "6.0.0-alpha.11",
"private": true,
"scripts": {
"start": "react-native start",
Expand All @@ -11,15 +11,15 @@
"prepare": "patch-package"
},
"dependencies": {
"@react-native-firebase/analytics": "6.0.0-alpha.10",
"@react-native-firebase/app": "6.0.0-alpha.10",
"@react-native-firebase/analytics": "^6.0.0-alpha.11",
"@react-native-firebase/app": "^6.0.0-alpha.11",
"react": "16.8.1",
"react-native": "0.59.5"
"react-native": "0.59.8"
},
"devDependencies": {
"@babel/core": "^7.3.3",
"@babel/runtime": "^7.3.1",
"@react-native-community/cli": "2.0.0-alpha.13",
"@react-native-community/cli": "2.0.0-alpha.20",
"@react-native-community/eslint-config": "^0.0.3",
"babel-jest": "^24.1.0",
"jest": "^24.1.0",
Expand Down
3 changes: 1 addition & 2 deletions packages/template/template.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module.exports = {
// Directory with template
templateDir: './project',

// TODO currently breaks on cli
// Path to script, which will be executed after init
// postInitScript: "./post-init.js"
postInitScript: './post-init.js',
};
5 changes: 1 addition & 4 deletions tests/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
platform :ios, '10.0'
require_relative '../node_modules/@react-native-firebase/app/pod_config'

install! 'cocoapods', :deterministic_uuids => false

target 'testing' do
platform :ios, '10.0'

use_frameworks!

react_native_path = "../node_modules/react-native"
Expand All @@ -18,13 +17,11 @@ target 'testing' do
'RCTWebSocket',
]


pod "yoga", :path => "#{react_native_path}/ReactCommon/yoga"
pod 'DoubleConversion', :podspec => "#{react_native_path}/third-party-podspecs/DoubleConversion.podspec"
pod 'glog', :podspec => "#{react_native_path}/third-party-podspecs/glog.podspec"
pod 'Folly', :podspec => "#{react_native_path}/third-party-podspecs/Folly.podspec"
pod 'Jet', :path => '../node_modules/jet/ios'
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'

react_native_firebase!
end
Expand Down
29 changes: 15 additions & 14 deletions tests/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ EXTERNAL SOURCES:
:path: !ruby/object:Pathname
path: "../node_modules/@react-native-firebase/analytics"
RNFBApp:
:path: "../node_modules/@react-native-firebase/app"
:path: !ruby/object:Pathname
path: "../node_modules/@react-native-firebase/app"
RNFBAuth:
:path: !ruby/object:Pathname
path: "../node_modules/@react-native-firebase/auth"
Expand Down Expand Up @@ -419,20 +420,20 @@ SPEC CHECKSUMS:
nanopb: 2901f78ea1b7b4015c860c2fdd1ea2fee1a18d48
Protobuf: 7a877b7f3e5964e3fce995e2eb323dbc6831bb5a
React: 1d605e098d69bdf08960787f3446f0a9dc2e2ccf
RNFBAnalytics: 08c3f6d3b6ef42a69997efd14d4bb9f466dcc277
RNFBApp: 837d9ca65b7de07424405ba29a4d713b0a671ff9
RNFBAuth: 6a55c3686fce8a49e74c53b0a5801a08530b7af6
RNFBCrashlytics: 53064f99f95afffde0030996caf364051784bc90
RNFBFiam: 14f108517d006ac68481a4e48ae3c870ab55973e
RNFBFirestore: 22109f341a23cb0768d1de0548f20df4de8457d5
RNFBFunctions: 2ccab71052653272f1e515d5505c0513738fe6c9
RNFBIid: 856c8e6c00e8035806951b7291ec73a4a84d9881
RNFBInvites: 3f8d22b16df8d0d91fd76adc216270306f470496
RNFBPerf: a6f4618cec0fc86a1bff85482ff5e4431089e94a
RNFBStorage: 0a2124511b1079322a332b2b841eba1aacc39ff6
RNFBUtils: 5de1e5b225a129aef0438961f4059df1509d6a0a
RNFBAnalytics: e03359f6447302423ec6e87a41495de050944feb
RNFBApp: 7482cbe2a041c3072d57e4288ad74d1e9e7957b8
RNFBAuth: f9344d91dd699e8951325de8c29f2cf7652ae614
RNFBCrashlytics: a1e22e638d6840743ac40e682e3db2f32ec357c5
RNFBFiam: 74600d36ce77236d16505da0b5b53238990d7baa
RNFBFirestore: 0f1d858a79bfb252ac810b72617ca124ac29a999
RNFBFunctions: c808f7fb99fe5e5163eb8394752652c001872321
RNFBIid: 2abac0da11857bfb92e7fac7edebec2cc3244d0b
RNFBInvites: 501a697c63b517c1fc7d36a397552501cd7bfbbd
RNFBPerf: 31fe96325bd659fe0369d37aa94bcb409fdab5c6
RNFBStorage: 38546e2bd728e2910ac2b17c3640fdf2c64fd6d8
RNFBUtils: 2aa8a9a1357fdf13e264f7b139cd5831f67f0fd6
yoga: 128daf064cacaede0c3bb27424b6b4c71052e6cd

PODFILE CHECKSUM: 02f715d793c3e2604c56af92bf8efe0192c9f84e
PODFILE CHECKSUM: cefbd7c428a5b33a7a051ddc98946a385520b922

COCOAPODS: 1.5.3
25 changes: 23 additions & 2 deletions tests/ios/testing.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@
7D57265F10EEF7CD92D7973F /* Copy Detox Framework */,
1237E61692A0342A2C3FDCDD /* [CP] Embed Pods Frameworks */,
1BCDFF76126B3FF732C3286B /* [CP] Copy Pods Resources */,
B9C817E4784628596EE39CD0 /* [CP-User] RNFB crashlytics Build Script */,
B0D3529FE4EC7B139F26EC08 /* [CP-User] RNFB app Build Script */,
DC37E3FC678FDD885431CC5C /* [CP-User] RNFB crashlytics Build Script */,
);
buildRules = (
);
Expand Down Expand Up @@ -353,7 +354,27 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
B9C817E4784628596EE39CD0 /* [CP-User] RNFB crashlytics Build Script */ = {
B0D3529FE4EC7B139F26EC08 /* [CP-User] RNFB app Build Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)",
);
name = "[CP-User] RNFB app Build Script";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "#!/usr/bin/env bash\n#\n# Copyright (c) 2016-present Invertase Limited & Contributors\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this library except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\nset -e\n\n_MAX_LOOKUPS=3;\n_SEARCH_RESULT=''\n_CURRENT_LOOKUPS=1\n_JSON_ROOT=\"'react-native'\"\n_JSON_FILE_NAME='firebase.json'\n_CURRENT_SEARCH_DIR=${PROJECT_DIR}\n_PLIST_BUDDY=/usr/libexec/PlistBuddy\n_TARGET_PLIST=\"${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}\"\n_DSYM_PLIST=\"${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Info.plist\"\n\n_PLIST_ENTRY_KEYS=(\n 'firebase_crashlytics_collection_enabled' #1\n 'firebase_json_raw' #2 - must always be last entry\n)\n\n_PLIST_ENTRY_TYPES=(\n 'bool' #1\n 'string' #2 - must always be last entry\n)\n\n_PLIST_ENTRY_VALUES=(\n 'NO' #1\n 'e30=' #2 - must always be last entry - base64 of {}\n)\n\nfunction setPlistValue {\n echo \"info: setting plist entry '$1' of type '$2' in file '$4'\"\n ${_PLIST_BUDDY} -c \"Add :$1 $2 '$3'\" $4 || echo \"info: '$1' already exists\"\n}\n\necho \"info: -> RNFB build script started\"\necho \"info: 1) Locating ${_JSON_FILE_NAME} file:\"\n\nif [[ -z ${_CURRENT_SEARCH_DIR} ]]; then\n _CURRENT_SEARCH_DIR=`pwd`\nfi;\n\nwhile true; do\n _CURRENT_SEARCH_DIR=`dirname \"$_CURRENT_SEARCH_DIR\"`\n if [[ \"$_CURRENT_SEARCH_DIR\" == \"/\" ]] || [[ ${_CURRENT_LOOKUPS} -gt ${_MAX_LOOKUPS} ]]; then break; fi;\n\n echo \"info: ($_CURRENT_LOOKUPS of $_MAX_LOOKUPS) Searching in '$_CURRENT_SEARCH_DIR' for a ${_JSON_FILE_NAME} file.\"\n _SEARCH_RESULT=`find \"$_CURRENT_SEARCH_DIR\" -maxdepth 2 -name ${_JSON_FILE_NAME} -print | head -n 1`\n\n if [[ ${_SEARCH_RESULT} ]]; then\n echo \"info: ${_JSON_FILE_NAME} found at $_SEARCH_RESULT\"\n break;\n fi;\n\n _CURRENT_LOOKUPS=$((_CURRENT_LOOKUPS+1))\ndone\n\nif [[ ${_SEARCH_RESULT} ]]; then\n _SEARCH_RESULT=\"'$_SEARCH_RESULT'\"\n _JSON_OUTPUT=`python -c 'import json,sys,base64;print(base64.b64encode(json.dumps(json.loads(open('${_SEARCH_RESULT}').read())['${_JSON_ROOT}'])))' || echo \"e30=\"`\n _PLIST_ENTRY_VALUES[${#_PLIST_ENTRY_VALUES[@]}-1]=\"${_JSON_OUTPUT}\"\n echo \"info: firebase.json value: ${_JSON_OUTPUT}\"\nelse\n echo \"warning: A firebase.json file was not found, whilst this file is optional it is recommended to include it to configure firebase services in React Native Firebase.\"\nfi;\n\necho \"info: 2) Adding Info.plist entries: \"\n\nfor plist in ${_TARGET_PLIST} ${_DSYM_PLIST} ; do\n if [[ -f ${plist} ]]; then\n for i in \"${!_PLIST_ENTRY_KEYS[@]}\"; do\n setPlistValue ${_PLIST_ENTRY_KEYS[$i]} ${_PLIST_ENTRY_TYPES[$i]} ${_PLIST_ENTRY_VALUES[$i]} ${plist}\n done\n else\n echo \"warning: A plist file was not found\"\n fi\ndone\n\necho \"info: <- RNFB build script finished\"\n\n\n\n";
showEnvVarsInLog = 0;
};
DC37E3FC678FDD885431CC5C /* [CP-User] RNFB crashlytics Build Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand Down

0 comments on commit ab1c8c7

Please sign in to comment.