Created
April 1, 2017 10:47
-
-
Save xxnjdlys/a100b47440775e4cd675732f5e460f94 to your computer and use it in GitHub Desktop.
tinker-support.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.tencent.bugly.tinker-support' | |
def bakPath = file("${buildDir}/bakApk/") | |
/** | |
* 此处填写每次构建生成的基准包目录 | |
*/ | |
def baseApkDir = "client-0316-20-35-07" | |
/** | |
* 对于插件各参数的详细解析请参考 | |
*/ | |
tinkerSupport { | |
// 开启tinker-support插件,默认值true | |
enable = true | |
// 指定归档目录,默认值当前module的子目录tinker | |
autoBackupApkDir = "${bakPath}" | |
// 是否启用覆盖tinkerPatch配置功能,默认值false | |
// 开启后tinkerPatch配置不生效,即无需添加tinkerPatch | |
overrideTinkerPatchConfiguration = true | |
// 编译补丁包时,必需指定基线版本的apk,默认值为空 | |
// 如果为空,则表示不是进行补丁包的编译 | |
// @{link tinkerPatch.oldApk } | |
baseApk = "${bakPath}/${baseApkDir}/update2/client-update2-release.apk" | |
// oldApk = "${bakPath}/${baseApkDir}/update2/client-update2-release.apk" | |
// 对应tinker插件applyMapping | |
baseApkProguardMapping = "${bakPath}/${baseApkDir}/update2/client-update2-release-mapping.txt" | |
// 对应tinker插件applyResourceMapping | |
baseApkResourceMapping = "${bakPath}/${baseApkDir}/update2/client-update2-release-R.txt" | |
// 构建基准包和补丁包都要指定不同的tinkerId,并且必须保证唯一性 | |
tinkerId = android.defaultConfig.versionName | |
// 构建多渠道补丁时使用 | |
buildAllFlavorsDir = "${bakPath}/${baseApkDir}" | |
// 是否开启反射Application模式 | |
enableProxyApplication = false | |
} | |
/** | |
* 一般来说,我们无需对下面的参数做任何的修改 | |
* 对于各参数的详细介绍请参考: | |
* https://github.com/Tencent/tinker/wiki/Tinker-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97 | |
*/ | |
tinkerPatch { | |
//oldApk ="${bakPath}/${appName}/app-release.apk" | |
ignoreWarning = false | |
useSign = true | |
dex { | |
dexMode = "jar" | |
pattern = ["classes*.dex"] | |
loader = [] | |
} | |
lib { | |
pattern = ["lib/*/*.so"] | |
} | |
res { | |
pattern = ["res/*", "r/*", "assets/*", "resources.arsc", "AndroidManifest.xml"] | |
ignoreChange = [] | |
largeModSize = 100 | |
} | |
packageConfig { | |
} | |
sevenZip { | |
zipArtifact = "com.tencent.mm:SevenZip:1.1.10" | |
// path = "/usr/local/bin/7za" | |
} | |
buildConfig { | |
keepDexApply = false | |
//tinkerId = "1.0.1-base" | |
//applyMapping = "${bakPath}/${appName}/app-release-mapping.txt" // 可选,设置mapping文件,建议保持旧apk的proguard混淆方式 | |
//applyResourceMapping = "${bakPath}/${appName}/app-release-R.txt" // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配 | |
} | |
} | |
task tinkerCheck << { | |
// println "\n" + "versionName : " + android.defaultConfig.versionName + "\n" | |
println "TinkerId : " + tinkerSupport.tinkerId | |
println "bakApk : " + tinkerSupport.baseApk | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment