mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 03:17:53 +00:00
cppformat -> fmt
This commit is contained in:
parent
e569297d6a
commit
7f0d8184c9
2
doc/_templates/layout.html
vendored
2
doc/_templates/layout.html
vendored
@ -4,7 +4,7 @@
|
||||
<meta name="description" content="Small, safe and fast formatting library for C++">
|
||||
<meta name="keywords" content="C++, formatting, printf, string, library">
|
||||
<meta name="author" content="Victor Zverovich">
|
||||
<link rel="stylesheet" href="_static/cppformat.css">
|
||||
<link rel="stylesheet" href="_static/fmt.css">
|
||||
{# Google Analytics #}
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
|
@ -76,7 +76,7 @@ def build_docs(version='dev'):
|
||||
FMT_USE_USER_DEFINED_LITERALS=1 \
|
||||
FMT_API=
|
||||
EXCLUDE_SYMBOLS = fmt::internal::* StringValue write_str
|
||||
'''.format(os.path.join(os.path.dirname(doc_dir), 'cppformat')).encode('UTF-8'))
|
||||
'''.format(os.path.join(os.path.dirname(doc_dir), 'fmt')).encode('UTF-8'))
|
||||
if p.returncode != 0:
|
||||
raise CalledProcessError(p.returncode, cmd)
|
||||
check_call(['sphinx-build',
|
||||
@ -86,8 +86,8 @@ def build_docs(version='dev'):
|
||||
try:
|
||||
check_call(['lessc', '--clean-css',
|
||||
'--include-path=' + os.path.join(doc_dir, 'bootstrap'),
|
||||
os.path.join(doc_dir, 'cppformat.less'),
|
||||
'html/_static/cppformat.css'])
|
||||
os.path.join(doc_dir, 'fmt.less'),
|
||||
'html/_static/fmt.css'])
|
||||
except OSError as e:
|
||||
if e.errno != errno.ENOENT:
|
||||
raise
|
||||
|
@ -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',
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user