Closed oakie closed 1 year ago
If you got a dedicated build machine you can do it like this:
unity-activate-license.js
(.js not .ts), and add the commandline args:
const unityCmd = tl.tool(unityExecutablePath)
.arg('-batchmode')
.arg('-quit')
.arg('-nographics')
.arg('-username').arg(username)
.arg('-password').arg(password)
.arg('-serial ').arg(serial)
.arg('-logfile').arg(logFilePath)
.arg('-ignorecompilererrors')
.arg('-projectpath').arg('<path_to_the_barebones_project>');
This then only takes about ~5s on our build machine for license activation. First run was 8s because Library had to be built :)
This change gets overwritten if the .ts gets retranspiled though so it's only a POC/workaround type of thing.
This has been addressed in v2.7.1 some time ago. The activate license task does not specify a project path anymore and instead activates using a default empty project.
I have a pipeline setup in which I try to activate the license in the first step, and build the project to a number of target platforms in subsequent steps. My issue is that the activation takes over 5 minutes to complete, and upon inspection of the logs, it seems that most of that time was spent importing assets to the library. The problem is made worse by the fact that the license activation task does not allow me to specify a build target, so the library will have to be rebuilt during the build step towards the correct build target.
Is it possible to somehow skip opening the unity project during the license activation?