MCPcopy
hub / github.com/meteor/meteor / runCompilerPlugins

Method runCompilerPlugins

tools/isobuild/compiler-plugin.js:140–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

138 }
139
140 runCompilerPlugins() {
141 const self = this;
142 buildmessage.assertInJob();
143
144 // plugin id -> {sourceProcessor, resourceSlots}
145 var sourceProcessorsWithSlots = {};
146
147 var sourceBatches = _.map(self.unibuilds, function (unibuild) {
148 const { pkg: { name }, arch } = unibuild;
149 const sourceRoot = name
150 && self.isopackCache.getSourceRoot(name, arch)
151 || self.sourceRoot;
152
153 return new PackageSourceBatch(unibuild, self, {
154 sourceRoot,
155 linkerCacheDir: self.linkerCacheDir,
156 scannerCacheDir: self.scannerCacheDir,
157 });
158 });
159
160 // If we failed to match sources with processors, we're done.
161 if (buildmessage.jobHasMessages()) {
162 return [];
163 }
164
165 // Find out which files go with which CompilerPlugins.
166 _.each(sourceBatches, function (sourceBatch) {
167 _.each(sourceBatch.resourceSlots, function (resourceSlot) {
168 var sourceProcessor = resourceSlot.sourceProcessor;
169 // Skip non-sources.
170 if (! sourceProcessor) {
171 return;
172 }
173
174 if (! _.has(sourceProcessorsWithSlots, sourceProcessor.id)) {
175 sourceProcessorsWithSlots[sourceProcessor.id] = {
176 sourceProcessor: sourceProcessor,
177 resourceSlots: []
178 };
179 }
180 sourceProcessorsWithSlots[sourceProcessor.id].resourceSlots.push(
181 resourceSlot);
182 });
183 });
184
185 // Now actually run the handlers.
186 _.each(sourceProcessorsWithSlots, function (data, id) {
187 var sourceProcessor = data.sourceProcessor;
188 var resourceSlots = data.resourceSlots;
189
190 var jobTitle = [
191 "processing files with ",
192 sourceProcessor.isopack.name,
193 " (for target ", self.arch, ")"
194 ].join('');
195
196 Profile.time("plugin "+sourceProcessor.isopack.name, () => {
197 buildmessage.enterJob({

Callers 1

_runCompilerPluginsMethod · 0.95

Calls 5

mapMethod · 0.80
eachMethod · 0.80
exceptionMethod · 0.80
getSourceRootMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected