【打包工具】修改生成Apk的包名
parent
042df03091
commit
8d9ac3bb69
|
|
@ -442,7 +442,7 @@ public class AutoPack : EditorWindow
|
||||||
string apkFilePath = _MomPackPath + PackConfig[index].project + "/build/outputs/apk/release/" + PackConfig[index].project + "-release.apk";
|
string apkFilePath = _MomPackPath + PackConfig[index].project + "/build/outputs/apk/release/" + PackConfig[index].project + "-release.apk";
|
||||||
if (File.Exists(apkFilePath))
|
if (File.Exists(apkFilePath))
|
||||||
{
|
{
|
||||||
File.Copy(apkFilePath, APKPath + "/" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk");
|
File.Copy(apkFilePath, APKPath + "/" + PackConfig[index].name +"_" + versionStr + "_" + PackTime + ".apk");
|
||||||
}
|
}
|
||||||
Debug.Log(PackConfig[index].name + ":打包完成");
|
Debug.Log(PackConfig[index].name + ":打包完成");
|
||||||
EditorUtility.ClearProgressBar();
|
EditorUtility.ClearProgressBar();
|
||||||
|
|
@ -454,6 +454,7 @@ public class AutoPack : EditorWindow
|
||||||
string[] lines = File.ReadAllLines(tpath);
|
string[] lines = File.ReadAllLines(tpath);
|
||||||
string versionCode = "";
|
string versionCode = "";
|
||||||
string versionName = "";
|
string versionName = "";
|
||||||
|
string applicationId = "";
|
||||||
foreach (string l in lines)
|
foreach (string l in lines)
|
||||||
{
|
{
|
||||||
string lt = l.Trim();
|
string lt = l.Trim();
|
||||||
|
|
@ -464,8 +465,13 @@ public class AutoPack : EditorWindow
|
||||||
{
|
{
|
||||||
versionName = lt.Split('\'')[1];
|
versionName = lt.Split('\'')[1];
|
||||||
}
|
}
|
||||||
|
else if (lt.StartsWith("applicationId"))
|
||||||
|
{
|
||||||
|
applicationId = lt.Split('\'')[1];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return string.Format("{0}({1})", versionName, versionCode);
|
return string.Format("{0}_{1}({2})", applicationId, versionName, versionCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void GitUpdate(int index)
|
private static void GitUpdate(int index)
|
||||||
|
|
@ -484,8 +490,8 @@ public class AutoPack : EditorWindow
|
||||||
string[] commands = new string[]{
|
string[] commands = new string[]{
|
||||||
"echo git add ." + printlog,
|
"echo git add ." + printlog,
|
||||||
"git add ." + printlog,
|
"git add ." + printlog,
|
||||||
"echo git commit -m 'AutoPack:" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
|
"echo git commit -m 'AutoPack:" + PackConfig[index].name +"_" + versionStr + "_" + PackTime + ".apk'" + printlog,
|
||||||
"git commit -m 'AutoPack:" + PackConfig[index].name +"_"+ PackConfig[index].project + "_" + versionStr + "_" + PackTime + ".apk'" + printlog,
|
"git commit -m 'AutoPack:" + PackConfig[index].name +"_" + versionStr + "_" + PackTime + ".apk'" + printlog,
|
||||||
"git push",
|
"git push",
|
||||||
};
|
};
|
||||||
ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index].project, commands);
|
ProcessUtil.ProcessCommand(_MomPackPath + PackConfig[index].project, commands);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue