@ Override @ Nullable public Path getCloudSdkPath ( ) { // search system environment PATH List < String > possiblePaths = getLocationsFromPath ( System . getenv ( "PATH" ) ) ; // try environment variable GOOGLE_CLOUD_SDK_HOME possiblePaths . add ( System . getenv ( "GOOGLE_CLOUD_SDK_HOME" ) ) ; // search program files if ( IS_WINDOWS ) { possiblePaths . add ( getLocalAppDataLocation ( ) ) ; possiblePaths . add ( getProgramFilesLocation ( ) ) ; } else { // home directory possiblePaths . add ( System . getProperty ( "user.home" ) + "/google-cloud-sdk" ) ; // usr directory possiblePaths . add ( "/usr/lib/google-cloud-sdk" ) ; // try devshell VM possiblePaths . add ( "/google/google-cloud-sdk" ) ; // try bitnami Jenkins VM: possiblePaths . add ( "/usr/local/share/google/google-cloud-sdk" ) ; } Path finalPath = searchPaths ( possiblePaths ) ; logger . log ( Level . FINE , "Resolved SDK path : " + finalPath ) ; return finalPath ; }
Attempts to find the path to Google Cloud SDK .