Gradle task grouping and rename task

This commit is contained in:
rocrocroc 2017-06-30 16:12:44 +08:00
parent 8fbcdd89ce
commit c1d71ca771
2 changed files with 15 additions and 3 deletions

View File

@ -16,7 +16,6 @@
package com.qihoo360.replugin.gradle.host
/**
*
* @author RePlugin Team
@ -29,5 +28,15 @@ class AppConstant {
/** 外部用户配置信息 */
def static final USER_CONFIG = "repluginHostConfig"
/** 用户Task组 */
def static final TASKS_GROUP = "replugin-plugin"
/** Task前缀 */
def static final TASKS_PREFIX = "rp"
/** 用户Task:安装插件 */
def static final TASK_SHOW_PLUGIN = TASKS_PREFIX + "ShowPlugins"
private AppConstant() {}
}

View File

@ -24,6 +24,7 @@ import com.qihoo360.replugin.gradle.host.creator.impl.json.PluginBuiltinJsonCrea
import com.qihoo360.replugin.gradle.host.handlemanifest.ComponentsGenerator
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.logging.LogLevel
/**
@ -74,9 +75,9 @@ public class Replugin implements Plugin<Project> {
}
}
// showPlugins
//
def addShowPluginTask() {
project.task('showPlugins').doLast {
Task showPlugins = project.task(AppConstant.TASK_SHOW_PLUGIN).doLast {
IFileCreator creator = new PluginBuiltinJsonCreator(project, config)
def dir = creator.getFileDir()
// src
@ -85,6 +86,8 @@ public class Replugin implements Plugin<Project> {
}
new File(dir, creator.getFileName()).write(creator.getFileContent(), 'UTF-8')
}
showPlugins.group = AppConstant.TASKS_GROUP
}
/**