Skip to content

Commit

Permalink
Update build.gradle to allow override of MS auth library version. (#43)
Browse files Browse the repository at this point in the history
* Update build.gradle to allow override of MS auth library version.

I think this is the least impact in terms of blast radius. I can also update the docs with a caveat that changing the library version may break the plugin.

* Update README.md with explanation.

* Update build.gradle to use namespaced var name.
  • Loading branch information
colonelpopcorn committed Aug 7, 2024
1 parent 65d19f5 commit 9d4f497
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ await MsAuthPlugin.logout({
keyHash: '<Android only, the key hash as obtained above>',
});
```
## MSAL Versions
There are some scenarios where the default project may be generated in such a way which prevents a build from succeeding. To get around this, a variable has been exposed to allow users to configure the Microsoft Authentication library version. By setting the `recognizebvMSALVersion` variable in your root `build.gradle` you can override the default version used during dependency resolution. See this [issue](https://github.com/recognizegroup/capacitor-plugin-msauth/issues/42) for more details. Here's an example you can place in your root `build.gradle` file to override the MSAL version.

```groovy
ext {
recognizebvMSALVersion = '5.3.0' // This version fixed the open telemetry issue described in issue #42.
}
```
3 changes: 2 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ext {
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
recognizebvMSALVersion = project.hasProperty("recognizebvMSALVersion") ? rootProject.ext.recognizebvMSALVersion : '4.9.0'
}

buildscript {
Expand Down Expand Up @@ -63,7 +64,7 @@ allprojects {
dependencies {
implementation project(':capacitor-android')
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation "com.microsoft.identity.client:msal:4.9.0"
implementation "com.microsoft.identity.client:msal:$recognizebvMSALVersion"

testImplementation "org.json:json:20230227"
testImplementation "org.mockito:mockito-inline:5.2.0"
Expand Down

0 comments on commit 9d4f497

Please sign in to comment.