Author: jleroux
Date: Fri Aug 19 12:23:32 2016
New Revision: 1756909
URL:
http://svn.apache.org/viewvc?rev=1756909&view=revLog:
Fixes "GitInfo.ftl cannot be created when sources checkout using svn" reported by Wai at
https://issues.apache.org/jira/browse/OFBIZ-7942Simply check if the one of the 2 major versions managers used with OFBiz (Git or Subversion) is used
Modified:
ofbiz/trunk/build.gradle
Modified: ofbiz/trunk/build.gradle
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/build.gradle?rev=1756909&r1=1756908&r2=1756909&view=diff==============================================================================
--- ofbiz/trunk/build.gradle (original)
+++ ofbiz/trunk/build.gradle Fri Aug 19 12:23:32 2016
@@ -656,11 +656,17 @@ task copyDtds(group: committerGroup, des
}
}
-task gitInfoFooter(group: committerGroup, description: 'Update the Git Branch-revision info in the footer') << {
+task gitInfoFooter(group: committerGroup, description: 'Update the Git Branch-revision info in the footer if Git is used') << {
def branch
def revision
def timestamp = new Date().format 'yyyy-MM-dd HH:mm:ss'
File gitFooterFile = new File("${rootDir}/runtime/GitInfo.ftl")
+ def gitFolder = new File('.git')
+
+ if(!gitFolder.exists()) {
+ println ("Git is not used")
+ return
+ }
def branchOutput = new ByteArrayOutputStream()
exec{
@@ -682,10 +688,17 @@ task gitInfoFooter(group: committerGroup
gitFooterFile << "Java Version: ${org.gradle.internal.jvm.Jvm.current()}"
}
-task svnInfoFooter(group: committerGroup, description: 'Update the Subversion revision info in the footer') << {
+task svnInfoFooter(group: committerGroup, description: 'Update the Subversion revision info in the footer if Subversion is used') << {
def timestamp = new Date().format 'yyyy-MM-dd HH:mm:ss'
File svnFooterFile = new File("${rootDir}/runtime/SvnInfo.ftl")
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