com.github.ksoichiro.eclipse.aar.CleanTask.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-eclipse-aar-plugin Show documentation
Show all versions of gradle-eclipse-aar-plugin Show documentation
Gradle plugin to use Android AAR libraries on Eclipse
package com.github.ksoichiro.eclipse.aar
import org.gradle.api.tasks.TaskAction
class CleanTask extends BaseTask {
CleanTask() {
description = 'Used for Eclipse. Cleans AAR dependencies directory.'
}
@TaskAction
def exec() {
extension = project.eclipseAar
findTargetProjects()
projects.each { AndroidProject p ->
def targets = [p.project.file(extension.aarDependenciesDir)]
println "${p.project.name}.cleanLibsDirectoryEnabled = ${p.project.eclipseAar.cleanLibsDirectoryEnabled}"
// Check sub-project's setting to clean partially
if (p.project.eclipseAar.cleanLibsDirectoryEnabled) {
targets << p.project.file('libs')
}
targets.findAll { it.exists() }?.each {
p.project.delete(it)
println "Deleted ${it}"
}
}
}
}