-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add windows builder script for alttester
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
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,60 @@ | ||
#if UNITY_EDITOR_WIN | ||
|
||
using AltTester.AltTesterUnitySDK.Editor; | ||
using AltTester.AltTesterUnitySDK; | ||
using System; | ||
using System.IO; | ||
using UnityEditor; | ||
using UnityEditor.Build.Reporting; | ||
using UnityEngine; | ||
|
||
public class WindowsBuildScript | ||
{ | ||
static void BuildForAltTester() | ||
{ | ||
try | ||
{ | ||
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions(); | ||
buildPlayerOptions.scenes = new string[] { | ||
"Assets/Scenes/SelectAuthMethod.unity", | ||
"Assets/Scenes/UnauthenticatedScene.unity", | ||
"Assets/Scenes/AuthenticatedScene.unity", | ||
"Assets/Scenes/ZkEvmGetBalance.unity", | ||
"Assets/Scenes/ZkEvmGetTransactionReceipt.unity", | ||
"Assets/Scenes/ZkEvmSendTransaction.unity", | ||
"Assets/Scenes/ImxNftTransfer.unity" | ||
}; | ||
|
||
buildPlayerOptions.locationPathName = "Builds/Windows64/SampleApp.exe"; | ||
buildPlayerOptions.target = BuildTarget.StandaloneWindows64; | ||
buildPlayerOptions.options = BuildOptions.Development | BuildOptions.IncludeTestAssemblies | BuildOptions.AutoRunPlayer; | ||
|
||
// Setup for AltTester | ||
var buildTargetGroup = BuildTargetGroup.Standalone; | ||
AltBuilder.AddAltTesterInScriptingDefineSymbolsGroup(buildTargetGroup); | ||
if (buildTargetGroup == UnityEditor.BuildTargetGroup.Standalone) | ||
AltBuilder.CreateJsonFileForInputMappingOfAxis(); | ||
var instrumentationSettings = new AltInstrumentationSettings(); | ||
AltBuilder.InsertAltInScene(buildPlayerOptions.scenes[0], instrumentationSettings); | ||
|
||
BuildReport report = BuildPipeline.BuildPlayer(buildPlayerOptions); | ||
AltBuilder.RemoveAltTesterFromScriptingDefineSymbols(BuildTargetGroup.Standalone); | ||
|
||
if (report.summary.result == BuildResult.Succeeded) | ||
{ | ||
Debug.Log("Build succeeded: " + report.summary.totalSize + " bytes"); | ||
} | ||
else | ||
{ | ||
Debug.LogError("Build failed"); | ||
} | ||
|
||
} | ||
catch (Exception exception) | ||
{ | ||
Debug.LogException(exception); | ||
} | ||
} | ||
} | ||
|
||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.