Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat(unity): add auto discoverability, testing, and publishing for unity3d projects #236

Closed
wants to merge 6 commits into from

Conversation

sjk07
Copy link
Member

@sjk07 sjk07 commented Dec 6, 2018

Condo can now discover, test, and publish Unity3d projects.

Some caveats:
unity.condo file must be at the root of your project. Still figuring out a good way to auto-discover the root level of a unity3d project

UNITY_PATH must be set, this is because unity does not get set on the path and they use relative pathing on the executable...

BUILD_TARGET will default to WebGL build if not specified. WebGL builds can also get built into a docker container on publish!

Publish When publishing had to add the -noUpm flag to disable package manager. Not sure how this effects final builds.
Also there is a hard requirement for a custom build script in your project, -executeMethod Build.PerformBuild, Will have to find a way to remove this requirement or publish the code somewhere.

Will have to add support for licensing and user/pass/key

Output with AllowPublish set to true:
condo -- /t:publish

         ----- Total AssetImport time: 0.459228s, AssetImport time: 0.179834s, Asset hashing: 0.000000s [0 B, 0.000000 mb/s]

         Refresh: detecting if any assets need to be imported or removed ...
         Refresh: elapses 0.005950 seconds (Nothing changed)
         Refresh completed in 0.006006 seconds.
         Cleanup mono
         debugger-agent: Unable to listen on 23
         Exiting batchmode successfully now!
       CreateRelease:
         Saved the conventional changelog: CHANGELOG.md...
       DockerBuild:
         docker build --label test --tag test:0.1.0-alpha-00340-0427 -f "/Users/scott/projects/nightly/games/test/Dockerfile" "/Users/scott/projects/nightly/games/test"
         Sending build context to Docker daemon  325.6MB

         Step 1/4 : FROM nginx:alpine
          ---> 63356c558c79
         Step 2/4 : ARG SOURCE
          ---> Using cache
          ---> 68a76b842d8c
         Step 3/4 : COPY ${SOURCE:-artifacts/publish/webgl} /usr/share/nginx/html
          ---> e52af7bee569
         Step 4/4 : LABEL test=
          ---> Running in c9c7a272c55e
         Removing intermediate container c9c7a272c55e
          ---> 53f03e3c854d
         Successfully built 53f03e3c854d
         Successfully tagged test:0.1.0-alpha-00340-0427
       DockerTag:
         docker tag test:0.1.0-alpha-00340-0427 test:0.1.0-alpha-00340-0427
     1>Done Building Project "/Users/scott/projects/nightly/games/test/condo.build" (publish target(s)).

Build succeeded.

closes #243

@ghost ghost assigned sjk07 Dec 6, 2018
@ghost ghost added the review label Dec 6, 2018
dmccaffery
dmccaffery previously approved these changes Dec 6, 2018
Copy link
Member

@dmccaffery dmccaffery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t know enough about unity to know whether or not all the options on the build and test phases make sense; so I leave it to you... just wondering if these are so common that they should always be specified for everyone using condo for unity.

<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Target Name="UnityPublish" Condition=" $(UnityPublish) ">
<Exec Command="&quot;$(UnityPath)&quot; -quit -batchmode -nographics -projectPath &quot;@(UnityProjectPath)&quot; -buildTarget $(BUILD_TARGET) -customBuildTarget $(BUILD_TARGET) -customBuildPath &quot;$(PublishArtifactsRoot)$(BUILD_TARGET.ToLower())&quot; -customBuildOptions AcceptExternalModificationsToPlayer -executeMethod Build.PerformBuild -logFile -noUpm"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the nographics switch common? Should it be an option?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for custom build target?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same for additional flags, like options... should these be defaulted but still overridable ala DOTNET_TEST_OPTIONS, etc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-quit -batchmode -nographics are all defined in the unity docs for running a CI build. If they are not set then unity will not close the process when complete, and open a GUI interface

Still playing around with customBuildTarget. to run unity headless you need to have an entry point file.

adding the additional flags is a good idea

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjk07
Copy link
Member Author

sjk07 commented Dec 6, 2018

Will leave this PR as WIP until I get a few unity builds running on CI and test actual outputs.

@sjk07
Copy link
Member Author

sjk07 commented Sep 3, 2019

no progress, closing for now

@sjk07 sjk07 closed this Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

request: support for unity3d
2 participants