2015-01-08 14:20:05 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#!/bin/bash
							 | 
						
					
						
							
								
									
										
										
										
											2015-11-05 08:20:13 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								set -ex
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-08 14:20:05 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-02-13 14:59:29 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								MODE=$1
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-01-08 14:20:05 -08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								echo =============================================================================
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# go to project dir
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								SCRIPT_DIR=$(dirname $0)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								cd $SCRIPT_DIR/../..
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-25 22:47:42 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								if [ "$MODE" = "dart_ddc" ]; then
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 17:22:30 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  ${SCRIPT_DIR}/build_$MODE.sh
							 | 
						
					
						
							
								
									
										
										
										
											2015-12-10 14:40:00 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								elif [[ $MODE = saucelabs* ]] ; then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ${SCRIPT_DIR}/test_saucelabs.sh $MODE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								elif [[ $MODE = browserstack* ]] ; then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ${SCRIPT_DIR}/test_browserstack.sh $MODE
							 | 
						
					
						
							
								
									
										
										
										
											2015-07-29 17:00:54 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								elif [ "$MODE" = "lint" ]; then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ./node_modules/.bin/gulp static-checks
							 | 
						
					
						
							
								
									
										
										
										
											2015-10-30 07:34:48 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								elif [ "$MODE" = "build_only" ]; then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ${SCRIPT_DIR}/build_js.sh
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ${SCRIPT_DIR}/build_dart.sh
							 | 
						
					
						
							
								
									
										
										
										
											2016-02-08 13:23:12 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								elif [ "$MODE" = "typescript_next" ]; then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   # Ignore complaints about unsatisfied peer deps
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   npm install typescript@next || true
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   ${SCRIPT_DIR}/build_js.sh
							 | 
						
					
						
							
								
									
										
										
										
											2016-04-10 13:51:11 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								   # Run typings test using the GA release of TypeScript
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   # This ensures that users aren't forced onto beta/nightly
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   npm install typescript@1.8.9
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								   ./node_modules/.bin/gulp \!test.typings
							 | 
						
					
						
							
								
									
										
										
										
											2015-11-20 09:59:08 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								elif [ "$MODE" = "payload" ]; then
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  source ${SCRIPT_DIR}/env_dart.sh
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ./node_modules/.bin/gulp test.payload.dart/ci
							 | 
						
					
						
							
								
									
										
										
										
											2016-01-20 17:56:00 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  node --max-old-space-size=2000 ./node_modules/.bin/gulp test.payload.js/ci
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 17:22:30 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								else
							 | 
						
					
						
							
								
									
										
										
										
											2015-07-29 17:00:54 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  ${SCRIPT_DIR}/build_$MODE.sh
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ${SCRIPT_DIR}/test_$MODE.sh
							 | 
						
					
						
							
								
									
										
										
										
											2015-06-03 17:22:30 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								fi
							 |