com.jdroid.gradle.android.task.CopyApksTask.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jdroid-gradle-android-plugin Show documentation
Show all versions of jdroid-gradle-android-plugin Show documentation
Gradle Plugin for Android projects
package com.jdroid.gradle.android.task
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.tasks.TaskAction
public class CopyApksTask extends DefaultTask {
public CopyApksTask() {
description = 'Copy the APKs on the build directory to the specified target directory'
}
@TaskAction
public void doExecute() {
String targetApksDirPath = project.jdroid.getStringProp('TARGET_APKS_DIR_PATH')
if (targetApksDirPath == null) {
throw new GradleException('Missing TARGET_APKS_DIR_PATH parameter')
}
project.copy {
from './build/outputs/apk'
into targetApksDirPath
include('**/*.apk')
exclude('**/*unaligned.apk')
}
logger.info("Copied APKs to " + targetApksDirPath)
}
}