2018-01-09 15:24:00 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								""" Re-export of some bazel rules with repository-wide defaults. """  
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-22 13:22:11 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								load ( " @build_bazel_rules_nodejs//:defs.bzl " ,  _nodejs_binary  =  " nodejs_binary " ,  _npm_package  =  " npm_package " )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								load ( " @npm_bazel_jasmine//:index.bzl " ,  _jasmine_node_test  =  " jasmine_node_test " )  
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								load ( " @npm_bazel_karma//:index.bzl " ,  _karma_web_test  =  " karma_web_test " ,  _karma_web_test_suite  =  " karma_web_test_suite " ,  _ts_web_test  =  " ts_web_test " ,  _ts_web_test_suite  =  " ts_web_test_suite " )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								load ( " @npm_bazel_typescript//:index.bzl " ,  _ts_library  =  " ts_library " )  
						 
					
						
							
								
									
										
										
										
											2018-02-13 11:26:06 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								load ( " //packages/bazel:index.bzl " ,  _ng_module  =  " ng_module " ,  _ng_package  =  " ng_package " )  
						 
					
						
							
								
									
										
										
										
											2018-09-11 18:11:32 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								load ( " //packages/bazel/src:ng_rollup_bundle.bzl " ,  _ng_rollup_bundle  =  " ng_rollup_bundle " )  
						 
					
						
							
								
									
										
										
										
											2018-01-09 15:24:00 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-02-13 09:16:27 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								_DEFAULT_TSCONFIG_TEST  =  " //packages:tsconfig-test "  
						 
					
						
							
								
									
										
										
										
											2019-03-09 13:24:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								_INTERNAL_NG_MODULE_API_EXTRACTOR  =  " //packages/bazel/src/api-extractor:api_extractor "  
						 
					
						
							
								
									
										
										
										
											2018-10-16 13:20:00 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								_INTERNAL_NG_MODULE_COMPILER  =  " //packages/bazel/src/ngc-wrapped "  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								_INTERNAL_NG_MODULE_XI18N  =  " //packages/bazel/src/ngc-wrapped:xi18n "  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								_INTERNAL_NG_PACKAGER_PACKAGER  =  " //packages/bazel/src/ng_package:packager "  
						 
					
						
							
								
									
										
										
										
											2018-01-09 15:24:00 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-03-13 11:00:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Packages which are versioned together on npm  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ANGULAR_SCOPED_PACKAGES  =  [ " @angular/ %s "  %  p  for  p  in  [  
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # core should be the first package because it's the main package in the group 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # this is significant for Angular CLI and "ng update" specifically, @angular/core 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # is considered the identifier of the group by these tools. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " core " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " bazel " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " common " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " compiler " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " compiler-cli " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " animations " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " elements " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " platform-browser " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " platform-browser-dynamic " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " forms " , 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-27 10:50:39 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # Current plan for Angular v8 is to not include @angular/http in ng update 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # "http", 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    " platform-server " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " platform-webworker " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " platform-webworker-dynamic " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " upgrade " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " router " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " language-service " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " service-worker " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-13 11:00:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								] ]  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PKG_GROUP_REPLACEMENTS  =  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    " \" NG_UPDATE_PACKAGE_GROUP \" " :  """ [ 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      % s 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ] """   %   " , \n        " .join([ " \" %s \" "   % s  for s in ANGULAR_SCOPED_PACKAGES]), 
 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-13 11:00:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-10 11:55:20 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  _default_module_name ( testonly ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """  Provide better defaults for package names. 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    e . g .  rather  than  angular / packages / core / testing  we  want  @angular / core / testing 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    TODO ( alexeagle ) :  we  ought  to  supply  a  default  module  name  for  every  library  in  the  repo . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    But  we  short - circuit  below  in  cases  that  are  currently  not  working . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    pkg  =  native . package_name ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  testonly : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Some tests currently rely on the long-form package names 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  pkg . startswith ( " packages/bazel " ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Avoid infinite recursion in the ViewEngine compiler. Error looks like: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #  Compiling Angular templates (ngc) //packages/bazel/test/ngc-wrapped/empty:empty failed (Exit 1) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # : RangeError: Maximum call stack size exceeded 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    at normalizeString (path.js:57:25) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    at Object.normalize (path.js:1132:12) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    at Object.join (path.js:1167:18) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    at resolveModule (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:582:50) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    at MetadataBundler.exportAll (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:119:42) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    at MetadataBundler.exportAll (execroot/angular/bazel-out/host/bin/packages/bazel/src/ngc-wrapped/ngc-wrapped.runfiles/angular/packages/compiler-cli/src/metadata/bundler.js:121:52) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  pkg . startswith ( " packages/ " ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  " @angular/ "  +  pkg [ len ( " packages/ " ) : ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  None 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  ts_library ( tsconfig  =  None ,  testonly  =  False ,  deps  =  [ ] ,  module_name  =  None ,  * * kwargs ) :  
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ Default values for ts_library """ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    deps  =  deps  +  [ " @npm//tslib " ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  testonly : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Match the types[] in //packages:tsconfig-test.json 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        deps . append ( " @npm//@types/jasmine " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps . append ( " @npm//@types/node " ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 11:42:58 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  tsconfig  and  testonly : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        tsconfig  =  _DEFAULT_TSCONFIG_TEST 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-15 23:24:22 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-10 11:55:20 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  module_name : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        module_name  =  _default_module_name ( testonly ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    _ts_library ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        tsconfig  =  tsconfig , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        testonly  =  testonly , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps  =  deps , 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-10 11:55:20 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        module_name  =  module_name , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-09 15:24:00 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-03-06 11:08:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  ng_module ( name ,  tsconfig  =  None ,  entry_point  =  None ,  testonly  =  False ,  deps  =  [ ] ,  module_name  =  None ,  bundle_dts  =  True ,  * * kwargs ) :  
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ Default values for ng_module """ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    deps  =  deps  +  [ " @npm//tslib " ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  testonly : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Match the types[] in //packages:tsconfig-test.json 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        deps . append ( " @npm//@types/jasmine " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps . append ( " @npm//@types/node " ) 
							 
						 
					
						
							
								
									
										
										
										
											2019-04-02 11:42:58 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  tsconfig  and  testonly : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        tsconfig  =  _DEFAULT_TSCONFIG_TEST 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-10 11:55:20 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  module_name : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        module_name  =  _default_module_name ( testonly ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  entry_point : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        entry_point  =  " public_api.ts " 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    _ng_module ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        name  =  name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        flat_module_out_file  =  name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        tsconfig  =  tsconfig , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        entry_point  =  entry_point , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        testonly  =  testonly , 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-06 11:08:42 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        bundle_dts  =  bundle_dts , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        deps  =  deps , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-16 13:20:00 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        compiler  =  _INTERNAL_NG_MODULE_COMPILER , 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-09 13:24:20 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        api_extractor  =  _INTERNAL_NG_MODULE_API_EXTRACTOR , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-16 13:20:00 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ng_xi18n  =  _INTERNAL_NG_MODULE_XI18N , 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-10 11:55:20 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        module_name  =  module_name , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												build(ivy): support alternate compilation modes to enable Ivy testing (#24056)
Bazel has a restriction that a single output (eg. a compiled version of
//packages/common) can only be produced by a single rule. This precludes
the Angular repo from having multiple rules that build the same code. And
the complexity of having a single rule produce multiple outputs (eg. an
ngc-compiled version of //packages/common and an Ivy-enabled version) is
too high.
Additionally, the Angular repo has lots of existing tests which could be
executed as-is under Ivy. Such testing is very valuable, and it would be
nice to share not only the code, but the dependency graph / build config
as well.
Thus, this change introduces a --define flag 'compile' with three potential
values. When --define=compile=X is set, the entire build system runs in a
particular mode - the behavior of all existing targets is controlled by
the flag. This allows us to reuse our entire build structure for testing
in a variety of different manners. The flag has three possible settings:
* legacy (the default): the traditional View Engine (ngc) build
* local: runs the prototype ngtsc compiler, which does not rely on global
  analysis
* jit: runs ngtsc in a mode which executes tsickle, but excludes the
  Angular related transforms, which approximates the behavior of plain
  tsc. This allows the main packages such as common to be tested with
  the JIT compiler.
Additionally, the ivy_ng_module() rule still exists and runs ngc in a mode
where Ivy-compiled output is produced from global analysis information, as
a stopgap while ngtsc is being developed.
PR Close #24056
											 
										 
										
											2018-05-21 15:48:00 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  ng_package ( name ,  readme_md  =  None ,  license_banner  =  None ,  deps  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ Default values for ng_package """ 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  readme_md : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        readme_md  =  " //packages:README.md " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  not  license_banner : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        license_banner  =  " //packages:license-banner.txt " 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    deps  =  deps  +  [ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//tslib " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-13 11:26:06 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    _ng_package ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        name  =  name , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        deps  =  deps , 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        readme_md  =  readme_md , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        license_banner  =  license_banner , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        replacements  =  PKG_GROUP_REPLACEMENTS , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-16 13:20:00 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ng_packager  =  _INTERNAL_NG_PACKAGER_PACKAGER , 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-13 11:00:53 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  npm_package ( name ,  replacements  =  { } ,  * * kwargs ) :  
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ Default values for npm_package """ 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    _npm_package ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        name  =  name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        replacements  =  dict ( replacements ,  * * PKG_GROUP_REPLACEMENTS ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 18:33:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 22:09:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  ts_web_test ( bootstrap  =  [ ] ,  deps  =  [ ] ,  runtime_deps  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ Default values for ts_web_test """ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  not  bootstrap : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bootstrap  =  [ " //:web_test_bootstrap_scripts " ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    local_deps  =  [ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//node_modules/tslib:tslib.js " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 22:09:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " //tools/rxjs:rxjs_umd_modules " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ]  +  deps 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    local_runtime_deps  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " //tools/testing:browser " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ]  +  runtime_deps 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    _ts_web_test ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        runtime_deps  =  local_runtime_deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bootstrap  =  bootstrap , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps  =  local_deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-01-03 17:46:14 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  ts_web_test_suite ( bootstrap  =  [ ] ,  deps  =  [ ] ,  runtime_deps  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ Default values for ts_web_test_suite """ 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    if  not  bootstrap : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bootstrap  =  [ " //:web_test_bootstrap_scripts " ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    local_deps  =  [ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//node_modules/tslib:tslib.js " , 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-13 16:31:29 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " //tools/rxjs:rxjs_umd_modules " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ]  +  deps 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-03 17:46:14 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    local_runtime_deps  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " //tools/testing:browser " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ]  +  runtime_deps 
							 
						 
					
						
							
								
									
										
										
										
											2018-03-15 18:33:52 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    _ts_web_test_suite ( 
							 
						 
					
						
							
								
									
										
										
										
											2019-01-03 17:46:14 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        runtime_deps  =  local_runtime_deps , 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        bootstrap  =  bootstrap , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps  =  local_deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Run unit tests on local Chromium by default. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # You can exclude tests based on tags, e.g. to skip Firefox testing, 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-27 09:25:45 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        #   `yarn bazel test --test_tag_filters=-browser:firefox-local [targets]` 
							 
						 
					
						
							
								
									
										
										
										
											2018-08-07 16:15:45 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        browsers  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " @io_bazel_rules_webtesting//browsers:chromium-local " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # Don't test on local Firefox by default, for faster builds. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # We think that bugs in Angular tend to be caught the same in any 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # evergreen browser. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # "@io_bazel_rules_webtesting//browsers:firefox-local", 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # TODO(alexeagle): add remote browsers on SauceLabs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 18:11:32 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 22:09:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  karma_web_test ( bootstrap  =  [ ] ,  deps  =  [ ] ,  data  =  [ ] ,  runtime_deps  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ Default values for karma_web_test """ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  not  bootstrap : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bootstrap  =  [ " //:web_test_bootstrap_scripts " ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    local_deps  =  [ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//karma-browserstack-launcher " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " @npm//node_modules/tslib:tslib.js " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 22:09:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " //tools/rxjs:rxjs_umd_modules " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ]  +  deps 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    local_runtime_deps  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " //tools/testing:browser " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ]  +  runtime_deps 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    _karma_web_test ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        runtime_deps  =  local_runtime_deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bootstrap  =  bootstrap , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        config_file  =  " //:karma-js.conf.js " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps  =  local_deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        data  =  data  +  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " //:browser-providers.conf.js " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " //tools:jasmine-seed-generator.js " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        configuration_env_vars  =  [ " KARMA_WEB_TEST_MODE " ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  karma_web_test_suite ( bootstrap  =  [ ] ,  deps  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ Default values for karma_web_test_suite """ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    if  not  bootstrap : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bootstrap  =  [ " //:web_test_bootstrap_scripts " ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    local_deps  =  [ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//node_modules/tslib:tslib.js " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-12-17 22:09:39 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " //tools/rxjs:rxjs_umd_modules " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ]  +  deps 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    _karma_web_test_suite ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        bootstrap  =  bootstrap , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps  =  local_deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Run unit tests on local Chromium by default. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # You can exclude tests based on tags, e.g. to skip Firefox testing, 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #   `yarn bazel test --test_tag_filters=-browser:firefox-local [targets]` 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        browsers  =  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            " @io_bazel_rules_webtesting//browsers:chromium-local " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # Don't test on local Firefox by default, for faster builds. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # We think that bugs in Angular tend to be caught the same in any 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # evergreen browser. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # "@io_bazel_rules_webtesting//browsers:firefox-local", 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # TODO(alexeagle): add remote browsers on SauceLabs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-22 18:02:42 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  nodejs_binary ( data  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ Default values for nodejs_binary """ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    _nodejs_binary ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Pass-thru --define=compile=foo as an environment variable 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        configuration_env_vars  =  [ " compile " ] , 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        data  =  data  +  [ " @npm//source-map-support " ] , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 18:11:32 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-24 18:15:46 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  jasmine_node_test ( deps  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    """ Default values for jasmine_node_test """ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    deps  =  deps  +  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Very common dependencies for tests 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//chokidar " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " @npm//domino " , 
							 
						 
					
						
							
								
									
										
										
										
											2019-03-21 12:11:29 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//jasmine-core " , 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//mock-fs " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " @npm//reflect-metadata " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " @npm//source-map-support " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " @npm//tslib " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " @npm//xhr2 " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    _jasmine_node_test ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps  =  deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # Pass-thru --define=compile=foo as an environment variable 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        configuration_env_vars  =  [ " compile " ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-11 18:11:32 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								def  ng_rollup_bundle ( deps  =  [ ] ,  * * kwargs ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ Default values for ng_rollup_bundle """ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    deps  =  deps  +  [ 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-20 09:54:42 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        " @npm//tslib " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " @npm//reflect-metadata " , 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 13:14:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    _ng_rollup_bundle ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        deps  =  deps , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        * * kwargs 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    )