38 lines
1.6 KiB
Groovy
38 lines
1.6 KiB
Groovy
//=================================================================
|
|
// Byway Studios Inc. Confidential Information.
|
|
// Copyright Byway Studios Inc. All rights reserved
|
|
//=================================================================
|
|
@groovy.transform.Field gUnityVersion_Windows = ""
|
|
def call(clearPackageCache,methodName)
|
|
{
|
|
if(gUnityVersion_Windows.isEmpty())
|
|
{
|
|
gUnityVersion_Windows = detectUnityVersion("${WORKSPACE}/ProjectSettings/ProjectVersion.txt")
|
|
}
|
|
|
|
// if (clearPackageCache || params.CLEAN)
|
|
// {
|
|
// bat label: 'Clearing Unity Cache', script: """
|
|
// if exist "${WORKSPACE}\\unity\\Library\\PackageCache" del /F /S /Q "${WORKSPACE}\\unity\\Library\\PackageCache"
|
|
// if exist "${WORKSPACE}\\unity\\Library\\ScriptAssemblies" del /F /S /Q "${WORKSPACE}\\unity\\Library\\ScriptAssemblies"
|
|
// if "%CLEAN%" == "true" (
|
|
// echo ">>> CLEAN ENABLED -- DELETING LIBRARY"
|
|
// del /S /Q "${WORKSPACE}\\unity\\Library"
|
|
// )
|
|
// """
|
|
// }
|
|
|
|
//def gitHash = env.GIT_COMMIT.take(7)
|
|
// def gitHash = bat(
|
|
// script: 'git rev-parse --short HEAD',
|
|
// returnStdout: true
|
|
// ).trim()
|
|
|
|
//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% -stackTraceLogType None -logFile -
|
|
"""
|
|
}
|