debug要签名,不然没法测试微信登录,但是最近出现了这样的情况,就是我的mac电脑和window电脑来回切换,而我总是需要改这个文件,导致提交的时候又总是把它给提交上去了,
而我是如下这样写的
signingConfigs {
debug {
Properties properties = new Properties()
properties.load(project.rootProject.file("d:/sign/sign.properties").newDataInputStream())
def keyPwd = properties.getProperty("signingConfigs.keyPwd")
def keyName = properties.getProperty("signingConfigs.keyName")
def keyPath = properties.getProperty("signingConfigs.path")
storeFile file(keyPath)
storePassword keyPwd
keyAlias keyName
keyPassword keyPwd
v2SigningEnabled false
}
}
那么window电脑的话可以2台电脑放到同一个路径中,但是mac的话不是设置盘符的,看来要下手解决这个问题呢。,怎么解决了,两种方法,一种是取window登录用户名下的路径,第二种是取环境变量路径,
我用第二种
创建环境变量signfile
并设置路径,
signingConfigs {
debug {
Properties properties = new Properties()
properties.load(project.rootProject.file(System.getenv("signfile")).newDataInputStream())
def keyPwd = properties.getProperty("signingConfigs.keyPwd")
def keyName = properties.getProperty("signingConfigs.keyName")
def keyPath = properties.getProperty("signingConfigs.path")
storeFile file(keyPath)
storePassword keyPwd
keyAlias keyName
keyPassword keyPwd
v2SigningEnabled false
}
}