コード例 #1
0
 /**
  * Deploy the apk built with the current projects to all attached devices and emulators. Skips
  * other projects in a multi-module build without terminating.
  *
  * @throws MojoExecutionException
  * @throws MojoFailureException
  */
 protected void deployBuiltApk() throws MojoExecutionException, MojoFailureException {
   if (project.getPackaging().equals(APK)) {
     File apkFile = new File(targetDirectory, finalName + "." + APK);
     deployApk(apkFile);
   } else {
     getLog().info("Project packaging is not apk, skipping deployment.");
   }
 }
コード例 #2
0
 /**
  * @throws MojoExecutionException
  * @throws MojoFailureException
  */
 protected void deployBuiltApk() throws MojoExecutionException, MojoFailureException {
   // If we're not on a supported packaging with just skip (Issue 112)
   // http://code.google.com/p/maven-android-plugin/issues/detail?id=112
   if (!SUPPORTED_PACKAGING_TYPES.contains(project.getPackaging())) {
     getLog().info("Skipping deployment on " + project.getPackaging());
     return;
   }
   File apkFile =
       new File(project.getBuild().getDirectory(), project.getBuild().getFinalName() + "." + APK);
   deployApk(apkFile);
 }
コード例 #3
0
 /**
  * @throws MojoExecutionException
  * @throws MojoFailureException
  */
 protected void deployDependencies() throws MojoExecutionException, MojoFailureException {
   Set<Artifact> directDependentArtifacts = project.getDependencyArtifacts();
   if (directDependentArtifacts != null) {
     for (Artifact artifact : directDependentArtifacts) {
       String type = artifact.getType();
       if (type.equals(APK)) {
         getLog()
             .debug(
                 "Detected apk dependency " + artifact + ". Will resolve and deploy to device...");
         final File targetApkFile = resolveArtifactToFile(artifact);
         getLog().debug("Deploying " + targetApkFile + " to device...");
         deployApk(targetApkFile);
       }
     }
   }
 }