1 | var profile = (function(){ |
---|
2 | var testResourceRe = /\/tests\//, |
---|
3 | |
---|
4 | copyOnly = function(filename, mid){ |
---|
5 | var list = { |
---|
6 | "dojox/dojox.profile":1, |
---|
7 | "dojox/package.json":1, |
---|
8 | "dojox/mobile/themes/utils/compile":1, |
---|
9 | "dojox/mobile/themes/utils/cleanup":1, |
---|
10 | "dojox/app/tests/layoutApp/build.profile": 1, |
---|
11 | "dojox/app/tests/globalizedApp/build.profile": 1 |
---|
12 | }; |
---|
13 | return (mid in list) || /^dojox\/resources\//.test(mid) || /(png|jpg|jpeg|gif|tiff)$/.test(filename) || /dojox\/app\/build\//.test(mid); |
---|
14 | }, |
---|
15 | |
---|
16 | excludes = [ |
---|
17 | "secure", |
---|
18 | "data/(demos|ItemExplorer|StoreExplorer|restListener)", |
---|
19 | "drawing/plugins/drawing/Silverlight", |
---|
20 | "editor/plugins/(ResizeTableColumn|SpellCheck)", |
---|
21 | "embed/(IE)", |
---|
22 | "flash/_base", |
---|
23 | "help", |
---|
24 | "image/(Gallery|SlideShow|ThumbnailPicker)", |
---|
25 | "jq", |
---|
26 | "jsonPath/query", |
---|
27 | "lang/(aspect|async|docs|observable|oo|typed|functional/(binrec|curry|linrec|listcomp|multirec|numrec|tailrec|util|zip))", |
---|
28 | "layout/(BorderContainer|dnd|ext-dijit)", |
---|
29 | "mobile/app/", |
---|
30 | "rails", |
---|
31 | "robot", |
---|
32 | "socket/Reconnect", |
---|
33 | "sql/", |
---|
34 | "storage/", |
---|
35 | "widget/(AnalogGauge|BarGauge|DataPresentation|DocTester|DynamicTooltip|FeedPortlet|FilePicker|gauge|Iterator|Loader|RollingList|SortList)", |
---|
36 | "wire/", |
---|
37 | "xmpp" |
---|
38 | ], |
---|
39 | |
---|
40 | excludesRe = new RegExp(("^dojox/(" + excludes.join("|") + ")").replace(/\//, "\\/")), |
---|
41 | |
---|
42 | usesDojoProvideEtAl = function(mid){ |
---|
43 | return excludesRe.test(mid); |
---|
44 | }; |
---|
45 | |
---|
46 | return { |
---|
47 | resourceTags:{ |
---|
48 | test: function(filename, mid){ |
---|
49 | return testResourceRe.test(mid); |
---|
50 | }, |
---|
51 | |
---|
52 | copyOnly: function(filename, mid){ |
---|
53 | return copyOnly(filename, mid); |
---|
54 | }, |
---|
55 | |
---|
56 | amd: function(filename, mid){ |
---|
57 | return !testResourceRe.test(mid) && !copyOnly(filename, mid) && !usesDojoProvideEtAl(mid) && /\.js$/.test(filename); |
---|
58 | }, |
---|
59 | |
---|
60 | miniExclude: function(filename, mid){ |
---|
61 | return /\/demos\//.test(mid); |
---|
62 | } |
---|
63 | } |
---|
64 | }; |
---|
65 | })(); |
---|