-
Notifications
You must be signed in to change notification settings - Fork 390
/
SConscript
39 lines (27 loc) · 1.62 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
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
# -*- mode: python; -*-
Import('CfgmEnv')
env = CfgmEnv.Clone()
import os
import shutil
doc_sources_rules = []
sphinxapidocs = ['gen.rst', 'modules.rst']
if os.path.exists('/usr/bin/sphinx-apidoc'):
apidoc_rule = env.Command(sphinxapidocs, '', 'SPHINX_APIDOC_OPTIONS="members,show-inheritance" sphinx-apidoc -f -o ' + Dir('.').path + ' ' + Dir('../vnc_cfg_api_server/gen').path + ' ' + Dir('.').path)
env.Depends(apidoc_rule, File(env['TOP'] + '/config/api-server/vnc_cfg_api_server/gen/__init__.py'))
userdoc_rule = env.Install(Dir('.'), Glob('#controller/src/config/api-server/doc/source/*'))
schema_rule = env.Install(Dir('.'), Glob('#controller/src/schema/*.xsd'))
gendoc_rule = env.Install(Dir('.'), env['TOP'] + '/config/api-server/vnc_cfg_api_server/gen/contrail_openapi.rst')
openapi_rule = env.Install(Dir('.'), env['TOP'] + '/config/api-server/vnc_cfg_api_server/gen/contrail_openapi.json')
html_gen_rule = env.Command('contrail-config', ['Makefile', 'conf.py'],
'make -C ' + Dir('.').path + ' html')
env.Depends(html_gen_rule,
[apidoc_rule, gendoc_rule, userdoc_rule, schema_rule, openapi_rule])
doc_sources_rules.append(env.Install("../vnc_cfg_api_server", Dir('.')))
env.Depends(doc_sources_rules, html_gen_rule)
env.Requires(doc_sources_rules, File(env['TOP'] + '/config/api-server/vnc_cfg_api_server/vnc_cfg_api_server.py'))
if 'install' in BUILD_TARGETS:
env.Alias('install', env.Install(env['INSTALL_DOC']+'/contrail-config', doc_sources_rules))
Return('doc_sources_rules')