ext {
//JDK环境1.8的Eclipse使用的container名称
eclipseJreContainer = "org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java1.8"
novatarTargetVersion = '1.04'
//JETTY9的路径,如果不需要生产eclipse的Jetty插件运行环境,则不必使用
novatarJettyPath = System.getenv("JETTY_HOME")
//查找有哪些web project
def rootProjectDir = file(rootProject.projectDir.absolutePath + '/project')
def webPrjDirs = new ArrayList();
rootProjectDir.eachDir { dir ->
def tmpDir1 = file(dir.absolutePath + "/src/main/webapp")
def tmpDir2 = file(dir.absolutePath + "/src/main/jetty-base")
if (tmpDir1.isDirectory() && tmpDir1.exists() && tmpDir2.isDirectory() && tmpDir2.exists()) {
webPrjDirs.add(dir)
}
}
//那些包含jsp,script资源的java工程,默认输出到web project项目文件夹,这里获取第一个,
//多系统的情况下 这里需要特别指定
defaultResourceOutputWebappProject = ":project:" + webPrjDirs.get(0).name
novatarJarDate = getDate()
novatarTargetVersionWithDt = novatarTargetVersion + "." + novatarJarDate
def envDist = System.getenv("BUILD_DIST");
destinationDir = envDist != null ? file(envDist) : file(buildDir.absolutePath + "/dist")
}
task build() << {}
task clean() << {}
task removeDistBeforeBuild << {
FileTree files = fileTree(dir: destinationDir, include: '*.*')
files.each {File file ->
file.delete()
}
}
build.dependsOn removeDistBeforeBuild
def getDate() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd')
return formattedDate
}
build.gradle
最新推荐文章于 2024-08-22 23:27:11 发布