com.simpligility.maven.plugins.android.configuration.SimpleVersionElementParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of android-maven-plugin Show documentation
Show all versions of android-maven-plugin Show documentation
Maven Plugin for Android Development
The newest version!
package com.simpligility.maven.plugins.android.configuration;
import org.apache.maven.plugin.MojoExecutionException;
/**
* VersionElementParser implementing the old version generator behavior.
*
* @author Wang Xuerui - [email protected]
*
*/
public class SimpleVersionElementParser implements VersionElementParser
{
@Override
public int[] parseVersionElements( final String versionName ) throws MojoExecutionException
{
final String[] versionNameElements = versionName.replaceAll( "[^0-9.]", "" ).split( "\\." );
int[] result = new int[versionNameElements.length];
for ( int i = 0; i < versionNameElements.length; i++ )
{
result[i] = Integer.valueOf( versionNameElements[i] );
}
return result;
}
}