Skip to content

Commit

Permalink
Merge pull request #363 from aeddi/fix/aeddi/release-builded-app-crash
Browse files Browse the repository at this point in the history
Fix crash on ios app builded in release mode
  • Loading branch information
gfanton committed Oct 15, 2018
2 parents e4407a7 + 6bd5902 commit 11c319d
Show file tree
Hide file tree
Showing 148 changed files with 2,662 additions and 11,829 deletions.
95 changes: 46 additions & 49 deletions .circleci/config.yml
Expand Up @@ -177,7 +177,10 @@ jobs:
- restore_cache:
key: node-v1-{{ checksum "client/react-native/package.json" }}-{{ arch }}

- run: cd client/react-native && make deps
- run:
name: install react-native deps
command: |
cd client/react-native && make deps
- save_cache:
key: yarn-v1-{{ checksum "client/react-native/yarn.lock" }}-{{ arch }}
Expand All @@ -194,12 +197,9 @@ jobs:
paths:
- client/react-native/common
- client/react-native/node_modules
- client/react-native/gomobile/node_modules
- client/react-native/common/node_modules
- client/react-native/mobile/node_modules

client.rn.android:
working_directory: ~/go/src/berty.tech/client/react-native/mobile/android
working_directory: ~/go/src/berty.tech/client/react-native/android
docker:
- image: bertychat/android-ci:v2
steps:
Expand All @@ -212,22 +212,19 @@ jobs:
- run:
name: setup golang environment
command: |
~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
echo "export PATH=/usr/local/go/bin/:~/go/bin:$PATH" >> $BASH_ENV
- run:
name: gomobile android build
command: |
~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
env && cd ../../gomobile && make android
env && cd ../gomobile && make build.android
- restore_cache:
key: android-gems-{{ checksum "~/go/src/berty.tech/client/react-native/mobile/android/Gemfile.lock" }}

- run:
name: install bundle
command: |
~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
bundle check || bundle install --path vendor/bundle
- save_cache:
Expand All @@ -238,7 +235,6 @@ jobs:
- run:
name: build app
command: |
~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
time bundle exec fastlane android beta
client.rn.ios:
Expand All @@ -265,13 +261,13 @@ jobs:
- attach_workspace:
at: ~/go/src/berty.tech/

# - restore_cache:
# key: ios-golang-{{ .Environment.GOVERSION }}-2
# if build breaks, increment vX in both restore_cache and save_cache
- restore_cache:
key: v1-ios-golang-{{ .Environment.GOVERSION }}-2

- run:
name: install-go
command: |
# ~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
if [ ! -f ~/go-install/go/bin/go ]; then
cd ~ && git clone https://github.com/udhos/update-golang
cd ~/update-golang && mkdir ~/go-install && sudo DESTINATION=~/go-install ./update-golang.sh
Expand All @@ -281,7 +277,6 @@ jobs:
- run:
name: install gomobile
command: |
# ~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
if [ ! -f ~/go/bin/gomobile ]; then
go get golang.org/x/mobile/cmd/gomobile
cd ~/go/src/golang.org/x/mobile
Expand All @@ -292,47 +287,49 @@ jobs:
gomobile init
fi
# - save_cache:
# key: ios-golang-{{ .Environment.GOVERSION }}-2
# paths:
# - ~/go
# - ~/go-install
- save_cache:
key: v1-ios-golang-{{ .Environment.GOVERSION }}-2
paths:
- ~/go
- ~/go-install

- run:
name: install core
working_directory: ~/go/src/berty.tech/client/react-native/gomobile
command: |
# ~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
make ios
make build.ios
# - restore_cache:
# key: ios-gems-{{ checksum "~/go/src/berty.tech/client/react-native/Gemfile.lock" }}-3
- restore_cache:
key: ios-gems-{{ checksum "~/go/src/berty.tech/client/react-native/Gemfile.lock" }}-3

- run:
working_directory: ~/go/src/berty.tech/client/react-native
command: |
# ~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
bundle check || bundle install --path vendor/bundle
# - save_cache:
# key: ios-gems-{{ checksum "~/go/src/berty.tech/client/react-native/Gemfile.lock" }}-3
# paths:
# - client/react-native/vendor/bundle
- save_cache:
key: ios-gems-{{ checksum "~/go/src/berty.tech/client/react-native/Gemfile.lock" }}-3
paths:
- client/react-native/vendor/bundle

- run:
name: set version
working_directory: ~/go/src/berty.tech/client/react-native
command: |
# ~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
make version
- run:
name: install fsevents
working_directory: ~/go/src/berty.tech/client/react-native
command: |
yarn add fsevents
- run:
name: build app
working_directory: ~/go/src/berty.tech/client/react-native
command: |
# ~/go/src/berty.tech/.circleci/paths_changed ^client ^.circle || exit 0
make fastlane.setup_circle \
fastlane.ios.build
fastlane.ios.build
- store_artifacts:
path: /tmp/fl
Expand All @@ -349,29 +346,29 @@ jobs:
at: ~/go/src/berty.tech/


- restore_cache:
key: yarn-v1-{{ checksum "client/react-native/web/yarn.lock" }}-{{ arch }}
# - restore_cache:
# key: yarn-v1-{{ checksum "client/react-native/web/yarn.lock" }}-{{ arch }}

- restore_cache:
key: node-v1-{{ checksum "client/react-native/web/package.json" }}-{{ arch }}
# - restore_cache:
# key: node-v1-{{ checksum "client/react-native/web/package.json" }}-{{ arch }}

- run: cd client/react-native/web && yarn
# - run: cd client/react-native/web && yarn

- save_cache:
key: yarn-v1-{{ checksum "client/react-native/web/yarn.lock" }}-{{ arch }}
paths:
- ~/.cache/yarn
# - save_cache:
# key: yarn-v1-{{ checksum "client/react-native/web/yarn.lock" }}-{{ arch }}
# paths:
# - ~/.cache/yarn

- save_cache:
key: node-v1-{{ checksum "client/react-native/web/package.json" }}-{{ arch }}
paths:
- node_modules
# - save_cache:
# key: node-v1-{{ checksum "client/react-native/web/package.json" }}-{{ arch }}
# paths:
# - node_modules

- run:
name: build web app
working_directory: ~/go/src/berty.tech/client/react-native/web
command: |
yarn build
# - run:
# name: build web app
# working_directory: ~/go/src/berty.tech/client/react-native/web
# command: |
# yarn build

workflows:
version: 2
Expand Down
14 changes: 8 additions & 6 deletions Makefile
Expand Up @@ -30,6 +30,7 @@ lint-editorconfig:
! -name '*.patch' \
! -name '*.diff' \
! -name '*.vim' \
! -name '*.bat' \
! -name '.DS_Store' \
! -name '.generated' \
! -name '.gitkeep' \
Expand All @@ -48,12 +49,13 @@ lint-editorconfig:
! -path './.github/*' \
! -path './client/common/openssl/built/*' \
! -path './client/react-native/common/schema.graphql' \
! -path './client/react-native/mobile/*/Build/*' \
! -path './client/react-native/mobile/*/build/*' \
! -path './client/react-native/mobile/android/.gradle/*' \
! -path './client/react-native/mobile/ios/berty.xcodeproj/*' \
! -path './client/react-native/mobile/ios/berty/Images.xcassets/*' \
! -path './client/react-native/mobile/ios/core.framework/*' \
! -path './client/react-native/*/Build/*' \
! -path './client/react-native/*/build/*' \
! -path './client/react-native/android/.idea/*' \
! -path './client/react-native/android/.gradle/*' \
! -path './client/react-native/ios/Berty.xcodeproj/*' \
! -path './client/react-native/ios/Berty/Images.xcassets/*' \
! -path './client/react-native/ios/core.framework/*' \
! -path './vendor/*' \
`; \
COUNT=$$(echo "$$FILES" | sed '/^\s*$$/d' | wc -l | tr -d ' '); \
Expand Down
7 changes: 3 additions & 4 deletions client/react-native/.babelrc
@@ -1,9 +1,8 @@
{
"presets": ["react-native", "react-app", "stage-0"],
"env": {
"browser": true
},
"presets": ["module:metro-react-native-babel-preset"],
"plugins": [
"module:@babel/plugin-syntax-export-namespace-from",
"transform-export-extensions",
"relay"
]
}
File renamed without changes.
18 changes: 0 additions & 18 deletions client/react-native/.env.example

This file was deleted.

Expand Up @@ -29,6 +29,9 @@ node_modules/react-native/flow-github/
[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
Expand Down Expand Up @@ -64,4 +67,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

[version]
^0.75.0
^0.78.0
@@ -1 +1,2 @@
*.pbxproj -text
*.bat eol=crlf
15 changes: 9 additions & 6 deletions client/react-native/.gitignore
@@ -1,5 +1,8 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# Fastlane
.build

# junk files
#
*~
Expand All @@ -14,8 +17,8 @@ gin-bin

## Gomobile
#
mobile/ios/core.framework
mobile/android/app/libs/core.aar
ios/core.framework
android/app/libs/core.aar

# Xcode
#
Expand Down Expand Up @@ -84,14 +87,14 @@ fastlane/Appfile
fastlane/Matchfile

# Gomobile
mobile/android/app/libs/*.aar
mobile/android/app/libs/*-sources.jar
android/app/libs/*.aar
android/app/libs/*-sources.jar
gomobile/vendor
gomobile/bin
gomobile/_vendor-*
gomobile/tags
mobile/android/libs/
mobile/ios/libs/
android/libs/
ios/libs/

# mobile
shim.js
Expand Down

0 comments on commit 11c319d

Please sign in to comment.