forked from nvaccess/nvda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsconscript
95 lines (86 loc) · 2.63 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
###
#This file is a part of the NVDA project.
#URL: http://www.nvaccess.org/
#Copyright 2019 NV Access Limited.
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License version 2.0, as published by
#the Free Software Foundation.
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#This license can be found at:
#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
###
import os
import sys
Import("env", "outputDir", "sourceDir", "t2tBuildConf")
env = env.Clone()
devDocsOutputDir=outputDir.Dir('devDocs')
#Build the developer guide and move it to the output directory
htmlFile=env.txt2tags('developerGuide.t2t')
env.Depends(htmlFile, t2tBuildConf)
env.SideEffect('_txt2tags',htmlFile)
devGuide = env.Command(
target=devDocsOutputDir.File('developerGuide.html'),
source=htmlFile,
action=Move('$TARGET','$SOURCE')
)
env.Alias("developerGuide",devGuide)
devDocs_nvdaHelper_temp=env.Doxygen(source='../nvdaHelper/doxyfile')
devDocs_nvdaHelper = env.Command(
target=devDocsOutputDir.Dir('nvdaHelper'),
source=devDocs_nvdaHelper_temp,
action=Move('$TARGET','$SOURCE')
)
env.Alias('devDocs_nvdaHelper', devDocs_nvdaHelper)
env.Clean('devDocs_nvdaHelper', devDocs_nvdaHelper)
devDocs_nvdaHelper_readme = env.Command(
target=devDocsOutputDir.File('nvdaHelper_readme.md'),
source=env.File('../nvdaHelper/readme.md'),
action=Copy('$TARGET', '$SOURCE')
)
ignorePaths = [
'_buildVersion.py',
'comInterfaces',
'images',
'lib',
'lib64',
'libArm64',
'locale',
'louis', # Not our project
'typelibs',
'waves',
"mathType.py", # Fails when not installed
'oleTypes.py', # Not our code
'setup.py', # Py2exe
'sourceEnv.py', # Only available when running from source
]
sphinxAPIDocs = env.Command(
"api",
sourceDir,
[
[
sys.executable,
"-m", "sphinx.ext.apidoc",
# "--force", # overwrite existing files
"-P", # Include private modules
"--module-first", # put module documentation before submodule documentation
"--output-dir", "$TARGET",
"$SOURCE" # Module sources
] + [f"{sourceDir}\\{f}" for f in ignorePaths]
]
)
sphinxHtml = env.Command(
"_build",
sphinxAPIDocs,
[[
sys.executable,
"-m", "sphinx.cmd.build",
"-M", "html",
"devDocs", # Source directory
"$TARGET", # Build directory
]]
)
devDocs_nvda = env.Command(devDocsOutputDir.Dir('NVDA'), sphinxHtml, Move('$TARGET', '$SOURCE'))
env.Alias('devDocs', [devGuide, devDocs_nvda, devDocs_nvdaHelper_readme])
env.Clean('devDocs', [devGuide, devDocs_nvda, devDocs_nvdaHelper_readme])