-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
759c3e3
commit f4bceb4
Showing
20 changed files
with
468 additions
and
42 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
public static class Builder | ||
{ | ||
[MenuItem("Tools/Build")] | ||
public static void Execute() | ||
{ | ||
BuilderUtility.GetArg("-buildTarget"); | ||
|
||
var options = new BuildPlayerOptions(); | ||
options.scenes = EditorBuildSettings.scenes.Where(s => s.enabled).Select(s => s.path).ToArray(); | ||
options.target = GetBuildTarget(); | ||
options.locationPathName = GetOutputPath(); | ||
BuildPipeline.BuildPlayer(options); | ||
} | ||
|
||
static BuildTarget GetBuildTarget() | ||
{ | ||
string target = BuilderUtility.GetArg("-buildTarget"); | ||
|
||
switch (target) | ||
{ | ||
case "Android": return BuildTarget.Android; | ||
case "iOS": return BuildTarget.iOS; | ||
case "OSX": return BuildTarget.StandaloneOSX; | ||
case "Win64": return BuildTarget.StandaloneWindows64; | ||
case "Win32": | ||
default: return BuildTarget.StandaloneWindows; | ||
} | ||
} | ||
|
||
static string GetOutputPath() | ||
{ | ||
return BuilderUtility.GetArg("-outputPath"); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class BuilderUtility | ||
{ | ||
public static string GetArg(string key) | ||
{ | ||
var args = Environment.GetCommandLineArgs(); | ||
int idx = Array.LastIndexOf(args, key); | ||
|
||
if (idx >= 0 && idx < args.Length - 1) | ||
{ | ||
return args[idx + 1]; | ||
} | ||
|
||
return ""; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...uild/Assets/Scenes/SampleScene.unity.meta → AutoBuild/Assets/Scenes/Home.unity.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export project_path=$(dirname $0) | ||
export WKSPACES="/Users/minh.nguyen/wkspaces" | ||
export UNITY_PATH="/Applications/Unity/Hub/Editor/2022.3.7f1/Unity.app" | ||
|
||
echo $UNITY_PATH | ||
|
||
$UNITY_PATH \ | ||
-quit \ | ||
-batchmode \ | ||
-projectPath $project_path \ | ||
-executeMethod Builder.Execute \ | ||
-buildTarget Win \ | ||
-logFile %WKSPACES\log.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
set UNITY_PATH="C:\Program Files\Unity\Hub\Editor\2022.3.7f1\Editor\Unity.exe" | ||
ECHO. | ||
ECHO [[== Execute config.bat | ||
SET BUILD_TOOL=%~dp0 | ||
SET PROJECT_PATH=%~dp0..\ | ||
SET UNITY_PATH=C:\Program Files\Unity\Hub\Editor\2022.3.7f1\Editor\Unity.exe | ||
SET WORKSPACE=C:\wkspaces | ||
|
||
ECHO Variables in config.bat | ||
ECHO BUILD_TOOL: '%BUILD_TOOL%' | ||
ECHO PROJECT_PATH: '%PROJECT_PATH%' | ||
ECHO UNITY_PATH: '%UNITY_PATH%' | ||
ECHO WORKSPACE: '%WORKSPACE%' | ||
|
||
ECHO End of config.bat ==]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
ECHO. | ||
ECHO [[== Load dev.bat | ||
CALL :%* | ||
EXIT /b %errorlevel% | ||
|
||
:global_config | ||
ECHO - Executing :global_config | ||
CALL :define_symbols ds | ||
CALL :namespace ns | ||
SET "%~1=%ds% %ns%" | ||
GOTO :EOF | ||
|
||
:define_symbols | ||
ECHO - Executing :define_symbols | ||
SET "%~1=-scriptingDefineSymbols BUILD_DEV,ENABLE_LOG" | ||
GOTO :EOF | ||
|
||
:namespace | ||
ECHO - Executing :namespace | ||
SET "%~1=-namespace com.minhnh.autobuild" | ||
GOTO :EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
ECHO. | ||
ECHO [[== Execute utility.bat | ||
CALL :%* | ||
EXIT /b %errorlevel% | ||
|
||
:zip_file | ||
ECHO Running zip file | ||
GOTO EOF | ||
|
||
:validate_file | ||
ECHO Running verify file | ||
GOTO EOF | ||
|
||
:EOF | ||
ECHO End of utility.bat ==]] | ||
ECHO. | ||
|
||
EXIT /b 0 |
17 changes: 17 additions & 0 deletions
17
AutoBuild/ProjectSettings/BurstAotSettings_StandaloneOSX.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"MonoBehaviour": { | ||
"Version": 4, | ||
"EnableBurstCompilation": true, | ||
"EnableOptimisations": true, | ||
"EnableSafetyChecks": false, | ||
"EnableDebugInAllBuilds": false, | ||
"DebugDataKind": 1, | ||
"EnableArmv9SecurityFeatures": false, | ||
"CpuMinTargetX32": 0, | ||
"CpuMaxTargetX32": 0, | ||
"CpuMinTargetX64": 0, | ||
"CpuMaxTargetX64": 0, | ||
"CpuTargetsX64": 72, | ||
"OptimizeFor": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.