forked from ooici/ioncore-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
141 lines (126 loc) · 4.51 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!-- Ant build file for LCAarch -->
<project name="LCAarch" default="info" basedir=".">
<description>
This is the ANT build file for the LCAarch OOI CI Python capability
container and service platform.
</description>
<!-- load python specific ant tasks from jar file -->
<taskdef resource="pyAntTasks.properties" classpath="res/lib/pyAntTasks-1.3.3.jar"/>
<!-- set global properties for this build -->
<property name="src" location="ion"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<target name="info">
<echo message="LCAarch ant build file. Specify a target to build"/>
</target>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
</target>
<target name="compile" depends="init"
description="compile the source">
<!-- Precompiles all Python code without executing. Finds compile errors -->
<py-compile dir="${src}" pythonpath="${src}" optimize="0"/>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}/lib"/>
</target>
<target name="clean"
description="clean up" >
<delete>
<fileset dir="${src}" includes="**/*.pyc"/>
</delete>
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="ioncore.egg-info"/>
<delete dir="_trial_temp"/>
<echo message="Use 'ant clean-buildout' if you want to clean out buildout directories as well."/>
</target>
<target name="clean-buildout"
description="clean up buildout dirs" depends="clean" >
<echo message="Clean up buildout directories. Please run `python bootstrap.py` to start buildout."/>
<delete dir="parts"/>
<delete dir="develop-eggs"/>
<delete dir="bin"/>
<delete dir="downloads"/>
<delete dir="eggs"/>
<delete file=".installed.cfg"/>
</target>
<target name="pipclean"
description="Uninstall dependencies using Pip">
<echo message="Uninstall dependencies using Pip"/>
<exec executable="pip">
<arg value="uninstall"/>
<arg value="-y"/>
<arg value="--requirement=requirements.txt"/>
</exec>
</target>
<property environment="env"/>
<target name="cleanpipbuild"
description="rm virtual env build dir left over by pip" if="env.VIRTUAL_ENV" >
<echo message="rm virtual env build dir left over by pip"/>
<exec executable="rm">
<arg value="-rf"/>
<arg value="${env.VIRTUAL_ENV}/build"/>
</exec>
</target>
<target name="pipinstall"
description="Install dependencies using Pip" depends="cleanpipbuild">
<echo message="Installing dependencies using Pip"/>
<exec executable="pip" failonerror="true">
<arg value="install"/>
<arg value="--upgrade"/>
<arg value="--find-links=http://ooici.net/packages"/>
<arg value="--requirement=requirements.txt"/>
</exec>
</target>
<target name="install" depends="clean"
description="Install dependencies" >
<!-- Run new empty capability container without shell -->
<echo message="Installing dependencies"/>
<exec executable="python">
<arg value="setup.py"/>
<arg value="install"/>
</exec>
</target>
<target name="newcc" depends=""
description="start a Python CC" >
<!-- Run new empty capability container without shell -->
<echo message="Starting empty ION PyCC with sysname=${user.name}"/>
<exec executable="twistd">
<arg value="-n"/>
<arg value="--logfile=-"/>
<arg value="magnet"/>
<arg value="-h"/>
<arg value="amoeba.ucsd.edu"/>
<arg value="-a"/>
<arg value="sysname=${user.name}"/>
<arg value="-n"/>
<arg value="res/scripts/newcc.py"/>
</exec>
</target>
<target name="javalca" depends=""
description="start Python CC with Java Integration LCA Demo" >
<!-- Run new empty capability container without shell -->
<echo message="Starting ION PyCC with sysname=${user.name}"/>
<exec executable="twistd">
<arg value="-n"/>
<arg value="--logfile=-"/>
<arg value="magnet"/>
<arg value="-h"/>
<arg value="amoeba.ucsd.edu"/>
<arg value="-a"/>
<arg value="sysname=${user.name}"/>
<arg value="-n"/>
<arg value="res/scripts/javalca.py"/>
</exec>
</target>
<target name="test" depends="clean, pipinstall"
description="exdecutes all trial unit test cases" >
<exec executable="trial">
<arg value="${src}"/>
</exec>
</target>
</project>