All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.ksoichiro.eclipse.aar.CleanTask.groovy Maven / Gradle / Ivy

There is a newer version: 0.3.1
Show newest version
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}"
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy