forked from SDoc/SDoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
114 lines (100 loc) · 5.06 KB
/
build.xml
File metadata and controls
114 lines (100 loc) · 5.06 KB
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
108
109
110
111
112
113
114
<project name="SDoc" 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"/>
<property name="ANTLR4" value="java -jar /usr/local/lib/antlr-4.5.3-complete.jar"/>
<property name="GRUN" value="java org.antlr.v4.gui.TestRig"/>
<!-- 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>
<reflexive>
<fileset dir=".">
<include name="sdoc/application/SdocApplication.py"/>
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="Application.__init__\(self, 'SDoc', .*"
replace="Application.__init__(self, 'SDoc', '${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/SDoc-${VERSION}.tar.gz" passthru="true" checkreturn="true"/>
</target>
<!-- All steps for releasing a new version -->
<target name="new-version" depends="version,dist,upload"/>
<target name="antlr1">
<exec command="${ANTLR4} -Dlanguage=Python3 -visitor -no-listener -lib sdoc/antlr sdoc/antlr/sdoc1Lexer.g4" passthru="true" checkreturn="true"/>
<exec command="${ANTLR4} -Dlanguage=Python3 -visitor -no-listener -lib sdoc/antlr sdoc/antlr/sdoc1Parser.g4" passthru="true" checkreturn="true"/>
</target>
<target name="antlr2">
<exec command="${ANTLR4} -Dlanguage=Python3 -visitor -no-listener -lib sdoc/antlr sdoc/antlr/sdoc2Lexer.g4" passthru="true" checkreturn="true"/>
<exec command="${ANTLR4} -Dlanguage=Python3 -visitor -no-listener -lib sdoc/antlr sdoc/antlr/sdoc2Parser.g4" passthru="true" checkreturn="true"/>
</target>
<target name="antlr" depends="antlr1,antlr2"/>
<target name="grun-test1" depends="antlr1">
<exec command="${ANTLR4} -lib sdoc/antlr sdoc/antlr/sdoc1Lexer.g4" passthru="true" checkreturn="true"/>
<exec command="${ANTLR4} -lib sdoc/antlr sdoc/antlr/sdoc1Parser.g4" passthru="true" checkreturn="true"/>
<exec command="javac sdoc/antlr/sdoc1*.java" passthru="true" checkreturn="true"/>
<exec command="cd sdoc/antlr; ${GRUN} sdoc1 sdoc -gui ../../test1.sdoc" passthru="true" checkreturn="true"/>
<delete>
<fileset dir="sdoc/antlr">
<include name="*.java"/>
<include name="*.class"/>
</fileset>
</delete>
</target>
<target name="grun-test2" depends="antlr2">
<exec command="${ANTLR4} -lib sdoc/antlr sdoc/antlr/sdoc2Lexer.g4" passthru="true" checkreturn="true"/>
<exec command="${ANTLR4} -lib sdoc/antlr sdoc/antlr/sdoc2Parser.g4" passthru="true" checkreturn="true"/>
<exec command="javac sdoc/antlr/sdoc2*.java" passthru="true" checkreturn="true"/>
<exec command="cd sdoc/antlr; ${GRUN} sdoc2 sdoc -gui ../../test2.sdoc" passthru="true" checkreturn="true"/>
<delete>
<fileset dir="sdoc/antlr">
<include name="*.java"/>
<include name="*.class"/>
</fileset>
</delete>
</target>
<!-- Checks the code with pylint -->
<target name="pylint">
<exec command="pylint --rcfile pylintrc --ignore=antlr -extension-pkg-whitelist=antlr,antlr4 sdoc" passthru="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>