Comments (7)
Yeap good idea thanks. I even didn't know that your lib provides such a possibility!
Actually, if we talk about CI, getting value from the environment is preferable, since it provides this variable automatically from the Secrets store ( Bitrise ).
But locally (during development) I didn't want to do the same way )
Thanks for your time! I suppose the question is resolved
from react-native-ultimate-config.
hi @tr3v3r the last time I checked this was possible using the following API: https://github.com/maxkomarychev/react-native-ultimate-config/blob/master/docs/api.md#buildgradle
it's quite hard to debug your issue not seeing any code - can you please create project with minimal reproducible example of the problem?
from react-native-ultimate-config.
@tr3v3r I am assuming things but you might be seeing this problem because you're not applying gradle plugin as described in quickstart guide:
apply from: "../../node_modules/react-native-ultimate-config/android/rnuc.gradle"
from react-native-ultimate-config.
@maxkomarychev I’ve got error not in android/app/build.gradle ( when according to docs I need to insert ‘apply from’ statement ) but in android/build.gradle. I suppose the config could not be reached from this place with current implementation. What do you think?
from react-native-ultimate-config.
oh I see, sorry for missing that part.
unfortunately I haven't even tried to apply the plugin there and frankly I'm not that well versed in gradle nuances.
do you mind sharing why is this needed? can this be moved into internal app/build.gradle
? buildscripts are typically free from application-specific logic.. (at least on projects I've worked on)...
from react-native-ultimate-config.
I needed this because of this tutorial from the react-native-mapbox library.
In particular I need paste this code in android/build.gradle:
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = 'mapbox'
// Use the secret token you stored in gradle.properties as the password
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}
But also it's mandatory for us NOT to store this token directly in the project directory - so we decided to link it during build on CI. Obviously, the first thing that came to my mind is storing MAPBOX_DOWNLOADS_TOKEN in .env file (which is already linking on CI during the build ).
But it doesn't work:
password = project.config.get['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
Actually, we came up with another solution:
password = System.getenv("MAPBOX_DOWNLOADS_TOKEN") as String
and just export this env variable on CI during the build. So we can close the issue if you want )
from react-native-ultimate-config.
Then I can suggest you to use hooks API and generate '.properties' file which gradle can naturally pick up
from react-native-ultimate-config.
Related Issues (20)
- Warning on build: ios/rnuc.xcconfig: line 1: //: is a directory HOT 4
- is it possible to keep env based package name in proguard-rules.pro? HOT 2
- Build Failure - RN 0.69.1 HOT 30
- Android JCenter - build failure HOT 3
- expo 47 compatible ? HOT 2
- RN issue: Cannot choose between the following variants of com.facebook.react:react-native HOT 4
- Cannot choose between the following variants of com.facebook.react:react-native:0.70.6: HOT 2
- Error React Native IOS Undefined symbol: _RCTRegisterModule HOT 1
- Build error on 0.71.2: 'RNUltimateConfigSpec.h' file not found HOT 7
- Doc/Quickstart (minor): `npm bin` deprecated in Node 18.14 HOT 1
- Gradle 8 support HOT 4
- Could not set unknown property 'classifier' for task
- Packaging error
- Multiple env files possible? HOT 1
- Kotlin support
- '$' is not recognized as internal or external command HOT 1
- Error: Cannot resolve ./override HOT 8
- Does this package support use_frameworks! :linkage => :static ? HOT 1
- Firebase Initialization Issue with react-native-ultimate-config in NX Monorepo
- How to access from shell scripts HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-ultimate-config.