-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
79 lines (69 loc) · 3.1 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<project name="Enarksh-Lib" default="build" basedir=".">
<taskdef name="readSemanticVersion" classname="vendor.setbased.phing-extensions.src.Task.ReadSemanticVersionTask"/>
<property name="BUILD_DIR" value="./build"/>
<property name="VERSION" value="0.0.0"/>
<!-- Run composer update and executes various other updates -->
<target name="composer-update">
<exec command="composer update" checkreturn="true" passthru="true"/>
</target>
<!-- Creates a new version/release. -->
<!-- @todo replace semantic version with pep-396 -->
<target name="version">
<readSemanticVersion file=".version"
versionProperty="VERSION"
haltOnError="true"/>
<reflexive>
<fileset dir=".">
<include name="setup.py"/>
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="version=.*" replace="version='${VERSION}',"/>
</replaceregexp>
</filterchain>
</reflexive>
<gitcommit repository="." message="Release: ${VERSION}" allFiles="true"/>
<gitpush repository="."/>
<gittag repository="." name="${VERSION}"/>
<gitpush repository="." refspec="${VERSION}" quiet="false"/>
</target>
<!-- Creates a new distribution using setup.py -->
<target name="dist">
<exec command="python3 setup.py sdist" passthru="true" checkreturn="true"/>
</target>
<!-- Uploads a distribution to PyPI -->
<target name="upload">
<loadfile property="VERSION" file=".version"/>
<exec command="twine upload dist/Enarksh-Lib-${VERSION}.tar.gz" passthru="true" checkreturn="true"/>
</target>
<!-- All steps for releasing a new version -->
<target name="new-version" depends="version,dist,upload"/>
<!-- Checks the code with pylint -->
<target name="pylint">
<exec command="pylint --rcfile pylintrc pystratum" passthru="true"/>
</target>
<!-- Generates the API documentation -->
<target name="apidoc">
<delete includeemptydirs="true" verbose="false" failonerror="true">
<fileset dir="source">
<include name="**"/>
<exclude name="conf.py"/>
<exclude name="index.rst"/>
<exclude name="Makefile"/>
<exclude name="modules.rst"/>
<exclude name="_static"/>
</fileset>
</delete>
<exec command="sphinx-apidoc-3 -f pystratum/ -d 4 -e -P -o source/" passthru="true" checkreturn="true"/>
<exec command="sphinx-build-3 -b html -d build/doctrees source build/html" passthru="true" checkreturn="true"/>
</target>
<!-- Runs all unit tests-->
<target name="unit">
<exec command="coverage3 run -m unittest discover -s test -p *Test.py" passthru="true" checkreturn="true"/>
<exec command="coverage3 html" passthru="true" checkreturn="true"/>
</target>
<!-- Default target -->
<target name="build">
<echo msg="And Now for Something Completely Different"/>
</target>
</project>