Open EbiPenMan opened 2 years ago
Oh, sorry, I need to update the documentation.
Since 1.3.0 and f19ca220, Trimmer switches the active build target and waits for the domain reload before doing a build. You need to remove the "-quit" or Unity will exit before the domain reload and builds cannot start, Trimmer will quit Unity itself once the builds are complete.
Not sure why the build profile cannot be found on Linux. Trimmer uses the asset database to search for build profiles, maybe there's an issue if the project is imported for the first time?
I also just found an issue where Trimmer will not properly quit Unity in batchmode if the profile cannot be found, will hopefully fix that soon.
@sttz Thanks for your reply.
My problem for build on the Windows platform was fixed by removing '-quit' and the project compiled correctly.
But on the Linux platform, I still have the same problem as before and it doesn't find the build profile.
As you said yourself After removing Argument '-quit' on the Linux platform, Unity did not close. Because the build process encountered an error and did not find the build profile.
@sttz Hi Is there a way to temporarily solve the problem of not finding the build profile in Linux? For example, the address is hard-coded.
Because I really need this.
Could you try importing the project once first and then running the build in a separate invocation? Just to see if the issue is related to the project being imported for the first time (i.e. running Unity once without -executeMethod
and then again with).
As a workaround, you could write your own method that loads the profile with a path, e.g.
using System;
using sttz.Trimmer.Editor;
using UnityEditor;
using UnityEngine;
public class CustomBuild
{
const string PROFILE_PATH = "Assets/My_Build_Profile.asset";
public static void Build()
{
var profile = AssetDatabase.LoadAssetAtPath<BuildProfile>(PROFILE_PATH);
if (profile == null) {
throw new Exception($"Build Profile not found at path: {PROFILE_PATH}");
}
var onComplete = ScriptableObject.CreateInstance<BuildManager.CommandLineBuildsCompleteListener>();
BuildManager.Build(profile, onComplete);
}
}
Ok, I will definitely do this and let you know the result. Thank you for your follow up
Hi I want to build my project from the command line, But I have 2 problems.
command:
Unity.exe -quit -batchmode -nographics -logFile e:/stdout.log -projectPath "E:\Working_Projects\xTests\unity\livekit\LiveKit\LiveKit" -executeMethod sttz.Trimmer.Editor.BuildManager.Build -profileName Build_Profile_1
Log:
command:
/home/Unity/2021.3.6f1/Editor/Unity -quit -batchmode -nographics -projectPath /home/gitlab-runner/builds/2vyUksym/0/landrocker-workflow/livekit-test -executeMethod sttz.Trimmer.Editor.BuildManager.Build -profileName Build_Profile_1
Log:
How can I fix these problems on those platforms?