标签:keystore 新建 文件名 bug kde dmi 闭包 debug types
KEY_PATH = D:/KeyStorePath/keystore/keystore.jks
KEY_PASS = pwdkeystore
ALIAS_NAME = keyAlias
ALIAS_PASS = pwdkeyAlias
signingConfigs {
config {
storeFile file(KEY_PATH)
storePassword KEY_PASS
keyAlias ALIAS_NAME
keyPassword ALIAS_PASS
}
}
signingConfig signingConfigs.config
configurations {
ftpAntTask
}
ftpAntTask("org.apache.ant:ant-commons-net:1.8.4") {
module("commons-net:commons-net:1.4.1") {
dependencies "oro:oro:2.0.8:jar"
}
}
//将gradle生成的release包推送到ftp服务器
task uploadReleaseToFtp {
//在assembleRelease执行之后再执行
dependsOn ‘assembleRelease‘
doLast {
ant {
taskdef(name: ‘ftp‘,
classname: ‘org.apache.tools.ant.taskdefs.optional.net.FTP‘,
classpath: configurations.ftpAntTask.asPath)
ftp(server: "xxx.xxx.xxx.xxx",
userid: "userid", //用户名
password: "password", //密码
//上传后文件存储的目录
remoteDir: "/ldc/") {
//本地文件路径
fileset(dir: "build/outputs/apk/release") {
include(name: "app-release.apk")
}
}
}
}
}
//将gradle生成的debug包推送到ftp服务器
task uploadDebugToFtp {
//在assembleDebug执行之后再执行
dependsOn ‘assembleDebug‘
doLast {
ant {
taskdef(name: ‘ftp‘,
classname: ‘org.apache.tools.ant.taskdefs.optional.net.FTP‘,
classpath: configurations.ftpAntTask.asPath)
ftp(server: "xxx.xxx.xxx.xxx",
userid: "userid", //用户名
password: "adminftp123", //密码
//上传后文件存储的目录
remoteDir: "/ldc/") {
//本地文件路径
fileset(dir: "build/outputs/apk/debug") {
//要上传的文件名
include(name: "app-debug.apk")
}
}
}
}
}
在执行以上任务时,需要将防火墙关闭,否则在运行时会出现上传文件大小为0的情况
标签:keystore 新建 文件名 bug kde dmi 闭包 debug types
原文地址:https://www.cnblogs.com/Ricardoldc/p/10335506.html