Permalink
Browse files

Merge branch 'ndk-multiple-libraries' of https://github.com/tptak/mav…

  • Loading branch information...
2 parents 0f468ee + 3803352 commit 0b6e76fc8ddffb688b45a65a84ca6c70c7cf34f4 @mosabua mosabua committed Dec 27, 2012
@@ -22,6 +22,8 @@
import com.jayway.maven.plugins.android.common.AetherHelper;
import com.jayway.maven.plugins.android.common.AndroidExtension;
import com.jayway.maven.plugins.android.common.DeviceHelper;
+import com.jayway.maven.plugins.android.config.ConfigPojo;
+import com.jayway.maven.plugins.android.configuration.Ndk;
import com.jayway.maven.plugins.android.configuration.Sdk;
import org.apache.commons.jxpath.JXPathContext;
import org.apache.commons.jxpath.JXPathNotFoundException;
@@ -78,6 +80,30 @@
* The <code>ANDROID_NDK_HOME</code> environment variable name.
*/
public static final String ENV_ANDROID_NDK_HOME = "ANDROID_NDK_HOME";
+
+ /**
+ * <p>The Android NDK to use.</p>
+ * <p>Looks like this:</p>
+ * <pre>
+ * &lt;ndk&gt;
+ * &lt;path&gt;/opt/android-ndk-r4&lt;/path&gt;
+ * &lt;/ndk&gt;
+ * </pre>
+ * <p>The <code>&lt;path&gt;</code> parameter is optional. The default is the setting of the ANDROID_NDK_HOME
+ * environment variable. The parameter can be used to override this setting with a different environment variable
+ * like this:</p>
+ * <pre>
+ * &lt;ndk&gt;
+ * &lt;path&gt;${env.ANDROID_NDK_HOME}&lt;/path&gt;
+ * &lt;/ndk&gt;
+ * </pre>
+ * <p>or just with a hardcoded absolute path. The parameters can also be configured from command-line with parameter
+ * <code>-Dandroid.ndk.path</code>.</p>
+ *
+ * @parameter
+ */
+ @ConfigPojo( prefix = "ndk" )
+ private Ndk ndk;
/**
* The maven project.
@@ -989,8 +1015,8 @@ protected int deleteFilesFromDirectory( File baseDirectory, String... includes )
/**
* <p>Returns the Android SDK to use.</p>
* <p/>
- * <p>Current implementation looks for <code>&lt;sdk&gt;&lt;path&gt;</code> configuration in pom, then System
- * property <code>android.sdk.path</code>, then environment variable <code>ANDROID_HOME</code>.
+ * <p>Current implementation looks for System property <code>android.sdk.path</code>, then
+ * <code>&lt;sdk&gt;&lt;path&gt;</code> configuration in pom, then environment variable <code>ANDROID_HOME</code>.
* <p/>
* <p>This is where we collect all logic for how to lookup where it is, and which one to choose. The lookup is
* based on available parameters. This method should be the only one you should need to look at to understand how
@@ -1119,13 +1145,17 @@ public static String getLibraryUnpackDirectory( File unpackedApkLibsDirectory, A
*/
protected AndroidNdk getAndroidNdk() throws MojoExecutionException
{
- File chosenNdkPath;
+ File chosenNdkPath = null;
// There is no <ndk> tag in the pom.
if ( ndkPath != null )
{
// -Dandroid.ndk.path is set on command line, or via <properties><ndk.path>...
chosenNdkPath = ndkPath;
}
+ else if ( ndk != null && ndk.getPath() != null )
+ {
+ chosenNdkPath = ndk.getPath();
+ }
else
{
// No -Dandroid.ndk.path is set on command line, or via <properties><ndk.path>...
@@ -18,17 +18,19 @@
import java.util.Map;
/**
- * Configuration for an Android NDK. Only receives config parameter values, and there is no logic in here. Logic is in
+ * Configuration for an Android NDK. Only receives config parameter values, and
+ * there is no logic in here. Logic is in
* {@link com.jayway.maven.plugins.android.AndroidNdk}.
- *
+ *
* @author Johan Lindquist <johanlindquist@gmail.com>
*/
public class Ndk
{
/**
- * Directory of the installed Android NDK, for example <code>/usr/local/android-ndk-r4</code>
- *
+ * Directory of the installed Android NDK, for example
+ * <code>/usr/local/android-ndk-r4</code>
+ *
* @see com.jayway.maven.plugins.android.phase05compile.NdkBuildMojo#ndkPath
*/
private File path;
@@ -138,4 +140,226 @@
*/
private String buildWarningsRegularExpression;
+ public File getPath()
+ {
+ return path;
+ }
+
+ public void setPath( File path )
+ {
+ this.path = path;
+ }
+
+ public List<HeaderFilesDirective> getHeaderFilesDirectives()
+ {
+ return headerFilesDirectives;
+ }
+
+ public void setHeaderFilesDirectives(
+ List<HeaderFilesDirective> headerFilesDirectives )
+ {
+ this.headerFilesDirectives = headerFilesDirectives;
+ }
+
+ public Boolean getUseHeaderArchives()
+ {
+ return useHeaderArchives;
+ }
+
+ public void setUseHeaderArchives( Boolean useHeaderArchives )
+ {
+ this.useHeaderArchives = useHeaderArchives;
+ }
+
+ public Boolean getAttachHeaderFiles()
+ {
+ return attachHeaderFiles;
+ }
+
+ public void setAttachHeaderFiles( Boolean attachHeaderFiles )
+ {
+ this.attachHeaderFiles = attachHeaderFiles;
+ }
+
+ public Boolean getUseLocalSrcIncludePaths()
+ {
+ return useLocalSrcIncludePaths;
+ }
+
+ public void setUseLocalSrcIncludePaths( Boolean useLocalSrcIncludePaths )
+ {
+ this.useLocalSrcIncludePaths = useLocalSrcIncludePaths;
+ }
+
+ public String getBuildExecutable()
+ {
+ return buildExecutable;
+ }
+
+ public void setBuildExecutable( String buildExecutable )
+ {
+ this.buildExecutable = buildExecutable;
+ }
+
+ public String getBuildAdditionalCommandline()
+ {
+ return buildAdditionalCommandline;
+ }
+
+ public void setBuildAdditionalCommandline( String buildAdditionalCommandline )
+ {
+ this.buildAdditionalCommandline = buildAdditionalCommandline;
+ }
+
+ public String getToolchain()
+ {
+ return toolchain;
+ }
+
+ public void setToolchain( String toolchain )
+ {
+ this.toolchain = toolchain;
+ }
+
+ public String getClassifier()
+ {
+ return classifier;
+ }
+
+ public void setClassifier( String classifier )
+ {
+ this.classifier = classifier;
+ }
+
+ public Boolean getClearNativeArtifacts()
+ {
+ return clearNativeArtifacts;
+ }
+
+ public void setClearNativeArtifacts( Boolean clearNativeArtifacts )
+ {
+ this.clearNativeArtifacts = clearNativeArtifacts;
+ }
+
+ public Boolean getAttachNativeArtifacts()
+ {
+ return attachNativeArtifacts;
+ }
+
+ public void setAttachNativeArtifacts( Boolean attachNativeArtifacts )
+ {
+ this.attachNativeArtifacts = attachNativeArtifacts;
+ }
+
+ public String getBuildDirectory()
+ {
+ return buildDirectory;
+ }
+
+ public void setBuildDirectory( String buildDirectory )
+ {
+ this.buildDirectory = buildDirectory;
+ }
+
+ public String getFinalLibraryName()
+ {
+ return finalLibraryName;
+ }
+
+ public void setFinalLibraryName( String finalLibraryName )
+ {
+ this.finalLibraryName = finalLibraryName;
+ }
+
+ public String getMakefile()
+ {
+ return makefile;
+ }
+
+ public void setMakefile( String makefile )
+ {
+ this.makefile = makefile;
+ }
+
+ public String getApplicationMakefile()
+ {
+ return applicationMakefile;
+ }
+
+ public void setApplicationMakefile( String applicationMakefile )
+ {
+ this.applicationMakefile = applicationMakefile;
+ }
+
+ public Boolean getMaxJobs()
+ {
+ return maxJobs;
+ }
+
+ public void setMaxJobs( Boolean maxJobs )
+ {
+ this.maxJobs = maxJobs;
+ }
+
+ public String getTarget()
+ {
+ return target;
+ }
+
+ public void setTarget( String target )
+ {
+ this.target = target;
+ }
+
+ public String getArchitecture()
+ {
+ return architecture;
+ }
+
+ public void setArchitecture( String architecture )
+ {
+ this.architecture = architecture;
+ }
+
+ public Boolean getSkipStripping()
+ {
+ return skipStripping;
+ }
+
+ public void setSkipStripping( Boolean skipStripping )
+ {
+ this.skipStripping = skipStripping;
+ }
+
+ public Map<String, String> getSystemProperties()
+ {
+ return systemProperties;
+ }
+
+ public void setSystemProperties( Map<String, String> systemProperties )
+ {
+ this.systemProperties = systemProperties;
+ }
+
+ public Boolean getIgnoreBuildWarnings()
+ {
+ return ignoreBuildWarnings;
+ }
+
+ public void setIgnoreBuildWarnings( Boolean ignoreBuildWarnings )
+ {
+ this.ignoreBuildWarnings = ignoreBuildWarnings;
+ }
+
+ public String getBuildWarningsRegularExpression()
+ {
+ return buildWarningsRegularExpression;
+ }
+
+ public void setBuildWarningsRegularExpression(
+ String buildWarningsRegularExpression )
+ {
+ this.buildWarningsRegularExpression = buildWarningsRegularExpression;
+ }
+
}
@@ -19,10 +19,8 @@
import com.jayway.maven.plugins.android.common.AetherHelper;
import com.jayway.maven.plugins.android.common.AndroidExtension;
import com.jayway.maven.plugins.android.common.NativeHelper;
-import com.jayway.maven.plugins.android.config.ConfigPojo;
import com.jayway.maven.plugins.android.config.PullParameter;
import com.jayway.maven.plugins.android.configuration.HeaderFilesDirective;
-import com.jayway.maven.plugins.android.configuration.Ndk;
import org.apache.commons.io.FileUtils;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
@@ -61,30 +59,6 @@
* Name of the subdirectory of 'target' where we put the generated makefile
*/
public static final String NDK_MAKFILE_DIRECTORY = "ndk-build";
-
- /**
- * <p>The Android NDK to use.</p>
- * <p>Looks like this:</p>
- * <pre>
- * &lt;ndk&gt;
- * &lt;path&gt;/opt/android-ndk-r4&lt;/path&gt;
- * &lt;/ndk&gt;
- * </pre>
- * <p>The <code>&lt;path&gt;</code> parameter is optional. The default is the setting of the ANDROID_NDK_HOME
- * environment variable. The parameter can be used to override this setting with a different environment variable
- * like this:</p>
- * <pre>
- * &lt;ndk&gt;
- * &lt;path&gt;${env.ANDROID_NDK_HOME}&lt;/path&gt;
- * &lt;/ndk&gt;
- * </pre>
- * <p>or just with a hardcoded absolute path. The parameters can also be configured from command-line with parameter
- * <code>-Dandroid.ndk.path</code>.</p>
- *
- * @parameter
- */
- @ConfigPojo( prefix = "ndk" )
- private Ndk ndk;
/**
* Allows for overriding the default ndk-build executable.

0 comments on commit 0b6e76f

Please sign in to comment.