#926 Update Conan version by release

- Update release scripts to increment Conan version

Signed-off-by: Uilian Ries <[email protected]>
diff --git a/scripts/developBuild.py b/scripts/developBuild.py
index c16c8a6..3d3f6f0 100755
--- a/scripts/developBuild.py
+++ b/scripts/developBuild.py
@@ -7,5 +7,6 @@
 v.incrementBuildNumber()
 v.updateVersionFile()
 v.updateReadmeFile()
+v.updateConanFile()
 
-print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file
+print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/majorRelease.py b/scripts/majorRelease.py
index f367506..2341ecb 100755
--- a/scripts/majorRelease.py
+++ b/scripts/majorRelease.py
@@ -7,5 +7,6 @@
 v.incrementMajorVersion()
 v.updateVersionFile()
 v.updateReadmeFile()
+v.updateConanFile()
 
-print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file
+print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/minorRelease.py b/scripts/minorRelease.py
index ac36df9..585b701 100755
--- a/scripts/minorRelease.py
+++ b/scripts/minorRelease.py
@@ -7,5 +7,6 @@
 v.incrementMinorVersion()
 v.updateVersionFile()
 v.updateReadmeFile()
+v.updateConanFile()
 
-print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file
+print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/patchRelease.py b/scripts/patchRelease.py
index 878662f..312b4d5 100755
--- a/scripts/patchRelease.py
+++ b/scripts/patchRelease.py
@@ -7,5 +7,6 @@
 v.incrementPatchNumber()
 v.updateVersionFile()
 v.updateReadmeFile()
+v.updateConanFile()
 
-print( "Updated Version.hpp and README to v{0}".format( v.getVersionString() ) )
\ No newline at end of file
+print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
diff --git a/scripts/releaseCommon.py b/scripts/releaseCommon.py
index c49f746..16b5f19 100644
--- a/scripts/releaseCommon.py
+++ b/scripts/releaseCommon.py
@@ -11,6 +11,7 @@
 rootPath = os.path.join( catchPath, 'include/' )
 versionPath = os.path.join( rootPath, "internal/catch_version.hpp" )
 readmePath = os.path.join( catchPath, "README.md" )
+conanPath = os.path.join(catchPath, 'conanfile.py')
 
 class Version:
     def __init__(self):
@@ -86,3 +87,17 @@
             line = downloadParser.sub( r'<a href="https://github.com/philsquared/Catch/releases/download/v{0}/catch.hpp">'.format(self.getVersionString()) , line)
             f.write( line + "\n" )
 
+    def updateConanFile(self):
+        conanParser = re.compile( r'    version = "\d+\.\d+\.\d+.*"')
+        f = open( conanPath, 'r' )
+        lines = []
+        for line in f:
+            m = conanParser.match( line )
+            if m:
+                lines.append( '    version = "{0}"'.format(format(self.getVersionString())) )
+            else:
+                lines.append( line.rstrip() )
+        f.close()
+        f = open( conanPath, 'w' )
+        for line in lines:
+            f.write( line + "\n" )