| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-07 10:16:03 -07:00
										 |  |  | const fs = require('fs'); | 
					
						
							|  |  |  | const path = require('path'); | 
					
						
							|  |  |  | const sourceMapTest = require('../source-map-test'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-20 09:54:47 -07:00
										 |  |  | const excludedPackages = ['bazel', 'benchpress', 'compiler-cli', 'language-service']; | 
					
						
							| 
									
										
										
										
											2017-09-07 10:16:03 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | module.exports = (gulp) => () => { | 
					
						
							|  |  |  |   const packageDir = path.resolve(process.cwd(), 'dist/packages-dist/'); | 
					
						
							|  |  |  |   const packages = | 
					
						
							|  |  |  |       fs.readdirSync(packageDir).filter(package => excludedPackages.indexOf(package) === -1); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   packages.forEach(package => { | 
					
						
							|  |  |  |     if (sourceMapTest(package).length) { | 
					
						
							|  |  |  |       process.exit(1); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   if (!packages.length) { | 
					
						
							| 
									
										
										
										
											2017-09-22 19:51:03 +02:00
										 |  |  |     // tslint:disable-next-line:no-console
 | 
					
						
							| 
									
										
										
										
											2017-09-07 10:16:03 -07:00
										 |  |  |     console.log('No packages found in packages-dist. Unable to run source map test.'); | 
					
						
							|  |  |  |     process.exit(1); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | }; |