1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 from buildbot import util
18 from buildbot.process.base import Build
19 from buildbot.process.buildstep import BuildStep
20 from buildbot.steps.source import CVS, SVN
21 from buildbot.steps.shell import Configure, Compile, Test, PerlModuleTest
22
23
24 -def s(steptype, **kwargs):
25
26
27 return (steptype, kwargs)
28
30 """When calling BuildFactory.addStep(stepinstance), addStep() only takes
31 one argument. You passed extra arguments to addStep(), which you probably
32 intended to pass to your BuildStep constructor instead. For example, you
33 should do::
34
35 f.addStep(ShellCommand(command=['echo','stuff'], haltOnFailure=True))
36
37 instead of::
38
39 f.addStep(ShellCommand(command=['echo','stuff']), haltOnFailure=True)
40 """
41
43 """
44 @cvar buildClass: class to use when creating builds
45 @type buildClass: L{buildbot.process.base.Build}
46 """
47 buildClass = Build
48 useProgress = 1
49 workdir = "build"
50 compare_attrs = ['buildClass', 'steps', 'useProgress', 'workdir']
51
56
61
71
72 - def addStep(self, step_or_factory, **kwargs):
73 if isinstance(step_or_factory, BuildStep):
74 if kwargs:
75 raise ArgumentsInTheWrongPlace()
76 s = step_or_factory.getStepFactory()
77 elif type(step_or_factory) == type(BuildStep) and \
78 issubclass(step_or_factory, BuildStep):
79 s = (step_or_factory, dict(kwargs))
80 else:
81 raise ValueError('%r is not a BuildStep nor BuildStep subclass' % step_or_factory)
82 self.steps.append(s)
83
87
88
89
91 - def __init__(self, source, configure="./configure",
92 configureEnv={},
93 configureFlags=[],
94 compile=["make", "all"],
95 test=["make", "check"]):
115
116 -class CPAN(BuildFactory):
117 - def __init__(self, source, perl="perl"):
122
124 - def __init__(self, source, python="python", test=None):
129
130 -class Trial(BuildFactory):
131 """Build a python module that uses distutils and trial. Set 'tests' to
132 the module in which the tests can be found, or set useTestCaseNames=True
133 to always have trial figure out which tests to run (based upon which
134 files have been changed).
135
136 See docs/factories.xhtml for usage samples. Not all of the Trial
137 BuildStep options are available here, only the most commonly used ones.
138 To get complete access, you will need to create a custom
139 BuildFactory."""
140
141 trial = "trial"
142 randomly = False
143 recurse = False
144
145 - def __init__(self, source,
146 buildpython=["python"], trialpython=[], trial=None,
147 testpath=".", randomly=None, recurse=None,
148 tests=None, useTestCaseNames=False, env=None):
149 BuildFactory.__init__(self, [source])
150 assert tests or useTestCaseNames, "must use one or the other"
151 if trial is not None:
152 self.trial = trial
153 if randomly is not None:
154 self.randomly = randomly
155 if recurse is not None:
156 self.recurse = recurse
157
158 from buildbot.steps.python_twisted import Trial
159 buildcommand = buildpython + ["./setup.py", "build"]
160 self.addStep(Compile, command=buildcommand, env=env)
161 self.addStep(Trial,
162 python=trialpython, trial=self.trial,
163 testpath=testpath,
164 tests=tests, testChanges=useTestCaseNames,
165 randomly=self.randomly,
166 recurse=self.recurse,
167 env=env,
168 )
169
170
171
172
173
174
175 ConfigurableBuildFactory = BuildFactory
176
178
179
180 - def __init__(self, cvsroot, cvsmodule,
181 configure=None, configureEnv={},
182 compile="make all",
183 test="make check", cvsCopy=False):
192
194 useProgress = False
195
196 - def __init__(self, cvsroot, cvsmodule,
197 configure=None, configureEnv={},
198 compile="make all",
199 test="make check", cvsCopy=False):
206
208
209 - def __init__(self, svnurl,
210 configure=None, configureEnv={},
211 compile="make all",
212 test="make check"):
218