Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
f62e225e
Commit
f62e225e
authored
Feb 02, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically update version in release script (#431)
parent
94806747
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
support/manage.py
support/manage.py
+20
-6
No files found.
support/manage.py
View file @
f62e225e
...
...
@@ -8,7 +8,7 @@ Usage:
"""
from
__future__
import
print_function
import
datetime
,
docopt
,
fileinput
,
json
,
os
import
datetime
,
docopt
,
errno
,
fileinput
,
json
,
os
import
re
,
requests
,
shutil
,
sys
,
tempfile
from
contextlib
import
contextmanager
from
distutils.version
import
LooseVersion
...
...
@@ -80,6 +80,7 @@ def create_build_env():
import
build
env
.
build_dir
=
'build'
env
.
versions
=
build
.
versions
# Virtualenv and repos are cached to speed up builds.
build
.
create_build_env
(
os
.
path
.
join
(
env
.
build_dir
,
'virtualenv'
))
...
...
@@ -113,7 +114,7 @@ def update_site(env):
doc_repo
=
Git
(
os
.
path
.
join
(
env
.
build_dir
,
'fmtlib.github.io'
))
doc_repo
.
update
(
'git@github.com:fmtlib/fmtlib.github.io'
)
for
version
in
[
'1.0.0'
,
'1.1.0'
,
'2.0.0'
,
'3.0.0'
]
:
for
version
in
env
.
versions
:
clean_checkout
(
env
.
fmt_repo
,
version
)
target_doc_dir
=
os
.
path
.
join
(
env
.
fmt_repo
.
dir
,
'doc'
)
# Remove the old theme.
...
...
@@ -140,6 +141,7 @@ def update_site(env):
b
.
data
=
re
.
sub
(
pattern
,
r'doxygenfunction:: \1(int)'
,
b
.
data
)
b
.
data
=
b
.
data
.
replace
(
'std::FILE*'
,
'std::FILE *'
)
b
.
data
=
b
.
data
.
replace
(
'unsigned int'
,
'unsigned'
)
b
.
data
=
b
.
data
.
replace
(
'operator""_'
,
'operator"" _'
)
# Fix a broken link in index.rst.
index
=
os
.
path
.
join
(
target_doc_dir
,
'index.rst'
)
with
rewrite
(
index
)
as
b
:
...
...
@@ -165,7 +167,11 @@ def update_site(env):
os
.
symlink
(
target
,
link
)
# Copy docs to the website.
version_doc_dir
=
os
.
path
.
join
(
doc_repo
.
dir
,
version
)
shutil
.
rmtree
(
version_doc_dir
)
try
:
shutil
.
rmtree
(
version_doc_dir
)
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
ENOENT
:
raise
shutil
.
move
(
html_dir
,
version_doc_dir
)
...
...
@@ -204,16 +210,24 @@ def release(args):
line
=
'-'
*
title_len
+
'
\n
'
title_len
=
0
sys
.
stdout
.
write
(
line
)
# TODO: add new version to manage.py
# Add the version to the build script.
script
=
os
.
path
.
join
(
'doc'
,
'build.py'
)
script_path
=
os
.
path
.
join
(
fmt_repo
.
dir
,
script
)
for
line
in
fileinput
.
input
(
script_path
,
inplace
=
True
):
m
=
re
.
match
(
r'( *versions = )\[(.+)\]'
,
line
)
if
m
:
line
=
'{}[{},
\'
{}
\'
]
\n
'
.
format
(
m
.
group
(
1
),
m
.
group
(
2
),
version
)
sys
.
stdout
.
write
(
line
)
fmt_repo
.
checkout
(
'-B'
,
'release'
)
fmt_repo
.
add
(
changelog
,
cmakelists
)
fmt_repo
.
add
(
changelog
,
cmakelists
,
script
)
fmt_repo
.
commit
(
'-m'
,
'Update version'
)
# Build the docs and package.
run
=
Runner
(
fmt_repo
.
dir
)
run
(
'cmake'
,
'.'
)
run
(
'make'
,
'doc'
,
'package_source'
)
update_site
(
env
)
# Create a release on GitHub.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment