@@ -71,7 +71,7 @@ dependencies {
71
71
androidTestImplementation ' androidx.test.espresso:espresso-core:3.3.0'
72
72
73
73
// Branch
74
- api ' io.branch.sdk.android:library:5.14 .0'
74
+ api ' io.branch.sdk.android:library:5.15 .0'
75
75
implementation (' com.google.android.gms:play-services-ads-identifier:17.0.0' )
76
76
// for Huawei devices without GMS, adding it requires bumping up min api level to 19 though, so we
77
77
// leave it up to the client to add it following Branch documentation here: https://help.branch.io/developers-hub/docs/android-basic-integration
@@ -124,14 +124,23 @@ def applyCommonConfig = { MavenPublication publication ->
124
124
}
125
125
126
126
withXml {
127
- asNode(). dependencies. dependency. findAll {
128
- it. artifactId. text() == ' okhttp' || it. artifactId. text() == ' firebase-appindexing'
129
- }. each { dependency ->
130
- def optionalNode = dependency. optional
131
- if (optionalNode) {
132
- optionalNode[0 ]. value = ' true'
133
- } else {
134
- dependency. appendNode(' optional' , ' true' )
127
+ def node = asNode()
128
+ def dependenciesNode = node. appendNode(' dependencies' )
129
+
130
+ configurations. implementation. allDependencies. each { dependency ->
131
+ if (dependency. group != null && dependency. name != null && dependency. version != null ) {
132
+ def dependencyNode = dependenciesNode. appendNode(' dependency' )
133
+ dependencyNode. appendNode(' groupId' , dependency. group)
134
+ dependencyNode. appendNode(' artifactId' , dependency. name)
135
+ dependencyNode. appendNode(' version' , dependency. version)
136
+
137
+ // Default scope to compile
138
+ dependencyNode. appendNode(' scope' , ' compile' )
139
+
140
+ // Check for specific artifact IDs and add 'optional' flag
141
+ if (dependency. name in [' okhttp' , ' firebase-appindexing' ]) {
142
+ dependencyNode. appendNode(' optional' , ' true' )
143
+ }
135
144
}
136
145
}
137
146
}
@@ -154,15 +163,15 @@ project.afterEvaluate {
154
163
}
155
164
156
165
repositories {
157
- maven {
158
- url = isReleaseBuild() ? getReleaseRepositoryUrl() : getSnapshotRepositoryUrl()
159
- credentials {
160
- username = getRepositoryUsername()
161
- password = getRepositoryPassword()
166
+ maven {
167
+ url = isReleaseBuild() ? getReleaseRepositoryUrl() : getSnapshotRepositoryUrl()
168
+ credentials {
169
+ username = getRepositoryUsername()
170
+ password = getRepositoryPassword()
171
+ }
162
172
}
163
173
}
164
174
}
165
- }
166
175
167
176
signing {
168
177
sign publishing. publications. release
0 commit comments