Skip to content

Commit f411c51

Browse files
authored
Merge pull request changwoolab#1 from changwoolab/@wolewicki/add-fabric
Add Fabric
2 parents 9ab80fc + 71dc8be commit f411c51

File tree

111 files changed

+10882
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+10882
-69
lines changed

FabricExample/.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
BUNDLE_PATH: "vendor/bundle"
2+
BUNDLE_FORCE_RUBY_PLATFORM: 1

FabricExample/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native',
4+
};

FabricExample/.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
ios/.xcode.env.local
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
.cxx/
34+
*.keystore
35+
!debug.keystore
36+
37+
# node.js
38+
#
39+
node_modules/
40+
npm-debug.log
41+
yarn-error.log
42+
43+
# fastlane
44+
#
45+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
46+
# screenshots whenever they are needed.
47+
# For more information about the recommended setup visit:
48+
# https://docs.fastlane.tools/best-practices/source-control/
49+
50+
**/fastlane/report.xml
51+
**/fastlane/Preview.html
52+
**/fastlane/screenshots
53+
**/fastlane/test_output
54+
55+
# Bundle artifact
56+
*.jsbundle
57+
58+
# Ruby / CocoaPods
59+
/ios/Pods/
60+
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage

FabricExample/.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
bracketSpacing: false,
5+
singleQuote: true,
6+
trailingComma: 'all',
7+
};

FabricExample/.watchmanconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

FabricExample/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
gem 'cocoapods', '~> 1.12'

FabricExample/__tests__/App.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
8+
9+
// Note: import explicitly to use the types shiped with jest.
10+
import {it} from '@jest/globals';
11+
12+
// Note: test renderer must be required after react-native.
13+
import renderer from 'react-test-renderer';
14+
15+
it('renders correctly', () => {
16+
renderer.create(<App />);
17+
});
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
apply plugin: "com.android.application"
2+
apply plugin: "com.facebook.react"
3+
4+
/**
5+
* This is the configuration block to customize your React Native Android app.
6+
* By default you don't need to apply any configuration, just uncomment the lines you need.
7+
*/
8+
react {
9+
/* Folders */
10+
// The root of your project, i.e. where "package.json" lives. Default is '..'
11+
// root = file("../")
12+
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
13+
// reactNativeDir = file("../node_modules/react-native")
14+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
15+
// codegenDir = file("../node_modules/@react-native/codegen")
16+
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
17+
// cliFile = file("../node_modules/react-native/cli.js")
18+
19+
/* Variants */
20+
// The list of variants to that are debuggable. For those we're going to
21+
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
22+
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
23+
// debuggableVariants = ["liteDebug", "prodDebug"]
24+
25+
/* Bundling */
26+
// A list containing the node command and its flags. Default is just 'node'.
27+
// nodeExecutableAndArgs = ["node"]
28+
//
29+
// The command to run when bundling. By default is 'bundle'
30+
// bundleCommand = "ram-bundle"
31+
//
32+
// The path to the CLI configuration file. Default is empty.
33+
// bundleConfig = file(../rn-cli.config.js)
34+
//
35+
// The name of the generated asset file containing your JS bundle
36+
// bundleAssetName = "MyApplication.android.bundle"
37+
//
38+
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
39+
// entryFile = file("../js/MyApplication.android.js")
40+
//
41+
// A list of extra flags to pass to the 'bundle' commands.
42+
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
43+
// extraPackagerArgs = []
44+
45+
/* Hermes Commands */
46+
// The hermes compiler command to run. By default it is 'hermesc'
47+
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
48+
//
49+
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
50+
// hermesFlags = ["-O", "-output-source-map"]
51+
}
52+
53+
/**
54+
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
55+
*/
56+
def enableProguardInReleaseBuilds = false
57+
58+
/**
59+
* The preferred build flavor of JavaScriptCore (JSC)
60+
*
61+
* For example, to use the international variant, you can use:
62+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
63+
*
64+
* The international variant includes ICU i18n library and necessary data
65+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
66+
* give correct results when using with locales other than en-US. Note that
67+
* this variant is about 6MiB larger per architecture than default.
68+
*/
69+
def jscFlavor = 'org.webkit:android-jsc:+'
70+
71+
android {
72+
ndkVersion rootProject.ext.ndkVersion
73+
74+
compileSdkVersion rootProject.ext.compileSdkVersion
75+
76+
namespace "com.fabricexample"
77+
defaultConfig {
78+
applicationId "com.fabricexample"
79+
minSdkVersion rootProject.ext.minSdkVersion
80+
targetSdkVersion rootProject.ext.targetSdkVersion
81+
versionCode 1
82+
versionName "1.0"
83+
}
84+
signingConfigs {
85+
debug {
86+
storeFile file('debug.keystore')
87+
storePassword 'android'
88+
keyAlias 'androiddebugkey'
89+
keyPassword 'android'
90+
}
91+
}
92+
buildTypes {
93+
debug {
94+
signingConfig signingConfigs.debug
95+
}
96+
release {
97+
// Caution! In production, you need to generate your own keystore file.
98+
// see https://reactnative.dev/docs/signed-apk-android.
99+
signingConfig signingConfigs.debug
100+
minifyEnabled enableProguardInReleaseBuilds
101+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
102+
}
103+
}
104+
}
105+
106+
dependencies {
107+
// The version of react-native is set by the React Native Gradle Plugin
108+
implementation("com.facebook.react:react-android")
109+
110+
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
111+
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
112+
exclude group:'com.squareup.okhttp3', module:'okhttp'
113+
}
114+
115+
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
116+
if (hermesEnabled.toBoolean()) {
117+
implementation("com.facebook.react:hermes-android")
118+
} else {
119+
implementation jscFlavor
120+
}
121+
}
122+
123+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
2.2 KB
Binary file not shown.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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:

0 commit comments

Comments
 (0)