哪个变量包含apk路径,包括gradle / android中的basename?

时间:2015-09-14 19:41:47

标签: android gradle

我有多种口味,我需要计算将要准备的apk的哈希值,将哈希值添加到资源中并再次打包。

在代码之前,代码就像

一样简单
def first = true
def assetsDir = "/path/to/assets"
assembleRelease.doLast {
    def projectLocation = projectDir.toString()
    def apkLocation = projectLocation + "app-release.apk"

    if first {
         exec { executable 'hasher', apkLocation, assetsDir }
         first = false
         assembleRelease.execute()
    }
}

我需要通常包含" app-release.apk"

的变量

2 个答案:

答案 0 :(得分:0)

 applicationVariants.all { variant ->
                variant.outputs.each { output ->
                    def apkFile = output.outputFile
}}

答案 1 :(得分:0)

这个怎么样?

Public Sub SelectCellByPos(x, y)
    With ActiveSheet.Shapes.AddLine(x, y, x, y)
        .TopLeftCell.Select
        .Delete
    End With
End Sub