cleaning up pubsync pipeline

This commit is contained in:
Eric Froemling 2020-03-22 19:36:08 -07:00
parent 1beadbd27c
commit 82f87af5eb
4 changed files with 21 additions and 10 deletions

View File

@ -1394,6 +1394,7 @@
<w>rcfile</w>
<w>rdict</w>
<w>rdir</w>
<w>readlines</w>
<w>realpath</w>
<w>realsies</w>
<w>recache</w>

View File

@ -34,10 +34,10 @@ if TYPE_CHECKING:
from typing import Dict, List, Tuple, Union, Optional, Type, Set
import ba
# The API version of this build of the game.
# The meta api version of this build of the game.
# Only packages and modules requiring this exact api version
# will be considered when scanning directories.
# See bombsquadgame.com/apichanges for differences between api versions.
# See https://github.com/efroemling/ballistica/wiki/Using-ba_meta-Tags
CURRENT_API_VERSION = 6

View File

@ -1,5 +1,4 @@
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
<!--DOCSHASH=4cc8408fc43e408917a230a60d830e14-->
<h4><em>last updated on 2020-03-22 for Ballistica version 1.5.0 build 20001</em></h4>
<p>This page documents the Python classes and functions in the 'ba' module,
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>

View File

@ -665,6 +665,11 @@ def update_docs_md() -> None:
docs_path = 'docs/ba_module.md'
# We store the hash in a separate file that only exists on private
# so public isn't full of constant hash change commits.
# (don't care so much on private)
docs_hash_path = 'docs/ba_module_hash'
# Generate a hash from all c/c++ sources under the python subdir
# as well as all python scripts.
pysources = []
@ -683,11 +688,13 @@ def update_docs_md() -> None:
curhash = get_files_hash(pysources)
# Extract the current embedded hash.
with open(docs_path) as infile:
lines = infile.readlines()
hashlines = [l for l in lines if '<!--DOCSHASH=' in l]
assert len(hashlines) == 1
storedhash = hashlines[0][13:-4]
# with open(docs_path) as infile:
# lines = infile.readlines()
# hashlines = [l for l in lines if '<!--DOCSHASH=' in l]
# assert len(hashlines) == 1
# storedhash = hashlines[0][13:-4]
with open(docs_hash_path) as infile:
storedhash = infile.read()
if curhash != storedhash:
if check:
@ -700,10 +707,14 @@ def update_docs_md() -> None:
# bits at the top.
with open('build/docs.html') as infile:
docs = infile.read()
docs = ('<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->\n'
f'<!--DOCSHASH={curhash}-->\n') + docs
docs = (
'<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->\n'
# f'<!--DOCSHASH={curhash}-->\n'
) + docs
with open(docs_path, 'w') as outfile:
outfile.write(docs)
with open(docs_hash_path, 'w') as outfile:
outfile.write(curhash)
print(f'{docs_path} is up to date.')