From 5b0762e3dc0a6f9f782ec367353c6c408faa5d7b Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 24 Oct 2019 10:46:29 +0100 Subject: [PATCH] JAL-3210 Fixed cleaning tasks. --- build.gradle | 81 ++++++++++++++++++++++++++++++++++++----------------- gradle.properties | 4 +-- 2 files changed, 57 insertions(+), 28 deletions(-) diff --git a/build.gradle b/build.gradle index c7d2311..63665a9 100644 --- a/build.gradle +++ b/build.gradle @@ -509,12 +509,16 @@ compileCloverJava { } clean { - delete sourceSets.main.java.outputDir + doFirst { + delete sourceSets.main.java.outputDir + } } cleanTest { - delete sourceSets.test.java.outputDir - delete cloverInstrDir + doFirst { + delete sourceSets.test.java.outputDir + delete cloverInstrDir + } } // format is a string like date.format("dd MMMM yyyy") @@ -560,12 +564,14 @@ task createBuildProperties(type: WriteProperties) { } def buildingHTML = "$jalviewDir/$docDir/building.html" -task deleteBuildingHTML(type: Delete) { - delete buildingHTML +task cleanBuildingHTML(type: Delete) { + doFirst { + delete buildingHTML + } } task convertBuildingMD(type: Exec) { - dependsOn deleteBuildingHTML + dependsOn cleanBuildingHTML def buildingMD = "$jalviewDir/$docDir/building.md" def css = "$jalviewDir/$docDir/github.css" @@ -597,8 +603,11 @@ task convertBuildingMD(type: Exec) { inputs.file(css) outputs.file(buildingHTML) } + clean { - delete buildingHTML + doFirst { + delete buildingHTML + } } task syncDocs(type: Sync) { @@ -736,7 +745,9 @@ ant.importBuild "$utilsDir/publishHelp.xml" task cleanPackageDir(type: Delete) { - delete fileTree("$jalviewDir/$packageDir").include("*.jar") + doFirst { + delete fileTree("$jalviewDir/$packageDir").include("*.jar") + } } jar { @@ -820,10 +831,6 @@ task getdownWebsite() { dependsOn makeDist } - // clean the getdown website and files dir before creating getdown folders - delete project.ext.getdownWebsiteDir - delete project.ext.getdownFilesDir - def getdownWebsiteResourceFilenames = [] def getdownTextString = "" def getdownResourceDir = project.ext.getdownResourceDir @@ -831,6 +838,10 @@ task getdownWebsite() { def getdownResourceFilenames = [] doFirst { + // clean the getdown website and files dir before creating getdown folders + delete project.ext.getdownWebsiteDir + delete project.ext.getdownFilesDir + copy { from buildProperties rename(buildPropertiesFile, getdown_build_properties) @@ -1027,8 +1038,10 @@ task getdown() { } clean { - delete project.ext.getdownWebsiteDir - delete project.ext.getdownFilesDir + doFirst { + delete project.ext.getdownWebsiteDir + delete project.ext.getdownFilesDir + } } install4j { @@ -1144,7 +1157,9 @@ task installers(type: com.install4j.gradle.Install4jTask) { } clean { - delete install4jConf + doFirst { + delete install4jConf + } } task sourceDist (type: Tar) { @@ -1347,7 +1362,7 @@ task jalviewjsEclipsePaths { } } -task jalviewjsEclipseCopyDropins { +task OLDjalviewjsEclipseCopyDropins { dependsOn jalviewjsEclipsePaths def inputFiles = fileTree(dir: jalviewjs_utils_dir+"/"+fromDropinsDir, include: "*.jar") def outputDir = eclipseDropinsDir @@ -1368,6 +1383,12 @@ task jalviewjsEclipseCopyDropins { } } +// this version (type: Copy) will delete anything in the eclipse dropins folder that isn't in fromDropinsDir +task jalviewjsEclipseCopyDropins(type: Copy) { + from fromDropinsDir + into eclipseDropinsDir +} + task jalviewjsCreateJ2sSettings(type: WriteProperties) { dependsOn jalviewjsSitePath outputFile (jalviewDir+"/"+jalviewjs_j2s_settings) @@ -1388,6 +1409,7 @@ task jalviewjsCreateJ2sSettings(type: WriteProperties) { property(siteDirProperty,jalviewjsTransferSiteDir) } } + inputs.properties(props.findAll( { k, v -> k.startsWith("j2s.") } )) outputs.file(outputFile) } @@ -1429,13 +1451,17 @@ task jalviewjsCopySiteResources (type: Copy) { inputs.files inputFiles } -task jalviewjsTotalClean { +task cleanJalviewjsAll { group "JalviewJS" - description "Delete everything to do with JalviewJS build" - //delete jalviewjsBuildDir - delete jalviewDir+"/"+eclipse_bin_dir - delete file(eclipseWorkspace.getAbsolutePath()+"/.metadata") - delete jalviewDir+"/"+jalviewjs_j2s_settings + description "Delete all configuration and build artifacts to do with JalviewJS build" + dependsOn cleanJalviewjsSite + + doFirst { + delete jalviewjsBuildDir + delete jalviewDir+"/"+eclipse_bin_dir + delete file(eclipseWorkspace.getAbsolutePath()+"/.metadata") + delete jalviewDir+"/"+jalviewjs_j2s_settings + } } task jalviewjsProjectImport(type: Exec) { @@ -1507,6 +1533,7 @@ task jalviewjsTranspile(type: Exec) { inputs.dir(sourceDir) outputs.dir(eclipse_bin_dir+"/main") outputs.dir(jalviewjsTransferSiteDir) + outputs.upToDateWhen { file("${jalviewjsTransferSiteDir}${jalviewjs_server_resource}").exists() } } @@ -1536,9 +1563,11 @@ task jalviewjsBuildSite { dependsOn jalviewjsPrepareSite } -task jalviewjsSiteClean { - //delete jalviewjsTransferSiteDir - //delete jalviewjsSiteDir +task cleanJalviewjsSite { + doFirst { + delete jalviewjsTransferSiteDir + delete jalviewjsSiteDir + } } task jalviewjsSiteTar(type: Tar) { @@ -1625,7 +1654,7 @@ task jalviewjsIDEBuildSite { task jalviewjsIDESiteClean { group "JalviewJS in Eclipse" description "Deletes the Eclipse transpiled site" - dependsOn jalviewjsSiteClean + dependsOn cleanJalviewjsSite } task jalviewjsIDEServer { diff --git a/gradle.properties b/gradle.properties index b0c4113..c035a59 100644 --- a/gradle.properties +++ b/gradle.properties @@ -167,8 +167,8 @@ j2s.compiler.status = enable #j2s.log.methods.declared = j2s_methods_declared.log #j2s.log.methods.called = j2s_methods_called.log #a semicolon-separated list of package-level file paths to be excluded -j2s.excluded.paths = test;testng;util -j2s.include.tests = true +#j2s.excluded.paths = test;testng;util +#j2s.include.tests = true #j2s.testing = null #j2s.compiler.nonqualified.packages = null #j2s.compiler.nonqualified.classes = null -- 1.7.10.2