-
Notifications
You must be signed in to change notification settings - Fork 390
/
SConscript
114 lines (91 loc) · 3.42 KB
/
SConscript
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
# -*- mode: python; -*-
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
Import('BuildEnv')
OpEnv = BuildEnv.Clone()
setup_sources = [
'setup.py',
'MANIFEST.in',
]
setup_sources_rules = []
for file in setup_sources:
setup_sources_rules.append(
OpEnv.Install(Dir("."), '#controller/src/nodemgr/' + file))
local_sources = [
'__init__.py',
'main.py'
]
local_sources_rules = []
for file in local_sources:
local_sources_rules.append(OpEnv.Install(Dir("nodemgr"), file))
analytics_sources = [
'__init__.py',
'analytics_nodemgr/analytics_event_manager.py'
]
analytics_sources_rules = []
for file in analytics_sources:
analytics_sources_rules.append(OpEnv.Install(Dir("nodemgr/analytics_nodemgr"), file))
control_sources = [
'__init__.py',
'control_nodemgr/control_event_manager.py'
]
control_sources_rules = []
for file in control_sources:
control_sources_rules.append(OpEnv.Install(Dir("nodemgr/control_nodemgr"), file))
config_sources = [
'__init__.py',
'config_nodemgr/config_event_manager.py'
]
config_sources_rules = []
for file in config_sources:
config_sources_rules.append(OpEnv.Install(Dir("nodemgr/config_nodemgr"), file))
vrouter_sources = [
'__init__.py',
'vrouter_nodemgr/vrouter_process_stat.py',
'vrouter_nodemgr/loadbalancer_stats.py',
'vrouter_nodemgr/haproxy_stats.py',
'vrouter_nodemgr/vrouter_event_manager.py'
]
vrouter_sources_rules = []
for file in vrouter_sources:
vrouter_sources_rules.append(OpEnv.Install(Dir("nodemgr/vrouter_nodemgr"), file))
database_sources = [
'__init__.py',
'database_nodemgr/database_event_manager.py'
]
database_sources_rules = []
for file in database_sources:
database_sources_rules.append(OpEnv.Install(Dir("nodemgr/database_nodemgr"), file))
common_sources = [
'__init__.py',
'common/event_manager.py',
'common/process_stat.py',
'common/event_listener_protocol_nodemgr.py',
'common/cpuinfo.py',
]
common_sources_rules = []
for file in common_sources:
common_sources_rules.append(OpEnv.Install(Dir("nodemgr/common"), file))
cpu_info_pkg = OpEnv.SandeshGenPy('#controller/src/base/sandesh/cpuinfo.sandesh', 'nodemgr/common/sandesh/', False)
rel_path = Dir('nodemgr/common').path
def BuildInfoAction(target, source, env):
env.GenerateBuildInfoPyCode(path=rel_path)
build_info_rules = [OpEnv.Command(target='buildinfo.py', source = None, action=BuildInfoAction)]
sdist_depends = [setup_sources_rules, local_sources_rules, analytics_sources_rules,
control_sources_rules, config_sources_rules, common_sources_rules,
vrouter_sources_rules, database_sources_rules, build_info_rules,
cpu_info_pkg
]
cd_cmd = 'cd ' + Dir('.').path + ' && '
sdist_gen = OpEnv.Command('dist/nodemgr-0.1dev.tar.gz', 'setup.py',
cd_cmd + 'python setup.py sdist')
OpEnv.Depends(sdist_gen, sdist_depends)
OpEnv.Default(sdist_gen)
OpEnv.Alias("src:nodemgr", sdist_gen)
OpEnv.Alias("contrail-nodemgr", sdist_gen)
#dummy scons target for nodemgr test
test_suite = [ ]
test_cmd = OpEnv.TestSuite('contrail-nodemgr-test', test_suite)
OpEnv.Alias('contrail-nodemgr:test', test_cmd)