Android Studio の設定 digningConfigs-->storeFile は Windows および Mac との互換性のために使用されます

(1) Windows および Mac との互換性のために、storeFile パスを構成します。

同僚はMac、私はWindowsを使っているのですが、githubからコードをマージするたびにstoreFileのパスを変更するのは面倒なので、buildに新しい機能を追加しました。(デバッグもリリースも同じです)

debug {
            keyAlias xxx'
            keyPassword 'xxx'
            try {
                if (file('/Users/xxx/Desktop/xxx.keystore').exists()) {
                    storeFile file('/Users/xxx/Desktop/xxx.keystore')
                    println("windows_mac_____mac")
                }else {
                    println("windows_mac_____win")
                    storeFile file('E:\\xxx\\xxx.keystore')
                }
            } catch(Exception e) {

            } finally{

            }
            storePassword 'xxx'
        }

もっと良い方法があれば、ぜひ教えてください!

おすすめ

転載: blog.csdn.net/L73748196_/article/details/124972660