Skip to content

Commit d50c562

Browse files
authored
Merge pull request #150 from yosupo06/issue/20
add all_combined.cpp to generated zip
2 parents 437f77b + 2f1dab5 commit d50c562

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tools/generate_zip.py

+17
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,31 @@
33
from logging import Logger, basicConfig, getLogger
44
from os import getenv
55
from pathlib import Path
6+
from subprocess import run
67
import zipfile
78

89
logger: Logger = getLogger(__name__)
910

11+
combined_cpp_main = """
12+
int main() {
13+
// write your code here
14+
return 0;
15+
}
16+
"""
17+
1018
if __name__ == "__main__":
1119
basicConfig(
1220
format="%(asctime)s [%(levelname)s] %(message)s",
1321
datefmt="%H:%M:%S",
1422
level=getenv('LOG_LEVEL', 'INFO'),
1523
)
24+
25+
# generate all_combined.cpp
26+
run(['../expander.py', '../atcoder/all', '--lib', '..'])
27+
with open('combined.cpp', 'a') as f:
28+
f.writelines(combined_cpp_main)
29+
30+
# generate zip
1631
with zipfile.ZipFile('ac-library.zip', 'w') as zipf:
1732
langs = ['en', 'ja']
1833
for lang in langs:
@@ -27,4 +42,6 @@
2742
for f in (Path('..') / 'atcoder').glob('*'):
2843
zipf.write(f, f.relative_to(Path('..')))
2944

45+
zipf.write('combined.cpp', 'all_combined.cpp');
46+
3047
zipf.write('../expander.py', 'expander.py')

0 commit comments

Comments
 (0)