| 
									
										
										
										
											2016-09-12 18:13:26 -07:00
										 |  |  | #!/usr/bin/env bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-02 00:22:24 -08:00
										 |  |  | set -u -e -o pipefail | 
					
						
							| 
									
										
										
										
											2016-09-07 16:04:33 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # This script is used to compile and copy the contents for each of | 
					
						
							|  |  |  | # example directories over to the dist/examples directory so that they | 
					
						
							|  |  |  | # can be tested with karma and protractor. The `gulp serve-examples` command | 
					
						
							|  |  |  | # can be used to run each of the examples in isolation via http as well. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | cd `dirname $0` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-02 12:12:46 -08:00
										 |  |  | DIST="../../dist/examples"; | 
					
						
							| 
									
										
										
										
											2016-09-07 16:04:33 -07:00
										 |  |  | rm -rf -- $DIST | 
					
						
							| 
									
										
										
										
											2016-09-08 16:48:07 -07:00
										 |  |  | $(npm bin)/tsc -p ./tsconfig-build.json | 
					
						
							| 
									
										
										
										
											2016-09-07 16:04:33 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | mkdir $DIST/vendor/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 14:48:20 -08:00
										 |  |  | ln -s ../../../dist/packages-dist/ $DIST/vendor/@angular | 
					
						
							| 
									
										
										
										
											2016-09-07 16:04:33 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | for FILE in \
 | 
					
						
							| 
									
										
										
										
											2017-03-08 14:48:20 -08:00
										 |  |  |     ../../../node_modules/angular/angular.js \
 | 
					
						
							|  |  |  |     ../../../node_modules/zone.js/dist/zone.js \
 | 
					
						
							| 
									
										
										
										
											2017-04-27 11:44:14 -07:00
										 |  |  |     ../../../node_modules/zone.js/dist/task-tracking.js \
 | 
					
						
							| 
									
										
										
										
											2017-03-08 14:48:20 -08:00
										 |  |  |     ../../../node_modules/systemjs/dist/system.js \
 | 
					
						
							|  |  |  |     ../../../node_modules/reflect-metadata/Reflect.js \
 | 
					
						
							|  |  |  |     ../../../node_modules/rxjs | 
					
						
							| 
									
										
										
										
											2016-09-07 16:04:33 -07:00
										 |  |  | do | 
					
						
							|  |  |  |   ln -s $FILE $DIST/vendor/`basename $FILE` | 
					
						
							|  |  |  | done | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | for MODULE in `find . -name module.ts`; do | 
					
						
							|  |  |  |   FINAL_DIR_PATH=$DIST/`dirname $MODULE` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   echo "==== $MODULE" | 
					
						
							|  |  |  |   cp _common/*.html $FINAL_DIR_PATH | 
					
						
							|  |  |  |   cp $DIST/_common/*.js $FINAL_DIR_PATH | 
					
						
							|  |  |  |   cp $DIST/_common/*.js.map $FINAL_DIR_PATH | 
					
						
							| 
									
										
										
										
											2016-11-07 19:51:09 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   find `dirname $MODULE` -name \*.css -exec cp {} $FINAL_DIR_PATH \; | 
					
						
							| 
									
										
										
										
											2016-09-07 16:04:33 -07:00
										 |  |  | done |