Skip to content

Commit

Permalink
fixes: class name collision with native react-native-config (#724)
Browse files Browse the repository at this point in the history
* fix: class name collision with native react-native-config

* added 0.68.5 example project

* more name collision changes

* include latest changes

* updated class prefix and added android example project

* Bump github actions
  • Loading branch information
philpettican118 authored Jan 22, 2023
1 parent c92150e commit d29df70
Show file tree
Hide file tree
Showing 90 changed files with 10,984 additions and 273 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12.9.1'
node-version: '16.19.0'

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.0
uses: microsoft/setup-msbuild@v1.1.3
with:
vs-version: 16.5

Expand Down
2 changes: 2 additions & 0 deletions Example/0.68.5/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ENV=dev
API_URL=http://localhost
2 changes: 2 additions & 0 deletions Example/0.68.5/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ENV=production
API_URL=https://myapi.com
63 changes: 63 additions & 0 deletions Example/0.68.5/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
*.xcshareddata

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle

# CocoaPods
/ios/Pods/

# MSBuild Binary and Structured Log
*.binlog
42 changes: 42 additions & 0 deletions Example/0.68.5/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/react-native-community/react-native-template-typescript
*
* @format
*/

import React from 'react';
import {
StyleSheet,
Text,
View,
} from 'react-native';
import Config from 'react-native-config';

const App = () => {
return (
<View style={styles.container}>
<Text style={styles.text}>ENV={Config.ENV}</Text>
<Text style={styles.text}>API_URL={Config.API_URL}</Text>
</View>
);
};

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
text: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
});

export default App;
6 changes: 6 additions & 0 deletions Example/0.68.5/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.4'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
14 changes: 14 additions & 0 deletions Example/0.68.5/__tests__/App-test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @format
*/

import 'react-native';
import React from 'react';
import App from '../App';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
renderer.create(<App />);
});
2 changes: 2 additions & 0 deletions Example/0.68.5/_bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
1 change: 1 addition & 0 deletions Example/0.68.5/_ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.4
55 changes: 55 additions & 0 deletions Example/0.68.5/android/app/_BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

create_aar_targets(glob(["libs/*.aar"]))

create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = "build_config",
package = "com.example",
)

android_resource(
name = "res",
package = "com.example",
res = "src/main/res",
)

android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)
Loading

0 comments on commit d29df70

Please sign in to comment.