Skip to content

Commit 0ca190e

Browse files
committed
Initial commit
Generated by create-react-native-app 3.6.0.
0 parents  commit 0ca190e

Some content is hidden

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

59 files changed

+9765
-0
lines changed

.buckconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
[android]
3+
target = Google Inc.:Google APIs:23
4+
5+
[maven_repositories]
6+
central = https://repo1.maven.org/maven2

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.pbxproj -text

.gitignore

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
project.xcworkspace
24+
25+
# Android/IntelliJ
26+
#
27+
build/
28+
.idea
29+
.gradle
30+
local.properties
31+
*.iml
32+
*.hprof
33+
34+
# node.js
35+
#
36+
node_modules/
37+
npm-debug.log
38+
yarn-error.log
39+
40+
# BUCK
41+
buck-out/
42+
\.buckd/
43+
*.keystore
44+
!debug.keystore
45+
46+
# Bundle artifacts
47+
*.jsbundle
48+
49+
# CocoaPods
50+
/ios/Pods/
51+
52+
# Expo
53+
.expo/
54+
web-build/
55+
dist/

App.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { StatusBar } from 'expo-status-bar';
2+
import React from 'react';
3+
import { StyleSheet, Text, View } from 'react-native';
4+
5+
export default function App() {
6+
return (
7+
<View style={styles.container}>
8+
<Text>Open up App.js to start working on your app!</Text>
9+
<StatusBar style="auto" />
10+
</View>
11+
);
12+
}
13+
14+
const styles = StyleSheet.create({
15+
container: {
16+
flex: 1,
17+
backgroundColor: '#fff',
18+
alignItems: 'center',
19+
justifyContent: 'center',
20+
},
21+
});

__tests__/App.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import 'react-native';
2+
import React from 'react';
3+
import App from '../App';
4+
5+
// Note: test renderer must be required after react-native.
6+
import renderer from 'react-test-renderer';
7+
8+
it('renders correctly', () => {
9+
renderer.create(<App />);
10+
});

android/app/BUCK

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
13+
lib_deps = []
14+
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
18+
19+
android_library(
20+
name = "all-libs",
21+
exported_deps = lib_deps,
22+
)
23+
24+
android_library(
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
34+
)
35+
36+
android_build_config(
37+
name = "build_config",
38+
package = "com.chatminderclient",
39+
)
40+
41+
android_resource(
42+
name = "res",
43+
package = "com.chatminderclient",
44+
res = "src/main/res",
45+
)
46+
47+
android_binary(
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
55+
)

android/app/build.gradle

+244
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
apply plugin: "com.android.application"
2+
3+
import com.android.build.OutputFile
4+
5+
/**
6+
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7+
* and bundleReleaseJsAndAssets).
8+
* These basically call `react-native bundle` with the correct arguments during the Android build
9+
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10+
* bundle directly from the development server. Below you can see all the possible configurations
11+
* and their defaults. If you decide to add a configuration block, make sure to add it before the
12+
* `apply from: "../../node_modules/react-native/react.gradle"` line.
13+
*
14+
* project.ext.react = [
15+
* // the name of the generated asset file containing your JS bundle
16+
* bundleAssetName: "index.android.bundle",
17+
*
18+
* // the entry file for bundle generation. If none specified and
19+
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
20+
* // default. Can be overridden with ENTRY_FILE environment variable.
21+
* entryFile: "index.android.js",
22+
*
23+
* // https://reactnative.dev/docs/performance#enable-the-ram-format
24+
* bundleCommand: "ram-bundle",
25+
*
26+
* // whether to bundle JS and assets in debug mode
27+
* bundleInDebug: false,
28+
*
29+
* // whether to bundle JS and assets in release mode
30+
* bundleInRelease: true,
31+
*
32+
* // whether to bundle JS and assets in another build variant (if configured).
33+
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
34+
* // The configuration property can be in the following formats
35+
* // 'bundleIn${productFlavor}${buildType}'
36+
* // 'bundleIn${buildType}'
37+
* // bundleInFreeDebug: true,
38+
* // bundleInPaidRelease: true,
39+
* // bundleInBeta: true,
40+
*
41+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
42+
* // for example: to disable dev mode in the staging build type (if configured)
43+
* devDisabledInStaging: true,
44+
* // The configuration property can be in the following formats
45+
* // 'devDisabledIn${productFlavor}${buildType}'
46+
* // 'devDisabledIn${buildType}'
47+
*
48+
* // the root of your project, i.e. where "package.json" lives
49+
* root: "../../",
50+
*
51+
* // where to put the JS bundle asset in debug mode
52+
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
53+
*
54+
* // where to put the JS bundle asset in release mode
55+
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
56+
*
57+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
58+
* // require('./image.png')), in debug mode
59+
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
60+
*
61+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
62+
* // require('./image.png')), in release mode
63+
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
64+
*
65+
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
66+
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
67+
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
68+
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
69+
* // for example, you might want to remove it from here.
70+
* inputExcludes: ["android/**", "ios/**"],
71+
*
72+
* // override which node gets called and with what additional arguments
73+
* nodeExecutableAndArgs: ["node"],
74+
*
75+
* // supply additional arguments to the packager
76+
* extraPackagerArgs: []
77+
* ]
78+
*/
79+
80+
project.ext.react = [
81+
enableHermes: (findProperty('expo.jsEngine') ?: "jsc") == "hermes",
82+
cliPath: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/cli.js",
83+
hermesCommand: new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/%OS-BIN%/hermesc",
84+
composeSourceMapsPath: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/scripts/compose-source-maps.js",
85+
]
86+
87+
apply from: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../react.gradle")
88+
89+
/**
90+
* Set this to true to create two separate APKs instead of one:
91+
* - An APK that only works on ARM devices
92+
* - An APK that only works on x86 devices
93+
* The advantage is the size of the APK is reduced by about 4MB.
94+
* Upload all the APKs to the Play Store and people will download
95+
* the correct one based on the CPU architecture of their device.
96+
*/
97+
def enableSeparateBuildPerCPUArchitecture = false
98+
99+
/**
100+
* Run Proguard to shrink the Java bytecode in release builds.
101+
*/
102+
def enableProguardInReleaseBuilds = false
103+
104+
/**
105+
* The preferred build flavor of JavaScriptCore.
106+
*
107+
* For example, to use the international variant, you can use:
108+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
109+
*
110+
* The international variant includes ICU i18n library and necessary data
111+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
112+
* give correct results when using with locales other than en-US. Note that
113+
* this variant is about 6MiB larger per architecture than default.
114+
*/
115+
def jscFlavor = 'org.webkit:android-jsc:+'
116+
117+
/**
118+
* Whether to enable the Hermes VM.
119+
*
120+
* This should be set on project.ext.react and mirrored here. If it is not set
121+
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
122+
* and the benefits of using Hermes will therefore be sharply reduced.
123+
*/
124+
def enableHermes = project.ext.react.get("enableHermes", false);
125+
126+
android {
127+
compileSdkVersion rootProject.ext.compileSdkVersion
128+
129+
compileOptions {
130+
sourceCompatibility JavaVersion.VERSION_1_8
131+
targetCompatibility JavaVersion.VERSION_1_8
132+
}
133+
134+
defaultConfig {
135+
applicationId "com.chatminderclient"
136+
minSdkVersion rootProject.ext.minSdkVersion
137+
targetSdkVersion rootProject.ext.targetSdkVersion
138+
versionCode 1
139+
versionName "1.0"
140+
}
141+
splits {
142+
abi {
143+
reset()
144+
enable enableSeparateBuildPerCPUArchitecture
145+
universalApk false // If true, also generate a universal APK
146+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
147+
}
148+
}
149+
signingConfigs {
150+
debug {
151+
storeFile file('debug.keystore')
152+
storePassword 'android'
153+
keyAlias 'androiddebugkey'
154+
keyPassword 'android'
155+
}
156+
}
157+
buildTypes {
158+
debug {
159+
signingConfig signingConfigs.debug
160+
}
161+
release {
162+
// Caution! In production, you need to generate your own keystore file.
163+
// see https://reactnative.dev/docs/signed-apk-android.
164+
signingConfig signingConfigs.debug
165+
minifyEnabled enableProguardInReleaseBuilds
166+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
167+
}
168+
}
169+
170+
// applicationVariants are e.g. debug, release
171+
applicationVariants.all { variant ->
172+
variant.outputs.each { output ->
173+
// For each separate APK per architecture, set a unique version code as described here:
174+
// https://developer.android.com/studio/build/configure-apk-splits.html
175+
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
176+
def abi = output.getFilter(OutputFile.ABI)
177+
if (abi != null) { // null for the universal-debug, universal-release variants
178+
output.versionCodeOverride =
179+
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
180+
}
181+
182+
}
183+
}
184+
}
185+
186+
dependencies {
187+
implementation fileTree(dir: "libs", include: ["*.jar"])
188+
//noinspection GradleDynamicVersion
189+
implementation "com.facebook.react:react-native:+" // From node_modules
190+
191+
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
192+
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
193+
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
194+
195+
// If your app supports Android versions before Ice Cream Sandwich (API level 14)
196+
// All fresco packages should use the same version
197+
if (isGifEnabled || isWebpEnabled) {
198+
implementation 'com.facebook.fresco:fresco:2.0.0'
199+
implementation 'com.facebook.fresco:imagepipeline-okhttp3:2.0.0'
200+
}
201+
202+
if (isGifEnabled) {
203+
// For animated gif support
204+
implementation 'com.facebook.fresco:animated-gif:2.0.0'
205+
}
206+
207+
if (isWebpEnabled) {
208+
// For webp support
209+
implementation 'com.facebook.fresco:webpsupport:2.0.0'
210+
if (isWebpAnimatedEnabled) {
211+
// Animated webp support
212+
implementation 'com.facebook.fresco:animated-webp:2.0.0'
213+
}
214+
}
215+
216+
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
217+
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
218+
exclude group:'com.facebook.fbjni'
219+
}
220+
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
221+
exclude group:'com.facebook.flipper'
222+
exclude group:'com.squareup.okhttp3', module:'okhttp'
223+
}
224+
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
225+
exclude group:'com.facebook.flipper'
226+
}
227+
228+
if (enableHermes) {
229+
debugImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim(), "../android/hermes-debug.aar"))
230+
releaseImplementation files(new File(["node", "--print", "require.resolve('hermes-engine/package.json')"].execute(null, rootDir).text.trim(), "../android/hermes-release.aar"))
231+
} else {
232+
implementation jscFlavor
233+
}
234+
}
235+
236+
// Run this once to be able to run the application with BUCK
237+
// puts all compile dependencies into folder libs for BUCK to use
238+
task copyDownloadableDepsToLibs(type: Copy) {
239+
from configurations.compile
240+
into 'libs'
241+
}
242+
243+
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
244+
applyNativeModulesAppBuildGradle(project)

0 commit comments

Comments
 (0)