Browse Source

Merge branch 'master' of seth.tian/demo-chart-pie into master

master
richie 5 years ago committed by Gogs
parent
commit
6f0190d0b0
  1. 28
      build.gradle

28
build.gradle

@ -10,8 +10,23 @@ ext{
// jar的路径
// jar需要打包到zip中,/lib目录下
libPath = "$projectDir/webroot/WEB-INF/lib"
def pluginInfo = getPluginInfo()
pluginPre = "fr-plugin"
pluginName = pluginInfo.id
pluginVersion = pluginInfo.version
}
/*读取plugin.xml中的version*/
def getPluginInfo(){
def xmlFile = "./plugin.xml"
def plugin = new XmlParser().parse(xmlFile)
def version = plugin.version[0].text()
def id = plugin.id[0].text()
return ["id":id,"version":version]
}
repositories {
mavenLocal()
maven {
@ -67,25 +82,28 @@ jar.dependsOn("preJar")
task makeJar(type: Jar,dependsOn: preJar){
from fileTree(dir:"$buildDir/classes/java/main")
baseName pluginPre
appendix pluginName
version pluginVersion
destinationDir = file("$buildDir/libs")
}
task copyFile(type: Copy,dependsOn: ["jar"]){
task copyFile(type: Copy,dependsOn: ["makeJar"]){
from "$buildDir/libs"
from("$projectDir/lib") {
include "*.jar"
}
from "$projectDir/plugin.xml"
into file("$buildDir/temp/fr-"+"$project.name"+"-$project.version")
into file("$buildDir/temp/fr-plugin-"+"$pluginName"+"-$pluginVersion")
}
task zip(type:Zip,dependsOn:["copyFile"]){
from "$buildDir/temp"
destinationDir file("$buildDir/install")
//: baseName-appendix-0.0.1.zip
// baseName 'baseName'
// appendix 'appendix'
// version '0.0.1'
baseName pluginPre
appendix pluginName
version pluginVersion
}
//build时包含哪些文件,

Loading…
Cancel
Save