src/main/java/com/simpligility/maven/plugins/android/AndroidSdk.java
public File getPlatform()
    {
        assertPathIsDirectory( sdkPath );

        final File platformsDirectory = new File( sdkPath, PLATFORMS_FOLDER_NAME );
        assertPathIsDirectory( platformsDirectory );

        final File platformDirectory;
        if ( androidTarget == null )
        {
            IAndroidTarget latestTarget = null;
            AndroidTargetManager targetManager = sdkManager.getAndroidTargetManager( progressIndicator );
            for ( IAndroidTarget target: targetManager.getTargets( progressIndicator ) )
            {
                if ( target.isPlatform() )
                {
                    if ( latestTarget == null
                            || target.getVersion().getApiLevel() > latestTarget.getVersion().getApiLevel() )
                    {
                        latestTarget = target;
                    }
                }
            }
            platformDirectory = new File ( latestTarget.getLocation() );
        }
        else
        {
            platformDirectory = new File( androidTarget.getLocation() );
        }
        assertPathIsDirectory( platformDirectory );
        return platformDirectory;
    }
public File getPlatform()
    {
        assertPathIsDirectory( sdkPath );

        final File platformsDirectory = new File( sdkPath, PLATFORMS_FOLDER_NAME );
        assertPathIsDirectory( platformsDirectory );

        final File platformDirectory;
        if ( androidTarget == null )
        {
            IAndroidTarget latestTarget = null;
            AndroidTargetManager targetManager = sdkManager.getAndroidTargetManager( progressIndicator );
            for ( IAndroidTarget target: targetManager.getTargets( progressIndicator ) )
            {
                if ( target.isPlatform() )
                {
                    if ( latestTarget == null
                            || target.getVersion().getApiLevel() > latestTarget.getVersion().getApiLevel() )
                    {
                        latestTarget = target;
                    }
                }
            }
            platformDirectory = new File ( latestTarget.getLocation() );
        }
        else
        {
            platformDirectory = new File( androidTarget.getLocation() );
        }
        assertPathIsDirectory( platformDirectory );
        return platformDirectory;
    }
public File getPlatform ( ) { assertPathIsDirectory ( sdkPath ) ; final File platformsDirectory = new File ( sdkPath , PLATFORMS_FOLDER_NAME ) ; assertPathIsDirectory ( platformsDirectory ) ; final File platformDirectory ; if ( androidTarget == null ) { IAndroidTarget latestTarget = null ; AndroidTargetManager targetManager = sdkManager . getAndroidTargetManager ( progressIndicator ) ; for ( IAndroidTarget target : targetManager . getTargets ( progressIndicator ) ) { if ( target . isPlatform ( ) ) { if ( latestTarget == null || target . getVersion ( ) . getApiLevel ( ) > latestTarget . getVersion ( ) . getApiLevel ( ) ) { latestTarget = target ; } } } platformDirectory = new File ( latestTarget . getLocation ( ) ) ; } else { platformDirectory = new File ( androidTarget . getLocation ( ) ) ; } assertPathIsDirectory ( platformDirectory ) ; return platformDirectory ; }
This method returns the previously specified version. However, if none have been specified it returns the
"latest" version.
This method returns the previously specified version . However if none have been specified it returns the latest version .