etendo-ui-library 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/.buckconfig +6 -0
  2. package/.eslintrc.js +16 -0
  3. package/.ondevice/Storybook.tsx +4 -0
  4. package/.ondevice/main.js +11 -0
  5. package/.ondevice/preview.js +9 -0
  6. package/.ondevice/storybook.requires.js +33 -0
  7. package/.prettierrc.js +7 -0
  8. package/.storybook/main.js +5 -8
  9. package/.watchmanconfig +1 -0
  10. package/App.tsx +2 -0
  11. package/Gemfile +6 -0
  12. package/Gemfile.lock +100 -0
  13. package/_bundle/config +2 -0
  14. package/_ruby-version +1 -0
  15. package/android/app/_BUCK +55 -0
  16. package/android/app/build.gradle +321 -0
  17. package/android/app/build_defs.bzl +19 -0
  18. package/android/app/debug.keystore +0 -0
  19. package/android/app/proguard-rules.pro +10 -0
  20. package/android/app/src/debug/AndroidManifest.xml +13 -0
  21. package/android/app/src/debug/java/com/myapp/ReactNativeFlipper.java +73 -0
  22. package/android/app/src/main/AndroidManifest.xml +26 -0
  23. package/android/app/src/main/java/com/myapp/MainActivity.java +40 -0
  24. package/android/app/src/main/java/com/myapp/MainApplication.java +91 -0
  25. package/android/app/src/main/java/com/myapp/newarchitecture/MainApplicationReactNativeHost.java +116 -0
  26. package/android/app/src/main/java/com/myapp/newarchitecture/components/MainComponentsRegistry.java +36 -0
  27. package/android/app/src/main/java/com/myapp/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java +48 -0
  28. package/android/app/src/main/jni/Android.mk +49 -0
  29. package/android/app/src/main/jni/MainApplicationModuleProvider.cpp +24 -0
  30. package/android/app/src/main/jni/MainApplicationModuleProvider.h +16 -0
  31. package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp +45 -0
  32. package/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h +38 -0
  33. package/android/app/src/main/jni/MainComponentsRegistry.cpp +61 -0
  34. package/android/app/src/main/jni/MainComponentsRegistry.h +32 -0
  35. package/android/app/src/main/jni/OnLoad.cpp +11 -0
  36. package/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  37. package/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  38. package/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  39. package/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  40. package/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  41. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  42. package/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  43. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  44. package/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  45. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  46. package/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  47. package/android/app/src/main/res/values/strings.xml +3 -0
  48. package/android/app/src/main/res/values/styles.xml +9 -0
  49. package/android/build.gradle +57 -0
  50. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  51. package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  52. package/android/gradle.properties +40 -0
  53. package/android/gradlew +234 -0
  54. package/android/gradlew.bat +89 -0
  55. package/android/settings.gradle +9 -0
  56. package/app.json +4 -0
  57. package/babel.config.js +2 -5
  58. package/{src/components/__stories__ → components}/Button.stories.tsx +2 -2
  59. package/{src/components/__tests__ → components}/Button.test.tsx +2 -2
  60. package/{src/components → components}/Button.tsx +1 -1
  61. package/{src/components → components}/Button.types.ts +0 -0
  62. package/index.js +9 -0
  63. package/ios/MyApp/AppDelegate.h +8 -0
  64. package/ios/MyApp/AppDelegate.mm +108 -0
  65. package/ios/MyApp/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  66. package/ios/MyApp/Images.xcassets/Contents.json +6 -0
  67. package/ios/MyApp/Info.plist +55 -0
  68. package/ios/MyApp/LaunchScreen.storyboard +47 -0
  69. package/ios/MyApp/main.m +10 -0
  70. package/ios/MyApp.xcodeproj/project.pbxproj +698 -0
  71. package/ios/MyApp.xcodeproj/xcshareddata/xcschemes/MyApp.xcscheme +88 -0
  72. package/ios/MyApp.xcworkspace/contents.xcworkspacedata +10 -0
  73. package/ios/MyApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  74. package/ios/MyAppTests/Info.plist +24 -0
  75. package/ios/MyAppTests/MyAppTests.m +66 -0
  76. package/ios/Podfile +37 -0
  77. package/ios/Podfile.lock +562 -0
  78. package/metro.config.js +20 -0
  79. package/package.json +62 -43
  80. package/pipelines/Jenkinsfile +63 -0
  81. package/pipelines/build-update.sh +19 -0
  82. package/tsconfig.json +59 -96
  83. package/.editorconfig +0 -12
  84. package/README.md +0 -68
  85. package/dist/cjs/index.js +0 -42
  86. package/jest.config.ts +0 -199
  87. package/rollup.config.js +0 -39
  88. package/src/components/Input.tsx +0 -54
  89. package/src/components/Input.types.ts +0 -12
  90. package/src/components/__stories__/Input.stories.tsx +0 -22
  91. package/src/components/__stories__/Introduction.stories.mdx +0 -211
  92. package/src/components/__stories__/assets/code-brackets.svg +0 -1
  93. package/src/components/__stories__/assets/colors.svg +0 -1
  94. package/src/components/__stories__/assets/comments.svg +0 -1
  95. package/src/components/__stories__/assets/direction.svg +0 -1
  96. package/src/components/__stories__/assets/flow.svg +0 -1
  97. package/src/components/__stories__/assets/plugin.svg +0 -1
  98. package/src/components/__stories__/assets/repo.svg +0 -1
  99. package/src/components/__stories__/assets/stackalt.svg +0 -1
  100. package/src/components/__tests__/Input.test.tsx +0 -26
  101. package/src/index.d.ts +0 -0
  102. package/src/index.ts +0 -5
package/.buckconfig ADDED
@@ -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
package/.eslintrc.js ADDED
@@ -0,0 +1,16 @@
1
+ module.exports = {
2
+ root: true,
3
+ extends: '@react-native-community',
4
+ parser: '@typescript-eslint/parser',
5
+ plugins: ['@typescript-eslint'],
6
+ overrides: [
7
+ {
8
+ files: ['*.ts', '*.tsx'],
9
+ rules: {
10
+ '@typescript-eslint/no-shadow': ['error'],
11
+ 'no-shadow': 'off',
12
+ 'no-undef': 'off',
13
+ },
14
+ },
15
+ ],
16
+ };
@@ -0,0 +1,4 @@
1
+ import { getStorybookUI } from '@storybook/react-native';
2
+ import './storybook.requires';
3
+ const StorybookUIRoot = getStorybookUI({});
4
+ export default StorybookUIRoot;
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ stories: [
3
+ '../components/**/*.stories.?(ts|tsx|js|jsx)'
4
+ ],
5
+ addons: [
6
+ '@storybook/addon-ondevice-notes',
7
+ '@storybook/addon-ondevice-controls',
8
+ '@storybook/addon-ondevice-backgrounds',
9
+ '@storybook/addon-ondevice-actions',
10
+ ],
11
+ };
@@ -0,0 +1,9 @@
1
+ import {withBackgrounds} from '@storybook/addon-ondevice-backgrounds';
2
+ export const decorators = [withBackgrounds];
3
+ export const parameters = {
4
+ backgrounds: [
5
+ {name: 'plain', value: 'white', default: true},
6
+ {name: 'warm', value: 'hotpink'},
7
+ {name: 'cool', value: 'deepskyblue'},
8
+ ],
9
+ };
@@ -0,0 +1,33 @@
1
+ /* do not change this file, it is auto generated by storybook. */
2
+
3
+ import {
4
+ configure,
5
+ addDecorator,
6
+ addParameters,
7
+ addArgsEnhancer,
8
+ } from "@storybook/react-native";
9
+
10
+ import "@storybook/addon-ondevice-notes/register";
11
+ import "@storybook/addon-ondevice-controls/register";
12
+ import "@storybook/addon-ondevice-backgrounds/register";
13
+ import "@storybook/addon-ondevice-actions/register";
14
+
15
+ import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs";
16
+
17
+ import { decorators, parameters } from "./preview";
18
+
19
+ if (decorators) {
20
+ decorators.forEach((decorator) => addDecorator(decorator));
21
+ }
22
+
23
+ if (parameters) {
24
+ addParameters(parameters);
25
+ }
26
+
27
+ argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer));
28
+
29
+ const getStories = () => {
30
+ return [require("../components/Button.stories.tsx")];
31
+ };
32
+
33
+ configure(getStories, module, false);
package/.prettierrc.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ arrowParens: 'avoid',
3
+ bracketSameLine: true,
4
+ bracketSpacing: false,
5
+ singleQuote: true,
6
+ trailingComma: 'all',
7
+ };
@@ -1,12 +1,9 @@
1
1
  module.exports = {
2
- "stories": [
3
- "../src/**/*.stories.mdx",
4
- "../src/**/*.stories.@(js|jsx|ts|tsx)"
5
- ],
6
- "addons": [
2
+ stories: ["../components/**/*.stories.?(ts|tsx|js|jsx)"],
3
+ addons: [
7
4
  "@storybook/addon-links",
8
5
  "@storybook/addon-essentials",
9
- "@storybook/addon-interactions"
6
+ "@storybook/addon-react-native-web",
10
7
  ],
11
- "framework": "@storybook/react"
12
- }
8
+ framework: "@storybook/react",
9
+ };
@@ -0,0 +1 @@
1
+ {}
package/App.tsx ADDED
@@ -0,0 +1,2 @@
1
+ import StorybookUIRoot from "./.ondevice/Storybook";
2
+ export { StorybookUIRoot as default };
package/Gemfile ADDED
@@ -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.7.4'
5
+
6
+ gem 'cocoapods', '~> 1.11', '>= 1.11.2'
package/Gemfile.lock ADDED
@@ -0,0 +1,100 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ CFPropertyList (3.0.5)
5
+ rexml
6
+ activesupport (6.1.5)
7
+ concurrent-ruby (~> 1.0, >= 1.0.2)
8
+ i18n (>= 1.6, < 2)
9
+ minitest (>= 5.1)
10
+ tzinfo (~> 2.0)
11
+ zeitwerk (~> 2.3)
12
+ addressable (2.8.0)
13
+ public_suffix (>= 2.0.2, < 5.0)
14
+ algoliasearch (1.27.5)
15
+ httpclient (~> 2.8, >= 2.8.3)
16
+ json (>= 1.5.1)
17
+ atomos (0.1.3)
18
+ claide (1.1.0)
19
+ cocoapods (1.11.3)
20
+ addressable (~> 2.8)
21
+ claide (>= 1.0.2, < 2.0)
22
+ cocoapods-core (= 1.11.3)
23
+ cocoapods-deintegrate (>= 1.0.3, < 2.0)
24
+ cocoapods-downloader (>= 1.4.0, < 2.0)
25
+ cocoapods-plugins (>= 1.0.0, < 2.0)
26
+ cocoapods-search (>= 1.0.0, < 2.0)
27
+ cocoapods-trunk (>= 1.4.0, < 2.0)
28
+ cocoapods-try (>= 1.1.0, < 2.0)
29
+ colored2 (~> 3.1)
30
+ escape (~> 0.0.4)
31
+ fourflusher (>= 2.3.0, < 3.0)
32
+ gh_inspector (~> 1.0)
33
+ molinillo (~> 0.8.0)
34
+ nap (~> 1.0)
35
+ ruby-macho (>= 1.0, < 3.0)
36
+ xcodeproj (>= 1.21.0, < 2.0)
37
+ cocoapods-core (1.11.3)
38
+ activesupport (>= 5.0, < 7)
39
+ addressable (~> 2.8)
40
+ algoliasearch (~> 1.0)
41
+ concurrent-ruby (~> 1.1)
42
+ fuzzy_match (~> 2.0.4)
43
+ nap (~> 1.0)
44
+ netrc (~> 0.11)
45
+ public_suffix (~> 4.0)
46
+ typhoeus (~> 1.0)
47
+ cocoapods-deintegrate (1.0.5)
48
+ cocoapods-downloader (1.6.3)
49
+ cocoapods-plugins (1.0.0)
50
+ nap
51
+ cocoapods-search (1.0.1)
52
+ cocoapods-trunk (1.6.0)
53
+ nap (>= 0.8, < 2.0)
54
+ netrc (~> 0.11)
55
+ cocoapods-try (1.2.0)
56
+ colored2 (3.1.2)
57
+ concurrent-ruby (1.1.10)
58
+ escape (0.0.4)
59
+ ethon (0.15.0)
60
+ ffi (>= 1.15.0)
61
+ ffi (1.15.5)
62
+ fourflusher (2.3.1)
63
+ fuzzy_match (2.0.4)
64
+ gh_inspector (1.1.3)
65
+ httpclient (2.8.3)
66
+ i18n (1.10.0)
67
+ concurrent-ruby (~> 1.0)
68
+ json (2.6.1)
69
+ minitest (5.15.0)
70
+ molinillo (0.8.0)
71
+ nanaimo (0.3.0)
72
+ nap (1.1.0)
73
+ netrc (0.11.0)
74
+ public_suffix (4.0.7)
75
+ rexml (3.2.5)
76
+ ruby-macho (2.5.1)
77
+ typhoeus (1.4.0)
78
+ ethon (>= 0.9.0)
79
+ tzinfo (2.0.4)
80
+ concurrent-ruby (~> 1.0)
81
+ xcodeproj (1.21.0)
82
+ CFPropertyList (>= 2.3.3, < 4.0)
83
+ atomos (~> 0.1.3)
84
+ claide (>= 1.0.2, < 2.0)
85
+ colored2 (~> 3.1)
86
+ nanaimo (~> 0.3.0)
87
+ rexml (~> 3.2.4)
88
+ zeitwerk (2.5.4)
89
+
90
+ PLATFORMS
91
+ ruby
92
+
93
+ DEPENDENCIES
94
+ cocoapods (~> 1.11, >= 1.11.2)
95
+
96
+ RUBY VERSION
97
+ ruby 2.7.4p191
98
+
99
+ BUNDLED WITH
100
+ 2.2.27
package/_bundle/config ADDED
@@ -0,0 +1,2 @@
1
+ BUNDLE_PATH: "vendor/bundle"
2
+ BUNDLE_FORCE_RUBY_PLATFORM: 1
package/_ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.4
@@ -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.myapp",
39
+ )
40
+
41
+ android_resource(
42
+ name = "res",
43
+ package = "com.myapp",
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
+ )
@@ -0,0 +1,321 @@
1
+ apply plugin: "com.android.application"
2
+
3
+ import com.android.build.OutputFile
4
+ import org.apache.tools.ant.taskdefs.condition.Os
5
+
6
+ /**
7
+ * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
8
+ * and bundleReleaseJsAndAssets).
9
+ * These basically call `react-native bundle` with the correct arguments during the Android build
10
+ * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
11
+ * bundle directly from the development server. Below you can see all the possible configurations
12
+ * and their defaults. If you decide to add a configuration block, make sure to add it before the
13
+ * `apply from: "../../node_modules/react-native/react.gradle"` line.
14
+ *
15
+ * project.ext.react = [
16
+ * // the name of the generated asset file containing your JS bundle
17
+ * bundleAssetName: "index.android.bundle",
18
+ *
19
+ * // the entry file for bundle generation. If none specified and
20
+ * // "index.android.js" exists, it will be used. Otherwise "index.js" is
21
+ * // default. Can be overridden with ENTRY_FILE environment variable.
22
+ * entryFile: "index.android.js",
23
+ *
24
+ * // https://reactnative.dev/docs/performance#enable-the-ram-format
25
+ * bundleCommand: "ram-bundle",
26
+ *
27
+ * // whether to bundle JS and assets in debug mode
28
+ * bundleInDebug: false,
29
+ *
30
+ * // whether to bundle JS and assets in release mode
31
+ * bundleInRelease: true,
32
+ *
33
+ * // whether to bundle JS and assets in another build variant (if configured).
34
+ * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
35
+ * // The configuration property can be in the following formats
36
+ * // 'bundleIn${productFlavor}${buildType}'
37
+ * // 'bundleIn${buildType}'
38
+ * // bundleInFreeDebug: true,
39
+ * // bundleInPaidRelease: true,
40
+ * // bundleInBeta: true,
41
+ *
42
+ * // whether to disable dev mode in custom build variants (by default only disabled in release)
43
+ * // for example: to disable dev mode in the staging build type (if configured)
44
+ * devDisabledInStaging: true,
45
+ * // The configuration property can be in the following formats
46
+ * // 'devDisabledIn${productFlavor}${buildType}'
47
+ * // 'devDisabledIn${buildType}'
48
+ *
49
+ * // the root of your project, i.e. where "package.json" lives
50
+ * root: "../../",
51
+ *
52
+ * // where to put the JS bundle asset in debug mode
53
+ * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
54
+ *
55
+ * // where to put the JS bundle asset in release mode
56
+ * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
57
+ *
58
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
59
+ * // require('./image.png')), in debug mode
60
+ * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
61
+ *
62
+ * // where to put drawable resources / React Native assets, e.g. the ones you use via
63
+ * // require('./image.png')), in release mode
64
+ * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
65
+ *
66
+ * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
67
+ * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
68
+ * // date; if you have any other folders that you want to ignore for performance reasons (gradle
69
+ * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
70
+ * // for example, you might want to remove it from here.
71
+ * inputExcludes: ["android/**", "ios/**"],
72
+ *
73
+ * // override which node gets called and with what additional arguments
74
+ * nodeExecutableAndArgs: ["node"],
75
+ *
76
+ * // supply additional arguments to the packager
77
+ * extraPackagerArgs: []
78
+ * ]
79
+ */
80
+
81
+ project.ext.react = [
82
+ enableHermes: false, // clean and rebuild if changing
83
+ ]
84
+
85
+ apply from: "../../node_modules/react-native/react.gradle"
86
+
87
+ /**
88
+ * Set this to true to create two separate APKs instead of one:
89
+ * - An APK that only works on ARM devices
90
+ * - An APK that only works on x86 devices
91
+ * The advantage is the size of the APK is reduced by about 4MB.
92
+ * Upload all the APKs to the Play Store and people will download
93
+ * the correct one based on the CPU architecture of their device.
94
+ */
95
+ def enableSeparateBuildPerCPUArchitecture = false
96
+
97
+ /**
98
+ * Run Proguard to shrink the Java bytecode in release builds.
99
+ */
100
+ def enableProguardInReleaseBuilds = false
101
+
102
+ /**
103
+ * The preferred build flavor of JavaScriptCore.
104
+ *
105
+ * For example, to use the international variant, you can use:
106
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
107
+ *
108
+ * The international variant includes ICU i18n library and necessary data
109
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
110
+ * give correct results when using with locales other than en-US. Note that
111
+ * this variant is about 6MiB larger per architecture than default.
112
+ */
113
+ def jscFlavor = 'org.webkit:android-jsc:+'
114
+
115
+ /**
116
+ * Whether to enable the Hermes VM.
117
+ *
118
+ * This should be set on project.ext.react and that value will be read here. If it is not set
119
+ * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
120
+ * and the benefits of using Hermes will therefore be sharply reduced.
121
+ */
122
+ def enableHermes = project.ext.react.get("enableHermes", false);
123
+
124
+ /**
125
+ * Architectures to build native code for.
126
+ */
127
+ def reactNativeArchitectures() {
128
+ def value = project.getProperties().get("reactNativeArchitectures")
129
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
130
+ }
131
+
132
+ android {
133
+ ndkVersion rootProject.ext.ndkVersion
134
+
135
+ compileSdkVersion rootProject.ext.compileSdkVersion
136
+
137
+ defaultConfig {
138
+ applicationId "com.myapp"
139
+ minSdkVersion rootProject.ext.minSdkVersion
140
+ targetSdkVersion rootProject.ext.targetSdkVersion
141
+ versionCode 1
142
+ versionName "1.0"
143
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
144
+
145
+ if (isNewArchitectureEnabled()) {
146
+ // We configure the NDK build only if you decide to opt-in for the New Architecture.
147
+ externalNativeBuild {
148
+ ndkBuild {
149
+ arguments "APP_PLATFORM=android-21",
150
+ "APP_STL=c++_shared",
151
+ "NDK_TOOLCHAIN_VERSION=clang",
152
+ "GENERATED_SRC_DIR=$buildDir/generated/source",
153
+ "PROJECT_BUILD_DIR=$buildDir",
154
+ "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
155
+ "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
156
+ cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
157
+ cppFlags "-std=c++17"
158
+ // Make sure this target name is the same you specify inside the
159
+ // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160
+ targets "myapp_appmodules"
161
+
162
+ // Fix for windows limit on number of character in file paths and in command lines
163
+ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
164
+ arguments "NDK_OUT=${rootProject.projectDir.getParent()}\\.cxx",
165
+ "NDK_APP_SHORT_COMMANDS=true"
166
+ }
167
+ }
168
+ }
169
+ if (!enableSeparateBuildPerCPUArchitecture) {
170
+ ndk {
171
+ abiFilters (*reactNativeArchitectures())
172
+ }
173
+ }
174
+ }
175
+ }
176
+
177
+ if (isNewArchitectureEnabled()) {
178
+ // We configure the NDK build only if you decide to opt-in for the New Architecture.
179
+ externalNativeBuild {
180
+ ndkBuild {
181
+ path "$projectDir/src/main/jni/Android.mk"
182
+ }
183
+ }
184
+ def reactAndroidProjectDir = project(':ReactAndroid').projectDir
185
+ def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
186
+ dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
187
+ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
188
+ into("$buildDir/react-ndk/exported")
189
+ }
190
+ def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
191
+ dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
192
+ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
193
+ into("$buildDir/react-ndk/exported")
194
+ }
195
+ afterEvaluate {
196
+ // If you wish to add a custom TurboModule or component locally,
197
+ // you should uncomment this line.
198
+ // preBuild.dependsOn("generateCodegenArtifactsFromSchema")
199
+ preDebugBuild.dependsOn(packageReactNdkDebugLibs)
200
+ preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
201
+
202
+ // Due to a bug inside AGP, we have to explicitly set a dependency
203
+ // between configureNdkBuild* tasks and the preBuild tasks.
204
+ // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
205
+ configureNdkBuildRelease.dependsOn(preReleaseBuild)
206
+ configureNdkBuildDebug.dependsOn(preDebugBuild)
207
+ reactNativeArchitectures().each { architecture ->
208
+ tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
209
+ dependsOn("preDebugBuild")
210
+ }
211
+ tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
212
+ dependsOn("preReleaseBuild")
213
+ }
214
+ }
215
+ }
216
+ }
217
+
218
+ splits {
219
+ abi {
220
+ reset()
221
+ enable enableSeparateBuildPerCPUArchitecture
222
+ universalApk false // If true, also generate a universal APK
223
+ include (*reactNativeArchitectures())
224
+ }
225
+ }
226
+ signingConfigs {
227
+ debug {
228
+ storeFile file('debug.keystore')
229
+ storePassword 'android'
230
+ keyAlias 'androiddebugkey'
231
+ keyPassword 'android'
232
+ }
233
+ }
234
+ buildTypes {
235
+ debug {
236
+ signingConfig signingConfigs.debug
237
+ }
238
+ release {
239
+ // Caution! In production, you need to generate your own keystore file.
240
+ // see https://reactnative.dev/docs/signed-apk-android.
241
+ signingConfig signingConfigs.debug
242
+ minifyEnabled enableProguardInReleaseBuilds
243
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
244
+ }
245
+ }
246
+
247
+ // applicationVariants are e.g. debug, release
248
+ applicationVariants.all { variant ->
249
+ variant.outputs.each { output ->
250
+ // For each separate APK per architecture, set a unique version code as described here:
251
+ // https://developer.android.com/studio/build/configure-apk-splits.html
252
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
253
+ def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
254
+ def abi = output.getFilter(OutputFile.ABI)
255
+ if (abi != null) { // null for the universal-debug, universal-release variants
256
+ output.versionCodeOverride =
257
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
258
+ }
259
+
260
+ }
261
+ }
262
+ }
263
+
264
+ dependencies {
265
+ implementation fileTree(dir: "libs", include: ["*.jar"])
266
+
267
+ //noinspection GradleDynamicVersion
268
+ implementation "com.facebook.react:react-native:+" // From node_modules
269
+
270
+ implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
271
+
272
+ debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
273
+ exclude group:'com.facebook.fbjni'
274
+ }
275
+
276
+ debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
277
+ exclude group:'com.facebook.flipper'
278
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
279
+ }
280
+
281
+ debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
282
+ exclude group:'com.facebook.flipper'
283
+ }
284
+
285
+ if (enableHermes) {
286
+ def hermesPath = "../../node_modules/hermes-engine/android/";
287
+ debugImplementation files(hermesPath + "hermes-debug.aar")
288
+ releaseImplementation files(hermesPath + "hermes-release.aar")
289
+ } else {
290
+ implementation jscFlavor
291
+ }
292
+ }
293
+
294
+ if (isNewArchitectureEnabled()) {
295
+ // If new architecture is enabled, we let you build RN from source
296
+ // Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
297
+ // This will be applied to all the imported transtitive dependency.
298
+ configurations.all {
299
+ resolutionStrategy.dependencySubstitution {
300
+ substitute(module("com.facebook.react:react-native"))
301
+ .using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
302
+ }
303
+ }
304
+ }
305
+
306
+ // Run this once to be able to run the application with BUCK
307
+ // puts all compile dependencies into folder libs for BUCK to use
308
+ task copyDownloadableDepsToLibs(type: Copy) {
309
+ from configurations.implementation
310
+ into 'libs'
311
+ }
312
+
313
+ apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
314
+
315
+ def isNewArchitectureEnabled() {
316
+ // To opt-in for the New Architecture, you can either:
317
+ // - Set `newArchEnabled` to true inside the `gradle.properties` file
318
+ // - Invoke gradle with `-newArchEnabled=true`
319
+ // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
320
+ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
321
+ }
@@ -0,0 +1,19 @@
1
+ """Helper definitions to glob .aar and .jar targets"""
2
+
3
+ def create_aar_targets(aarfiles):
4
+ for aarfile in aarfiles:
5
+ name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6
+ lib_deps.append(":" + name)
7
+ android_prebuilt_aar(
8
+ name = name,
9
+ aar = aarfile,
10
+ )
11
+
12
+ def create_jar_targets(jarfiles):
13
+ for jarfile in jarfiles:
14
+ name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15
+ lib_deps.append(":" + name)
16
+ prebuilt_jar(
17
+ name = name,
18
+ binary_jar = jarfile,
19
+ )
Binary file
@@ -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,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:tools="http://schemas.android.com/tools">
4
+
5
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
+
7
+ <application
8
+ android:usesCleartextTraffic="true"
9
+ tools:targetApi="28"
10
+ tools:ignore="GoogleAppIndexingWarning">
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12
+ </application>
13
+ </manifest>