I just committed a change to the Tools repository (https://bitbucket.org/cafu/tools) that adds a very simple script (
deploy.py
) that calls a new function CopyRepoToBinary()
.Source code of
deploy.py
:
Code: Select all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, subprocess
from common import CopyRepoToBinary
# This is a very simple test for the newly written functions in `common.py`.
# It essentially duplicates (some of) the functionality in `make_binary.py`,
# but in a manner that is easier to re-use, to maintain, and to adapt to new
# purposes.
# Please see the documentation of this function in `common.py` for details.
CopyRepoToBinary("../Cafu", "Cafu-copy-test")
CopyRepoToBinary()
(in common.py
):
Code: Select all
Creates a "binary release" directory `DestDir` from a Cafu source code
repository `SourceDir`.
The directory `SourceDir` must be the root directory of a Cafu source code
repository checkout in which in which all programs and libraries have already
successfully been built, all maps files have already been compiled, all
texture images are present, etc.
The directory `DestDir` is newly created and intended to be used as a public,
binary release of the Cafu Engine and games developed with it (possibly after
further packaging, e.g. as a zip file). An exeption is thrown if `DestDir`
already exists.
Code: Select all
d:\Dev>dir
Verzeichnis von d:\Dev
20.04.2014 23:15 <DIR> .
20.04.2014 23:15 <DIR> ..
25.04.2014 14:27 <DIR> Cafu
25.04.2014 23:12 <DIR> Tools
[...]
d:\Dev>cd Tools
d:\Dev\Tools>python deploy.py
d:\Dev\Tools>dir
Verzeichnis von d:\Dev\Tools
25.04.2014 23:12 <DIR> .
25.04.2014 23:12 <DIR> ..
25.04.2014 23:42 <DIR> Cafu-copy-test # newly created by deploy.py
23.10.2013 20:35 79 .gitattributes
23.10.2013 20:35 6 .gitignore
23.10.2013 20:35 2.305 BalanceDetailMap.cpp
25.04.2014 23:13 3.625 check_source.py
[...]
Cafu-copy-test
contains a stand-alone, self-contained, binary-only edition of Cafu, ready for release or further processing (e.g. packing into a zip file, upload to FTP site, etc.).My further plan for the scripts in the Tools repository is to further split the well-working, but rather monolithic functionality of the `make_binary.py` and `make_source.py` scripts into smaller functions that can act independent of each other, so that eventually a set of functions results that is easy to use and (re-)combine, so that deployment tasks involving the Cafu Engine can easily and robustly be solved.