2.1.0 • Published 7 years ago

react-native-gradle-config v2.1.0

Weekly downloads
3
License
GPL-3.0
Repository
github
Last release
7 years ago

React Native Gradle Config

automate gradle config for production or dev

npm-version npm-downloads peer-dependencies devDependencies dependencies GPLv3

Why

when developing my react-native projects, I want to have both DEV and PRODUCTION versions on my device, and I want to easily distinguish between the two.

this package makes it possible to set seach configuration with a single command. combine with react-native-install-on-device for complete build automation.

Install

$ npm install --save-dev react-native-gradle-config
$ npm install --save-dev replace@ # peer dependency
$ npm run configGradleSetup # generates .gradleConfig file

Use

$ npm run configGradle # config gradle for DEV
$ npm run configGradle -- -p # config gradle for PRODUCTION

easy peasy! ;)

Config file

.gradleConfig contains 4 keys:

  • appDirName: created initially by react-native init, located at PROJECT_ROOT/android/app/src/main/java/com/
  • appDisplayName: what your users c, located at PROJECT_ROOT/android/app/src/main/res/values/strings.xml
  • appPackageName: the app's identifier for google store, located at the "package" attribute at the manifest file PROJECT_ROOT/android/app/src/main/AndroidManifest.xml
  • iconName: The name of the icon files to use for the app, located at:
    • PROJECT_ROOT/android/app/src/main/res/mipmap-mdpi/
    • PROJECT_ROOT/android/app/src/main/res/mipmap-hdpi/
    • PROJECT_ROOT/android/app/src/main/res/mipmap-xhdpi/
    • PROJECT_ROOT/android/app/src/main/res/mipmap-xxhdpi/ default is ic_launcher

if u make any changes to any of the above fields in your project, i.e. change the display name, u can either edit .gradleConfig manually, or run the setup script again:

$ npm run configGradleSetup

Related projects

Contact

Issues, features (and PRs!) are always welcomed :)

License

The code is available under the GPL v3 license.