mirror of
https://gitee.com/replugin/RePlugin.git
synced 2024-11-30 02:38:34 +08:00
Gradle task grouping and rename task
This commit is contained in:
parent
8fbcdd89ce
commit
c1d71ca771
@ -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() {}
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user