在我的库模块,我想复制和重命名的aar文件到不同的路径下面的代码使用
ext {
version = 'P-1.1.6'
name = 'Player'
}
defaultConfig {
missingDimensionStrategy "exoplayerversion", "Exo_2_13_3", "Exo_2_18_1"
missingDimensionStrategy "playserviceversion", "PlayService_16_0_0", "PlayService_21_0_1"
buildConfigField "String", "LIBRARY_VERSION", "\"${version}\""
}
libraryVariants.all { variant ->
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
if (outputFile.name.contains("debug"))
outputFileName = new File("../../../../releases/${version}", "${name}-${version}-debug.aar")
else outputFileName = new File("../../../../releases/${version}", "${name}-${version}-release.aar")
}
variant.assemble.doLast {
if (variant.mappingFile != null) {
copy {
from variant.mappingFile
into outputFile.parent
rename { String fileName ->
"../../../../releases/${version}/mapping.txt"
}
}
}
}
}
}
正在复制aar
文件,但名称不正确,我得到的aar名称为Exo_2_18_1-PlayService_16_0_0-debug-P-1.1.6-debug.aar
,而它应该是Player-P-1.1.6-debug.aar
1条答案
按热度按时间but5z9lq1#
必须使用
project.name