package com.qmai.android.plugin

import org.gradle.api.Plugin
import org.gradle.api.Project

class OssFileUploadPlugin implements Plugin<Project> {
    @Override
    void apply(Project project) {
        //单独上传任务的task
        OssUploadFileBean ossUploadFileBean = project.getExtensions().create("uploadOss",OssUploadFileBean.class)
        project.afterEvaluate {
            def uploadFile = new File(ossUploadFileBean.localPath)
            println("single upload file "+uploadFile.exists() + "  "+uploadFile.absolutePath)
            project.getTasks().register("uploadOssFile", OssUploadTask.class, uploadFile,ossUploadFileBean.ossPath,"","","")
        }
    }



}
