Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ default config for macOS: &macos_defaults
<<: *defaults
resource_class: 'medium'
macos:
xcode: '11.7.0'
xcode: '12.1.0'

default config for android apk builds: &android_defaults
<<: *defaults
Expand Down Expand Up @@ -147,13 +147,16 @@ jobs:
command: |
brew bundle --file=.circleci/Brewfile.ios --no-lock
touch .watchmanconfig
node -v
echo Node $(node --version)
- save-cache: *cache_save_brew
- restore-cache: *cache_restore_yarn
- run:
name: Installing Yarn dependencies
command: yarn --pure-lockfile --non-interactive --cache-folder ~/.cache/yarn
- save-cache: *cache_save_yarn
- run:
name: Bundle JS
command: yarn bundle:ios --dev false
- run:
name: Install pod dependencies
working_directory: example/ios
Expand Down Expand Up @@ -187,12 +190,12 @@ jobs:

# Build and test
- run:
name: Bundle
command: mkdir example/android/app/src/main/assets && npx react-native bundle --platform android --dev false --entry-file example/index.js --bundle-output example/android/app/src/main/assets/index.android.bundle --assets-dest example/android/app/src/main/res/
name: Bundle JS
command: yarn bundle:android --dev false
- run:
name: Build Android apk
name: Build APK
working_directory: example/android
command: ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release --max-workers 2 -x bundleReleaseJsAndAssets
command: ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release --max-workers 2

- persist_to_workspace:
root: ~/async_storage
Expand Down
7 changes: 3 additions & 4 deletions .circleci/scripts/run_android_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ MAX_RETRIES=60 # wait max 5 minutes for emu to boot
build_apk() {
echo
echo "[Detox e2e] Building APK"
eval "mkdir example/android/app/src/main/assets"
eval "npx react-native bundle --platform android --dev false --entry-file example/index.js --bundle-output example/android/app/src/main/assets/index.android.bundle --assets-dest example/android/app/src/main/res/"
cd "example/android"
eval "./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release -x bundleReleaseJsAndAssets"
yarn bundle:android --dev false
cd example/android
./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release
cd ${ROOT_DIR}
}

Expand Down
5 changes: 2 additions & 3 deletions .circleci/scripts/run_ios_e2e.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

RESOURCE_DIR="$PWD/example/ios/build/Build/Products/Release-iphonesimulator/AsyncStorageExample.app"
RESOURCE_DIR="$PWD/example/ios/build/Build/Products/Release-iphonesimulator/ReactTestApp.app"
ENTRY_FILE="example/index.js"
BUNDLE_FILE="$RESOURCE_DIR/main.jsbundle"
EXTRA_PACKAGER_ARGS="--entry-file=$ENTRY_FILE"
Expand All @@ -9,11 +9,10 @@ build_project() {
echo "[Detox e2e] Building iOS project"
eval "xcodebuild \
-workspace example/ios/AsyncStorageExample.xcworkspace \
-scheme AsyncStorageExample \
-scheme ReactTestApp \
-configuration Release \
-sdk iphonesimulator \
-derivedDataPath example/ios/build \
-UseModernBuildSystem=NO \
BUNDLE_FILE=$BUNDLE_FILE \
EXTRA_PACKAGER_ARGS=$EXTRA_PACKAGER_ARGS"
}
Expand Down
32 changes: 32 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
BasedOnStyle: LLVM
AccessModifierOffset: -4
AllowShortFunctionsOnASingleLine: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Linux
ColumnLimit: 100
Cpp11BracedListStyle: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '"pch\.h"'
Priority: -1
- Regex: '^<React'
Priority: 4
- Regex: '^<[.a-z]+>'
Priority: 2
- Regex: '^<'
Priority: 3
- Regex: '.\*'
Priority: 10
IndentCaseLabels: true
IndentWidth: 4
NamespaceIndentation: All
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyReturnTypeOnItsOwnLine: 100
PointerAlignment: Right
SpacesBeforeTrailingComments: 2
SpacesInContainerLiterals: false
TabWidth: 4
22 changes: 10 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

configurations {
compileClasspath
}

buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.4'
}
}

Expand Down Expand Up @@ -69,7 +68,6 @@ android {
}

repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "${resolveModulePath("react-native")}/android"
Expand Down
23 changes: 23 additions & 0 deletions example/AsyncStorageExample.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'json'

package = JSON.parse(File.read(File.join('..', 'package.json')))

Pod::Spec.new do |s|
s.name = 'AsyncStorageExample'
s.version = '0.0.1-dev'
s.author = { package['author']['name'] => package['author']['email'] }
s.license = package['license']
s.homepage = package['homepage']
s.source = { :git => package['repository']['url'] }
s.summary = 'AsyncStorage example app'

s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.14'

s.dependency 'React'
s.dependency 'ReactTestApp-DevSupport'

#s.user_target_xcconfig = { 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES' => '$(inherited)' }

s.source_files = 'ios/AsyncStorageExample/**/*.{h,m,swift}'
end
55 changes: 0 additions & 55 deletions example/android/app/BUCK

This file was deleted.

Loading