Skip to content

Commit 39bde68

Browse files
committed
构建slave工程前先将构建环境switch到正确的环境
1 parent a67068d commit 39bde68

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Master/Assets/MultiProcessBuild/Editor/BuildPipeline.cs

+10-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ public static AssetBundleManifest BuildAssetBundles(string output, AssetBundleBu
6868
AssetBundleManifest[] results = new AssetBundleManifest[jobs.Length];
6969

7070
bool allFinish = true;
71-
if (jobs.Length == 1)
71+
if (jobs.Length == 0)
72+
return null;
73+
else if (jobs.Length == 1)
7274
{
7375
var job = jobs[0];
7476
File.WriteAllText("build_0.json", JsonUtility.ToJson(job, true));
@@ -94,12 +96,17 @@ public static AssetBundleManifest BuildAssetBundles(string output, AssetBundleBu
9496
" -logfile {0}/log_{1}.txt" +
9597
//" -projectPath {0} " +
9698
" -executeMethod MultiProcessBuild.BuildPipeline.BuildJobSlave" +
97-
" -buildJob {0}/build_{1}.json",
98-
Path.GetFullPath("."), jobID);
99+
" -buildJob {0}/build_{1}.json" +
100+
" -buildTarget {2}",
101+
Path.GetFullPath("."),
102+
jobID,
103+
target.ToString());
99104
cmds.Add(cmd);
100105
}
101106
}
102107

108+
EditorUserBuildSettings.SwitchActiveBuildTarget(target);
109+
103110
var exitCodes = MultiProcess.UnityFork(cmds.ToArray(), "building", "waiting for sub process...");
104111
for (int jobID = 0; jobID < jobs.Length; ++jobID)
105112
{

0 commit comments

Comments
 (0)