35 lines
1.5 KiB
Groovy
35 lines
1.5 KiB
Groovy
//=================================================================
|
|
// Byway Studios Inc. Confidential Information.
|
|
// Copyright Byway Studios Inc. All rights reserved
|
|
//=================================================================
|
|
|
|
@groovy.transform.Field gUnityVersion_Windows = ""
|
|
|
|
def call(methodName)
|
|
{
|
|
if(gUnityVersion_Windows.isEmpty())
|
|
{
|
|
gUnityVersion_Windows = detectUnityVersion("${WORKSPACE}/ProjectSettings/ProjectVersion.txt")
|
|
}
|
|
|
|
if (params.CleanCache)
|
|
{
|
|
bat label: 'Clearing Unity Package and Script Cache', script: """
|
|
if exist "${WORKSPACE}\\Library\\PackageCache" del /F /S /Q "${WORKSPACE}\\Library\\PackageCache"
|
|
if exist "${WORKSPACE}\\Library\\ScriptAssemblies" del /F /S /Q "${WORKSPACE}\\Library\\ScriptAssemblies"
|
|
if (params.CleanLibrary)
|
|
(
|
|
echo ">>> CLEAN ENABLED -- DELETING LIBRARY"
|
|
del /S /Q "${WORKSPACE}\\Library"
|
|
)
|
|
"""
|
|
}
|
|
|
|
//open unity and execute unity method
|
|
bat label: "Executing Unity method: ${methodName}", script: """
|
|
set UNITY_PATH=C:\\Program Files\\Unity\\Hub\\Editor\\${gUnityVersion_Windows}\\Editor\\Unity.exe
|
|
for /f %%i in ('git rev-parse --short HEAD') do set GIT_HASH=%%i
|
|
"%UNITY_PATH%" -quit -batchmode -nographics -projectPath "${WORKSPACE}" -executeMethod "${methodName}" -buildTarget Android -gitHash %GIT_HASH% -buildNumber %BUILD_NUMBER% -cleanBuild params.CleanBuild -debugBuild params.DebugBuild -nonTuyoo params.BuildNonTuyoo -stackTraceLogType None -logFile -
|
|
"""
|
|
}
|