Author: taher
Date: Thu May 18 14:47:46 2017 New Revision: 1795541 URL: http://svn.apache.org/viewvc?rev=1795541&view=rev Log: Implemented: removed and cleaned up tasks in master gradle file In reference to the discussion thread [1] below, we agreed to remove copyDtd from build.gradle as it is not related to building OFBiz in a similar fashion to the removal of the tools subdirectory from OFBiz. In addition, this commit also removed the committers group label and renamed the groups for svnInfoFooter and gitInfoFooter tasks. [1] https://s.apache.org/xUSN Modified: ofbiz/ofbiz-framework/trunk/build.gradle Modified: ofbiz/ofbiz-framework/trunk/build.gradle URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1795541&r1=1795540&r2=1795541&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/build.gradle (original) +++ ofbiz/ofbiz-framework/trunk/build.gradle Thu May 18 14:47:46 2017 @@ -307,7 +307,6 @@ def cleanupGroup = 'Cleaning' def ofbizServer = 'OFBiz Server' def ofbizPlugin = 'OFBiz Plugin' def sysadminGroup = 'System Administration' -def committerGroup = 'OFBiz committers' // ========== OFBiz Server tasks ========== @@ -500,6 +499,64 @@ gradle.taskGraph.afterTask { Task task, } } +task gitInfoFooter(group: sysadminGroup, description: 'Update the Git Branch-revision info in the footer if Git is used') { + doLast { + def branch + def revision + def timestamp = new Date().format 'yyyy-MM-dd HH:mm:ss' + def gitFolder = new File('.git') + + if (!gitFolder.exists()) { + println ("Git is not used") + return + } + + def branchOutput = new ByteArrayOutputStream() + exec{ + commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD' + standardOutput = branchOutput + } + branch = branchOutput.toString() + def revisionOutput = new ByteArrayOutputStream() + exec{ + commandLine 'git', 'rev-parse', 'HEAD' + standardOutput = revisionOutput + } + revision = revisionOutput.toString() + gitFooterFile.delete() + gitFooterFile.createNewFile() + gitFooterFile << '${uiLabelMap.CommonBranch} : ' + "${branch}" + System.lineSeparator() + gitFooterFile << '${uiLabelMap.CommonRevision} : ' + "${revision}" + System.lineSeparator() + gitFooterFile << '${uiLabelMap.CommonBuiltOn} : ' + "${timestamp}" + System.lineSeparator() + gitFooterFile << '${uiLabelMap.CommonJavaVersion} : ' + "${org.gradle.internal.jvm.Jvm.current()}" + } +} + +task svnInfoFooter(group: sysadminGroup, description: 'Update the Subversion revision info in the footer if Subversion is used') { + doLast { + def timestamp = new Date().format 'yyyy-MM-dd HH:mm:ss' + def svnOutput = new ByteArrayOutputStream() + def svnFolder = new File('.svn') + + if (!svnFolder.exists()) { + println ("Subversion is not used") + return + } + + exec{ + commandLine 'svn', 'info', '--xml' + standardOutput = svnOutput + } + def info = new XmlParser().parseText(svnOutput.toString()) + svnFooterFile.delete() + svnFooterFile.createNewFile() + svnFooterFile << '${uiLabelMap.CommonBranch} : ' + "${info.entry.url.text()}" + System.lineSeparator() + svnFooterFile << '${uiLabelMap.CommonRevision} : ' + "${info.entry.commit.@revision}" + System.lineSeparator() + svnFooterFile << '${uiLabelMap.CommonBuiltOn} : ' + "${timestamp}" + System.lineSeparator() + svnFooterFile << '${uiLabelMap.CommonJavaVersion} : ' + "${org.gradle.internal.jvm.Jvm.current()}" + } +} + // ========== OFBiz Plugin Management ========== task createPlugin(group: ofbizPlugin, description: 'create a new plugin component based on specified templates') { doLast { @@ -828,83 +885,6 @@ task cleanAll(group: cleanupGroup, depen description 'Execute all cleaning tasks.' } -// ========== Tasks for OFBiz committers ========== -def websiteDir = "${rootDir}/../site" -task copyDtds(group: committerGroup, description: 'Copy all DTDs from OFBiz instance to website') { - doLast { - mkdir websiteDir+'/dtds' - copy { - from (fileTree("${rootDir}").files) { - include '**/*.xsd' - exclude '**/002*.xsd' - exclude '**/068*.xsd' - exclude '**/161*.xsd' - exclude '**/196*.xsd' - exclude '**/197*.xsd' - } - into websiteDir+'/dtds' - } - } -} - -task gitInfoFooter(group: committerGroup, description: 'Update the Git Branch-revision info in the footer if Git is used') { - doLast { - def branch - def revision - def timestamp = new Date().format 'yyyy-MM-dd HH:mm:ss' - def gitFolder = new File('.git') - - if (!gitFolder.exists()) { - println ("Git is not used") - return - } - - def branchOutput = new ByteArrayOutputStream() - exec{ - commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD' - standardOutput = branchOutput - } - branch = branchOutput.toString() - def revisionOutput = new ByteArrayOutputStream() - exec{ - commandLine 'git', 'rev-parse', 'HEAD' - standardOutput = revisionOutput - } - revision = revisionOutput.toString() - gitFooterFile.delete() - gitFooterFile.createNewFile() - gitFooterFile << '${uiLabelMap.CommonBranch} : ' + "${branch}" + System.lineSeparator() - gitFooterFile << '${uiLabelMap.CommonRevision} : ' + "${revision}" + System.lineSeparator() - gitFooterFile << '${uiLabelMap.CommonBuiltOn} : ' + "${timestamp}" + System.lineSeparator() - gitFooterFile << '${uiLabelMap.CommonJavaVersion} : ' + "${org.gradle.internal.jvm.Jvm.current()}" - } -} - -task svnInfoFooter(group: committerGroup, description: 'Update the Subversion revision info in the footer if Subversion is used') { - doLast { - def timestamp = new Date().format 'yyyy-MM-dd HH:mm:ss' - def svnOutput = new ByteArrayOutputStream() - def svnFolder = new File('.svn') - - if (!svnFolder.exists()) { - println ("Subversion is not used") - return - } - - exec{ - commandLine 'svn', 'info', '--xml' - standardOutput = svnOutput - } - def info = new XmlParser().parseText(svnOutput.toString()) - svnFooterFile.delete() - svnFooterFile.createNewFile() - svnFooterFile << '${uiLabelMap.CommonBranch} : ' + "${info.entry.url.text()}" + System.lineSeparator() - svnFooterFile << '${uiLabelMap.CommonRevision} : ' + "${info.entry.commit.@revision}" + System.lineSeparator() - svnFooterFile << '${uiLabelMap.CommonBuiltOn} : ' + "${timestamp}" + System.lineSeparator() - svnFooterFile << '${uiLabelMap.CommonJavaVersion} : ' + "${org.gradle.internal.jvm.Jvm.current()}" - } -} - /* ======================================================== * Rules-based OFBiz server commands * ======================================================== */ |
Free forum by Nabble | Edit this page |