Skip to content

Commit

Permalink
Update paths according to changes in Android plugin 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ok3141 committed Mar 3, 2020
1 parent 1674674 commit 1682799
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class VariantProcessor {
}
}

String taskPath = 'transformClassesAndResourcesWithSyncLibJarsFor' + mVariant.name.capitalize()
String taskPath = mVersionAdapter.getSyncLibJarsTaskPath()
Task syncLibTask = mProject.tasks.findByPath(taskPath)
if (syncLibTask == null) {
throw new RuntimeException("Can not find task ${taskPath}!")
Expand Down
14 changes: 12 additions & 2 deletions source/src/main/groovy/com/kezong/fataar/VersionAdapter.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class VersionAdapter {
}

File getLibsDirFile() {
if (Utils.compareVersion(mGradlePluginVersion, "3.1.0") >= 0) {
if (Utils.compareVersion(mGradlePluginVersion, '3.6.0') >= 0) {
return mProject.file("${mProject.buildDir.path}/intermediates/aar_libs_directory/${mVariant.dirName}/libs")
} else if (Utils.compareVersion(mGradlePluginVersion, '3.1.0') >= 0) {
return mProject.file(mProject.buildDir.path + '/intermediates/packaged-classes/' + mVariant.dirName + "/libs")
} else {
return mProject.file(mProject.buildDir.path + '/intermediates/bundles/' + mVariant.dirName + "/libs")
Expand Down Expand Up @@ -87,4 +89,12 @@ class VersionAdapter {
return mProject.file(mProject.buildDir.path + '/intermediates/bundles/' + mVariant.name + "/R.txt")
}
}
}

String getSyncLibJarsTaskPath() {
if (Utils.compareVersion(mGradlePluginVersion, '3.6.0') >= 0) {
return "sync${mVariant.name.capitalize()}LibJars"
} else {
return "transformClassesAndResourcesWithSyncLibJarsFor${mVariant.name.capitalize()}"
}
}
}

0 comments on commit 1682799

Please sign in to comment.