cppformat -> fmt

This commit is contained in:
Victor Zverovich
2016-04-24 10:39:33 -07:00
parent e569297d6a
commit 7f0d8184c9
5 changed files with 18 additions and 18 deletions

View File

@@ -136,16 +136,16 @@ if __name__ == '__main__':
workdir = tempfile.mkdtemp()
try:
run = Runner()
cppformat_dir = os.path.join(workdir, 'cppformat')
fmt_dir = os.path.join(workdir, 'fmt')
branch = args.get('<branch>', 'master')
run('git', 'clone', '-b', branch, 'git@github.com:cppformat/cppformat.git', cppformat_dir)
run('git', 'clone', '-b', branch, 'git@github.com:cppformat/cppformat.git', fmt_dir)
# Convert changelog from RST to GitHub-flavored Markdown and get the version.
changelog = 'ChangeLog.rst'
changelog_path = os.path.join(cppformat_dir, changelog)
changelog_path = os.path.join(fmt_dir, changelog)
changes, version = core.publish_file(source_path=changelog_path, writer=MDWriter())
cmakelists = 'CMakeLists.txt'
for line in fileinput.input(os.path.join(cppformat_dir, cmakelists), inplace=True):
for line in fileinput.input(os.path.join(fmt_dir, cmakelists), inplace=True):
prefix = 'set(FMT_VERSION '
if line.startswith(prefix):
line = prefix + version + ')\n'
@@ -162,7 +162,7 @@ if __name__ == '__main__':
line = '-' * title_len + '\n'
title_len = 0
sys.stdout.write(line)
run.cwd = cppformat_dir
run.cwd = fmt_dir
run('git', 'checkout', '-b', 'release')
run('git', 'add', changelog, cmakelists)
run('git', 'commit', '-m', 'Update version')
@@ -173,14 +173,14 @@ if __name__ == '__main__':
site_dir = os.path.join(workdir, 'cppformat.github.io')
run('git', 'clone', 'git@github.com:cppformat/cppformat.github.io.git', site_dir)
doc_dir = os.path.join(site_dir, version)
shutil.copytree(os.path.join(cppformat_dir, 'doc', 'html'), doc_dir,
shutil.copytree(os.path.join(fmt_dir, 'doc', 'html'), doc_dir,
ignore=shutil.ignore_patterns('.doctrees', '.buildinfo'))
run.cwd = site_dir
run('git', 'add', doc_dir)
run('git', 'commit', '-m', 'Update docs')
# Create a release on GitHub.
run('git', 'push', 'origin', 'release', cwd=cppformat_dir)
run('git', 'push', 'origin', 'release', cwd=fmt_dir)
r = requests.post('https://api.github.com/repos/cppformat/cppformat/releases',
params={'access_token': os.getenv('CPPFORMAT_TOKEN')},
data=json.dumps({'tag_name': version, 'target_commitish': 'release',

View File

@@ -19,7 +19,7 @@ def makedirs_if_not_exist(dir):
if e.errno != errno.EEXIST:
raise
cppformat_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
fmt_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
build = os.environ['BUILD']
if build == 'Doc':
@@ -41,7 +41,7 @@ if build == 'Doc':
urllib.urlretrieve('http://mirrors.kernel.org/ubuntu/pool/main/d/doxygen/' +
deb_file, deb_file)
check_call(['sudo', 'dpkg', '-i', deb_file])
sys.path.insert(0, os.path.join(cppformat_dir, 'doc'))
sys.path.insert(0, os.path.join(fmt_dir, 'doc'))
import build
html_dir = build.build_docs()
repo = 'cppformat.github.io'
@@ -76,9 +76,9 @@ if build == 'Doc':
exit(0)
standard = os.environ['STANDARD']
install_dir = os.path.join(cppformat_dir, "_install")
build_dir = os.path.join(cppformat_dir, "_build")
test_build_dir = os.path.join(cppformat_dir, "_build_test")
install_dir = os.path.join(fmt_dir, "_install")
build_dir = os.path.join(fmt_dir, "_build")
test_build_dir = os.path.join(fmt_dir, "_build_test")
# Configure library.
makedirs_if_not_exist(build_dir)
@@ -88,7 +88,7 @@ common_cmake_flags = [
extra_cmake_flags = []
if standard != '0x':
extra_cmake_flags = ['-DCMAKE_CXX_FLAGS=-std=c++' + standard, '-DFMT_USE_CPP11=OFF']
check_call(['cmake', '-DFMT_DOC=OFF', '-DFMT_PEDANTIC=ON', cppformat_dir] +
check_call(['cmake', '-DFMT_DOC=OFF', '-DFMT_PEDANTIC=ON', fmt_dir] +
common_cmake_flags + extra_cmake_flags, cwd=build_dir)
# Build library.
@@ -108,6 +108,6 @@ check_call(['make', 'install'], cwd=build_dir)
# Test installation.
makedirs_if_not_exist(test_build_dir)
check_call(['cmake', '-DCMAKE_CXX_FLAGS=-std=c++' + standard,
os.path.join(cppformat_dir, "test", "find-package-test")] +
os.path.join(fmt_dir, "test", "find-package-test")] +
common_cmake_flags, cwd=test_build_dir)
check_call(['make', '-j4'], cwd=test_build_dir)