@@ -20,7 +20,7 @@ const logger = Logger.instance;
2020 * @returns A promise that resolves when the check is complete.
2121 */
2222export async function CheckAndroidSdkInstalled ( editor : UnityEditor , projectPath : string ) : Promise < void > {
23- logger . ci ( `Checking Android SDK installation for:\n > Editor: ${ editor . editorPath } \n > Project: ${ projectPath } ` ) ;
23+ logger . ci ( `Checking Android SDK installation for:\n > Editor: ${ editor . editorRootPath } \n > Project: ${ projectPath } ` ) ;
2424 let sdkPath = undefined ;
2525 await createRepositoryCfg ( ) ;
2626 const projectSettingsPath = path . join ( projectPath , 'ProjectSettings/ProjectSettings.asset' ) ;
@@ -65,14 +65,14 @@ async function getJDKPath(editor: UnityEditor): Promise<string> {
6565 let jdkPath : string | undefined = undefined ;
6666
6767 if ( editor . version . isGreaterThanOrEqualTo ( '2019.0.0' ) ) {
68- logger . info ( 'Using JDK bundled with Unity 2019+' ) ;
69- jdkPath = await ResolveGlobToPath ( [ editor . editorRootPath , '**' , 'AndroidPlayer' , 'OpenJDK' ] ) ;
68+ logger . debug ( 'Using JDK bundled with Unity 2019+' ) ;
69+ jdkPath = await ResolveGlobToPath ( [ editor . editorRootPath , '**' , 'AndroidPlayer' , 'OpenJDK/ ' ] ) ;
7070
7171 if ( ! jdkPath ) {
7272 throw new Error ( `Failed to resolve OpenJDK in ${ editor . editorRootPath } ` ) ;
7373 }
7474 } else {
75- logger . info ( 'Using system JDK for Unity versions prior to 2019' ) ;
75+ logger . debug ( 'Using system JDK for Unity versions prior to 2019' ) ;
7676 jdkPath = process . env . JAVA_HOME || process . env . JDK_HOME ;
7777
7878 if ( ! jdkPath ) {
@@ -88,7 +88,7 @@ async function getJDKPath(editor: UnityEditor): Promise<string> {
8888async function getSdkManager ( editor : UnityEditor ) : Promise < string > {
8989 let globPath : string [ ] = [ ] ;
9090 if ( editor . version . isGreaterThanOrEqualTo ( '2019.0.0' ) ) {
91- logger . info ( 'Using sdkmanager bundled with Unity 2019+' ) ;
91+ logger . debug ( 'Using sdkmanager bundled with Unity 2019+' ) ;
9292 switch ( process . platform ) {
9393 case 'darwin' :
9494 case 'linux' :
@@ -101,7 +101,7 @@ async function getSdkManager(editor: UnityEditor): Promise<string> {
101101 throw new Error ( `Unsupported platform: ${ process . platform } ` ) ;
102102 }
103103 } else {
104- logger . info ( 'Using system sdkmanager for Unity versions prior to 2019' ) ;
104+ logger . debug ( 'Using system sdkmanager for Unity versions prior to 2019' ) ;
105105 const systemSdkPath = process . env . ANDROID_SDK_ROOT || process . env . ANDROID_HOME ;
106106
107107 if ( ! systemSdkPath ) {
@@ -133,20 +133,20 @@ async function getSdkManager(editor: UnityEditor): Promise<string> {
133133}
134134
135135async function getAndroidSdkPath ( editor : UnityEditor , androidTargetSdk : number ) : Promise < string | undefined > {
136- logger . ci ( `Attempting to locate Android SDK Path...\n > editorPath : ${ editor . editorPath } \n > androidTargetSdk: ${ androidTargetSdk } ` ) ;
136+ logger . ci ( `Attempting to locate Android SDK Path...\n > editorRootPath : ${ editor . editorRootPath } \n > androidTargetSdk: ${ androidTargetSdk } ` ) ;
137137 let sdkPath : string ;
138138
139139 // if 2019+ test editor path, else use system android installation
140140 if ( editor . version . isGreaterThanOrEqualTo ( '2019.0.0' ) ) {
141- logger . info ( 'Using Android SDK bundled with Unity 2019+' ) ;
141+ logger . debug ( 'Using Android SDK bundled with Unity 2019+' ) ;
142142 try {
143- sdkPath = await ResolveGlobToPath ( [ editor . editorPath , '**' , 'PlaybackEngines' , 'AndroidPlayer' , 'SDK' , 'platforms' , `android-${ androidTargetSdk } /` ] ) ;
143+ sdkPath = await ResolveGlobToPath ( [ editor . editorRootPath , '**' , 'PlaybackEngines' , 'AndroidPlayer' , 'SDK' , 'platforms' , `android-${ androidTargetSdk } /` ] ) ;
144144 } catch ( error ) {
145145 logger . debug ( `android-${ androidTargetSdk } not installed` ) ;
146146 return undefined ;
147147 }
148148 } else { // fall back to system android installation
149- logger . info ( 'Using system Android SDK for Unity versions prior to 2019' ) ;
149+ logger . debug ( 'Using system Android SDK for Unity versions prior to 2019' ) ;
150150 try {
151151 const systemSdkPath = process . env . ANDROID_SDK_ROOT || process . env . ANDROID_HOME ;
152152
@@ -162,7 +162,6 @@ async function getAndroidSdkPath(editor: UnityEditor, androidTargetSdk: number):
162162 }
163163 }
164164
165- logger . ci ( `Android sdkPath:\n > "${ sdkPath } "` ) ;
166165 return sdkPath ;
167166}
168167
0 commit comments