-
Notifications
You must be signed in to change notification settings - Fork 6
/
Conscript
307 lines (285 loc) · 11.8 KB
/
Conscript
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
#!/usr/local/bin/perl
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is Komodo code.
#
# The Initial Developer of the Original Code is ActiveState Software Inc.
# Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
# ActiveState Software Inc. All Rights Reserved.
#
# Contributor(s):
# ActiveState Software Inc
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
Import(
"cons",
"build",
"mozComponentsDir",
"mozIdlIncludePath",
"idlExportDir",
"ranRegxpcomStateFileName",
"komodoPythonUtilsDir",
'platform',
'mozSrc',
'mozVersion',
'productType',
'buildFlavour',
'buildType',
'unsiloedPythonExe',
'komodoDevDir',
'siloedPython',
'sdkDir',
'supportDir',
'withKomodoCix',
);
# src/komodo/...
$cons->Install($idlExportDir, "src/komodo/koICodeIntel.idl");
$cons->BuildAndInstallXpt("src/komodo/koICodeIntel.idl");
$cons->InstallXpcomComponent("src/komodo/koCodeIntel.py");
$cons->InstallXpcomComponent("src/komodo/koCatalogsTree.py");
$cons->BuildAndInstallXpt("src/komodo/koIScintillaAutoCompleteController.idl");
$cons->InstallXpcomComponent("src/komodo/koScintillaAutoCompleteController.js",
{'@activestate.com/koScintillaAutoCompleteController;1' => '{88febdcd-e6f0-4542-9d16-464413967757}'});
$cons->InstallXpcomComponent("src/komodo/koCodeIntelXPCOMSupport.py");
$cons->InstallXpcomComponent("src/komodo/xpcomJSElements.py");
my @codeintel2_files = (
"lib/codeintel2/accessor.py",
"lib/codeintel2/buffer.py",
"lib/codeintel2/citadel.py",
"lib/codeintel2/citadel_common.py",
"lib/codeintel2/common.py",
"lib/codeintel2/constants_css1.py",
"lib/codeintel2/constants_css2.py",
"lib/codeintel2/constants_css3.py",
"lib/codeintel2/constants_css_microsoft_extensions.py",
"lib/codeintel2/constants_css_moz_extensions.py",
"lib/codeintel2/constants_css_webkit_extensions.py",
"lib/codeintel2/css_linter.py",
"lib/codeintel2/environment.py",
"lib/codeintel2/hooks.py",
"lib/codeintel2/indexer.py",
"lib/codeintel2/gencix_utils.py",
"lib/codeintel2/jsdoc.py",
"lib/codeintel2/langintel.py",
"lib/codeintel2/lang_css.py",
"lib/codeintel2/lang_javascript.py",
"lib/codeintel2/lang_less.py",
"lib/codeintel2/lang_nodejs.py",
"lib/codeintel2/lang_perl.py",
"lib/codeintel2/lang_python.py",
"lib/codeintel2/lang_python3.py",
"lib/codeintel2/lang_ruby.py",
"lib/codeintel2/lang_ruby_common.py",
"lib/codeintel2/lang_tcl.py",
"lib/codeintel2/manager.py",
"lib/codeintel2/parser_cix.py",
"lib/codeintel2/parser_data.py",
"lib/codeintel2/parseutil.py",
"lib/codeintel2/perlcile.py",
"lib/codeintel2/perl_lexer.py",
"lib/codeintel2/perl_parser.py",
"lib/codeintel2/phpdoc.py",
"lib/codeintel2/pybinary.py",
"lib/codeintel2/pythoncile.py",
"lib/codeintel2/pythoncile1.py",
"lib/codeintel2/rubycile.py",
"lib/codeintel2/ruby_lexer.py",
"lib/codeintel2/ruby_parser.py",
"lib/codeintel2/tclcile.py",
"lib/codeintel2/tcl_lexer.py",
"lib/codeintel2/tcl_parser.py",
"lib/codeintel2/tdparser.py",
"lib/codeintel2/tree.py",
"lib/codeintel2/tree_javascript.py",
"lib/codeintel2/tree_perl.py",
"lib/codeintel2/tree_php.py",
"lib/codeintel2/tree_python.py",
"lib/codeintel2/tree_ruby.py",
"lib/codeintel2/shared_lexer.py",
"lib/codeintel2/shared_parser.py",
"lib/codeintel2/udl.py",
"lib/codeintel2/util.py",
#"lib/codeintel2/xblcile.py",
#"lib/codeintel2/xsltcile.py",
"lib/codeintel2/__init__.py",
);
foreach my $file (@codeintel2_files) {
$cons->InstallPythonUtility($file, "codeintel2");
}
my @pygencix_files = ("support/gencix/python/gencixcore.py",
"support/gencix/python/parsedocs.py");
foreach my $file (@pygencix_files) {
$cons->InstallPythonUtility($file, "gencix/python");
}
my @codeintel2_database_files = (
"lib/codeintel2/database/__init__.py",
"lib/codeintel2/database/catalog.py",
"lib/codeintel2/database/database.py",
"lib/codeintel2/database/langlibbase.py",
"lib/codeintel2/database/langlib.py",
"lib/codeintel2/database/multilanglib.py",
"lib/codeintel2/database/projlib.py",
"lib/codeintel2/database/resource.py",
"lib/codeintel2/database/stdlib.py",
"lib/codeintel2/database/util.py",
);
foreach my $file (@codeintel2_database_files) {
$cons->InstallPythonUtility($file, "codeintel2/database");
}
my @stdlibs_files = (
"lib/codeintel2/stdlibs/javascript.cix",
"lib/codeintel2/stdlibs/python-2.4.cix",
"lib/codeintel2/stdlibs/python-2.5.cix",
"lib/codeintel2/stdlibs/python-2.6.cix",
"lib/codeintel2/stdlibs/python-2.7.cix",
"lib/codeintel2/stdlibs/python3-3.1.cix",
"lib/codeintel2/stdlibs/python3-3.2.cix",
"lib/codeintel2/stdlibs/python3-3.3.cix",
"lib/codeintel2/stdlibs/perl-5.8.cix",
"lib/codeintel2/stdlibs/perl-5.10.cix",
"lib/codeintel2/stdlibs/perl-5.12.cix",
"lib/codeintel2/stdlibs/perl-5.14.cix",
"lib/codeintel2/stdlibs/perl-5.16.cix",
"lib/codeintel2/stdlibs/ruby-1.8.cix",
"lib/codeintel2/stdlibs/ruby-1.9.2.cix",
"lib/codeintel2/stdlibs/ruby-1.9.3.cix",
"lib/codeintel2/stdlibs/php-4.4.cix",
"lib/codeintel2/stdlibs/php-5.2.cix",
"lib/codeintel2/stdlibs/php-5.3.cix",
"lib/codeintel2/stdlibs/php-5.4.cix",
"lib/codeintel2/stdlibs/php-5.5.cix",
"lib/codeintel2/stdlibs/node.js.cix",
);
foreach my $file (@stdlibs_files) {
$cons->InstallPythonUtility($file, "codeintel2/stdlibs");
}
my @catalog_files = (
"lib/codeintel2/catalogs/dojo.cix",
"lib/codeintel2/catalogs/yui.cix",
"lib/codeintel2/catalogs/mochikit.cix",
"lib/codeintel2/catalogs/prototype.cix",
"lib/codeintel2/catalogs/pywin32.cix",
"lib/codeintel2/catalogs/python3-pywin32.cix",
"lib/codeintel2/catalogs/rails.cix",
"lib/codeintel2/catalogs/jquery.cix",
"lib/codeintel2/catalogs/html5.cix",
"lib/codeintel2/catalogs/ext.cix",
"lib/codeintel2/catalogs/xbl.cix",
#TODO: "lib/codeintel2/catalogs/pecl.cix",
#TODO: "lib/codeintel2/catalogs/drupal.cix",
"lib/codeintel2/catalogs/xpcom.cix",
);
foreach my $file (@catalog_files) {
$cons->InstallPythonUtility($file, "codeintel2/catalogs");
}
my @codeintel2_oop_files = (
# Files for out-of-process codeintel
"lib/codeintel2/oop/__init__.py",
"lib/codeintel2/oop/controller.py",
"lib/codeintel2/oop/driver.py",
"lib/codeintel2/oop/memory_reporter.py",
);
foreach my $file (@codeintel2_oop_files) {
$cons->InstallPythonUtility($file, "codeintel2/oop");
}
$cons->Install("$supportDir/codeintel", "bin/oop-driver.py");
# Node.js standard library comes as raw JS files
# Generated by /src/codeintel/support/gencix/javascript/nodejs/node_html_to_js.py
$cons->InstallRecursive("$komodoPythonUtilsDir/codeintel2/lib_srcs/node.js",
cwd()."/src/codeintel/lib/codeintel2/lib_srcs/node.js");
# InstallRecursive must take absolute paths for input (bug in InstallRecursive)
# lib/codeintel2/stdlibs/node.js.cix above generated by
# /src/codeintel/support/gencix/javascript/nodejs/node_global_cix.py
# Build codeintel's custom cElementTree -> ciElementTree.
my $PYD = ($platform eq "win") ? (($buildType eq "debug") ? "_d.pyd" : ".pyd") : ".so";
my $ciElementTreeExt = "lib/ciElementTree$PYD";
$cons->Command(
$ciElementTreeExt,
# files needed to do the generation
"Makefile.py",
"config.py",
qq(
$unsiloedPythonExe bin/run-in-dir.py %1:d python %1:f distclean_elementtree elementtree
)
);
$cons->DependsRecursive($ciElementTreeExt, "support",
('\.consign', '.*\.pyc', 'gencix', 'cix2html\.py',
'\.svn'));
$cons->DependsRecursive($ciElementTreeExt, "src/patches", ('\.svn'));
#TODO: Should have the following 2 deps but they cause ciElementTree.so
# to *always* get rebuilt.
#$cons->DependsRecursive($ciElementTreeExt, "$komodoDevDir/contrib/elementtree",
# ('\.svn'));
#$cons->DependsRecursive($ciElementTreeExt, "$komodoDevDir/contrib/cElementTree",
# ('\.svn'));
$cons->InstallPythonUtility($ciElementTreeExt);
# Generate the Komodo JavaScript API Catalog.
if ($withKomodoCix) {
# Set "CODEINTEL_NO_PYXPCOM" for the "komodo_to_cix.py" build.
# Running PyXPCOM-y things at build time can be difficult. If XPCOM
# registration hasn't run yet then components will be missing and
# using PyXPCOM will likely fail (`regxpcom` isn't sufficient for
# XPCOM registration -- go figure).
%consLocal = $cons->copy();
$consLocal{ENV}{'CODEINTEL_NO_PYXPCOM'} = '1';
$consLocal{ENV}{'KOMODO_VERBOSE'} = '1'; # avoid stdhandle redirection by sitepyxpcom.py
$consLocal = new cons(%consLocal);
my $komodoCix = "$komodoPythonUtilsDir/codeintel2/catalogs/komodo.cix";
my $pydExt = ($platform eq "win" ? ".pyd" : ".so");
my $cElementTreeExt = "$komodoPythonUtilsDir/cElementTree$pydExt";
my $pythonToUse = ($platform eq "win" ? $siloedPython: "mozpython");
$consLocal->Command(
$komodoCix,
# files needed to do the generation
"support/gencix/javascript/komodo/komodo_to_cix.py",
$ciElementTreeExt,
# landmark for elementtree package (built by contrib/Conscript)
"$komodoPythonUtilsDir/elementtree/__init__.py",
# landmark for SilverCity package (built by src/silvercity/Conscript)
"$komodoPythonUtilsDir/SilverCity/__init__.py",
"$komodoPythonUtilsDir/styles.py",
# These files used by codeintel2.lang_xml|html.
"$komodoPythonUtilsDir/koXMLTreeService.py",
"$komodoPythonUtilsDir/koXMLDatasetInfo.py",
"$komodoPythonUtilsDir/HTMLTreeParser.py",
$cElementTreeExt,
# To avoid the following build error with a Moz build that hasn't yet
# been run (common for the installer-build moz builds):
# xpcom.Exception: The interface 'koICodeIntelTrigger' does not exist
$ranRegxpcomStateFileName,
qq(
$pythonToUse %1 -o %0
)
);
#TODO: Should refine the exclude patterns here so only depend on the minimal
# necessary set of files -- to minimize running the expensive
# komodo_to_cix.py.
$cons->DependsRecursive($komodoCix, "lib/codeintel2",
(".consign", '.*\.cix', '.*\.pyc', '\.svn'));
$cons->DependsRecursive($komodoCix, "../chrome/komodo/content",
(".consign", "test", '.*\.png', '.*\.xul',
'.*\.css', '\.svn'));
}