Skip to content

Commit cf8fa4d

Browse files
authored
Putting renaming task back in afterEvaluate (#2120)
### Summary Putting the task configuring logic to rename the msal AAR file back in afterEvaluate. It's needed for our maven release pipeline, though I'm not quite sure why this logic is specifically needed in MSAL and not common.
1 parent ec100b8 commit cf8fa4d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

msal/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,18 @@ task pmd(type: Pmd) {
306306
}
307307

308308
afterEvaluate {
309+
// Gradle 6.1.1 and Android Gradle Plugin 4.0.1 doesn't rename the file (see 'outputFileName' above)
310+
// Adding this work around to have the file properly renamed.
311+
tasks.named("assembleDistRelease").configure {
312+
def buildFile = file("$buildDir/outputs/aar/${archivesBaseName}-dist-release.aar")
313+
print "Build file $buildFile"
314+
doLast {
315+
println "Renaming build file $buildFile to '$buildDir${File.separator}outputs${File.separator}aar${File.separator}${archivesBaseName}-${version}.aar'"
316+
if (!buildFile.renameTo("$buildDir${File.separator}outputs${File.separator}aar${File.separator}${archivesBaseName}-${version}.aar")) {
317+
println "Rename failed!"
318+
}
319+
}
320+
}
309321
publishing {
310322
publications {
311323
msal(MavenPublication) {

0 commit comments

Comments
 (0)