@Mojo(name="proguard", defaultPhase=PROCESS_CLASSES, requiresDependencyResolution=COMPILE) public class ProguardMojo extends AbstractAndroidMojo
Modifier and Type | Field and Description |
---|---|
protected List<org.apache.maven.artifact.Artifact> |
pluginDependencies
The plugin dependencies.
|
protected Proguard |
proguard
ProGuard configuration.
|
aaptExtraArgs, aaptVerbose, adbConnectionTimeout, androidManifestFile, assetsDirectory, attachJar, attachSources, combinedAssets, configurations, customPackage, dependencyGraphBuilder, destinationManifestFile, device, devices, deviceThreads, ENV_ANDROID_HOME, ENV_ANDROID_NDK_HOME, execution, extractedDependenciesDirectory, extractedDependenciesJavaResources, extractedDependenciesJavaSources, finalName, genDirectory, generateApk, ips, nativeLibrariesDirectory, ndkOutputDirectory, proguardFile, project, projectHelper, projectOutputDirectory, release, renameManifestPackage, resourceDirectory, resourceOverlayDirectories, resourceOverlayDirectory, resources, session, sourceDirectory, sourceEncoding, SUPPORTED_PACKAGING_TYPES, targetDirectory, undeployBeforeDeploy
Constructor and Description |
---|
ProguardMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute() |
copyFolder, deployApk, deployBuiltApk, deployDependencies, doWithDevices, extractInstrumentationRunnerFromAndroidManifest, extractPackageNameFromAndroidArtifact, extractPackageNameFromAndroidManifest, extractPackageNameFromAndroidManifestXmlTree, extractPackageNameFromApk, getAndroidManifestPackageName, getAndroidNdk, getAndroidSdk, getArtifactResolverHelper, getDependencyResolver, getDirectDependencyArtifacts, getJack, getLibraryUnpackDirectory, getNativeHelper, getRelevantCompileArtifacts, getResourceOverlayDirectories, getTransitiveDependencyArtifacts, getTransitiveDependencyArtifacts, getUnpackedAarClassesJar, getUnpackedApkLibSourceFolder, getUnpackedLibAssetsFolder, getUnpackedLibFolder, getUnpackedLibHelper, getUnpackedLibNativesFolder, getUnpackedLibResourceFolder, getUnpackedLibsDirectory, initAndroidDebugBridge, isAPKBuild, isInstrumentationTest, resolveArtifactToFile, undeployApk, undeployApk, waitForInitialDeviceList
@Parameter protected Proguard proguard
ProGuard configuration. ProGuard is disabled by default. Set the skip parameter to false to activate proguard. A complete configuration can include any of the following:
<proguard> <skip>true|false</skip> <config>proguard.cfg</config> <configs> <config>${env.ANDROID_HOME}/tools/proguard/proguard-android.txt</config> </configs> <proguardJarPath>someAbsolutePathToProguardJar</proguardJarPath> <filterMavenDescriptor>true|false</filterMavenDescriptor> <filterManifest>true|false</filterManifest> <customFilter>filter1,filter2</customFilter> <jvmArguments> <jvmArgument>-Xms256m</jvmArgument> <jvmArgument>-Xmx512m</jvmArgument> </jvmArguments> </proguard>
A good practice is to create a release profile in your POM, in which you enable ProGuard. ProGuard should be disabled for development builds, since it obfuscates class and field names, and it may interfere with test projects that rely on your application classes. All parameters can be overridden in profiles or the the proguard* properties. Default values apply and are documented with these properties.
@Parameter(defaultValue="${plugin.artifacts}", required=true, readonly=true) protected List<org.apache.maven.artifact.Artifact> pluginDependencies
Copyright © 2008–2019 simpligility technologies inc.. All rights reserved.