forked from semuconsulting/pyubx2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
107 lines (107 loc) · 3.63 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version = "1.0"?>
<project name="pyubx2" default="build">
<property name="module.name" value="pyubx2" />
<property name="version" value="1.1.4" />
<condition property="python" value="python">
<os family="windows" />
</condition>
<condition property="python" value="/Library/Frameworks/Python.framework/Versions/3.9/bin/python3">
<os family="mac" />
</condition>
<condition property="python" value="/usr/bin/python3">
<os family="unix" />
</condition>
<condition property="make" value="docs/make.bat">
<os family="windows" />
</condition>
<condition property="makedir" value="${user.dir}">
<os family="windows" />
</condition>
<condition property="make" value="/usr/bin/make">
<os family="mac" />
</condition>
<condition property="makedir" value="${user.dir}/docs">
<os family="mac" />
</condition>
<condition property="make" value="/usr/bin/make">
<os family="unix" />
</condition>
<condition property="makedir" value="${user.dir}/docs">
<os family="unix" />
</condition>
<property name="sphinx" value="sphinx-apidoc" />
<property name="test_args" value="tests/testsuite.py" />
<property name="analyse_args" value="-m pylint --reports=y ${module.name}" />
<property name="format_args" value="-m black ${module.name}" />
<property name="build_args" value="setup.py sdist bdist_wheel" />
<property name="deploy_args" value="-m twine upload --config-file .pypirc dist/*" />
<property name="install_args" value="-m pip install dist/${ant.project.name}-${version}.tar.gz --user --force-reinstall" />
<property name="coverage_args" value="-m coverage run --source=${module.name} -m pytest" />
<property name="coverage_html_args" value="-m coverage html" />
<property name="apidoc_args" value="-f -o docs ${module.name}" />
<property name="html_args" value="html" />
<target name="clean">
<echo>Cleaning...</echo>
<delete includeEmptyDirs="true" quiet="true" failonerror="false">
<fileset dir="build" />
<fileset dir="dist" />
<fileset dir="htmlcov" />
<fileset dir="docs/_build" />
<fileset dir="${ant.project.name}.egg-info" />
</delete>
</target>
<target name="format" depends="clean">
<echo>Formatting...</echo>
<exec executable="${python}">
<arg line="${format_args}" />
</exec>
</target>
<target name="analyse" depends="format">
<echo>Analysing...</echo>
<exec executable="${python}">
<arg line="${analyse_args}" />
</exec>
</target>
<target name="build" depends="analyse">
<echo>Building...</echo>
<exec executable="${python}">
<arg line="${build_args}" />
</exec>
</target>
<target name="test" depends="build">
<echo>Testing...</echo>
<exec executable="${python}">
<arg line="${test_args}" />
</exec>
</target>
<target name = "coverage" depends="test">
<echo>Assessing Test Coverage...</echo>
<exec executable="${python}">
<arg line="${coverage_args}"/>
</exec>
<exec executable="${python}">
<arg line="${coverage_html_args}"/>
</exec>
</target>
<target name = "document" depends="coverage">
<echo>Documenting...</echo>
<exec executable="${sphinx}">
<arg line="${apidoc_args}"/>
</exec>
<exec executable="${make}" dir="${makedir}">
<arg line="${html_args}"/>
</exec>
</target>
<target name = "install_locally" depends="document">
<echo>Installing Locally...</echo>
<exec executable="${python}">
<arg line="${install_args}"/>
</exec>
</target>
<target name = "deploy" depends="build">
<echo>Deploying...</echo>
<exec executable="${python}">
<arg line="${deploy_args}"/>
</exec>
</target>
</project>