Commit c2f72155 authored by Sergio Martins's avatar Sergio Martins

Merge branch '1.7'

parents f39e219b 9abf7675
......@@ -47,9 +47,7 @@ You can get clazy from:
# Pre-built binaries
Pre-built binaries are produced by KDAB, you can get them from https://downloads.kdab.com/clazy/.
Currently MSVC2015, MSVC2017 (clazy-1.5 based on clang-7.0) and Linux AppImage packages (clazy 1.7 based on clang-10.0) are provided.
Pre-built clazy-1.7 binaries based on clang-10 for MSVC2019 and Linux AppImage are produced by KDAB, you can get them from https://downloads.kdab.com/clazy/.
# Build Instructions
## Linux
......
......@@ -7,11 +7,11 @@ from shutil import copyfile
# Change here:
CLAZY_VERSION = '1.7'
CANDIDATE_SHA1 = 'v1.7'
PACKAGE_DIR = '/c/d/clazy-msvc-package/'
PACKAGE_DIR_WIN = 'c:\\d\\clazy-msvc-package\\'
PACKAGE_DIR = '/d/clazy-msvc-package/'
PACKAGE_DIR_WIN = 'd:\\clazy-msvc-package\\'
#--------------------------------------------------
CLAZY_REPO_URL = "https://github.com/KDE/clazy.git"
CLAZY_REPO_URL = "https://invent.kde.org/sdk/clazy.git"
MSVC_VERSION = os.getenv('MSVC_VERSION', '')
LLVM_INSTALL_DIR = os.getenv('LLVM_INSTALL_DIR', '')
CLAZY_WORK_DIR = 'work' + MSVC_VERSION
......@@ -19,11 +19,9 @@ CLAZY_ZIP_WITHOUT_EXTENSION = "clazy_v%s-msvc%s" % (CLAZY_VERSION, MSVC_VERSION)
CLAZY_ZIP = CLAZY_ZIP_WITHOUT_EXTENSION + '.zip'
CLAZY_SRC_ZIP = "clazy_v%s-src.zip" % CLAZY_VERSION
IS_FIRST_RUN = (MSVC_VERSION == '2015')
def run_command(cmd, abort_on_error = True):
print cmd
print(cmd)
success = (os.system(cmd) == 0)
if abort_on_error and not success:
sys.exit(1)
......@@ -34,16 +32,15 @@ def copy(src, dest):
run_command('cp %s %s' % (src, dest))
def check_env():
if MSVC_VERSION not in ['2015', '2017']:
print "Error: Set MSVC_VERSION to a proper value. Exiting..."
if MSVC_VERSION not in ['2019']:
print("Error: Set MSVC_VERSION to a proper value. Exiting...")
sys.exit(1)
if not LLVM_INSTALL_DIR:
print "Error: Set LLVM_INSTALL_DIR to a proper value. Exiting..."
print("Error: Set LLVM_INSTALL_DIR to a proper value. Exiting...")
sys.exit(1)
if IS_FIRST_RUN:
run_command('rm -rf ' + PACKAGE_DIR)
run_command('rm -rf ' + PACKAGE_DIR)
def clone_clazy(sha1, work_dir):
if os.path.exists(work_dir):
......@@ -52,10 +49,10 @@ def clone_clazy(sha1, work_dir):
run_command("git checkout " + sha1)
def build_clazy():
cmd = 'cmake -DCMAKE_INSTALL_PREFIX=%s -DCMAKE_BUILD_TYPE=Release -DCLANG_LIBRARY_IMPORT=%s\lib\clang.lib -G "NMake Makefiles JOM" .' % (LLVM_INSTALL_DIR, LLVM_INSTALL_DIR)
cmd = 'cmake -DCMAKE_INSTALL_PREFIX=%s -DCMAKE_BUILD_TYPE=Release -DCLANG_LIBRARY_IMPORT=%s\lib\clang.lib -G "Ninja" .' % (LLVM_INSTALL_DIR, LLVM_INSTALL_DIR)
run_command(cmd)
run_command('jom')
run_command('jom install')
run_command('cmake --build .')
run_command('cmake --build . --target install')
def copy_files(work_dir):
......@@ -74,6 +71,7 @@ def copy_files(work_dir):
copy("../windows-package/README.txt", PACKAGE_DIR + 'clazy')
copy("../README.md", PACKAGE_DIR + 'clazy/README-CLAZY.md')
copy(LLVM_INSTALL_DIR + '/bin/clang.exe', PACKAGE_DIR + 'clazy/bin/clang/')
copy(LLVM_INSTALL_DIR + '/bin/clang-apply-replacements.exe', PACKAGE_DIR + 'clazy/bin/clang/')
copy(LLVM_INSTALL_DIR + '/bin/clang.exe', PACKAGE_DIR + 'clazy/bin/clang/clang-cl.exe')
copy(LLVM_INSTALL_DIR + '/bin/ClazyPlugin.dll', PACKAGE_DIR + 'clazy/bin/clang/')
copy(LLVM_INSTALL_DIR + '/bin/clazy-standalone.exe', PACKAGE_DIR + 'clazy/bin/clang/')
......@@ -88,18 +86,14 @@ def zip_package():
run_command('zip -r %s clazy/' % (CLAZY_ZIP))
run_command('rm -rf clazy')
if IS_FIRST_RUN:
run_command('wget --no-check-certificate https://github.com/KDE/clazy/archive/%s.zip -O %s' % (CANDIDATE_SHA1, CLAZY_SRC_ZIP))
run_command('sha1sum %s > sums.txt' % CLAZY_ZIP)
run_command('sha256sum %s >> sums.txt' % CLAZY_ZIP)
run_command('sha1sum %s >> sums.txt' % CLAZY_SRC_ZIP)
run_command('sha256sum %s >> sums.txt' % CLAZY_SRC_ZIP)
else:
run_command('sha1sum %s >> sums.txt' % CLAZY_ZIP)
run_command('sha256sum %s >> sums.txt' % CLAZY_ZIP)
run_command('wget --no-check-certificate https://github.com/KDE/clazy/archive/%s.zip -O %s' % (CANDIDATE_SHA1, CLAZY_SRC_ZIP))
run_command('sha1sum %s > sums.txt' % CLAZY_ZIP)
run_command('sha256sum %s >> sums.txt' % CLAZY_ZIP)
run_command('sha1sum %s >> sums.txt' % CLAZY_SRC_ZIP)
run_command('sha256sum %s >> sums.txt' % CLAZY_SRC_ZIP)
run_command("unzip %s -d %s" % (CLAZY_ZIP, CLAZY_ZIP_WITHOUT_EXTENSION))
print "Don't forget to delete %s after testing" % CLAZY_ZIP_WITHOUT_EXTENSION
print("Don't forget to delete %s after testing" % CLAZY_ZIP_WITHOUT_EXTENSION)
os.chdir('..')
check_env()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment