@Mojo(name="generate-sources", defaultPhase=GENERATE_SOURCES, requiresDependencyResolution=COMPILE) public class GenerateSourcesMojo extends AbstractAndroidMojo
R.java
based on resources specified by the resources
configuration parameter.
Generates java files based on aidl files.Modifier and Type | Field and Description |
---|---|
protected File |
aidlSourceDirectory
The directory containing the aidl files.
|
protected BuildConfigConstant[] |
buildConfigConstants
Parameter designed to generate custom BuildConfig constants
|
protected static List<String> |
EXCLUDED_DEPENDENCY_SCOPES_FOR_EXTRACTION
Which dependency scopes should not be included when unpacking dependencies
|
protected File |
genDirectoryAidl
Override default generated folder containing aidl classes
|
protected boolean |
warnOnApklibDependencies
Whether to produce a warning if there is an aar dependency that has an apklib artifact in its dependency
tree.
|
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 |
---|
GenerateSourcesMojo() |
Modifier and Type | Method and Description |
---|---|
protected void |
copyManifest()
Copy the AndroidManifest.xml from androidManifestFile to destinationManifestFile
|
void |
execute()
Generates the sources.
|
protected void |
extractSourceDependencies()
Extract the source dependencies.
|
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(defaultValue="true") protected boolean warnOnApklibDependencies
Whether to produce a warning if there is an aar dependency that has an apklib artifact in its dependency tree. The combination of aar library including or depending on an apklib has been deprecated and may not be supported by future plugin versions. Traversing the dependency graph is done for all project dependencies present in build classpath.
It is recommended to keep this set to true
to catch possible issues as soon as possible.
@Parameter(property="android.genDirectoryAidl", defaultValue="${project.build.directory}/generated-sources/aidl") protected File genDirectoryAidl
@Parameter(property="android.aidlSourceDirectory", defaultValue="${project.basedir}/src/main/aidl") protected File aidlSourceDirectory
@Parameter(property="android.buildConfigConstants") protected BuildConfigConstant[] buildConfigConstants
Parameter designed to generate custom BuildConfig constants
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
- if it fails.org.apache.maven.plugin.MojoFailureException
- if it fails.protected void copyManifest() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected void extractSourceDependencies() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
- if it fails.Copyright © 2008–2019 simpligility technologies inc.. All rights reserved.