Search Unity

Question Intercepting the Build Comamnd

Discussion in 'Unity Build Automation' started by libra34567, Nov 9, 2022.

  1. libra34567

    libra34567

    Joined:
    Apr 5, 2014
    Posts:
    62
    Context:
    We are using DOTS 0.51 and not yet ready to switch to DOTS 1.0exp, and we are trying to make cloud build works for dots project. We are trying to intercept the build commandline cloudbuild sends to unity and trigger a BuildPlatform.Build.

    What we tried:
    1. Intercepting the command
    upload_2022-11-9_10-36-4.png
    2. Trigger a BuildPlatform.Build
    upload_2022-11-9_10-37-2.png

    The issues we've met and need help about
    1. We don't know how to debug in cloud console, we searched "LTB: " in the full log and its not even there. So I don't know if the GetBatchModeCmds method actually works in cloud build. (it did work in editor tho)
    2. I wonder if it is the correct way to intercept a command in unityCloud.
    3. After I figure out how to intercept the command I guess I could figure out the rest.

    Thank you for your suggestions and helps in advanced.
     

    Attached Files:

  2. libra34567

    libra34567

    Joined:
    Apr 5, 2014
    Posts:
    62
    Anyone? Any help would be really appreciated :)
     
  3. tonemcbride

    tonemcbride

    Joined:
    Sep 7, 2010
    Posts:
    1,089
    I didn't want to answer this before because I don't have any specific knowledge about the DOTS system but here's a few notes from what I've used in the past:

    1) I'm happy to be proven wrong but I don't think you can manually activate the build process from within the cloud build using the config.Build() command (https://meta.wikimedia.org/wiki/Cunningham's_Law)

    2) You could derive an editor class from 'IPreprocessBuildWithReport , IPostprocessBuildWithReport' and then use 'public void OnPreprocessBuild( BuildReport report )' to run some pre process commands that happen before the build starts. These might setup various project settings that you need

    3) I've also seen people run a bash 'sh' script before the build starts that can do all sorts of stuff. For example, you could have it overwrite your ProjectSettings file with one that's in a different folder or move various resources around for the build.

    4) Cloud build uses fastlane afaik which means you can do some custom build files that way too (https://docs.unity3d.com/Manual/UnityCloudBuildGymfile.html)