summaryrefslogtreecommitdiffstats
path: root/test/Actions/pre-post-fixture/work2/SConstruct
blob: 61f739f69b195018e3981ccb227554af852b2442 (plain)
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
def b(target, source, env):
    open(str(target[0]), 'wb').write((env['X'] + '\n').encode())
env1 = Environment(X='111')
env2 = Environment(X='222')
B = Builder(action = b, env = env1, multi=1)
print("B =", B)
print("B.env =", B.env)
env1.Append(BUILDERS = {'B' : B})
env2.Append(BUILDERS = {'B' : B})
env3 = env1.Clone(X='333')
print("env1 =", env1)
print("env2 =", env2)
print("env3 =", env3)
f1 = env1.B(File('file1.out'), [])
f2 = env2.B('file2.out', [])
f3 = env3.B('file3.out', [])
def do_nothing(env, target, source):
    pass
AddPreAction(f2[0], do_nothing)
AddPostAction(f3[0], do_nothing)
print("f1[0].builder =", f1[0].builder)
print("f2[0].builder =", f2[0].builder)
print("f3[0].builder =", f3[0].builder)
print("f1[0].env =", f1[0].env)
print("f2[0].env =", f2[0].env)
print("f3[0].env =", f3[0].env)