-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for providing alternate resource directory and config.yaml file #41
feat: add support for providing alternate resource directory and config.yaml file #41
Conversation
7e8ac3c
to
0c53f0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- I tested this: I built the android app and confirmed the new resources were showing within the app
- I read through the code
- I checked for accessibility issues
- Includes documentation: Needs to include small comment in documentation.
- I made sure any change in configuration variables is reflected in the corresponding client's
configuration-secure
repository.
sourceSets { | ||
prod { | ||
def envMap = config.environments.find { it.key == "PROD" } | ||
if (envMap.value.RES_DIR) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can include a small comment in the README about using RES_DIR
variable to include custom resources in the app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- I tested this
- I read through the code
-
I checked for accessibility issues - Includes documentation
-
I made sure any change in configuration variables is reflected in the corresponding client'sconfiguration-secure
repository.
@@ -6,6 +15,9 @@ plugins { | |||
id "com.google.firebase.crashlytics" | |||
} | |||
|
|||
def config_file = System.getenv("OPENEDX_ANDROID_CFG_FILE") ?: "config.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to rebuild the app while providing a different location for the config file using this ENV variable.
|
||
5. Select the build variant ``develop``, ``stage``, or ``prod``. | ||
|
||
6. Click the **Run** button. | ||
|
||
## Customising |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the README.
This change adds support for specifying an alternative resource directory, allowing resources to be overridden without needing to fork the repository.
This change makes it possible to specify an alternative location for the config.yaml file using an environment variable. This allows the developers to override all important data without messing up any files that can be committed to the repository.
ffd3914
to
9f8c4f1
Compare
@xitij2000 @yusuf-musleh It looks like this PR wasn't added to the Contributions board nor marked as an I've updated it now to show up on the board. @volodymyr-chekyrta This PR is ready for engineering review. Could you please have a look? |
Thanks for the pull request, @xitij2000! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Thanks, @itsjeyd! I've added this to my tracker. |
@xitij2000, appreciation for your valuable contribution! Looks like they are honoring the original request. |
I think custom settings are lot better with the recent changes, however I was hoping to have a mechanism for theming that could also allow loading resources from a custom location without touching the app's code. I'm not sure if this allows that though, I haven't investigated deeply enough. In any case I'm closing this since it's been implemented already as you mentioned. Thanks! |
@xitij2000 Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Fixes: LEARNER-10108
This change adds support for specifying an alternative resource directory, allowing resources to be overridden without needing to fork the repository.
With this change you can use an environment variable to specify a custom location for the config.yaml file and in that you can specify a directory to override resources from the app. This way you can have a completely custom build with a custom theme, logos, string etc without making any changes to the repo itself.