-
-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from andreasfertig/switchToLLVM9
Switch to LLVM 9 and bump development version to 0.5.
- Loading branch information
Showing
69 changed files
with
331 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#! /usr/bin/env python3 | ||
# | ||
# | ||
# C++ Insights, copyright (C) by Andreas Fertig | ||
# Distributed under an MIT license. See LICENSE for details | ||
# | ||
#------------------------------------------------------------------------------ | ||
|
||
import re | ||
import os | ||
import subprocess | ||
#------------------------------------------------------------------------------ | ||
|
||
def main(): | ||
oldClangDevel = '9' | ||
newClangDevel = '10' | ||
oldClangStable = '8' | ||
newClangStable = oldClangDevel | ||
oldInsightsVersion = '0.4' | ||
newInsightsVersion = '0.5' | ||
|
||
print('Preparing a new release:') | ||
print(' Current Clang development : %s' %(oldClangDevel)) | ||
print(' New Clang development : %s' %(newClangDevel)) | ||
print(' Current Clang stable : %s' %(oldClangStable)) | ||
print(' New Clang stable : %s' %(newClangStable)) | ||
print(' Current Insights version : %s' %(oldInsightsVersion)) | ||
print(' New Insights version : %s' %(newInsightsVersion)) | ||
|
||
|
||
print(' - Updating .travis.yml') | ||
travis = open('.travis.yml', 'r').read() | ||
|
||
regEx = re.compile('[clang|llvm]-([0-9]+)') | ||
# regEx = re.compile('llvm-([0-9]+)', re.MULTILINE) | ||
|
||
travis = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangDevel), '\\1-%s' %(newClangDevel) , travis) | ||
travis = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangStable), '\\1-%s' %(newClangStable) , travis) | ||
travis = re.sub('(clang|Clang|llvm|LLVM) (%s)' %(oldClangStable), '\\1 %s' %(newClangStable) , travis) | ||
travis = re.sub(r"(LLVM_VERSION=)('%s)" %(oldClangStable), r"\1'%s" %(newClangStable) , travis) | ||
travis = re.sub(r"clang(%s)0" %(oldClangStable), r"clang%s0" %(newClangStable) , travis) | ||
travis = re.sub(r"(llvm-toolchain-xenial)-(%s)" %(oldClangStable), r"\1-%s" %(newClangStable) , travis) | ||
# travis = re.sub('([clang|llvm])(-[0-9]+)', r'\1-%s' %(newClangDevel) , travis) | ||
# print regEx.sub(travis, r'\1', newClangDevel) | ||
# m = regEx.findall(travis) | ||
|
||
# print(travis) | ||
open('.travis.yml', 'w').write(travis) | ||
|
||
|
||
print(' - Updating appveyor.yml') | ||
appveyor = open('appveyor.yml', 'r').read() | ||
appveyor = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangDevel), '\\1-%s' %(newClangDevel) , appveyor) | ||
appveyor = re.sub('(clang|llvm|clang\+\+|llvm-config|llvm-toolchain-bionic|clang-format|clang-tidy|llvm-toolchain-trusty)(-%s)' %(oldClangStable), '\\1-%s' %(newClangStable) , appveyor) | ||
appveyor = re.sub('(download)(/%s.)(0.0/llvm)' %(oldClangStable), '\\1/%s.\\3' %(newClangStable) , appveyor) | ||
appveyor = re.sub(r"(LLVM_VERSION=)('%s)" %(oldClangStable), r"\1'%s" %(newClangStable) , appveyor) | ||
open('appveyor.yml', 'w').write(appveyor) | ||
|
||
|
||
print(' - Updating CMakeLists.txt') | ||
cmake = open('CMakeLists.txt', 'r').read() | ||
cmake = re.sub('(set\(INSIGHTS_MIN_LLVM_MAJOR_VERSION)( %s)\)' %(oldClangStable), '\\1 %s)' %(newClangStable) , cmake) | ||
open('CMakeLists.txt', 'w').write(cmake) | ||
|
||
|
||
print(' - Updating version.h %s -> %s' %(oldInsightsVersion, newInsightsVersion)) | ||
version = open('version.h.in', 'r').read() | ||
version = re.sub('(INSIGHTS_VERSION )"(.*)"', '\\1"%s"' %(newInsightsVersion) , version) | ||
open('version.h.in', 'w').write(version) | ||
|
||
|
||
print(' - Generating CHANGELOG.md') | ||
# os.system('gren changelog --override --username=andreasfertig --repo=cppinsights %s...continous' %(oldInsightsVersion)) | ||
|
||
cmd = ['gren', 'changelog', '--override', '--username=andreasfertig', '--repo=cppinsights', '%s...continous' %(oldInsightsVersion)] | ||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | ||
stdout, stderr = p.communicate() | ||
|
||
if 0 != p.returncode: | ||
print('FAILED') | ||
return 1 | ||
|
||
changeLog = open('CHANGELOG.md', 'r').read() | ||
changeLog = re.sub('(## Continuous build.*?---)\n', '', changeLog, flags=re.DOTALL) | ||
open('CHANGELOG.md', 'w').write(changeLog) | ||
|
||
print(' - Tagging v_%s' %(newInsightsVersion)) | ||
|
||
cppInsightsDockerBaseFile = '../cppinsights-docker-base/Dockerfile' | ||
|
||
print(' - Updating cppinsights-docker-base (%s)' %(cppInsightsDockerBaseFile)) | ||
|
||
dockerFile = open(cppInsightsDockerBaseFile, 'r').read() | ||
dockerFile = re.sub('(ENV\s+CLANG_VERSION=)([0-9]+)', r'\g<1>%s' %(newClangStable), dockerFile) | ||
open(cppInsightsDockerBaseFile, 'w').write(dockerFile) | ||
#------------------------------------------------------------------------------ | ||
|
||
main() | ||
#------------------------------------------------------------------------------ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.