Skip to content

Commit 4bdaa09

Browse files
committed
Remove functions.json and labels.json
Not sure why those are needed in the first place, but they are quite big.
1 parent 37c9aa8 commit 4bdaa09

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

Assets/Scripts/Editor/BuildScript.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ public static void Build(string[] args)
110110
break;
111111
}
112112
case BuildTarget.StandaloneOSX:
113+
#if UNITY_2021_2_OR_NEWER
114+
PlayerSettings.SetScriptingBackend(NamedBuildTarget.Standalone, ScriptingImplementation.Mono2x);
115+
#else
113116
PlayerSettings.SetScriptingBackend(BuildTargetGroup.Standalone, ScriptingImplementation.Mono2x);
114-
break;
117+
#endif
118+
break;
115119
case BuildTarget.WebGL:
116120
#if UNITY_2021_2_OR_NEWER
117121
// Use ASTC texture compression, since we are also targeting mobile versions - Don't use this for desktop only targets
@@ -228,7 +232,7 @@ private static void SetGraphicsApi(string[] tagParameters)
228232
if (tagParameters.Contains("webgl1"))
229233
{
230234
#if !UNITY_2023_1_OR_NEWER
231-
graphicsAPIs.Add(GraphicsDeviceType.OpenGLES2);
235+
graphicsAPIs.Add(GraphicsDeviceType.OpenGLES2);
232236
#else
233237
LogWarning("WebGL1 not supported anymore, choosing WebGL2 instead");
234238
graphicsAPIs.Add(GraphicsDeviceType.OpenGLES3);
@@ -391,10 +395,31 @@ private static void Build(BuildTarget buildTarget, string filePath)
391395
var webBuild = WebBuildReportList.Instance.GetBuild(buildSummary.outputPath);
392396

393397
var settings = StrippingProjectSettings.ActiveSettings;
398+
Log($"Using stripping settings {settings.name} with modules to strip: {string.Join(", ", settings.SubmodulesToStrip)}");
394399
var successfulStripping = WebBuildProcessor.StripBuild(webBuild, settings);
395400
if (successfulStripping)
396401
{
397402
Log("The build was stripped successfully.");
403+
string functionsJsonPath = Path.Combine(buildSummary.outputPath, "Build", "functions.json");
404+
if (File.Exists(functionsJsonPath))
405+
{
406+
File.Delete(functionsJsonPath);
407+
Log($"Deleted functions.json at {functionsJsonPath}");
408+
}
409+
else
410+
{
411+
LogWarning($"Could not find file to delete: {functionsJsonPath}");
412+
}
413+
string labelsJsonPath = Path.Combine(buildSummary.outputPath, "Build", "labels.json");
414+
if (File.Exists(labelsJsonPath))
415+
{
416+
File.Delete(labelsJsonPath);
417+
Log($"Deleted labels.json at {labelsJsonPath}");
418+
}
419+
else
420+
{
421+
LogWarning($"Could not find file to delete: {labelsJsonPath}");
422+
}
398423
}
399424
else
400425
{

0 commit comments

Comments
 (0)