Best JavaScript code snippet using ng-mocks
dependency_display.py
Source:dependency_display.py
...10log = logging.getLogger( __name__ )11class DependencyDisplayer( object ):12 def __init__( self, app ):13 self.app = app14 def add_installation_directories_to_tool_dependencies( self, tool_dependencies ):15 """16 Determine the path to the installation directory for each of the received17 tool dependencies. This path will be displayed within the tool dependencies18 container on the select_tool_panel_section or reselect_tool_panel_section19 pages when installing or reinstalling repositories that contain tools with20 the defined tool dependencies. The list of tool dependencies may be associated21 with more than a single repository.22 """23 for dependency_key, requirements_dict in tool_dependencies.items():24 if dependency_key in [ 'set_environment' ]:25 continue26 repository_name = requirements_dict.get( 'repository_name', 'unknown' )27 repository_owner = requirements_dict.get( 'repository_owner', 'unknown' )28 changeset_revision = requirements_dict.get( 'changeset_revision', 'unknown' )29 dependency_name = requirements_dict[ 'name' ]30 version = requirements_dict[ 'version' ]31 if self.app.config.tool_dependency_dir:32 root_dir = self.app.config.tool_dependency_dir33 else:34 root_dir = '<set your tool_dependency_dir in your Galaxy configuration file>'35 install_dir = os.path.join( root_dir,36 dependency_name,37 version,38 repository_owner,39 repository_name,40 changeset_revision )41 requirements_dict[ 'install_dir' ] = install_dir42 tool_dependencies[ dependency_key ] = requirements_dict43 return tool_dependencies44 def generate_message_for_invalid_repository_dependencies( self, metadata_dict, error_from_tuple=False ):45 """46 Get or generate and return an error message associated with an invalid repository dependency.47 """48 message = ''49 if metadata_dict:50 if error_from_tuple:51 # Return the error messages associated with a set of one or more invalid repository52 # dependency tuples.53 invalid_repository_dependencies_dict = metadata_dict.get( 'invalid_repository_dependencies', None )54 if invalid_repository_dependencies_dict is not None:55 invalid_repository_dependencies = \56 invalid_repository_dependencies_dict.get( 'invalid_repository_dependencies', [] )57 for repository_dependency_tup in invalid_repository_dependencies:58 toolshed, name, owner, changeset_revision, \59 prior_installation_required, \60 only_if_compiling_contained_td, error = \61 common_util.parse_repository_dependency_tuple( repository_dependency_tup, contains_error=True )62 if error:63 message += '%s ' % str( error )64 else:65 # The complete dependency hierarchy could not be determined for a repository being installed into66 # Galaxy. This is likely due to invalid repository dependency definitions, so we'll get them from67 # the metadata and parse them for display in an error message. This will hopefully communicate the68 # problem to the user in such a way that a resolution can be determined.69 message += 'The complete dependency hierarchy could not be determined for this repository, so no required '70 message += 'repositories will not be installed. This is likely due to invalid repository dependency definitions. '71 repository_dependencies_dict = metadata_dict.get( 'repository_dependencies', None )72 if repository_dependencies_dict is not None:73 rd_tups = repository_dependencies_dict.get( 'repository_dependencies', None )74 if rd_tups is not None:75 message += 'Here are the attributes of the dependencies defined for this repository to help determine the '76 message += 'cause of this problem.<br/>'77 message += '<table cellpadding="2" cellspacing="2">'78 message += '<tr><th>Tool shed</th><th>Repository name</th><th>Owner</th><th>Changeset revision</th>'79 message += '<th>Prior install required</th></tr>'80 for rd_tup in rd_tups:81 tool_shed, name, owner, changeset_revision, pir, oicct = \82 common_util.parse_repository_dependency_tuple( rd_tup )83 if util.asbool( pir ):84 pir_str = 'True'85 else:86 pir_str = ''87 message += '<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>' % \88 ( tool_shed, name, owner, changeset_revision, pir_str )89 message += '</table>'90 return message91 def generate_message_for_invalid_tool_dependencies( self, metadata_dict ):92 """93 Tool dependency definitions can only be invalid if they include a definition for a complex94 repository dependency and the repository dependency definition is invalid. This method95 retrieves the error message associated with the invalid tool dependency for display in the96 caller.97 """98 message = ''99 if metadata_dict:100 invalid_tool_dependencies = metadata_dict.get( 'invalid_tool_dependencies', None )101 if invalid_tool_dependencies:102 for td_key, requirement_dict in invalid_tool_dependencies.items():103 error = requirement_dict.get( 'error', None )104 if error:105 message = '%s ' % str( error )106 return message107 def generate_message_for_orphan_tool_dependencies( self, repository, metadata_dict ):108 """109 The designation of a ToolDependency into the "orphan" category has evolved over time,110 and is significantly restricted since the introduction of the TOOL_DEPENDENCY_DEFINITION111 repository type. This designation is still critical, however, in that it handles the112 case where a repository contains both tools and a tool_dependencies.xml file, but the113 definition in the tool_dependencies.xml file is in no way related to anything defined114 by any of the contained tool's requirements tag sets. This is important in that it is115 often a result of a typo (e.g., dependency name or version) that differs between the tool116 dependency definition within the tool_dependencies.xml file and what is defined in the117 tool config's <requirements> tag sets. In these cases, the user should be presented with118 a warning message, and this warning message is is in fact displayed if the following119 is_orphan attribute is True. This is tricky because in some cases it may be intentional,120 and tool dependencies that are categorized as "orphan" are in fact valid.121 """122 has_orphan_package_dependencies = False123 has_orphan_set_environment_dependencies = False124 message = ''125 package_orphans_str = ''126 set_environment_orphans_str = ''127 # Tool dependencies are categorized as orphan only if the repository contains tools.128 if metadata_dict:129 tools = metadata_dict.get( 'tools', [] )130 tool_dependencies = metadata_dict.get( 'tool_dependencies', {} )131 # The use of the orphan_tool_dependencies category in metadata has been deprecated,132 # but we still need to check in case the metadata is out of date.133 orphan_tool_dependencies = metadata_dict.get( 'orphan_tool_dependencies', {} )134 # Updating should cause no problems here since a tool dependency cannot be included135 # in both dictionaries.136 tool_dependencies.update( orphan_tool_dependencies )137 if tool_dependencies and tools:138 for td_key, requirements_dict in tool_dependencies.items():139 if td_key == 'set_environment':140 # "set_environment": [{"name": "R_SCRIPT_PATH", "type": "set_environment"}]141 for env_requirements_dict in requirements_dict:142 name = env_requirements_dict[ 'name' ]143 type = env_requirements_dict[ 'type' ]144 if self.tool_dependency_is_orphan( type, name, None, tools ):145 if not has_orphan_set_environment_dependencies:146 has_orphan_set_environment_dependencies = True147 set_environment_orphans_str += "<b>* name:</b> %s, <b>type:</b> %s<br/>" % \148 ( str( name ), str( type ) )149 else:150 # "R/2.15.1": {"name": "R", "readme": "some string", "type": "package", "version": "2.15.1"}151 name = requirements_dict[ 'name' ]152 type = requirements_dict[ 'type' ]153 version = requirements_dict[ 'version' ]154 if self.tool_dependency_is_orphan( type, name, version, tools ):155 if not has_orphan_package_dependencies:156 has_orphan_package_dependencies = True157 package_orphans_str += "<b>* name:</b> %s, <b>type:</b> %s, <b>version:</b> %s<br/>" % \158 ( str( name ), str( type ), str( version ) )159 if has_orphan_package_dependencies:160 message += "The settings for <b>name</b>, <b>version</b> and <b>type</b> from a "161 message += "contained tool configuration file's <b>requirement</b> tag does not match "162 message += "the information for the following tool dependency definitions in the "163 message += "<b>tool_dependencies.xml</b> file, so these tool dependencies have no "164 message += "relationship with any tools within this repository.<br/>"165 message += package_orphans_str166 if has_orphan_set_environment_dependencies:167 message += "The settings for <b>name</b> and <b>type</b> from a contained tool "168 message += "configuration file's <b>requirement</b> tag does not match the information "169 message += "for the following tool dependency definitions in the <b>tool_dependencies.xml</b> "170 message += "file, so these tool dependencies have no relationship with any tools within "171 message += "this repository.<br/>"172 message += set_environment_orphans_str173 return message174 def get_installed_and_missing_tool_dependencies_for_installed_repository( self, repository, all_tool_dependencies ):175 """176 Return the lists of installed tool dependencies and missing tool dependencies for a Tool Shed177 repository that has been installed into Galaxy.178 """179 if all_tool_dependencies:180 tool_dependencies = {}181 missing_tool_dependencies = {}182 for td_key, val in all_tool_dependencies.items():183 if td_key in [ 'set_environment' ]:184 for index, td_info_dict in enumerate( val ):185 name = td_info_dict[ 'name' ]186 version = None187 type = td_info_dict[ 'type' ]188 tool_dependency = tool_dependency_util.get_tool_dependency_by_name_type_repository( self.app,189 repository,190 name,191 type )192 if tool_dependency:193 td_info_dict[ 'repository_id' ] = repository.id194 td_info_dict[ 'tool_dependency_id' ] = tool_dependency.id195 if tool_dependency.status:196 tool_dependency_status = str( tool_dependency.status )197 else:198 tool_dependency_status = 'Never installed'199 td_info_dict[ 'status' ] = tool_dependency_status200 val[ index ] = td_info_dict201 if tool_dependency.status == self.app.install_model.ToolDependency.installation_status.INSTALLED:202 tool_dependencies[ td_key ] = val203 else:204 missing_tool_dependencies[ td_key ] = val205 else:206 name = val[ 'name' ]207 version = val[ 'version' ]208 type = val[ 'type' ]209 tool_dependency = tool_dependency_util.get_tool_dependency_by_name_version_type_repository( self.app,210 repository,211 name,212 version,213 type )214 if tool_dependency:215 val[ 'repository_id' ] = repository.id216 val[ 'tool_dependency_id' ] = tool_dependency.id217 if tool_dependency.status:218 tool_dependency_status = str( tool_dependency.status )219 else:220 tool_dependency_status = 'Never installed'221 val[ 'status' ] = tool_dependency_status222 if tool_dependency.status == self.app.install_model.ToolDependency.installation_status.INSTALLED:223 tool_dependencies[ td_key ] = val224 else:225 missing_tool_dependencies[ td_key ] = val226 else:227 tool_dependencies = None228 missing_tool_dependencies = None229 return tool_dependencies, missing_tool_dependencies230 def merge_containers_dicts_for_new_install( self, containers_dicts ):231 """232 When installing one or more tool shed repositories for the first time, the received list of233 containers_dicts contains a containers_dict for each repository being installed. Since the234 repositories are being installed for the first time, all entries are None except the repository235 dependencies and tool dependencies. The entries for missing dependencies are all None since236 they have previously been merged into the installed dependencies. This method will merge the237 dependencies entries into a single container and return it for display.238 """239 new_containers_dict = dict( readme_files=None,240 datatypes=None,241 missing_repository_dependencies=None,242 repository_dependencies=None,243 missing_tool_dependencies=None,244 tool_dependencies=None,245 invalid_tools=None,246 valid_tools=None,247 workflows=None )248 if containers_dicts:249 lock = threading.Lock()250 lock.acquire( True )251 try:252 repository_dependencies_root_folder = None253 tool_dependencies_root_folder = None254 # Use a unique folder id (hopefully the following is).255 folder_id = 867256 for old_container_dict in containers_dicts:257 # Merge repository_dependencies.258 old_container_repository_dependencies_root = old_container_dict[ 'repository_dependencies' ]259 if old_container_repository_dependencies_root:260 if repository_dependencies_root_folder is None:261 repository_dependencies_root_folder = utility_container_manager.Folder( id=folder_id,262 key='root',263 label='root',264 parent=None )265 folder_id += 1266 repository_dependencies_folder = utility_container_manager.Folder( id=folder_id,267 key='merged',268 label='Repository dependencies',269 parent=repository_dependencies_root_folder )270 folder_id += 1271 # The old_container_repository_dependencies_root will be a root folder containing a single sub_folder.272 old_container_repository_dependencies_folder = old_container_repository_dependencies_root.folders[ 0 ]273 # Change the folder id so it won't confict with others being merged.274 old_container_repository_dependencies_folder.id = folder_id275 folder_id += 1276 repository_components_tuple = \277 container_util.get_components_from_key( old_container_repository_dependencies_folder.key )278 components_list = suc.extract_components_from_tuple( repository_components_tuple )279 name = components_list[ 1 ]280 # Generate the label by retrieving the repository name.281 old_container_repository_dependencies_folder.label = str( name )282 repository_dependencies_folder.folders.append( old_container_repository_dependencies_folder )283 # Merge tool_dependencies.284 old_container_tool_dependencies_root = old_container_dict[ 'tool_dependencies' ]285 if old_container_tool_dependencies_root:286 if tool_dependencies_root_folder is None:287 tool_dependencies_root_folder = utility_container_manager.Folder( id=folder_id,288 key='root',289 label='root',290 parent=None )291 folder_id += 1292 tool_dependencies_folder = utility_container_manager.Folder( id=folder_id,293 key='merged',294 label='Tool dependencies',295 parent=tool_dependencies_root_folder )296 folder_id += 1297 else:298 td_list = [ td.listify for td in tool_dependencies_folder.tool_dependencies ]299 # The old_container_tool_dependencies_root will be a root folder containing a single sub_folder.300 old_container_tool_dependencies_folder = old_container_tool_dependencies_root.folders[ 0 ]301 for td in old_container_tool_dependencies_folder.tool_dependencies:302 if td.listify not in td_list:303 tool_dependencies_folder.tool_dependencies.append( td )304 if repository_dependencies_root_folder:305 repository_dependencies_root_folder.folders.append( repository_dependencies_folder )306 new_containers_dict[ 'repository_dependencies' ] = repository_dependencies_root_folder307 if tool_dependencies_root_folder:308 tool_dependencies_root_folder.folders.append( tool_dependencies_folder )309 new_containers_dict[ 'tool_dependencies' ] = tool_dependencies_root_folder310 except Exception, e:311 log.debug( "Exception in merge_containers_dicts_for_new_install: %s" % str( e ) )312 finally:313 lock.release()314 return new_containers_dict315 def merge_missing_repository_dependencies_to_installed_container( self, containers_dict ):316 """317 Merge the list of missing repository dependencies into the list of installed318 repository dependencies.319 """320 missing_rd_container_root = containers_dict.get( 'missing_repository_dependencies', None )321 if missing_rd_container_root:322 # The missing_rd_container_root will be a root folder containing a single sub_folder.323 missing_rd_container = missing_rd_container_root.folders[ 0 ]324 installed_rd_container_root = containers_dict.get( 'repository_dependencies', None )325 # The installed_rd_container_root will be a root folder containing a single sub_folder.326 if installed_rd_container_root:327 installed_rd_container = installed_rd_container_root.folders[ 0 ]328 installed_rd_container.label = 'Repository dependencies'329 for index, rd in enumerate( missing_rd_container.repository_dependencies ):330 # Skip the header row.331 if index == 0:332 continue333 installed_rd_container.repository_dependencies.append( rd )334 installed_rd_container_root.folders = [ installed_rd_container ]335 containers_dict[ 'repository_dependencies' ] = installed_rd_container_root336 else:337 # Change the folder label from 'Missing repository dependencies' to be338 # 'Repository dependencies' for display.339 root_container = containers_dict[ 'missing_repository_dependencies' ]340 for sub_container in root_container.folders:341 # There should only be 1 sub-folder.342 sub_container.label = 'Repository dependencies'343 containers_dict[ 'repository_dependencies' ] = root_container344 containers_dict[ 'missing_repository_dependencies' ] = None345 return containers_dict346 def merge_missing_tool_dependencies_to_installed_container( self, containers_dict ):347 """348 Merge the list of missing tool dependencies into the list of installed tool349 dependencies.350 """351 missing_td_container_root = containers_dict.get( 'missing_tool_dependencies', None )352 if missing_td_container_root:353 # The missing_td_container_root will be a root folder containing a single sub_folder.354 missing_td_container = missing_td_container_root.folders[ 0 ]355 installed_td_container_root = containers_dict.get( 'tool_dependencies', None )356 # The installed_td_container_root will be a root folder containing a single sub_folder.357 if installed_td_container_root:358 installed_td_container = installed_td_container_root.folders[ 0 ]359 installed_td_container.label = 'Tool dependencies'360 for index, td in enumerate( missing_td_container.tool_dependencies ):361 # Skip the header row.362 if index == 0:363 continue364 installed_td_container.tool_dependencies.append( td )365 installed_td_container_root.folders = [ installed_td_container ]366 containers_dict[ 'tool_dependencies' ] = installed_td_container_root367 else:368 # Change the folder label from 'Missing tool dependencies' to be369 # 'Tool dependencies' for display.370 root_container = containers_dict[ 'missing_tool_dependencies' ]371 for sub_container in root_container.folders:372 # There should only be 1 subfolder.373 sub_container.label = 'Tool dependencies'374 containers_dict[ 'tool_dependencies' ] = root_container375 containers_dict[ 'missing_tool_dependencies' ] = None376 return containers_dict377 def populate_containers_dict_for_new_install( self, tool_shed_url, tool_path, readme_files_dict,378 installed_repository_dependencies, missing_repository_dependencies,379 installed_tool_dependencies, missing_tool_dependencies,380 updating=False ):381 """382 Return the populated containers for a repository being installed for the first time383 or for an installed repository that is being updated and the updates include newly384 defined repository (and possibly tool) dependencies.385 """386 installed_tool_dependencies, missing_tool_dependencies = \387 self.populate_tool_dependencies_dicts( tool_shed_url=tool_shed_url,388 tool_path=tool_path,389 repository_installed_tool_dependencies=installed_tool_dependencies,390 repository_missing_tool_dependencies=missing_tool_dependencies,391 required_repo_info_dicts=None )392 # Most of the repository contents are set to None since we don't yet know what they are.393 gucm = GalaxyUtilityContainerManager( self.app )394 containers_dict = gucm.build_repository_containers( repository=None,395 datatypes=None,396 invalid_tools=None,397 missing_repository_dependencies=missing_repository_dependencies,398 missing_tool_dependencies=missing_tool_dependencies,399 readme_files_dict=readme_files_dict,400 repository_dependencies=installed_repository_dependencies,401 tool_dependencies=installed_tool_dependencies,402 valid_tools=None,403 workflows=None,404 valid_data_managers=None,405 invalid_data_managers=None,406 data_managers_errors=None,407 new_install=True,408 reinstalling=False )409 if not updating:410 # If we installing a new repository and not updaing an installed repository, we can merge411 # the missing_repository_dependencies container contents to the installed_repository_dependencies412 # container. When updating an installed repository, merging will result in losing newly defined413 # dependencies included in the updates.414 containers_dict = self.merge_missing_repository_dependencies_to_installed_container( containers_dict )415 # Merge the missing_tool_dependencies container contents to the installed_tool_dependencies container.416 containers_dict = self.merge_missing_tool_dependencies_to_installed_container( containers_dict )417 return containers_dict418 def populate_containers_dict_from_repository_metadata( self, tool_shed_url, tool_path, repository, reinstalling=False,419 required_repo_info_dicts=None ):420 """421 Retrieve necessary information from the received repository's metadata to populate the422 containers_dict for display. This method is called only from Galaxy (not the tool shed)423 when displaying repository dependencies for installed repositories and when displaying424 them for uninstalled repositories that are being reinstalled.425 """426 metadata = repository.metadata427 if metadata:428 # Handle proprietary datatypes.429 datatypes = metadata.get( 'datatypes', None )430 # Handle invalid tools.431 invalid_tools = metadata.get( 'invalid_tools', None )432 # Handle README files.433 if repository.has_readme_files:434 if reinstalling or repository.status not in \435 [ self.app.install_model.ToolShedRepository.installation_status.DEACTIVATED,436 self.app.install_model.ToolShedRepository.installation_status.INSTALLED ]:437 # Since we're reinstalling, we need to send a request to the tool shed to get the README files.438 tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( self.app, tool_shed_url )439 params = dict( name=str( repository.name ),440 owner=str( repository.owner ),441 changeset_revision=str( repository.installed_changeset_revision ) )442 pathspec = [ 'repository', 'get_readme_files' ]443 raw_text = common_util.tool_shed_get( self.app, tool_shed_url, pathspec=pathspec, params=params )444 readme_files_dict = json.loads( raw_text )445 else:446 readme_files_dict = readme_util.build_readme_files_dict( self.app,447 repository,448 repository.changeset_revision,449 repository.metadata, tool_path )450 else:451 readme_files_dict = None452 # Handle repository dependencies.453 installed_repository_dependencies, missing_repository_dependencies = \454 self.app.installed_repository_manager.get_installed_and_missing_repository_dependencies( repository )455 # Handle the current repository's tool dependencies.456 repository_tool_dependencies = metadata.get( 'tool_dependencies', None )457 # Make sure to display missing tool dependencies as well.458 repository_invalid_tool_dependencies = metadata.get( 'invalid_tool_dependencies', None )459 if repository_invalid_tool_dependencies is not None:460 if repository_tool_dependencies is None:461 repository_tool_dependencies = {}462 repository_tool_dependencies.update( repository_invalid_tool_dependencies )463 repository_installed_tool_dependencies, repository_missing_tool_dependencies = \464 self.get_installed_and_missing_tool_dependencies_for_installed_repository( repository,465 repository_tool_dependencies )466 if reinstalling:467 installed_tool_dependencies, missing_tool_dependencies = \468 self.populate_tool_dependencies_dicts( tool_shed_url,469 tool_path,470 repository_installed_tool_dependencies,471 repository_missing_tool_dependencies,472 required_repo_info_dicts )473 else:474 installed_tool_dependencies = repository_installed_tool_dependencies475 missing_tool_dependencies = repository_missing_tool_dependencies476 # Handle valid tools.477 valid_tools = metadata.get( 'tools', None )478 # Handle workflows.479 workflows = metadata.get( 'workflows', None )480 # Handle Data Managers481 valid_data_managers = None482 invalid_data_managers = None483 data_managers_errors = None484 if 'data_manager' in metadata:485 valid_data_managers = metadata['data_manager'].get( 'data_managers', None )486 invalid_data_managers = metadata['data_manager'].get( 'invalid_data_managers', None )487 data_managers_errors = metadata['data_manager'].get( 'messages', None )488 gucm = GalaxyUtilityContainerManager( self.app )489 containers_dict = gucm.build_repository_containers( repository=repository,490 datatypes=datatypes,491 invalid_tools=invalid_tools,492 missing_repository_dependencies=missing_repository_dependencies,493 missing_tool_dependencies=missing_tool_dependencies,494 readme_files_dict=readme_files_dict,495 repository_dependencies=installed_repository_dependencies,496 tool_dependencies=installed_tool_dependencies,497 valid_tools=valid_tools,498 workflows=workflows,499 valid_data_managers=valid_data_managers,500 invalid_data_managers=invalid_data_managers,501 data_managers_errors=data_managers_errors,502 new_install=False,503 reinstalling=reinstalling )504 else:505 containers_dict = dict( datatypes=None,506 invalid_tools=None,507 readme_files_dict=None,508 repository_dependencies=None,509 tool_dependencies=None,510 valid_tools=None,511 workflows=None )512 return containers_dict513 def populate_tool_dependencies_dicts( self, tool_shed_url, tool_path, repository_installed_tool_dependencies,514 repository_missing_tool_dependencies, required_repo_info_dicts ):515 """516 Return the populated installed_tool_dependencies and missing_tool_dependencies dictionaries517 for all repositories defined by entries in the received required_repo_info_dicts.518 """519 installed_tool_dependencies = None520 missing_tool_dependencies = None521 if repository_installed_tool_dependencies is None:522 repository_installed_tool_dependencies = {}523 else:524 # Add the install_dir attribute to the tool_dependencies.525 repository_installed_tool_dependencies = \526 self.add_installation_directories_to_tool_dependencies( repository_installed_tool_dependencies )527 if repository_missing_tool_dependencies is None:528 repository_missing_tool_dependencies = {}529 else:530 # Add the install_dir attribute to the tool_dependencies.531 repository_missing_tool_dependencies = \532 self.add_installation_directories_to_tool_dependencies( repository_missing_tool_dependencies )533 if required_repo_info_dicts:534 # Handle the tool dependencies defined for each of the repository's repository dependencies.535 for rid in required_repo_info_dicts:536 for name, repo_info_tuple in rid.items():537 description, repository_clone_url, changeset_revision, \538 ctx_rev, repository_owner, repository_dependencies, \539 tool_dependencies = \540 suc.get_repo_info_tuple_contents( repo_info_tuple )541 if tool_dependencies:542 # Add the install_dir attribute to the tool_dependencies.543 tool_dependencies = self.add_installation_directories_to_tool_dependencies( tool_dependencies )544 # The required_repository may have been installed with a different changeset revision.545 required_repository, installed_changeset_revision = \546 suc.repository_was_previously_installed( self.app,547 tool_shed_url,548 name,549 repo_info_tuple,550 from_tip=False )551 if required_repository:552 required_repository_installed_tool_dependencies, required_repository_missing_tool_dependencies = \553 self.get_installed_and_missing_tool_dependencies_for_installed_repository( required_repository,554 tool_dependencies )555 if required_repository_installed_tool_dependencies:556 # Add the install_dir attribute to the tool_dependencies.557 required_repository_installed_tool_dependencies = \558 self.add_installation_directories_to_tool_dependencies( required_repository_installed_tool_dependencies )559 for td_key, td_dict in required_repository_installed_tool_dependencies.items():560 if td_key not in repository_installed_tool_dependencies:561 repository_installed_tool_dependencies[ td_key ] = td_dict562 if required_repository_missing_tool_dependencies:563 # Add the install_dir attribute to the tool_dependencies.564 required_repository_missing_tool_dependencies = \565 self.add_installation_directories_to_tool_dependencies( required_repository_missing_tool_dependencies )566 for td_key, td_dict in required_repository_missing_tool_dependencies.items():567 if td_key not in repository_missing_tool_dependencies:568 repository_missing_tool_dependencies[ td_key ] = td_dict569 if repository_installed_tool_dependencies:570 installed_tool_dependencies = repository_installed_tool_dependencies571 if repository_missing_tool_dependencies:572 missing_tool_dependencies = repository_missing_tool_dependencies573 return installed_tool_dependencies, missing_tool_dependencies574 def tool_dependency_is_orphan( self, type, name, version, tools ):575 """576 Determine if the combination of the received type, name and version is defined in the <requirement>577 tag for at least one tool in the received list of tools. If not, the tool dependency defined by the578 combination is considered an orphan in its repository in the tool shed.579 """...
dependenciesAny.generated.js
Source:dependenciesAny.generated.js
1/**2 * THIS FILE IS AUTO-GENERATED3 * DON'T MAKE CHANGES HERE4 */5export { absDependencies } from './dependenciesAny/dependenciesAbs.generated.js';6export { AccessorNodeDependencies } from './dependenciesAny/dependenciesAccessorNode.generated.js';7export { acosDependencies } from './dependenciesAny/dependenciesAcos.generated.js';8export { acoshDependencies } from './dependenciesAny/dependenciesAcosh.generated.js';9export { acotDependencies } from './dependenciesAny/dependenciesAcot.generated.js';10export { acothDependencies } from './dependenciesAny/dependenciesAcoth.generated.js';11export { acscDependencies } from './dependenciesAny/dependenciesAcsc.generated.js';12export { acschDependencies } from './dependenciesAny/dependenciesAcsch.generated.js';13export { addDependencies } from './dependenciesAny/dependenciesAdd.generated.js';14export { addScalarDependencies } from './dependenciesAny/dependenciesAddScalar.generated.js';15export { andDependencies } from './dependenciesAny/dependenciesAnd.generated.js';16export { applyDependencies } from './dependenciesAny/dependenciesApply.generated.js';17export { applyTransformDependencies } from './dependenciesAny/dependenciesApplyTransform.generated.js';18export { argDependencies } from './dependenciesAny/dependenciesArg.generated.js';19export { ArrayNodeDependencies } from './dependenciesAny/dependenciesArrayNode.generated.js';20export { asecDependencies } from './dependenciesAny/dependenciesAsec.generated.js';21export { asechDependencies } from './dependenciesAny/dependenciesAsech.generated.js';22export { asinDependencies } from './dependenciesAny/dependenciesAsin.generated.js';23export { asinhDependencies } from './dependenciesAny/dependenciesAsinh.generated.js';24export { AssignmentNodeDependencies } from './dependenciesAny/dependenciesAssignmentNode.generated.js';25export { atanDependencies } from './dependenciesAny/dependenciesAtan.generated.js';26export { atan2Dependencies } from './dependenciesAny/dependenciesAtan2.generated.js';27export { atanhDependencies } from './dependenciesAny/dependenciesAtanh.generated.js';28export { atomicMassDependencies } from './dependenciesAny/dependenciesAtomicMass.generated.js';29export { avogadroDependencies } from './dependenciesAny/dependenciesAvogadro.generated.js';30export { bellNumbersDependencies } from './dependenciesAny/dependenciesBellNumbers.generated.js';31export { BigNumberDependencies } from './dependenciesAny/dependenciesBigNumberClass.generated.js';32export { bignumberDependencies } from './dependenciesAny/dependenciesBignumber.generated.js';33export { binDependencies } from './dependenciesAny/dependenciesBin.generated.js';34export { bitAndDependencies } from './dependenciesAny/dependenciesBitAnd.generated.js';35export { bitNotDependencies } from './dependenciesAny/dependenciesBitNot.generated.js';36export { bitOrDependencies } from './dependenciesAny/dependenciesBitOr.generated.js';37export { bitXorDependencies } from './dependenciesAny/dependenciesBitXor.generated.js';38export { BlockNodeDependencies } from './dependenciesAny/dependenciesBlockNode.generated.js';39export { bohrMagnetonDependencies } from './dependenciesAny/dependenciesBohrMagneton.generated.js';40export { bohrRadiusDependencies } from './dependenciesAny/dependenciesBohrRadius.generated.js';41export { boltzmannDependencies } from './dependenciesAny/dependenciesBoltzmann.generated.js';42export { booleanDependencies } from './dependenciesAny/dependenciesBoolean.generated.js';43export { catalanDependencies } from './dependenciesAny/dependenciesCatalan.generated.js';44export { cbrtDependencies } from './dependenciesAny/dependenciesCbrt.generated.js';45export { ceilDependencies } from './dependenciesAny/dependenciesCeil.generated.js';46export { chainDependencies } from './dependenciesAny/dependenciesChain.generated.js';47export { ChainDependencies } from './dependenciesAny/dependenciesChainClass.generated.js';48export { classicalElectronRadiusDependencies } from './dependenciesAny/dependenciesClassicalElectronRadius.generated.js';49export { cloneDependencies } from './dependenciesAny/dependenciesClone.generated.js';50export { columnDependencies } from './dependenciesAny/dependenciesColumn.generated.js';51export { columnTransformDependencies } from './dependenciesAny/dependenciesColumnTransform.generated.js';52export { combinationsDependencies } from './dependenciesAny/dependenciesCombinations.generated.js';53export { combinationsWithRepDependencies } from './dependenciesAny/dependenciesCombinationsWithRep.generated.js';54export { compareDependencies } from './dependenciesAny/dependenciesCompare.generated.js';55export { compareNaturalDependencies } from './dependenciesAny/dependenciesCompareNatural.generated.js';56export { compareTextDependencies } from './dependenciesAny/dependenciesCompareText.generated.js';57export { compileDependencies } from './dependenciesAny/dependenciesCompile.generated.js';58export { complexDependencies } from './dependenciesAny/dependenciesComplex.generated.js';59export { ComplexDependencies } from './dependenciesAny/dependenciesComplexClass.generated.js';60export { compositionDependencies } from './dependenciesAny/dependenciesComposition.generated.js';61export { concatDependencies } from './dependenciesAny/dependenciesConcat.generated.js';62export { concatTransformDependencies } from './dependenciesAny/dependenciesConcatTransform.generated.js';63export { ConditionalNodeDependencies } from './dependenciesAny/dependenciesConditionalNode.generated.js';64export { conductanceQuantumDependencies } from './dependenciesAny/dependenciesConductanceQuantum.generated.js';65export { conjDependencies } from './dependenciesAny/dependenciesConj.generated.js';66export { ConstantNodeDependencies } from './dependenciesAny/dependenciesConstantNode.generated.js';67export { cosDependencies } from './dependenciesAny/dependenciesCos.generated.js';68export { coshDependencies } from './dependenciesAny/dependenciesCosh.generated.js';69export { cotDependencies } from './dependenciesAny/dependenciesCot.generated.js';70export { cothDependencies } from './dependenciesAny/dependenciesCoth.generated.js';71export { coulombDependencies } from './dependenciesAny/dependenciesCoulomb.generated.js';72export { countDependencies } from './dependenciesAny/dependenciesCount.generated.js';73export { createUnitDependencies } from './dependenciesAny/dependenciesCreateUnit.generated.js';74export { crossDependencies } from './dependenciesAny/dependenciesCross.generated.js';75export { cscDependencies } from './dependenciesAny/dependenciesCsc.generated.js';76export { cschDependencies } from './dependenciesAny/dependenciesCsch.generated.js';77export { ctransposeDependencies } from './dependenciesAny/dependenciesCtranspose.generated.js';78export { cubeDependencies } from './dependenciesAny/dependenciesCube.generated.js';79export { cumsumDependencies } from './dependenciesAny/dependenciesCumSum.generated.js';80export { cumsumTransformDependencies } from './dependenciesAny/dependenciesCumSumTransform.generated.js';81export { deepEqualDependencies } from './dependenciesAny/dependenciesDeepEqual.generated.js';82export { DenseMatrixDependencies } from './dependenciesAny/dependenciesDenseMatrixClass.generated.js';83export { derivativeDependencies } from './dependenciesAny/dependenciesDerivative.generated.js';84export { detDependencies } from './dependenciesAny/dependenciesDet.generated.js';85export { deuteronMassDependencies } from './dependenciesAny/dependenciesDeuteronMass.generated.js';86export { diagDependencies } from './dependenciesAny/dependenciesDiag.generated.js';87export { diffDependencies } from './dependenciesAny/dependenciesDiff.generated.js';88export { diffTransformDependencies } from './dependenciesAny/dependenciesDiffTransform.generated.js';89export { distanceDependencies } from './dependenciesAny/dependenciesDistance.generated.js';90export { divideDependencies } from './dependenciesAny/dependenciesDivide.generated.js';91export { divideScalarDependencies } from './dependenciesAny/dependenciesDivideScalar.generated.js';92export { dotDependencies } from './dependenciesAny/dependenciesDot.generated.js';93export { dotDivideDependencies } from './dependenciesAny/dependenciesDotDivide.generated.js';94export { dotMultiplyDependencies } from './dependenciesAny/dependenciesDotMultiply.generated.js';95export { dotPowDependencies } from './dependenciesAny/dependenciesDotPow.generated.js';96export { eDependencies } from './dependenciesAny/dependenciesE.generated.js';97export { efimovFactorDependencies } from './dependenciesAny/dependenciesEfimovFactor.generated.js';98export { eigsDependencies } from './dependenciesAny/dependenciesEigs.generated.js';99export { electricConstantDependencies } from './dependenciesAny/dependenciesElectricConstant.generated.js';100export { electronMassDependencies } from './dependenciesAny/dependenciesElectronMass.generated.js';101export { elementaryChargeDependencies } from './dependenciesAny/dependenciesElementaryCharge.generated.js';102export { equalDependencies } from './dependenciesAny/dependenciesEqual.generated.js';103export { equalScalarDependencies } from './dependenciesAny/dependenciesEqualScalar.generated.js';104export { equalTextDependencies } from './dependenciesAny/dependenciesEqualText.generated.js';105export { erfDependencies } from './dependenciesAny/dependenciesErf.generated.js';106export { evaluateDependencies } from './dependenciesAny/dependenciesEvaluate.generated.js';107export { expDependencies } from './dependenciesAny/dependenciesExp.generated.js';108export { expmDependencies } from './dependenciesAny/dependenciesExpm.generated.js';109export { expm1Dependencies } from './dependenciesAny/dependenciesExpm1.generated.js';110export { factorialDependencies } from './dependenciesAny/dependenciesFactorial.generated.js';111export { falseDependencies } from './dependenciesAny/dependenciesFalse.generated.js';112export { faradayDependencies } from './dependenciesAny/dependenciesFaraday.generated.js';113export { fermiCouplingDependencies } from './dependenciesAny/dependenciesFermiCoupling.generated.js';114export { fftDependencies } from './dependenciesAny/dependenciesFft.generated.js';115export { FibonacciHeapDependencies } from './dependenciesAny/dependenciesFibonacciHeapClass.generated.js';116export { filterDependencies } from './dependenciesAny/dependenciesFilter.generated.js';117export { filterTransformDependencies } from './dependenciesAny/dependenciesFilterTransform.generated.js';118export { fineStructureDependencies } from './dependenciesAny/dependenciesFineStructure.generated.js';119export { firstRadiationDependencies } from './dependenciesAny/dependenciesFirstRadiation.generated.js';120export { fixDependencies } from './dependenciesAny/dependenciesFix.generated.js';121export { flattenDependencies } from './dependenciesAny/dependenciesFlatten.generated.js';122export { floorDependencies } from './dependenciesAny/dependenciesFloor.generated.js';123export { forEachDependencies } from './dependenciesAny/dependenciesForEach.generated.js';124export { forEachTransformDependencies } from './dependenciesAny/dependenciesForEachTransform.generated.js';125export { formatDependencies } from './dependenciesAny/dependenciesFormat.generated.js';126export { fractionDependencies } from './dependenciesAny/dependenciesFraction.generated.js';127export { FractionDependencies } from './dependenciesAny/dependenciesFractionClass.generated.js';128export { FunctionAssignmentNodeDependencies } from './dependenciesAny/dependenciesFunctionAssignmentNode.generated.js';129export { FunctionNodeDependencies } from './dependenciesAny/dependenciesFunctionNode.generated.js';130export { gammaDependencies } from './dependenciesAny/dependenciesGamma.generated.js';131export { gasConstantDependencies } from './dependenciesAny/dependenciesGasConstant.generated.js';132export { gcdDependencies } from './dependenciesAny/dependenciesGcd.generated.js';133export { getMatrixDataTypeDependencies } from './dependenciesAny/dependenciesGetMatrixDataType.generated.js';134export { gravitationConstantDependencies } from './dependenciesAny/dependenciesGravitationConstant.generated.js';135export { gravityDependencies } from './dependenciesAny/dependenciesGravity.generated.js';136export { hartreeEnergyDependencies } from './dependenciesAny/dependenciesHartreeEnergy.generated.js';137export { hasNumericValueDependencies } from './dependenciesAny/dependenciesHasNumericValue.generated.js';138export { helpDependencies } from './dependenciesAny/dependenciesHelp.generated.js';139export { HelpDependencies } from './dependenciesAny/dependenciesHelpClass.generated.js';140export { hexDependencies } from './dependenciesAny/dependenciesHex.generated.js';141export { hypotDependencies } from './dependenciesAny/dependenciesHypot.generated.js';142export { iDependencies } from './dependenciesAny/dependenciesI.generated.js';143export { identityDependencies } from './dependenciesAny/dependenciesIdentity.generated.js';144export { ifftDependencies } from './dependenciesAny/dependenciesIfft.generated.js';145export { imDependencies } from './dependenciesAny/dependenciesIm.generated.js';146export { ImmutableDenseMatrixDependencies } from './dependenciesAny/dependenciesImmutableDenseMatrixClass.generated.js';147export { indexDependencies } from './dependenciesAny/dependenciesIndex.generated.js';148export { IndexDependencies } from './dependenciesAny/dependenciesIndexClass.generated.js';149export { IndexNodeDependencies } from './dependenciesAny/dependenciesIndexNode.generated.js';150export { indexTransformDependencies } from './dependenciesAny/dependenciesIndexTransform.generated.js';151export { InfinityDependencies } from './dependenciesAny/dependenciesInfinity.generated.js';152export { intersectDependencies } from './dependenciesAny/dependenciesIntersect.generated.js';153export { invDependencies } from './dependenciesAny/dependenciesInv.generated.js';154export { inverseConductanceQuantumDependencies } from './dependenciesAny/dependenciesInverseConductanceQuantum.generated.js';155export { invmodDependencies } from './dependenciesAny/dependenciesInvmod.generated.js';156export { isIntegerDependencies } from './dependenciesAny/dependenciesIsInteger.generated.js';157export { isNaNDependencies } from './dependenciesAny/dependenciesIsNaN.generated.js';158export { isNegativeDependencies } from './dependenciesAny/dependenciesIsNegative.generated.js';159export { isNumericDependencies } from './dependenciesAny/dependenciesIsNumeric.generated.js';160export { isPositiveDependencies } from './dependenciesAny/dependenciesIsPositive.generated.js';161export { isPrimeDependencies } from './dependenciesAny/dependenciesIsPrime.generated.js';162export { isZeroDependencies } from './dependenciesAny/dependenciesIsZero.generated.js';163export { kldivergenceDependencies } from './dependenciesAny/dependenciesKldivergence.generated.js';164export { klitzingDependencies } from './dependenciesAny/dependenciesKlitzing.generated.js';165export { kronDependencies } from './dependenciesAny/dependenciesKron.generated.js';166export { LN10Dependencies } from './dependenciesAny/dependenciesLN10.generated.js';167export { LN2Dependencies } from './dependenciesAny/dependenciesLN2.generated.js';168export { LOG10EDependencies } from './dependenciesAny/dependenciesLOG10E.generated.js';169export { LOG2EDependencies } from './dependenciesAny/dependenciesLOG2E.generated.js';170export { largerDependencies } from './dependenciesAny/dependenciesLarger.generated.js';171export { largerEqDependencies } from './dependenciesAny/dependenciesLargerEq.generated.js';172export { lcmDependencies } from './dependenciesAny/dependenciesLcm.generated.js';173export { leafCountDependencies } from './dependenciesAny/dependenciesLeafCount.generated.js';174export { leftShiftDependencies } from './dependenciesAny/dependenciesLeftShift.generated.js';175export { lgammaDependencies } from './dependenciesAny/dependenciesLgamma.generated.js';176export { logDependencies } from './dependenciesAny/dependenciesLog.generated.js';177export { log10Dependencies } from './dependenciesAny/dependenciesLog10.generated.js';178export { log1pDependencies } from './dependenciesAny/dependenciesLog1p.generated.js';179export { log2Dependencies } from './dependenciesAny/dependenciesLog2.generated.js';180export { loschmidtDependencies } from './dependenciesAny/dependenciesLoschmidt.generated.js';181export { lsolveDependencies } from './dependenciesAny/dependenciesLsolve.generated.js';182export { lsolveAllDependencies } from './dependenciesAny/dependenciesLsolveAll.generated.js';183export { lupDependencies } from './dependenciesAny/dependenciesLup.generated.js';184export { lusolveDependencies } from './dependenciesAny/dependenciesLusolve.generated.js';185export { madDependencies } from './dependenciesAny/dependenciesMad.generated.js';186export { magneticConstantDependencies } from './dependenciesAny/dependenciesMagneticConstant.generated.js';187export { magneticFluxQuantumDependencies } from './dependenciesAny/dependenciesMagneticFluxQuantum.generated.js';188export { mapDependencies } from './dependenciesAny/dependenciesMap.generated.js';189export { mapTransformDependencies } from './dependenciesAny/dependenciesMapTransform.generated.js';190export { matrixDependencies } from './dependenciesAny/dependenciesMatrix.generated.js';191export { MatrixDependencies } from './dependenciesAny/dependenciesMatrixClass.generated.js';192export { matrixFromColumnsDependencies } from './dependenciesAny/dependenciesMatrixFromColumns.generated.js';193export { matrixFromFunctionDependencies } from './dependenciesAny/dependenciesMatrixFromFunction.generated.js';194export { matrixFromRowsDependencies } from './dependenciesAny/dependenciesMatrixFromRows.generated.js';195export { maxDependencies } from './dependenciesAny/dependenciesMax.generated.js';196export { maxTransformDependencies } from './dependenciesAny/dependenciesMaxTransform.generated.js';197export { meanDependencies } from './dependenciesAny/dependenciesMean.generated.js';198export { meanTransformDependencies } from './dependenciesAny/dependenciesMeanTransform.generated.js';199export { medianDependencies } from './dependenciesAny/dependenciesMedian.generated.js';200export { minDependencies } from './dependenciesAny/dependenciesMin.generated.js';201export { minTransformDependencies } from './dependenciesAny/dependenciesMinTransform.generated.js';202export { modDependencies } from './dependenciesAny/dependenciesMod.generated.js';203export { modeDependencies } from './dependenciesAny/dependenciesMode.generated.js';204export { molarMassDependencies } from './dependenciesAny/dependenciesMolarMass.generated.js';205export { molarMassC12Dependencies } from './dependenciesAny/dependenciesMolarMassC12.generated.js';206export { molarPlanckConstantDependencies } from './dependenciesAny/dependenciesMolarPlanckConstant.generated.js';207export { molarVolumeDependencies } from './dependenciesAny/dependenciesMolarVolume.generated.js';208export { multinomialDependencies } from './dependenciesAny/dependenciesMultinomial.generated.js';209export { multiplyDependencies } from './dependenciesAny/dependenciesMultiply.generated.js';210export { multiplyScalarDependencies } from './dependenciesAny/dependenciesMultiplyScalar.generated.js';211export { NaNDependencies } from './dependenciesAny/dependenciesNaN.generated.js';212export { neutronMassDependencies } from './dependenciesAny/dependenciesNeutronMass.generated.js';213export { NodeDependencies } from './dependenciesAny/dependenciesNode.generated.js';214export { normDependencies } from './dependenciesAny/dependenciesNorm.generated.js';215export { notDependencies } from './dependenciesAny/dependenciesNot.generated.js';216export { nthRootDependencies } from './dependenciesAny/dependenciesNthRoot.generated.js';217export { nthRootsDependencies } from './dependenciesAny/dependenciesNthRoots.generated.js';218export { nuclearMagnetonDependencies } from './dependenciesAny/dependenciesNuclearMagneton.generated.js';219export { nullDependencies } from './dependenciesAny/dependenciesNull.generated.js';220export { numberDependencies } from './dependenciesAny/dependenciesNumber.generated.js';221export { numericDependencies } from './dependenciesAny/dependenciesNumeric.generated.js';222export { ObjectNodeDependencies } from './dependenciesAny/dependenciesObjectNode.generated.js';223export { octDependencies } from './dependenciesAny/dependenciesOct.generated.js';224export { onesDependencies } from './dependenciesAny/dependenciesOnes.generated.js';225export { OperatorNodeDependencies } from './dependenciesAny/dependenciesOperatorNode.generated.js';226export { orDependencies } from './dependenciesAny/dependenciesOr.generated.js';227export { ParenthesisNodeDependencies } from './dependenciesAny/dependenciesParenthesisNode.generated.js';228export { parseDependencies } from './dependenciesAny/dependenciesParse.generated.js';229export { parserDependencies } from './dependenciesAny/dependenciesParser.generated.js';230export { ParserDependencies } from './dependenciesAny/dependenciesParserClass.generated.js';231export { partitionSelectDependencies } from './dependenciesAny/dependenciesPartitionSelect.generated.js';232export { permutationsDependencies } from './dependenciesAny/dependenciesPermutations.generated.js';233export { phiDependencies } from './dependenciesAny/dependenciesPhi.generated.js';234export { piDependencies } from './dependenciesAny/dependenciesPi.generated.js';235export { pickRandomDependencies } from './dependenciesAny/dependenciesPickRandom.generated.js';236export { pinvDependencies } from './dependenciesAny/dependenciesPinv.generated.js';237export { planckChargeDependencies } from './dependenciesAny/dependenciesPlanckCharge.generated.js';238export { planckConstantDependencies } from './dependenciesAny/dependenciesPlanckConstant.generated.js';239export { planckLengthDependencies } from './dependenciesAny/dependenciesPlanckLength.generated.js';240export { planckMassDependencies } from './dependenciesAny/dependenciesPlanckMass.generated.js';241export { planckTemperatureDependencies } from './dependenciesAny/dependenciesPlanckTemperature.generated.js';242export { planckTimeDependencies } from './dependenciesAny/dependenciesPlanckTime.generated.js';243export { powDependencies } from './dependenciesAny/dependenciesPow.generated.js';244export { printDependencies } from './dependenciesAny/dependenciesPrint.generated.js';245export { prodDependencies } from './dependenciesAny/dependenciesProd.generated.js';246export { protonMassDependencies } from './dependenciesAny/dependenciesProtonMass.generated.js';247export { qrDependencies } from './dependenciesAny/dependenciesQr.generated.js';248export { quantileSeqDependencies } from './dependenciesAny/dependenciesQuantileSeq.generated.js';249export { quantumOfCirculationDependencies } from './dependenciesAny/dependenciesQuantumOfCirculation.generated.js';250export { randomDependencies } from './dependenciesAny/dependenciesRandom.generated.js';251export { randomIntDependencies } from './dependenciesAny/dependenciesRandomInt.generated.js';252export { rangeDependencies } from './dependenciesAny/dependenciesRange.generated.js';253export { RangeDependencies } from './dependenciesAny/dependenciesRangeClass.generated.js';254export { RangeNodeDependencies } from './dependenciesAny/dependenciesRangeNode.generated.js';255export { rangeTransformDependencies } from './dependenciesAny/dependenciesRangeTransform.generated.js';256export { rationalizeDependencies } from './dependenciesAny/dependenciesRationalize.generated.js';257export { reDependencies } from './dependenciesAny/dependenciesRe.generated.js';258export { reducedPlanckConstantDependencies } from './dependenciesAny/dependenciesReducedPlanckConstant.generated.js';259export { RelationalNodeDependencies } from './dependenciesAny/dependenciesRelationalNode.generated.js';260export { replacerDependencies } from './dependenciesAny/dependenciesReplacer.generated.js';261export { reshapeDependencies } from './dependenciesAny/dependenciesReshape.generated.js';262export { resizeDependencies } from './dependenciesAny/dependenciesResize.generated.js';263export { resolveDependencies } from './dependenciesAny/dependenciesResolve.generated.js';264export { ResultSetDependencies } from './dependenciesAny/dependenciesResultSet.generated.js';265export { reviverDependencies } from './dependenciesAny/dependenciesReviver.generated.js';266export { rightArithShiftDependencies } from './dependenciesAny/dependenciesRightArithShift.generated.js';267export { rightLogShiftDependencies } from './dependenciesAny/dependenciesRightLogShift.generated.js';268export { rotateDependencies } from './dependenciesAny/dependenciesRotate.generated.js';269export { rotationMatrixDependencies } from './dependenciesAny/dependenciesRotationMatrix.generated.js';270export { roundDependencies } from './dependenciesAny/dependenciesRound.generated.js';271export { rowDependencies } from './dependenciesAny/dependenciesRow.generated.js';272export { rowTransformDependencies } from './dependenciesAny/dependenciesRowTransform.generated.js';273export { rydbergDependencies } from './dependenciesAny/dependenciesRydberg.generated.js';274export { SQRT1_2Dependencies } from './dependenciesAny/dependenciesSQRT1_2.generated.js'; // eslint-disable-line camelcase275export { SQRT2Dependencies } from './dependenciesAny/dependenciesSQRT2.generated.js';276export { sackurTetrodeDependencies } from './dependenciesAny/dependenciesSackurTetrode.generated.js';277export { secDependencies } from './dependenciesAny/dependenciesSec.generated.js';278export { sechDependencies } from './dependenciesAny/dependenciesSech.generated.js';279export { secondRadiationDependencies } from './dependenciesAny/dependenciesSecondRadiation.generated.js';280export { setCartesianDependencies } from './dependenciesAny/dependenciesSetCartesian.generated.js';281export { setDifferenceDependencies } from './dependenciesAny/dependenciesSetDifference.generated.js';282export { setDistinctDependencies } from './dependenciesAny/dependenciesSetDistinct.generated.js';283export { setIntersectDependencies } from './dependenciesAny/dependenciesSetIntersect.generated.js';284export { setIsSubsetDependencies } from './dependenciesAny/dependenciesSetIsSubset.generated.js';285export { setMultiplicityDependencies } from './dependenciesAny/dependenciesSetMultiplicity.generated.js';286export { setPowersetDependencies } from './dependenciesAny/dependenciesSetPowerset.generated.js';287export { setSizeDependencies } from './dependenciesAny/dependenciesSetSize.generated.js';288export { setSymDifferenceDependencies } from './dependenciesAny/dependenciesSetSymDifference.generated.js';289export { setUnionDependencies } from './dependenciesAny/dependenciesSetUnion.generated.js';290export { signDependencies } from './dependenciesAny/dependenciesSign.generated.js';291export { simplifyDependencies } from './dependenciesAny/dependenciesSimplify.generated.js';292export { simplifyCoreDependencies } from './dependenciesAny/dependenciesSimplifyCore.generated.js';293export { sinDependencies } from './dependenciesAny/dependenciesSin.generated.js';294export { sinhDependencies } from './dependenciesAny/dependenciesSinh.generated.js';295export { sizeDependencies } from './dependenciesAny/dependenciesSize.generated.js';296export { sluDependencies } from './dependenciesAny/dependenciesSlu.generated.js';297export { smallerDependencies } from './dependenciesAny/dependenciesSmaller.generated.js';298export { smallerEqDependencies } from './dependenciesAny/dependenciesSmallerEq.generated.js';299export { sortDependencies } from './dependenciesAny/dependenciesSort.generated.js';300export { SpaDependencies } from './dependenciesAny/dependenciesSpaClass.generated.js';301export { sparseDependencies } from './dependenciesAny/dependenciesSparse.generated.js';302export { SparseMatrixDependencies } from './dependenciesAny/dependenciesSparseMatrixClass.generated.js';303export { speedOfLightDependencies } from './dependenciesAny/dependenciesSpeedOfLight.generated.js';304export { splitUnitDependencies } from './dependenciesAny/dependenciesSplitUnit.generated.js';305export { sqrtDependencies } from './dependenciesAny/dependenciesSqrt.generated.js';306export { sqrtmDependencies } from './dependenciesAny/dependenciesSqrtm.generated.js';307export { squareDependencies } from './dependenciesAny/dependenciesSquare.generated.js';308export { squeezeDependencies } from './dependenciesAny/dependenciesSqueeze.generated.js';309export { stdDependencies } from './dependenciesAny/dependenciesStd.generated.js';310export { stdTransformDependencies } from './dependenciesAny/dependenciesStdTransform.generated.js';311export { stefanBoltzmannDependencies } from './dependenciesAny/dependenciesStefanBoltzmann.generated.js';312export { stirlingS2Dependencies } from './dependenciesAny/dependenciesStirlingS2.generated.js';313export { stringDependencies } from './dependenciesAny/dependenciesString.generated.js';314export { subsetDependencies } from './dependenciesAny/dependenciesSubset.generated.js';315export { subsetTransformDependencies } from './dependenciesAny/dependenciesSubsetTransform.generated.js';316export { subtractDependencies } from './dependenciesAny/dependenciesSubtract.generated.js';317export { sumDependencies } from './dependenciesAny/dependenciesSum.generated.js';318export { sumTransformDependencies } from './dependenciesAny/dependenciesSumTransform.generated.js';319export { SymbolNodeDependencies } from './dependenciesAny/dependenciesSymbolNode.generated.js';320export { symbolicEqualDependencies } from './dependenciesAny/dependenciesSymbolicEqual.generated.js';321export { tanDependencies } from './dependenciesAny/dependenciesTan.generated.js';322export { tanhDependencies } from './dependenciesAny/dependenciesTanh.generated.js';323export { tauDependencies } from './dependenciesAny/dependenciesTau.generated.js';324export { thomsonCrossSectionDependencies } from './dependenciesAny/dependenciesThomsonCrossSection.generated.js';325export { toDependencies } from './dependenciesAny/dependenciesTo.generated.js';326export { traceDependencies } from './dependenciesAny/dependenciesTrace.generated.js';327export { transposeDependencies } from './dependenciesAny/dependenciesTranspose.generated.js';328export { trueDependencies } from './dependenciesAny/dependenciesTrue.generated.js';329export { typeOfDependencies } from './dependenciesAny/dependenciesTypeOf.generated.js';330export { typedDependencies } from './dependenciesAny/dependenciesTyped.generated.js';331export { unaryMinusDependencies } from './dependenciesAny/dependenciesUnaryMinus.generated.js';332export { unaryPlusDependencies } from './dependenciesAny/dependenciesUnaryPlus.generated.js';333export { unequalDependencies } from './dependenciesAny/dependenciesUnequal.generated.js';334export { UnitDependencies } from './dependenciesAny/dependenciesUnitClass.generated.js';335export { unitDependencies } from './dependenciesAny/dependenciesUnitFunction.generated.js';336export { EDependencies } from './dependenciesAny/dependenciesUppercaseE.generated.js';337export { PIDependencies } from './dependenciesAny/dependenciesUppercasePi.generated.js';338export { usolveDependencies } from './dependenciesAny/dependenciesUsolve.generated.js';339export { usolveAllDependencies } from './dependenciesAny/dependenciesUsolveAll.generated.js';340export { vacuumImpedanceDependencies } from './dependenciesAny/dependenciesVacuumImpedance.generated.js';341export { varianceDependencies } from './dependenciesAny/dependenciesVariance.generated.js';342export { varianceTransformDependencies } from './dependenciesAny/dependenciesVarianceTransform.generated.js';343export { versionDependencies } from './dependenciesAny/dependenciesVersion.generated.js';344export { weakMixingAngleDependencies } from './dependenciesAny/dependenciesWeakMixingAngle.generated.js';345export { wienDisplacementDependencies } from './dependenciesAny/dependenciesWienDisplacement.generated.js';346export { xgcdDependencies } from './dependenciesAny/dependenciesXgcd.generated.js';347export { xorDependencies } from './dependenciesAny/dependenciesXor.generated.js';348export { zerosDependencies } from './dependenciesAny/dependenciesZeros.generated.js';...
modularize.js
Source:modularize.js
1/**2 * @author mrdoob / http://mrdoob.com/3 * @author Mugen87 / https://github.com/Mugen874 */5var fs = require( 'fs' );6THREE = require( '../build/three.js' );7var srcFolder = __dirname + '/../examples/js/';8var dstFolder = __dirname + '/../examples/jsm/';9var files = [10 { path: 'animation/AnimationClipCreator.js', dependencies: [], ignoreList: [] },11 { path: 'animation/CCDIKSolver.js', dependencies: [], ignoreList: [ 'SkinnedMesh' ] },12 { path: 'animation/MMDAnimationHelper.js', dependencies: [ { name: 'CCDIKSolver', path: 'animation/CCDIKSolver.js' }, { name: 'MMDPhysics', path: 'animation/MMDPhysics.js' } ], ignoreList: [ 'AnimationClip', 'Audio', 'Camera', 'SkinnedMesh' ] },13 { path: 'animation/MMDPhysics.js', dependencies: [], ignoreList: [ 'SkinnedMesh' ] },14 { path: 'animation/TimelinerController.js', dependencies: [], ignoreList: [] },15 { path: 'cameras/CinematicCamera.js', dependencies: [ { name: 'BokehShader', path: 'shaders/BokehShader2.js' }, { name: 'BokehDepthShader', path: 'shaders/BokehShader2.js' } ], ignoreList: [] },16 { path: 'controls/DragControls.js', dependencies: [], ignoreList: [] },17 { path: 'controls/DeviceOrientationControls.js', dependencies: [], ignoreList: [] },18 { path: 'controls/FirstPersonControls.js', dependencies: [], ignoreList: [] },19 { path: 'controls/FlyControls.js', dependencies: [], ignoreList: [] },20 { path: 'controls/OrbitControls.js', dependencies: [], ignoreList: [] },21 { path: 'controls/PointerLockControls.js', dependencies: [], ignoreList: [] },22 { path: 'controls/TrackballControls.js', dependencies: [], ignoreList: [] },23 { path: 'controls/TransformControls.js', dependencies: [], ignoreList: [] },24 { path: 'curves/CurveExtras.js', dependencies: [], ignoreList: [] },25 { path: 'curves/NURBSCurve.js', dependencies: [ { name: 'NURBSUtils', path: 'curves/NURBSUtils.js' } ], ignoreList: [] },26 { path: 'curves/NURBSSurface.js', dependencies: [ { name: 'NURBSUtils', path: 'curves/NURBSUtils.js' } ], ignoreList: [] },27 { path: 'curves/NURBSUtils.js', dependencies: [], ignoreList: [] },28 { path: 'effects/AnaglyphEffect.js', dependencies: [], ignoreList: [] },29 { path: 'effects/AsciiEffect.js', dependencies: [], ignoreList: [] },30 { path: 'effects/OutlineEffect.js', dependencies: [], ignoreList: [] },31 { path: 'effects/ParallaxBarrierEffect.js', dependencies: [], ignoreList: [] },32 { path: 'effects/PeppersGhostEffect.js', dependencies: [], ignoreList: [] },33 { path: 'effects/StereoEffect.js', dependencies: [], ignoreList: [] },34 { path: 'exporters/ColladaExporter.js', dependencies: [], ignoreList: [] },35 { path: 'exporters/DRACOExporter.js', dependencies: [], ignoreList: [ 'Geometry' ] },36 { path: 'exporters/GLTFExporter.js', dependencies: [], ignoreList: [ 'AnimationClip', 'Camera', 'Geometry', 'Material', 'Mesh', 'Object3D', 'RGBFormat', 'Scenes', 'ShaderMaterial' ] },37 { path: 'exporters/MMDExporter.js', dependencies: [ { name: 'MMDParser', path: 'libs/mmdparser.module.js' } ], ignoreList: [] },38 { path: 'exporters/OBJExporter.js', dependencies: [], ignoreList: [] },39 { path: 'exporters/PLYExporter.js', dependencies: [], ignoreList: [] },40 { path: 'exporters/STLExporter.js', dependencies: [], ignoreList: [] },41 { path: 'exporters/TypedGeometryExporter.js', dependencies: [], ignoreList: [] },42 { path: 'geometries/BoxLineGeometry.js', dependencies: [], ignoreList: [] },43 { path: 'geometries/ConvexGeometry.js', dependencies: [ { name: 'ConvexHull', path: 'math/ConvexHull.js' } ], ignoreList: [] },44 { path: 'geometries/DecalGeometry.js', dependencies: [], ignoreList: [] },45 { path: 'geometries/LightningStrike.js', dependencies: [ { name: 'SimplexNoise', path: 'math/SimplexNoise.js' } ], ignoreList: [ 'Mesh' ] },46 { path: 'geometries/ParametricGeometries.js', dependencies: [], ignoreList: [] },47 { path: 'geometries/TeapotBufferGeometry.js', dependencies: [], ignoreList: [] },48 { path: 'interactive/SelectionBox.js', dependencies: [], ignoreList: [] },49 { path: 'interactive/SelectionHelper.js', dependencies: [], ignoreList: [] },50 { path: 'lights/LightProbeGenerator.js', dependencies: [], ignoreList: [] },51 { path: 'lights/RectAreaLightUniformsLib.js', dependencies: [], ignoreList: [] },52 { path: 'lines/Line2.js', dependencies: [ { name: 'LineSegments2', path: 'lines/LineSegments2.js' }, { name: 'LineGeometry', path: 'lines/LineGeometry.js' }, { name: 'LineMaterial', path: 'lines/LineMaterial.js' } ], ignoreList: [] },53 { path: 'lines/LineGeometry.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' } ], ignoreList: [] },54 { path: 'lines/LineMaterial.js', dependencies: [], ignoreList: [] },55 { path: 'lines/LineSegments2.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' }, { name: 'LineMaterial', path: 'lines/LineMaterial.js' } ], ignoreList: [] },56 { path: 'lines/LineSegmentsGeometry.js', dependencies: [], ignoreList: [] },57 { path: 'lines/Wireframe.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' }, { name: 'LineMaterial', path: 'lines/LineMaterial.js' } ], ignoreList: [] },58 { path: 'lines/WireframeGeometry2.js', dependencies: [ { name: 'LineSegmentsGeometry', path: 'lines/LineSegmentsGeometry.js' } ], ignoreList: [] },59 { path: 'loaders/3MFLoader.js', dependencies: [], ignoreList: [] },60 { path: 'loaders/AMFLoader.js', dependencies: [], ignoreList: [] },61 { path: 'loaders/AssimpLoader.js', dependencies: [], ignoreList: [] },62 { path: 'loaders/BasisTextureLoader.js', dependencies: [], ignoreList: [] },63 { path: 'loaders/BVHLoader.js', dependencies: [], ignoreList: [ 'Bones' ] },64 { path: 'loaders/ColladaLoader.js', dependencies: [ { name: 'TGALoader', path: 'loaders/TGALoader.js' } ], ignoreList: [] },65 { path: 'loaders/DDSLoader.js', dependencies: [], ignoreList: [] },66 { path: 'loaders/DRACOLoader.js', dependencies: [], ignoreList: [ 'LoadingManager' ] },67 { path: 'loaders/EXRLoader.js', dependencies: [ { name: 'Zlib', path: 'libs/inflate.module.min.js' } ], ignoreList: [] },68 { path: 'loaders/FBXLoader.js', dependencies: [ { name: 'Zlib', path: 'libs/inflate.module.min.js' }, { name: 'NURBSCurve', path: 'curves/NURBSCurve.js' } ], ignoreList: [] },69 { path: 'loaders/GCodeLoader.js', dependencies: [], ignoreList: [] },70 { path: 'loaders/GLTFLoader.js', dependencies: [], ignoreList: [ 'NoSide', 'Matrix2', 'Camera', 'Texture' ] },71 { path: 'loaders/HDRCubeTextureLoader.js', dependencies: [ { name: 'RGBELoader', path: 'loaders/RGBELoader.js' } ], ignoreList: [] },72 { path: 'loaders/KMZLoader.js', dependencies: [ { name: 'ColladaLoader', path: 'loaders/ColladaLoader.js' } ], ignoreList: [] },73 { path: 'loaders/LDrawLoader.js', dependencies: [], ignoreList: [ 'Cache', 'Material', 'Object3D' ] },74 { path: 'loaders/LWOLoader.js', dependencies: [], ignoreList: [] },75 { path: 'loaders/KTXLoader.js', dependencies: [], ignoreList: [] },76 { path: 'loaders/MD2Loader.js', dependencies: [], ignoreList: [] },77 { path: 'loaders/MMDLoader.js', dependencies: [ { name: 'TGALoader', path: 'loaders/TGALoader.js' }, { name: 'MMDParser', path: 'libs/mmdparser.module.js' } ], ignoreList: [ 'Camera', 'LoadingManager' ] },78 { path: 'loaders/MTLLoader.js', dependencies: [], ignoreList: [ 'BackSide', 'DoubleSide', 'ClampToEdgeWrapping', 'MirroredRepeatWrapping' ] },79 { path: 'loaders/NRRDLoader.js', dependencies: [ { name: 'Zlib', path: 'libs/gunzip.module.min.js' }, { name: 'Volume', path: 'misc/Volume.js' } ], ignoreList: [] },80 { path: 'loaders/OBJLoader.js', dependencies: [], ignoreList: [] },81 { path: 'loaders/PCDLoader.js', dependencies: [], ignoreList: [] },82 { path: 'loaders/PDBLoader.js', dependencies: [], ignoreList: [] },83 { path: 'loaders/PLYLoader.js', dependencies: [], ignoreList: [ 'Mesh' ] },84 { path: 'loaders/PRWMLoader.js', dependencies: [], ignoreList: [] },85 { path: 'loaders/PVRLoader.js', dependencies: [], ignoreList: [] },86 { path: 'loaders/RGBELoader.js', dependencies: [], ignoreList: [ 'RGBAFormat' ] },87 { path: 'loaders/STLLoader.js', dependencies: [], ignoreList: [ 'Mesh', 'MeshPhongMaterial' ] },88 { path: 'loaders/SVGLoader.js', dependencies: [], ignoreList: [ 'Color' ] },89 { path: 'loaders/TDSLoader.js', dependencies: [], ignoreList: [] },90 { path: 'loaders/TGALoader.js', dependencies: [], ignoreList: [] },91 { path: 'loaders/TTFLoader.js', dependencies: [], ignoreList: [ 'Font' ] },92 { path: 'loaders/VRMLLoader.js', dependencies: [ { name: 'chevrotain', path: 'libs/chevrotain.module.min.js' } ], ignoreList: [] },93 { path: 'loaders/VRMLoader.js', dependencies: [ { name: 'GLTFLoader', path: 'loaders/GLTFLoader.js' } ], ignoreList: [] },94 { path: 'loaders/VTKLoader.js', dependencies: [ { name: 'Zlib', path: 'libs/inflate.module.min.js' } ], ignoreList: [] },95 { path: 'loaders/XLoader.js', dependencies: [], ignoreList: [] },96 { path: 'math/ColorConverter.js', dependencies: [], ignoreList: [] },97 { path: 'math/ConvexHull.js', dependencies: [], ignoreList: [] },98 { path: 'math/ImprovedNoise.js', dependencies: [], ignoreList: [] },99 { path: 'math/Lut.js', dependencies: [], ignoreList: [] },100 { path: 'math/SimplexNoise.js', dependencies: [], ignoreList: [] },101 { path: 'misc/ConvexObjectBreaker.js', dependencies: [ { name: 'ConvexBufferGeometry', path: 'geometries/ConvexGeometry.js' } ], ignoreList: [ 'Matrix4' ] },102 { path: 'misc/GPUComputationRenderer.js', dependencies: [], ignoreList: [] },103 { path: 'misc/Gyroscope.js', dependencies: [], ignoreList: [] },104 { path: 'misc/MD2Character.js', dependencies: [ { name: 'MD2Loader', path: 'loaders/MD2Loader.js' } ], ignoreList: [] },105 { path: 'misc/MD2CharacterComplex.js', dependencies: [ { name: 'MD2Loader', path: 'loaders/MD2Loader.js' }, { name: 'MorphBlendMesh', path: 'misc/MorphBlendMesh.js' } ], ignoreList: [] },106 { path: 'misc/MorphAnimMesh.js', dependencies: [], ignoreList: [] },107 { path: 'misc/MorphBlendMesh.js', dependencies: [], ignoreList: [] },108 { path: 'misc/Ocean.js', dependencies: [ { name: 'OceanShaders', path: 'shaders/OceanShaders.js' } ], ignoreList: [] },109 { path: 'misc/RollerCoaster.js', dependencies: [], ignoreList: [] },110 { path: 'misc/Volume.js', dependencies: [ { name: 'VolumeSlice', path: 'misc/VolumeSlice.js' } ], ignoreList: [] },111 { path: 'misc/VolumeSlice.js', dependencies: [], ignoreList: [] },112 { path: 'modifiers/ExplodeModifier.js', dependencies: [], ignoreList: [] },113 { path: 'modifiers/SimplifyModifier.js', dependencies: [], ignoreList: [] },114 { path: 'modifiers/SubdivisionModifier.js', dependencies: [], ignoreList: [] },115 { path: 'modifiers/TessellateModifier.js', dependencies: [], ignoreList: [] },116 { path: 'objects/Fire.js', dependencies: [], ignoreList: [] },117 { path: 'objects/Lensflare.js', dependencies: [], ignoreList: [] },118 { path: 'objects/LightningStorm.js', dependencies: [ { name: 'LightningStrike', path: 'geometries/LightningStrike.js' } ], ignoreList: [ 'Material' ] },119 { path: 'objects/MarchingCubes.js', dependencies: [], ignoreList: [] },120 { path: 'objects/Reflector.js', dependencies: [], ignoreList: [] },121 { path: 'objects/Refractor.js', dependencies: [], ignoreList: [] },122 { path: 'objects/ReflectorRTT.js', dependencies: [ { name: 'Reflector', path: 'objects/Reflector.js' } ], ignoreList: [] },123 { path: 'objects/ShadowMesh.js', dependencies: [], ignoreList: [] },124 { path: 'objects/Sky.js', dependencies: [], ignoreList: [] },125 { path: 'objects/Water.js', dependencies: [], ignoreList: [] },126 { path: 'objects/Water2.js', dependencies: [ { name: 'Reflector', path: 'objects/Reflector.js' }, { name: 'Refractor', path: 'objects/Refractor.js' } ], ignoreList: [] },127 { path: 'postprocessing/AdaptiveToneMappingPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' }, { name: 'LuminosityShader', path: 'shaders/LuminosityShader.js' }, { name: 'ToneMapShader', path: 'shaders/ToneMapShader.js' } ], ignoreList: [] },128 { path: 'postprocessing/AfterimagePass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'AfterimageShader', path: 'shaders/AfterimageShader.js' } ], ignoreList: [] },129 { path: 'postprocessing/BloomPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' }, { name: 'ConvolutionShader', path: 'shaders/ConvolutionShader.js' } ], ignoreList: [] },130 { path: 'postprocessing/BokehPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'BokehShader', path: 'shaders/BokehShader.js' } ], ignoreList: [] },131 { path: 'postprocessing/ClearPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' } ], ignoreList: [] },132 { path: 'postprocessing/CubeTexturePass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' } ], ignoreList: [] },133 { path: 'postprocessing/DotScreenPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'DotScreenShader', path: 'shaders/DotScreenShader.js' } ], ignoreList: [] },134 { path: 'postprocessing/EffectComposer.js', dependencies: [ { name: 'CopyShader', path: 'shaders/CopyShader.js' }, { name: 'ShaderPass', path: 'postprocessing/ShaderPass.js' }, { name: 'MaskPass', path: 'postprocessing/MaskPass.js' }, { name: 'ClearMaskPass', path: 'postprocessing/MaskPass.js' } ], ignoreList: [] },135 { path: 'postprocessing/FilmPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'FilmShader', path: 'shaders/FilmShader.js' } ], ignoreList: [] },136 { path: 'postprocessing/GlitchPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'DigitalGlitch', path: 'shaders/DigitalGlitch.js' } ], ignoreList: [] },137 { path: 'postprocessing/HalftonePass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'HalftoneShader', path: 'shaders/HalftoneShader.js' } ], ignoreList: [] },138 { path: 'postprocessing/MaskPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' } ], ignoreList: [] },139 { path: 'postprocessing/OutlinePass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' } ], ignoreList: [] },140 { path: 'postprocessing/RenderPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' } ], ignoreList: [] },141 { path: 'postprocessing/SAOPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'SAOShader', path: 'shaders/SAOShader.js' }, { name: 'DepthLimitedBlurShader', path: 'shaders/DepthLimitedBlurShader.js' }, { name: 'BlurShaderUtils', path: 'shaders/DepthLimitedBlurShader.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' }, { name: 'UnpackDepthRGBAShader', path: 'shaders/UnpackDepthRGBAShader.js' } ], ignoreList: [] },142 { path: 'postprocessing/SavePass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' } ], ignoreList: [] },143 { path: 'postprocessing/ShaderPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' } ], ignoreList: [] },144 { path: 'postprocessing/SMAAPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'SMAAEdgesShader', path: 'shaders/SMAAShader.js' }, { name: 'SMAAWeightsShader', path: 'shaders/SMAAShader.js' }, { name: 'SMAABlendShader', path: 'shaders/SMAAShader.js' } ], ignoreList: [] },145 { path: 'postprocessing/SSAARenderPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' } ], ignoreList: [] },146 { path: 'postprocessing/SSAOPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'SimplexNoise', path: 'math/SimplexNoise.js' }, { name: 'SSAOShader', path: 'shaders/SSAOShader.js' }, { name: 'SSAOBlurShader', path: 'shaders/SSAOShader.js' }, { name: 'SSAODepthShader', path: 'shaders/SSAOShader.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' } ], ignoreList: [] },147 { path: 'postprocessing/TAARenderPass.js', dependencies: [ { name: 'SSAARenderPass', path: 'postprocessing/SSAARenderPass.js' } ], ignoreList: [] },148 { path: 'postprocessing/TexturePass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' } ], ignoreList: [] },149 { path: 'postprocessing/UnrealBloomPass.js', dependencies: [ { name: 'Pass', path: 'postprocessing/Pass.js' }, { name: 'CopyShader', path: 'shaders/CopyShader.js' }, { name: 'LuminosityHighPassShader', path: 'shaders/LuminosityHighPassShader.js' } ], ignoreList: [] },150 { path: 'renderers/CSS2DRenderer.js', dependencies: [], ignoreList: [] },151 { path: 'renderers/CSS3DRenderer.js', dependencies: [], ignoreList: [] },152 { path: 'renderers/Projector.js', dependencies: [], ignoreList: [] },153 { path: 'renderers/SVGRenderer.js', dependencies: [ { name: 'Projector', path: 'renderers/Projector.js' }, { name: 'RenderableFace', path: 'renderers/Projector.js' }, { name: 'RenderableLine', path: 'renderers/Projector.js' }, { name: 'RenderableSprite', path: 'renderers/Projector.js' } ], ignoreList: [] },154 { path: 'shaders/AfterimageShader.js', dependencies: [], ignoreList: [] },155 { path: 'shaders/BasicShader.js', dependencies: [], ignoreList: [] },156 { path: 'shaders/BleachBypassShader.js', dependencies: [], ignoreList: [] },157 { path: 'shaders/BlendShader.js', dependencies: [], ignoreList: [] },158 { path: 'shaders/BokehShader.js', dependencies: [], ignoreList: [] },159 { path: 'shaders/BokehShader2.js', dependencies: [], ignoreList: [] },160 { path: 'shaders/BrightnessContrastShader.js', dependencies: [], ignoreList: [] },161 { path: 'shaders/ColorCorrectionShader.js', dependencies: [], ignoreList: [] },162 { path: 'shaders/ColorifyShader.js', dependencies: [], ignoreList: [] },163 { path: 'shaders/ConvolutionShader.js', dependencies: [], ignoreList: [] },164 { path: 'shaders/CopyShader.js', dependencies: [], ignoreList: [] },165 { path: 'shaders/DepthLimitedBlurShader.js', dependencies: [], ignoreList: [] },166 { path: 'shaders/DigitalGlitch.js', dependencies: [], ignoreList: [] },167 { path: 'shaders/DOFMipMapShader.js', dependencies: [], ignoreList: [] },168 { path: 'shaders/DotScreenShader.js', dependencies: [], ignoreList: [] },169 { path: 'shaders/FilmShader.js', dependencies: [], ignoreList: [] },170 { path: 'shaders/FocusShader.js', dependencies: [], ignoreList: [] },171 { path: 'shaders/FreiChenShader.js', dependencies: [], ignoreList: [] },172 { path: 'shaders/FresnelShader.js', dependencies: [], ignoreList: [] },173 { path: 'shaders/FXAAShader.js', dependencies: [], ignoreList: [] },174 { path: 'shaders/GammaCorrectionShader.js', dependencies: [], ignoreList: [] },175 { path: 'shaders/GodRaysShader.js', dependencies: [], ignoreList: [ 'MeshDepthMaterial' ] },176 { path: 'shaders/HalftoneShader.js', dependencies: [], ignoreList: [] },177 { path: 'shaders/HorizontalBlurShader.js', dependencies: [], ignoreList: [] },178 { path: 'shaders/HorizontalTiltShiftShader.js', dependencies: [], ignoreList: [] },179 { path: 'shaders/HueSaturationShader.js', dependencies: [], ignoreList: [] },180 { path: 'shaders/KaleidoShader.js', dependencies: [], ignoreList: [] },181 { path: 'shaders/LuminosityHighPassShader.js', dependencies: [], ignoreList: [] },182 { path: 'shaders/LuminosityShader.js', dependencies: [], ignoreList: [] },183 { path: 'shaders/MirrorShader.js', dependencies: [], ignoreList: [] },184 { path: 'shaders/NormalMapShader.js', dependencies: [], ignoreList: [] },185 { path: 'shaders/OceanShaders.js', dependencies: [], ignoreList: [] },186 { path: 'shaders/ParallaxShader.js', dependencies: [], ignoreList: [] },187 { path: 'shaders/PixelShader.js', dependencies: [], ignoreList: [] },188 { path: 'shaders/RGBShiftShader.js', dependencies: [], ignoreList: [] },189 { path: 'shaders/SAOShader.js', dependencies: [], ignoreList: [] },190 { path: 'shaders/SepiaShader.js', dependencies: [], ignoreList: [] },191 { path: 'shaders/SMAAShader.js', dependencies: [], ignoreList: [] },192 { path: 'shaders/SobelOperatorShader.js', dependencies: [], ignoreList: [] },193 { path: 'shaders/SSAOShader.js', dependencies: [], ignoreList: [] },194 { path: 'shaders/TechnicolorShader.js', dependencies: [], ignoreList: [] },195 { path: 'shaders/ToneMapShader.js', dependencies: [], ignoreList: [] },196 { path: 'shaders/ToonShader.js', dependencies: [], ignoreList: [] },197 { path: 'shaders/TranslucentShader.js', dependencies: [], ignoreList: [] },198 { path: 'shaders/TriangleBlurShader.js', dependencies: [], ignoreList: [] },199 { path: 'shaders/UnpackDepthRGBAShader.js', dependencies: [], ignoreList: [] },200 { path: 'shaders/VerticalBlurShader.js', dependencies: [], ignoreList: [] },201 { path: 'shaders/VerticalTiltShiftShader.js', dependencies: [], ignoreList: [] },202 { path: 'shaders/VignetteShader.js', dependencies: [], ignoreList: [] },203 { path: 'shaders/VolumeShader.js', dependencies: [], ignoreList: [] },204 { path: 'shaders/WaterRefractionShader.js', dependencies: [], ignoreList: [] },205 { path: 'utils/BufferGeometryUtils.js', dependencies: [], ignoreList: [] },206 { path: 'utils/GeometryUtils.js', dependencies: [], ignoreList: [] },207 { path: 'utils/SceneUtils.js', dependencies: [], ignoreList: [] },208 { path: 'utils/ShadowMapViewer.js', dependencies: [ { name: 'UnpackDepthRGBAShader', path: 'shaders/UnpackDepthRGBAShader.js' } ], ignoreList: [] },209 { path: 'utils/SkeletonUtils.js', dependencies: [], ignoreList: [] },210 { path: 'utils/TypedArrayUtils.js', dependencies: [], ignoreList: [] },211 { path: 'utils/UVsDebug.js', dependencies: [], ignoreList: [ 'SphereBufferGeometry' ] },212 { path: 'WebGL.js', dependencies: [], ignoreList: [] },213];214for ( var i = 0; i < files.length; i ++ ) {215 var file = files[ i ];216 convert( file.path, file.dependencies, file.ignoreList );217}218//219function convert( path, exampleDependencies, ignoreList ) {220 var contents = fs.readFileSync( srcFolder + path, 'utf8' );221 var classNames = [];222 var coreDependencies = {};223 // imports224 contents = contents.replace( /^\/\*+[^*]*\*+(?:[^/*][^*]*\*+)*\//, function ( match ) {225 return `${match}\n\n_IMPORTS_`;226 } );227 // class name228 contents = contents.replace( /THREE\.([a-zA-Z0-9]+) = /g, function ( match, p1 ) {229 classNames.push( p1 );230 console.log( p1 );231 return `var ${p1} = `;232 } );233 contents = contents.replace( /(\'?)THREE\.([a-zA-Z0-9]+)(\.{0,1})/g, function ( match, p1, p2, p3 ) {234 if ( p1 === '\'' ) return match; // Inside a string235 if ( classNames.includes( p2 ) ) return `${p2}${p3}`;236 return match;237 } );238 // methods239 contents = contents.replace( /new THREE\.([a-zA-Z0-9]+)\(/g, function ( match, p1 ) {240 if ( ignoreList.includes( p1 ) ) return match;241 if ( p1 in THREE ) coreDependencies[ p1 ] = true;242 return `new ${p1}(`;243 } );244 // constants245 contents = contents.replace( /(\'?)THREE\.([a-zA-Z0-9_]+)/g, function ( match, p1, p2 ) {246 if ( ignoreList.includes( p2 ) ) return match;247 if ( p1 === '\'' ) return match; // Inside a string248 if ( classNames.includes( p2 ) ) return p2;249 if ( p2 in THREE ) coreDependencies[ p2 ] = true;250 // console.log( match, p2 );251 return `${p2}`;252 } );253 //254 var keys = Object.keys( coreDependencies )255 .filter( value => ! classNames.includes( value ) )256 .map( value => '\n\t' + value )257 .sort()258 .toString();259 var imports = '';260 // compute path prefix for imports/exports261 var level = path.split( '/' ).length - 1;262 var pathPrefix = '../'.repeat( level );263 // core imports264 if ( keys ) imports += `import {${keys}\n} from "${pathPrefix}../../build/three.module.js";`;265 // example imports266 for ( var dependency of exampleDependencies ) {267 imports += `\nimport { ${dependency.name} } from "${pathPrefix}${dependency.path}";`;268 }269 // exports270 var exports = `export { ${classNames.join( ", " )} };\n`;271 var output = contents.replace( '_IMPORTS_', imports ) + '\n' + exports;272 // console.log( output );273 fs.writeFileSync( dstFolder + path, output, 'utf-8' );...
instrumented_libraries.gyp
Source:instrumented_libraries.gyp
1# Copyright 2013 The Chromium Authors. All rights reserved.2# Use of this source code is governed by a BSD-style license that can be3# found in the LICENSE file.4{5 # Default value for all libraries.6 'extra_configure_flags': '',7 'extra_cflags': '',8 'extra_cxxflags': '',9 'extra_ldflags': '',10 'run_before_build': '',11 'build_method': 'destdir',12 'variables': {13 'verbose_libraries_build%': 0,14 'instrumented_libraries_jobs%': 1,15 },16 'jobs': '<(instrumented_libraries_jobs)',17 'conditions': [18 ['asan==1', {19 'sanitizer_type': 'asan',20 'sanitizer_blacklist': '',21 }],22 ['msan==1', {23 'sanitizer_type': 'msan',24 'sanitizer_blacklist': '<(msan_blacklist)',25 }],26 ['tsan==1', {27 'sanitizer_type': 'tsan',28 'sanitizer_blacklist': '<(tsan_blacklist)',29 }],30 ['use_goma==1', {31 'cc': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',32 'cxx': '<(gomadir)/gomacc <!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',33 }, {34 'cc': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang',35 'cxx': '<!(cd <(DEPTH) && pwd -P)/<(make_clang_dir)/bin/clang++',36 }],37 ],38 'targets': [39 {40 'target_name': 'instrumented_libraries',41 'type': 'none',42 'variables': {43 'prune_self_dependency': 1,44 # Don't add this target to the dependencies of targets with type=none.45 'link_dependency': 1,46 },47 'dependencies': [48 '<(_sanitizer_type)-libcairo2',49 '<(_sanitizer_type)-libexpat1',50 '<(_sanitizer_type)-libffi6',51 '<(_sanitizer_type)-libgcrypt11',52 '<(_sanitizer_type)-libgpg-error0',53 '<(_sanitizer_type)-libnspr4',54 '<(_sanitizer_type)-libp11-kit0',55 '<(_sanitizer_type)-libpcre3',56 '<(_sanitizer_type)-libpng12-0',57 '<(_sanitizer_type)-libx11-6',58 '<(_sanitizer_type)-libxau6',59 '<(_sanitizer_type)-libxcb1',60 '<(_sanitizer_type)-libxcomposite1',61 '<(_sanitizer_type)-libxcursor1',62 '<(_sanitizer_type)-libxdamage1',63 '<(_sanitizer_type)-libxdmcp6',64 '<(_sanitizer_type)-libxext6',65 '<(_sanitizer_type)-libxfixes3',66 '<(_sanitizer_type)-libxi6',67 '<(_sanitizer_type)-libxinerama1',68 '<(_sanitizer_type)-libxrandr2',69 '<(_sanitizer_type)-libxrender1',70 '<(_sanitizer_type)-libxss1',71 '<(_sanitizer_type)-libxtst6',72 '<(_sanitizer_type)-zlib1g',73 '<(_sanitizer_type)-libglib2.0-0',74 '<(_sanitizer_type)-libdbus-1-3',75 '<(_sanitizer_type)-libdbus-glib-1-2',76 '<(_sanitizer_type)-nss',77 '<(_sanitizer_type)-libfontconfig1',78 '<(_sanitizer_type)-pulseaudio',79 '<(_sanitizer_type)-libasound2',80 '<(_sanitizer_type)-pango1.0',81 '<(_sanitizer_type)-libcap2',82 '<(_sanitizer_type)-libudev0',83 '<(_sanitizer_type)-libtasn1-3',84 '<(_sanitizer_type)-libgnome-keyring0',85 '<(_sanitizer_type)-libgtk2.0-0',86 '<(_sanitizer_type)-libgdk-pixbuf2.0-0',87 '<(_sanitizer_type)-libpci3',88 '<(_sanitizer_type)-libdbusmenu-glib4',89 '<(_sanitizer_type)-liboverlay-scrollbar-0.2-0',90 '<(_sanitizer_type)-libgconf-2-4',91 '<(_sanitizer_type)-libappindicator1',92 '<(_sanitizer_type)-libdbusmenu',93 '<(_sanitizer_type)-atk1.0',94 '<(_sanitizer_type)-libunity9',95 '<(_sanitizer_type)-dee',96 ],97 'conditions': [98 ['asan==1', {99 'dependencies': [100 '<(_sanitizer_type)-libpixman-1-0',101 ],102 }],103 ['msan==1', {104 'dependencies': [105 '<(_sanitizer_type)-libcups2',106 ],107 }],108 ['tsan==1', {109 'dependencies!': [110 '<(_sanitizer_type)-libpng12-0',111 ],112 }],113 ],114 'actions': [115 {116 'action_name': 'fix_rpaths',117 'inputs': [118 'fix_rpaths.sh',119 ],120 'outputs': [121 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)/rpaths.fixed.txt',122 ],123 'action': [124 '<(DEPTH)/third_party/instrumented_libraries/fix_rpaths.sh',125 '<(PRODUCT_DIR)/instrumented_libraries/<(_sanitizer_type)'126 ],127 },128 ],129 'direct_dependent_settings': {130 'target_conditions': [131 ['_toolset=="target"', {132 'ldflags': [133 # Add RPATH to result binary to make it linking instrumented libraries ($ORIGIN means relative RPATH)134 '-Wl,-R,\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/lib/:\$$ORIGIN/instrumented_libraries/<(_sanitizer_type)/usr/lib/x86_64-linux-gnu/',135 '-Wl,-z,origin',136 ],137 }],138 ],139 },140 },141 {142 'library_name': 'freetype',143 'dependencies=': [],144 'run_before_build': 'freetype.sh',145 'includes': ['standard_instrumented_library_target.gypi'],146 },147 {148 'library_name': 'libcairo2',149 'dependencies=': [],150 'extra_configure_flags': '--disable-gtk-doc',151 'includes': ['standard_instrumented_library_target.gypi'],152 },153 {154 'library_name': 'libdbus-1-3',155 'dependencies=': [156 '<(_sanitizer_type)-libglib2.0-0',157 ],158 'includes': ['standard_instrumented_library_target.gypi'],159 },160 {161 'library_name': 'libdbus-glib-1-2',162 'dependencies=': [163 '<(_sanitizer_type)-libglib2.0-0',164 ],165 # Use system dbus-binding-tool. The just-built one is instrumented but166 # doesn't have the correct RPATH, and will crash.167 'extra_configure_flags': '--with-dbus-binding-tool=dbus-binding-tool',168 'includes': ['standard_instrumented_library_target.gypi'],169 },170 {171 'library_name': 'libexpat1',172 'dependencies=': [],173 'includes': ['standard_instrumented_library_target.gypi'],174 },175 {176 'library_name': 'libffi6',177 'dependencies=': [],178 'includes': ['standard_instrumented_library_target.gypi'],179 },180 {181 'library_name': 'libfontconfig1',182 'dependencies=': [183 '<(_sanitizer_type)-freetype',184 ],185 'extra_configure_flags': [186 '--disable-docs',187 '--sysconfdir=/etc/',188 # From debian/rules.189 '--with-add-fonts=/usr/X11R6/lib/X11/fonts,/usr/local/share/fonts',190 ],191 'run_before_build': 'libfontconfig.sh',192 'includes': ['standard_instrumented_library_target.gypi'],193 },194 {195 'library_name': 'libgcrypt11',196 'dependencies=': [],197 'extra_ldflags': '-Wl,-z,muldefs',198 'includes': ['standard_instrumented_library_target.gypi'],199 },200 {201 'library_name': 'libglib2.0-0',202 'dependencies=': [],203 'extra_configure_flags': [204 '--disable-gtk-doc',205 '--disable-gtk-doc-html',206 '--disable-gtk-doc-pdf',207 ],208 'includes': ['standard_instrumented_library_target.gypi'],209 },210 {211 'library_name': 'libgpg-error0',212 'dependencies=': [],213 'includes': ['standard_instrumented_library_target.gypi'],214 },215 {216 'library_name': 'libnspr4',217 'dependencies=': [],218 'extra_configure_flags': [219 '--enable-64bit',220 # TSan reports data races on debug variables.221 '--disable-debug',222 ],223 'run_before_build': 'libnspr4.sh',224 'includes': ['standard_instrumented_library_target.gypi'],225 },226 {227 'library_name': 'libp11-kit0',228 'dependencies=': [],229 'includes': ['standard_instrumented_library_target.gypi'],230 },231 {232 'library_name': 'libpcre3',233 'dependencies=': [],234 'extra_configure_flags': [235 '--enable-utf8',236 '--enable-unicode-properties',237 ],238 'includes': ['standard_instrumented_library_target.gypi'],239 },240 {241 'library_name': 'libpixman-1-0',242 'dependencies=': [243 '<(_sanitizer_type)-libglib2.0-0',244 ],245 'includes': ['standard_instrumented_library_target.gypi'],246 },247 {248 'library_name': 'libpng12-0',249 'dependencies=': [],250 'includes': ['standard_instrumented_library_target.gypi'],251 },252 {253 'library_name': 'libx11-6',254 'dependencies=': [],255 'extra_configure_flags': '--disable-specs',256 'includes': ['standard_instrumented_library_target.gypi'],257 },258 {259 'library_name': 'libxau6',260 'dependencies=': [],261 'includes': ['standard_instrumented_library_target.gypi'],262 },263 {264 'library_name': 'libxcb1',265 'dependencies=': [],266 'extra_configure_flags': '--disable-build-docs',267 'includes': ['standard_instrumented_library_target.gypi'],268 },269 {270 'library_name': 'libxcomposite1',271 'dependencies=': [],272 'includes': ['standard_instrumented_library_target.gypi'],273 },274 {275 'library_name': 'libxcursor1',276 'dependencies=': [],277 'includes': ['standard_instrumented_library_target.gypi'],278 },279 {280 'library_name': 'libxdamage1',281 'dependencies=': [],282 'includes': ['standard_instrumented_library_target.gypi'],283 },284 {285 'library_name': 'libxdmcp6',286 'dependencies=': [],287 'extra_configure_flags': '--disable-docs',288 'includes': ['standard_instrumented_library_target.gypi'],289 },290 {291 'library_name': 'libxext6',292 'dependencies=': [],293 'extra_configure_flags': '--disable-specs',294 'includes': ['standard_instrumented_library_target.gypi'],295 },296 {297 'library_name': 'libxfixes3',298 'dependencies=': [],299 'includes': ['standard_instrumented_library_target.gypi'],300 },301 {302 'library_name': 'libxi6',303 'dependencies=': [],304 'extra_configure_flags': [305 '--disable-specs',306 '--disable-docs',307 ],308 'includes': ['standard_instrumented_library_target.gypi'],309 },310 {311 'library_name': 'libxinerama1',312 'dependencies=': [],313 'includes': ['standard_instrumented_library_target.gypi'],314 },315 {316 'library_name': 'libxrandr2',317 'dependencies=': [],318 'includes': ['standard_instrumented_library_target.gypi'],319 },320 {321 'library_name': 'libxrender1',322 'dependencies=': [],323 'includes': ['standard_instrumented_library_target.gypi'],324 },325 {326 'library_name': 'libxss1',327 'dependencies=': [],328 'includes': ['standard_instrumented_library_target.gypi'],329 },330 {331 'library_name': 'libxtst6',332 'dependencies=': [],333 'extra_configure_flags': '--disable-specs',334 'includes': ['standard_instrumented_library_target.gypi'],335 },336 {337 'library_name': 'zlib1g',338 'dependencies=': [],339 'run_before_build': 'zlib1g.sh',340 'includes': ['standard_instrumented_library_target.gypi'],341 },342 {343 'library_name': 'nss',344 'dependencies=': [345 '<(_sanitizer_type)-libnspr4',346 ],347 'run_before_build': 'nss.sh',348 'build_method': 'custom_nss',349 'includes': ['standard_instrumented_library_target.gypi'],350 },351 {352 'library_name': 'pulseaudio',353 'dependencies=': [354 '<(_sanitizer_type)-libdbus-1-3',355 ],356 'run_before_build': 'pulseaudio.sh',357 'jobs': 1,358 'includes': ['standard_instrumented_library_target.gypi'],359 },360 {361 'library_name': 'libasound2',362 'dependencies=': [],363 'run_before_build': 'libasound2.sh',364 'includes': ['standard_instrumented_library_target.gypi'],365 },366 {367 'library_name': 'libcups2',368 'dependencies=': [],369 'run_before_build': 'libcups2.sh',370 'jobs': 1,371 'extra_configure_flags': [372 # All from debian/rules.373 '--localedir=/usr/share/cups/locale',374 '--enable-slp',375 '--enable-libpaper',376 '--enable-ssl',377 '--enable-gnutls',378 '--disable-openssl',379 '--enable-threads',380 '--enable-static',381 '--enable-debug',382 '--enable-dbus',383 '--with-dbusdir=/etc/dbus-1',384 '--enable-gssapi',385 '--enable-avahi',386 '--with-pdftops=/usr/bin/gs',387 '--disable-launchd',388 '--with-cups-group=lp',389 '--with-system-groups=lpadmin',390 '--with-printcap=/var/run/cups/printcap',391 '--with-log-file-perm=0640',392 '--with-local_protocols="CUPS dnssd"',393 '--with-remote_protocols="CUPS dnssd"',394 '--enable-libusb',395 ],396 'includes': ['standard_instrumented_library_target.gypi'],397 },398 {399 'library_name': 'pango1.0',400 'dependencies=': [401 '<(_sanitizer_type)-libglib2.0-0',402 ],403 'extra_configure_flags': [404 # Avoid https://bugs.gentoo.org/show_bug.cgi?id=425620405 '--enable-introspection=no',406 ],407 'build_method': 'custom_pango',408 'includes': ['standard_instrumented_library_target.gypi'],409 },410 {411 'library_name': 'libcap2',412 'dependencies=': [],413 'build_method': 'custom_libcap',414 'includes': ['standard_instrumented_library_target.gypi'],415 },416 {417 'library_name': 'libudev0',418 'dependencies=': [],419 'extra_configure_flags': [420 # Without this flag there's a linking step that doesn't honor LDFLAGS421 # and fails.422 # TODO(earthdok): find a better fix.423 '--disable-gudev'424 ],425 'includes': ['standard_instrumented_library_target.gypi'],426 },427 {428 'library_name': 'libtasn1-3',429 'dependencies=': [],430 'includes': ['standard_instrumented_library_target.gypi'],431 },432 {433 'library_name': 'libgnome-keyring0',434 'extra_configure_flags': [435 # Build static libs (from debian/rules).436 '--enable-static',437 '--enable-tests=no',438 ],439 'extra_ldflags': '-Wl,--as-needed',440 'dependencies=': [],441 'includes': ['standard_instrumented_library_target.gypi'],442 },443 {444 'library_name': 'libgtk2.0-0',445 'extra_cflags': '-Wno-return-type',446 'extra_configure_flags': [447 # From debian/rules.448 '--prefix=/usr',449 '--sysconfdir=/etc',450 '--enable-test-print-backend',451 '--enable-introspection=no',452 '--with-xinput=yes',453 ],454 'dependencies=': [],455 'run_before_build': 'libgtk2.0-0.sh',456 'includes': ['standard_instrumented_library_target.gypi'],457 },458 {459 'library_name': 'libgdk-pixbuf2.0-0',460 'extra_configure_flags': [461 # From debian/rules.462 '--with-libjasper',463 '--with-x11',464 # Make the build less problematic.465 '--disable-introspection',466 ],467 'dependencies=': [],468 'run_before_build': 'libgdk-pixbuf2.0-0.sh',469 'includes': ['standard_instrumented_library_target.gypi'],470 },471 {472 'library_name': 'libpci3',473 'dependencies=': [],474 'build_method': 'custom_libpci3',475 'jobs': 1,476 'includes': ['standard_instrumented_library_target.gypi'],477 },478 {479 'library_name': 'libdbusmenu-glib4',480 'extra_configure_flags': [481 # From debian/rules.482 '--disable-scrollkeeper',483 '--enable-gtk-doc',484 # --enable-introspection introduces a build step that attempts to run485 # a just-built binary and crashes. Vala requires introspection.486 # TODO(earthdok): find a better fix.487 '--disable-introspection',488 '--disable-vala',489 ],490 'dependencies=': [],491 'includes': ['standard_instrumented_library_target.gypi'],492 },493 {494 'library_name': 'liboverlay-scrollbar-0.2-0',495 'extra_configure_flags': [496 '--with-gtk=2',497 ],498 'dependencies=': [],499 'includes': ['standard_instrumented_library_target.gypi'],500 },501 {502 'library_name': 'libgconf-2-4',503 'extra_configure_flags': [504 # From debian/rules. (Even though --with-gtk=3.0 doesn't make sense.)505 '--with-gtk=3.0',506 '--disable-orbit',507 # See above.508 '--disable-introspection',509 ],510 'dependencies=': [],511 'includes': ['standard_instrumented_library_target.gypi'],512 },513 {514 'library_name': 'libappindicator1',515 'extra_configure_flags': [516 # See above.517 '--disable-introspection',518 ],519 'dependencies=': [],520 'build_method': 'custom_libappindicator1',521 'includes': ['standard_instrumented_library_target.gypi'],522 },523 {524 'library_name': 'libdbusmenu',525 'extra_configure_flags': [526 # From debian/rules.527 '--disable-scrollkeeper',528 '--with-gtk=2',529 # See above.530 '--disable-introspection',531 '--disable-vala',532 ],533 'dependencies=': [],534 'includes': ['standard_instrumented_library_target.gypi'],535 },536 {537 'library_name': 'atk1.0',538 'extra_configure_flags': [539 # See above.540 '--disable-introspection',541 ],542 'dependencies=': [],543 'includes': ['standard_instrumented_library_target.gypi'],544 },545 {546 'library_name': 'libunity9',547 'dependencies=': [],548 'includes': ['standard_instrumented_library_target.gypi'],549 },550 {551 'library_name': 'dee',552 'extra_configure_flags': [553 # See above.554 '--disable-introspection',555 ],556 'dependencies=': [],557 'includes': ['standard_instrumented_library_target.gypi'],558 },559 ],...
build_ninja_processor.py
Source:build_ninja_processor.py
...22 command: str23 dependencies: set24 implicit_dependencies: set25 order_only_dependencies: set26 def all_dependencies(self) -> set:27 return self.dependencies | self.implicit_dependencies | self.order_only_dependencies28class BuildNinjaFileProcessor(NinjaFileProcessor):29 BuildResults = namedtuple('BuildReulsts', 'outputs, implicit_outputs')30 BuildSources = namedtuple(31 'BuildSources', 'command dependencies implicit_dependencies order_only_dependencies')32 # Trailing "$" symbols.33 _ESCAPE_SYMBOLS_RE = re.compile(r".+(\$+)$")34 # Universal regex for parsing specific build.ninja syntax.35 _LINE_RE = re.compile(r"\s+(?P<parameter>COMMAND|depfile)\s*=\s*(?P<value>.+)"36 r"|include\s+(?P<rules_file_name>.*rules.ninja)\s*"37 r"|build\s+(?P<build_line>.+)")38 _MOCARG_RE = re.compile(r'.*moc(?:.exe)? @([^"]+)')39 def __init__(self, file_name: Path, build_directory: Path, debug_output: bool = False) -> None:40 self._line_number_by_output = {}41 self._outputs_by_dependencies = {}42 self._rules_file_name = Path("")43 super().__init__(44 file_name=file_name, build_directory=build_directory, debug_output=debug_output)45 def _parse_line(self, line: str) -> Line: # pylint:disable=inconsistent-return-statements46 match = self._LINE_RE.match(line)47 if match is None:48 return Line(raw=line, parsed=None, type=LineType.UNKNOWN)49 if match['build_line']:50 parsed_build_data = self._parse_build_line(match['build_line'])51 return Line(52 raw=line,53 parsed=parsed_build_data,54 type=LineType.BUILD)55 if match['parameter'] == 'COMMAND':56 return Line(raw=line, parsed=match['value'], type=LineType.COMMAND)57 if match['parameter'] == 'depfile':58 return Line(raw=line, parsed=match['value'], type=LineType.DEPFILE)59 if match['rules_file_name']:60 return Line(raw=line, parsed=match['rules_file_name'], type=LineType.INCLUDE)61 assert False, "Parsing regex error for line {line!r}"62 def _consume_line_object(self, line_object: Line) -> None:63 if line_object.type == LineType.BUILD:64 line_data = line_object.parsed65 # Add explicit and implicit outputs to output to line number map.66 current_outputs = {*line_data.outputs, *line_data.implicit_outputs}67 for output in current_outputs:68 self._line_number_by_output[output] = len(self._lines)69 for dependency in line_data.all_dependencies():70 self._outputs_by_dependencies.setdefault(dependency, set()).update(current_outputs)71 elif line_object.type == LineType.INCLUDE:72 self._rules_file_name = Path(line_object.parsed)73 def _parse_build_line(self, build_line: str) -> BuildLineData:74 try:75 results, sources = self._split_build_line(build_line.rstrip())76 except ValueError:77 raise NinjaFileProcessorParseError(78 self, f"invalid \"build\" line {build_line!r}.") from None79 build_results = self._parse_build_results_string(results)80 build_sources = self._parse_build_sources_string(sources)81 return BuildLineData(82 outputs=set(build_results.outputs),83 implicit_outputs=set(build_results.implicit_outputs),84 command=build_sources.command,85 dependencies=set(build_sources.dependencies),86 implicit_dependencies=set(build_sources.implicit_dependencies),87 order_only_dependencies=set(build_sources.order_only_dependencies))88 def _split_build_line(self, line: str) -> Tuple[str, str]:89 """Splits build line into "results" and "sources" parts.90 :param line: Source line.91 :type line: str92 :raises NinjaFileProcessorParseError: Bad build line format.93 :return: "results" and "sources" parts.94 :rtype: Tuple[str, str]95 """96 tokens = line.split(':')97 if len(tokens) < 2:98 raise NinjaFileProcessorParseError(self, f"invalid \"build\" line {line!r}.")99 [results, sources] = (tokens.pop(0), "")100 # This is needed because the ":" symbol (fileds separator) can be escaped by an odd number101 # of "$" symbols. So we go through all tokens and check - if the previous one ends with the102 # odd number of escaping symbols, then the new one is not a separate token but is a103 # continuation of the previous one (and, by transitivity, is a continuation of the104 # "results" part). Once we find the first separate token, we stop and consider all105 # remaining tokens to be the "sources" part.106 while tokens:107 token = tokens.pop(0)108 if results.endswith('$'):109 match = self._ESCAPE_SYMBOLS_RE.match(results)110 if len(match[1]) % 2 == 1:111 results += f":{token}"112 continue113 sources = token + (':' if tokens else '')114 break115 sources += ':'.join(tokens)116 if not sources:117 raise NinjaFileProcessorParseError(self, f"invalid \"build\" line {line!r}.")118 return results, sources.lstrip()119 def _parse_build_results_string(self, results: str) -> BuildResults: # pylint:disable=undefined-variable120 explicit_raw, has_implicit, implicit_raw = results.partition("|")121 if "|" in implicit_raw:122 raise NinjaFileProcessorParseError(self, f"invalid outputs list {results!r}.")123 explicit_outputs = self._tokenize(explicit_raw)124 implicit_outputs = self._tokenize(implicit_raw) if has_implicit else []125 return self.BuildResults(outputs=explicit_outputs, implicit_outputs=implicit_outputs)126 def _parse_build_sources_string(self, sources: str) -> BuildSources: # pylint:disable=undefined-variable127 normal_raw, has_order_only, order_only_raw = sources.partition("||")128 explicit_raw, has_implicit, implicit_raw = normal_raw.partition("|")129 # Check the line validity.130 if "|" in implicit_raw:131 raise NinjaFileProcessorParseError(self, f"invalid dependencies list {sources!r}.")132 if "||" in order_only_raw:133 raise NinjaFileProcessorParseError(self,134 f"invalid order only dependencies list {sources!r}.")135 # Tokenize explicit dependencies and check its validity.136 explicit_dependencies = self._tokenize(explicit_raw)137 if not explicit_dependencies:138 raise NinjaFileProcessorParseError(self, "command not found in \"build\" line.")139 # First token in explicit dependencies is actually a command, not dependency.140 command = explicit_dependencies.pop(0)141 # Tokenize other dependencies.142 implicit_dependencies = self._tokenize(implicit_raw) if has_implicit else []143 order_only_dependencies = self._tokenize(order_only_raw) if has_order_only else []144 return self.BuildSources(145 command=command,146 dependencies=explicit_dependencies,147 implicit_dependencies=implicit_dependencies,148 order_only_dependencies=order_only_dependencies)149 @classmethod150 def _tokenize(cls, line: str) -> list:151 tokens = []152 for token in line.split(' '):153 if not token:154 continue155 if not tokens or not tokens[-1].endswith('$'):156 tokens.append(token)157 continue158 # This is needed because the " " symbol (fileds separator) can be escaped by an odd159 # number of the "$" symbols. So we check the previous token, and if it ends with an odd160 # number of escaping symbols, then the new token is not a separate token but is a161 # continuation of the previous one. Thus we should concatenate these tokens instead of162 # adding a new token to the list.163 match = cls._ESCAPE_SYMBOLS_RE.match(tokens[-1])164 if len(match[1]) % 2 == 1:165 tokens[-1] += f" {token}"166 return tokens167 def strengthen_dependencies(self, targets: set) -> None:168 """Patch build.ninja file so the targets from the "targets" set become immediatelly169 dependent on all the dependencies of their dependencies (transitively).170 Parameters:171 targets (set): Set of the targets to be patched.172 """173 escaped_targets = self._escape_set(targets)174 dereferenced_targets = self._dereference_targets(escaped_targets)175 for target in dereferenced_targets:176 transitive_dependencies = self._collect_transitive_dependencies(target)177 self._replace_target(target,178 implicit_dependencies=transitive_dependencies,179 order_only_dependencies=set())180 self._is_patch_applied = True # pylint:disable=attribute-defined-outside-init181 def _dereference_targets(self, targets: set) -> set:182 """If there are "phony" targets, get the real targets for them."""183 real_targets = set()184 for target in targets:185 target_line = self._get_target_line_by_name(target)186 if target_line is None:187 print(f"Unknown target {target}")188 continue189 if self._is_target_phony(target_line):190 real_targets.update(self._dereference_targets(target_line.parsed.dependencies))191 else:192 real_targets.add(target)193 return real_targets194 def _get_target_line_by_name(self, target: str) -> Line:195 target_line_idx = self._line_number_by_output.get(target, None)196 if target_line_idx is None:197 return None198 return self._lines[target_line_idx]199 @classmethod200 def _is_target_phony(cls, target_line: Line) -> bool:201 assert target_line.type == LineType.BUILD, (202 "Error in logic: trying to check if target is phony for the line with the wrong type.")203 return target_line.parsed.command == "phony"204 def _collect_transitive_dependencies(self, target: str) -> set:205 """Recursivly gets all the dependencies that are targets themselves."""206 transitive_dependencies = set()207 target_line = self._get_target_line_by_name(target)208 first_target_data = target_line.parsed209 unchecked_targets = list(first_target_data.all_dependencies())210 while unchecked_targets:211 current_target = unchecked_targets.pop()212 if current_target in transitive_dependencies:213 continue214 current_target_line = self._get_target_line_by_name(current_target)215 if current_target_line is None:216 continue217 transitive_dependencies.add(current_target)218 current_target_data = current_target_line.parsed219 unchecked_targets.extend(list(current_target_data.all_dependencies()))220 # Don't need explicit dependecies of the target in the result.221 transitive_dependencies -= first_target_data.dependencies222 # Remove phony targets and non-targets from the dependencies.223 for dep in list(transitive_dependencies):224 target_line = self._get_target_line_by_name(dep)225 if not target_line or self._is_target_phony(target_line):226 transitive_dependencies.remove(dep)227 return transitive_dependencies228 def _replace_target(self,229 target: str,230 dependencies: set = None,231 implicit_dependencies: set = None,232 order_only_dependencies: set = None) -> None:233 target_line = self._get_target_line_by_name(target)...
dependenciesManager.factory.js
Source:dependenciesManager.factory.js
1/* globals jsPlumb */2(function() {3 'use strict';4 angular.module('gantt.dependencies').factory('GanttDependenciesManager', ['GanttDependency', 'GanttDependenciesEvents', 'GanttDependencyTaskMouseHandler', function(Dependency, DependenciesEvents, TaskMouseHandler) {5 var DependenciesManager = function(gantt, pluginScope, api) {6 var self = this;7 this.gantt = gantt;8 this.pluginScope = pluginScope;9 this.api = api;10 this.api.registerEvent('dependencies', 'add');11 this.api.registerEvent('dependencies', 'change');12 this.api.registerEvent('dependencies', 'remove');13 this.plumb = jsPlumb.getInstance();14 this.plumb.importDefaults(this.pluginScope.jsPlumbDefaults);15 this.dependenciesFrom = {};16 this.dependenciesTo = {};17 this.tasks = {};18 this.events = new DependenciesEvents(this);19 this.pluginScope.$watch('enabled', function(newValue, oldValue) {20 if (newValue !== oldValue) {21 self.refresh();22 }23 });24 this.pluginScope.$watch('jsPlumbDefaults', function(newValue, oldValue) {25 if (newValue !== oldValue) {26 self.plumb.importDefaults(newValue);27 self.refresh();28 }29 }, true);30 /**31 * Add all dependencies defined from a task. Dependencies will be added only if plugin is enabled.32 *33 * @param task34 */35 this.addDependenciesFromTask = function(task) {36 if (this.pluginScope.enabled) {37 var taskDependencies = task.model.dependencies;38 if (taskDependencies !== undefined) {39 if (!angular.isArray(taskDependencies)) {40 taskDependencies = [taskDependencies];41 task.model.dependencies = taskDependencies;42 }43 for (var i = 0, l = taskDependencies.length; i < l; i++) {44 var dependency = self.addDependency(task, taskDependencies[i]);45 dependency.connect();46 }47 }48 }49 };50 /**51 * Remove all dependencies defined for a task.52 *53 * @param task54 * @param keepConnection if true, dependency will not be disconnected.55 */56 this.removeDependenciesFromTask = function(task, keepConnection) {57 var dependencies = this.getTaskDependencies(task);58 if (dependencies) {59 for (var i = 0; i < dependencies.length; i++) {60 if (!keepConnection) {61 dependencies[i].disconnect();62 }63 self.removeDependency(dependencies[i]);64 }65 }66 };67 /**68 * Add definition of a dependency.69 *70 * @param task Task defining the dependency.71 * @param model Model object for the dependency.72 */73 this.addDependency = function(task, model) {74 var dependency = new Dependency(this, task, model);75 var fromTaskId = dependency.getFromTaskId();76 var toTaskId = dependency.getToTaskId();77 if (!(fromTaskId in this.dependenciesFrom)) {78 this.dependenciesFrom[fromTaskId] = [];79 }80 if (!(toTaskId in this.dependenciesTo)) {81 this.dependenciesTo[toTaskId] = [];82 }83 if (fromTaskId) {84 this.dependenciesFrom[fromTaskId].push(dependency);85 }86 if (toTaskId) {87 this.dependenciesTo[toTaskId].push(dependency);88 }89 return dependency;90 };91 /**92 * Remove definition of a dependency93 *94 * @param dependency Dependency object95 * @param keepConnection if true, dependency will not be disconnected.96 */97 this.removeDependency = function(dependency, keepConnection) {98 var fromDependencies = this.dependenciesFrom[dependency.getFromTaskId()];99 var fromRemove = [];100 var i;101 if (fromDependencies) {102 for (i = 0; i < fromDependencies.length; i++) {103 if (dependency === fromDependencies[i]) {104 fromRemove.push(dependency);105 }106 }107 }108 var toDependencies = this.dependenciesTo[dependency.getToTaskId()];109 var toRemove = [];110 if (toDependencies) {111 for (i = 0; i < toDependencies.length; i++) {112 if (dependency === toDependencies[i]) {113 toRemove.push(dependency);114 }115 }116 }117 for (i = 0; i < fromRemove.length; i++) {118 if (!keepConnection) {119 fromRemove[i].disconnect();120 }121 fromDependencies.splice(fromDependencies.indexOf(dependency), 1);122 }123 for (i = 0; i < toRemove.length; i++) {124 if (!keepConnection) {125 toRemove[i].disconnect();126 }127 toDependencies.splice(toDependencies.indexOf(dependency), 1);128 }129 if (this.dependenciesFrom[dependency.getFromTaskId()] &&130 this.dependenciesFrom[dependency.getFromTaskId()].length === 0) {131 delete this.dependenciesFrom[dependency.getFromTaskId()];132 }133 if (this.dependenciesTo[dependency.getToTaskId()] &&134 this.dependenciesTo[dependency.getToTaskId()].length === 0) {135 delete this.dependenciesTo[dependency.getToTaskId()];136 }137 };138 this.getTaskDependencies = function(task) {139 var dependencies = [];140 var fromDependencies = self.dependenciesFrom[task.model.id];141 if (fromDependencies) {142 dependencies = dependencies.concat(fromDependencies);143 }144 var toDependencies = self.dependenciesTo[task.model.id];145 if (toDependencies) {146 dependencies = dependencies.concat(toDependencies);147 }148 return dependencies;149 };150 this.setDraggingConnection = function(connection) {151 if (connection) {152 self.draggingConnection = connection;153 angular.forEach(self.tasks, function(task) {154 task.dependencies.mouseHandler.release();155 });156 } else {157 self.draggingConnection = undefined;158 angular.forEach(self.tasks, function(task) {159 task.dependencies.mouseHandler.install();160 });161 }162 };163 var addTaskEndpoints = function(task) {164 if (!task.dependencies) {165 task.dependencies = {};166 }167 task.dependencies.endpoints = [];168 if (self.pluginScope.endpoints) {169 for (var i = 0; i < self.pluginScope.endpoints.length; i++) {170 var endpointObject = self.plumb.addEndpoint(task.$element, self.pluginScope.endpoints[i]);171 endpointObject.$task = task;172 task.dependencies.endpoints.push(endpointObject);173 }174 }175 };176 var removeTaskEndpoint = function(task) {177 for (var i = 0; i < task.dependencies.endpoints.length; i++) {178 var endpointObject = task.dependencies.endpoints[i];179 self.plumb.deleteEndpoint(endpointObject);180 endpointObject.$task = undefined;181 }182 task.dependencies.endpoints = undefined;183 };184 var addTaskMouseHandler = function(task) {185 if (!task.dependencies) {186 task.dependencies = {};187 }188 task.dependencies.mouseHandler = new TaskMouseHandler(self, task);189 task.dependencies.mouseHandler.install();190 };191 var removeTaskMouseHandler = function(task) {192 task.dependencies.mouseHandler.release();193 task.dependencies.mouseHandler = undefined;194 };195 /**196 * Set tasks objects that can be used to display dependencies.197 *198 * @param tasks199 */200 this.setTasks = function(tasks) {201 angular.forEach(self.tasks, function(task) {202 removeTaskMouseHandler(task);203 removeTaskEndpoint(task);204 });205 var newTasks = {};206 for (var i = 0; i < tasks.length; i++) {207 var task = tasks[i];208 newTasks[task.model.id] = task;209 addTaskEndpoints(task);210 addTaskMouseHandler(task);211 }212 self.tasks = newTasks;213 };214 var disconnectTaskDependencies = function(task) {215 var dependencies = self.getTaskDependencies(task);216 if (dependencies) {217 for (var i = 0; i < dependencies.length; i++) {218 dependencies[i].disconnect();219 }220 }221 return dependencies;222 };223 var connectTaskDependencies = function(task) {224 var dependencies = self.getTaskDependencies(task);225 if (dependencies) {226 for (var i = 0; i < dependencies.length; i++) {227 dependencies[i].connect();228 }229 }230 return dependencies;231 };232 /**233 * Set task object in replacement of an existing with the same id.234 *235 * @param task236 */237 this.setTask = function(task) {238 self.plumb.setSuspendDrawing(true);239 try {240 var oldTask = self.tasks[task.model.id];241 if (oldTask !== undefined) {242 disconnectTaskDependencies(oldTask);243 removeTaskMouseHandler(oldTask);244 removeTaskEndpoint(oldTask);245 }246 self.tasks[task.model.id] = task;247 addTaskEndpoints(task);248 addTaskMouseHandler(task);249 connectTaskDependencies(task);250 } finally {251 self.plumb.setSuspendDrawing(false, true);252 }253 };254 /**255 * Retrieve the task from it's id.256 *257 * @param taskId id of the task element to retrieve.258 * @returns {*}259 */260 this.getTask = function(taskId) {261 return self.tasks[taskId];262 };263 var getSourceEndpoints = function(task) {264 return task.dependencies.endpoints.filter(function(endpoint) {265 return endpoint.isSource;266 });267 };268 var getTargetEndpoints = function(task) {269 return task.dependencies.endpoints.filter(function(endpoint) {270 return endpoint.isTarget;271 });272 };273 /**274 * Connects two tasks together using source endpoint from fromTask and target endpoint from toTask.275 *276 * @param fromTask277 * @param toTask278 * @param model279 * @returns connection object280 */281 this.connect = function(fromTask, toTask, model) {282 var sourceEndpoints = getSourceEndpoints(fromTask);283 var targetEndpoints = getTargetEndpoints(toTask);284 if (sourceEndpoints && targetEndpoints) {285 var sourceEndpoint;286 var targetEndpoint;287 if (model.connectParameters && model.connectParameters.sourceEndpointIndex) {288 sourceEndpoint = sourceEndpoints[model.connectParameters.sourceEndpointIndex];289 } else {290 sourceEndpoint = sourceEndpoints[0];291 }292 if (model.connectParameters && model.connectParameters.targetEndpointIndex) {293 targetEndpoint = targetEndpoints[model.connectParameters.targetEndpointIndex];294 } else {295 targetEndpoint = targetEndpoints[0];296 }297 var connection = self.plumb.connect({298 source: sourceEndpoint,299 target: targetEndpoint300 }, model.connectParameters);301 return connection;302 }303 };304 /**305 * Get all defined dependencies.306 *307 * @returns {Array}308 */309 this.getDependencies = function() {310 var allDependencies = [];311 angular.forEach(this.dependenciesFrom, function(dependencies) {312 for (var i = 0; i < dependencies.length; i++) {313 if (!(dependencies[i] in allDependencies)) {314 allDependencies.push(dependencies[i]);315 }316 }317 });318 return allDependencies;319 };320 /**321 * Refresh jsplumb status based on tasks dependencies models.322 */323 this.refresh = function(tasks) {324 self.plumb.setSuspendDrawing(true);325 try {326 var tasksDependencies;327 var i;328 if (tasks && !angular.isArray(tasks)) {329 tasks = [tasks];330 }331 if (tasks === undefined) {332 tasks = this.tasks;333 tasksDependencies = this.getDependencies();334 } else {335 tasksDependencies = [];336 angular.forEach(tasks, function(task) {337 var taskDependencies = self.getTaskDependencies(task);338 angular.forEach(taskDependencies, function(taskDependency) {339 if (!(taskDependency in tasksDependencies)) {340 tasksDependencies.push(taskDependency);341 }342 });343 });344 }345 for (i = 0; i < tasksDependencies.length; i++) {346 self.removeDependency(tasksDependencies[i]);347 }348 angular.forEach(tasks, function(task) {349 self.addDependenciesFromTask(task);350 });351 } finally {352 self.plumb.setSuspendDrawing(false, true);353 }354 };355 this.api.registerMethod('dependencies', 'refresh', this.refresh, this);356 };357 return DependenciesManager;358 }]);...
_temporal_callbacks.py
Source:_temporal_callbacks.py
1# Copyright (c) 2019-2020, RTE (https://www.rte-france.com)2# See AUTHORS.txt3# This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0.4# If a copy of the Mozilla Public License, version 2.0 was not distributed with this file,5# you can obtain one at http://mozilla.org/MPL/2.0/.6# SPDX-License-Identifier: MPL-2.07# This file is part of Grid2Game, Grid2Game a gamified platform to interact with grid2op environments.8import dash9def add_callbacks(dash_app, viz_server):10 dash_app.callback([dash.dependencies.Output("gofast-button", "children")],11 [dash.dependencies.Input("nb_step_go_fast", "value")]12 )(viz_server.change_nb_step_go_fast)13 # handle the press to one of the button to change the units14 dash_app.callback([dash.dependencies.Output("unit_trigger_rt_graph", "n_clicks"),15 dash.dependencies.Output("unit_trigger_for_graph", "n_clicks"),16 ],17 [dash.dependencies.Input("line-info-dropdown", "value"),18 dash.dependencies.Input("line-side-dropdown", "value"),19 dash.dependencies.Input("load-info-dropdown", "value"),20 dash.dependencies.Input("gen-info-dropdown", "value"),21 dash.dependencies.Input("stor-info-dropdown", "value")22 ],23 [dash.dependencies.State("unit_trigger_rt_graph", "n_clicks"),24 dash.dependencies.State("unit_trigger_for_graph", "n_clicks")25 ]26 )(viz_server.unit_clicked)27 # handle the interaction with the graph28 dash_app.callback([dash.dependencies.Output("do_display_action", "value"),29 dash.dependencies.Output("generator_clicked", "style"),30 dash.dependencies.Output("gen-redisp-curtail", "children"),31 dash.dependencies.Output("gen-id-hidden", "children"),32 dash.dependencies.Output("gen-id-clicked", "children"),33 dash.dependencies.Output("gen-dispatch", "min"),34 dash.dependencies.Output("gen-dispatch", "max"),35 dash.dependencies.Output("gen-dispatch", "value"),36 dash.dependencies.Output("gen_p", "children"),37 dash.dependencies.Output("target_disp", "children"),38 dash.dependencies.Output("actual_disp", "children"),39 dash.dependencies.Output("storage_clicked", "style"),40 dash.dependencies.Output("storage-id-hidden", "children"),41 dash.dependencies.Output("stor-id-clicked", "children"),42 dash.dependencies.Output("storage-power-input", "min"),43 dash.dependencies.Output("storage-power-input", "max"),44 dash.dependencies.Output("storage-power-input", "value"),45 dash.dependencies.Output("storage_p", "children"),46 dash.dependencies.Output("storage_energy", "children"),47 dash.dependencies.Output("line_clicked", "style"),48 dash.dependencies.Output("line-id-hidden", "children"),49 dash.dependencies.Output("line-id-clicked", "children"),50 dash.dependencies.Output("line-status-input", "value"),51 dash.dependencies.Output("line_flow", "children"),52 dash.dependencies.Output("sub_clicked", "style"),53 dash.dependencies.Output("sub-id-hidden", "children"),54 dash.dependencies.Output("sub-id-clicked", "children"),55 # dash.dependencies.Output("graph_clicked_sub", "figure"),56 dash.dependencies.Output("update_substation_layout_clicked_from_grid", "n_clicks"),57 ],58 [dash.dependencies.Input('real-time-graph', 'clickData'),59 dash.dependencies.Input("back-button", "n_clicks"),60 dash.dependencies.Input("step-button", "n_clicks"),61 dash.dependencies.Input("simulate-button", "n_clicks"),62 dash.dependencies.Input("go-button", "n_clicks"),63 dash.dependencies.Input("gofast-button", "n_clicks"),64 dash.dependencies.Input("go_till_game_over-button", "n_clicks"),65 ])(viz_server.display_click_data)66 # handle display of the action, if needed67 dash_app.callback([dash.dependencies.Output("current_action", "children"),68 dash.dependencies.Output("which_action_button", "value"),69 dash.dependencies.Output("update_substation_layout_clicked_from_sub", "n_clicks")70 ],71 [dash.dependencies.Input("which_action_button", "value"),72 dash.dependencies.Input("do_display_action", "value"),73 dash.dependencies.Input("gen-redisp-curtail", "children"),74 dash.dependencies.Input("gen-id-hidden", "children"),75 dash.dependencies.Input('gen-dispatch', "value"),76 dash.dependencies.Input("storage-id-hidden", "children"),77 dash.dependencies.Input('storage-power-input', "value"),78 dash.dependencies.Input("line-id-hidden", "children"),79 dash.dependencies.Input('line-status-input', "value"),80 dash.dependencies.Input('sub-id-hidden', "children"),81 dash.dependencies.Input("graph_clicked_sub", "clickData")82 ])(viz_server.display_action_fun)83 # plot the substation that changes when we click84 dash_app.callback([dash.dependencies.Output("graph_clicked_sub", "figure")],85 [dash.dependencies.Input("update_substation_layout_clicked_from_sub", "n_clicks"),86 dash.dependencies.Input("update_substation_layout_clicked_from_grid", "n_clicks"),87 ])(viz_server.display_grid_substation)88 # handle the interaction with self.env, that should be done all in one function, otherwise89 # there are concurrency issues90 dash_app.callback([91 # trigger the computation if needed92 dash.dependencies.Output("trigger_computation", "value"),93 # update the button color / shape / etc. if needed94 dash.dependencies.Output("step-button", "className"),95 dash.dependencies.Output("simulate-button", "className"),96 dash.dependencies.Output("back-button", "className"),97 dash.dependencies.Output("reset-button", "className"),98 dash.dependencies.Output("go-button", "className"),99 dash.dependencies.Output("gofast-button", "className"),100 dash.dependencies.Output("go_till_game_over-button", "className"),101 dash.dependencies.Output("is_computing_left", "style"),102 dash.dependencies.Output("is_computing_right", "style"),103 dash.dependencies.Output("change_graph_title", "n_clicks"),104 dash.dependencies.Output("update_progress_bar_from_act", "n_clicks")105 ],106 [dash.dependencies.Input("step-button", "n_clicks"),107 dash.dependencies.Input("simulate-button", "n_clicks"),108 dash.dependencies.Input("back-button", "n_clicks"),109 dash.dependencies.Input("reset-button", "n_clicks"),110 dash.dependencies.Input("go-button", "n_clicks"),111 dash.dependencies.Input("gofast-button", "n_clicks"),112 dash.dependencies.Input("go_till_game_over-button", "n_clicks"),113 dash.dependencies.Input("untilgo_butt_call_act_on_env", "value"),114 dash.dependencies.Input("selfloop_call_act_on_env", "value"),115 dash.dependencies.Input("timer", "n_intervals")116 ],117 [dash.dependencies.State("act_on_env_trigger_rt", "n_clicks"),118 dash.dependencies.State("act_on_env_trigger_for", "n_clicks"),119 dash.dependencies.State("act_on_env_call_selfloop", "value")120 ]121 )(viz_server.handle_act_on_env)122 dash_app.callback([dash.dependencies.Output("act_on_env_trigger_rt", "n_clicks"),123 dash.dependencies.Output("act_on_env_trigger_for", "n_clicks")124 ],125 [dash.dependencies.Input("trigger_computation", "value"),126 dash.dependencies.Input("recompute_rt_from_timeline", "n_clicks")127 ]128 )(viz_server.computation_wrapper)129 # handle triggers: refresh of the figures for real time (graph part)130 dash_app.callback([dash.dependencies.Output("figrt_trigger_temporal_figs", "n_clicks"),131 dash.dependencies.Output("figrt_trigger_rt_graph", "n_clicks"),132 dash.dependencies.Output("figrt_trigger_for_graph", "n_clicks"),133 dash.dependencies.Output("timeline_graph", "figure"),134 dash.dependencies.Output("update_progress_bar_from_figs", "n_clicks")135 ],136 [dash.dependencies.Input("act_on_env_trigger_rt", "n_clicks")],137 []138 )(viz_server.update_rt_fig)139 dash_app.callback([140 dash.dependencies.Output("scenario_progression", "value"),141 dash.dependencies.Output("scenario_progression", "label"),142 dash.dependencies.Output("scenario_progression", "color"),143 ],[144 dash.dependencies.Input("update_progress_bar_from_act", "n_clicks"),145 dash.dependencies.Input("update_progress_bar_from_figs", "n_clicks"),146 ])(viz_server.update_progress_bar)147 # handle triggers: refresh of the figures for the forecast148 dash_app.callback([dash.dependencies.Output("figfor_trigger_for_graph", "n_clicks")],149 [dash.dependencies.Input("act_on_env_trigger_for", "n_clicks")],150 []151 )(viz_server.update_simulated_fig)152 # final graph display153 # handle triggers: refresh the figures (temporal series part)154 dash_app.callback([dash.dependencies.Output("graph_gen_load", "figure"),155 dash.dependencies.Output("graph_flow_cap", "figure"),156 ],157 [dash.dependencies.Input("figrt_trigger_temporal_figs", "n_clicks"),158 dash.dependencies.Input("showtempo_trigger_rt_graph", "n_clicks")159 ],160 )(viz_server.update_temporal_figs)161 # dash_app.callback([dash.dependencies.Output('temporal_graphs', "style"),162 # dash.dependencies.Output("showtempo_trigger_rt_graph", "n_clicks")163 # ],164 # [dash.dependencies.Input('show-temporal-graph', "value")]165 # )(self.show_hide_tempo_graph)166 # handle final graph of the real time grid167 dash_app.callback([dash.dependencies.Output("real-time-graph", "figure"),168 dash.dependencies.Output("rt_date_time", "children"),169 dash.dependencies.Output("trigger_rt_extra_info", "n_clicks")170 ],171 [dash.dependencies.Input("figrt_trigger_rt_graph", "n_clicks"),172 dash.dependencies.Input("unit_trigger_rt_graph", "n_clicks"),173 ]174 )(viz_server.update_rt_graph_figs)175 # handle final graph for the forecast grid176 dash_app.callback([dash.dependencies.Output("simulated-graph", "figure"),177 dash.dependencies.Output("forecast_date_time", "children"),178 dash.dependencies.Output("trigger_for_extra_info", "n_clicks")179 ],180 [dash.dependencies.Input("figrt_trigger_for_graph", "n_clicks"),181 dash.dependencies.Input("figfor_trigger_for_graph", "n_clicks"),182 dash.dependencies.Input("unit_trigger_for_graph", "n_clicks"),183 ]184 )(viz_server.update_for_graph_figs)185 if viz_server._app_heroku is False:186 # this is deactivated on heroku at the moment !187 # load the assistant188 dash_app.callback([dash.dependencies.Output("current_assistant_path", "children"),189 dash.dependencies.Output("clear_assistant_path", "n_clicks"),190 dash.dependencies.Output("loading_assistant_output", "children"),191 ],192 [dash.dependencies.Input("load_assistant_button", "n_clicks")193 ],194 [dash.dependencies.State("select_assistant", "value")]195 )(viz_server.load_assistant)196 dash_app.callback([dash.dependencies.Output("select_assistant", "value")],197 [dash.dependencies.Input("clear_assistant_path", "n_clicks")]198 )(viz_server.clear_loading)199 # save the current experiment200 dash_app.callback([dash.dependencies.Output("current_save_path", "children"),201 dash.dependencies.Output("loading_save_output", "children"),202 ],203 [dash.dependencies.Input("save_expe_button", "n_clicks")],204 [dash.dependencies.State("save_expe", "value")]205 )(viz_server.save_expe)206 # tell if action was illegal207 dash_app.callback([dash.dependencies.Output("forecast_extra_info", "style")],208 [dash.dependencies.Input("trigger_for_extra_info", "n_clicks")]209 )(viz_server.tell_illegal_for)210 dash_app.callback([dash.dependencies.Output("rt_extra_info", "style")],211 [dash.dependencies.Input("trigger_rt_extra_info", "n_clicks")]212 )(viz_server.tell_illegal_rt)213 # callback for the timeline214 dash_app.callback([dash.dependencies.Output("recompute_rt_from_timeline", "n_clicks")],215 [dash.dependencies.Input('timeline_graph', 'clickData')])(viz_server.timeline_set_time)216 # callbacks when the "reset" button is pressed217 dash_app.callback([dash.dependencies.Output("scenario_id_title", "children"),218 dash.dependencies.Output("scenario_seed_title", "children"),219 dash.dependencies.Output("chronic_names", "value"),220 dash.dependencies.Output("set_seed", "value"),221 ],222 [dash.dependencies.Input("change_graph_title", "n_clicks")])(viz_server.change_graph_title)223 # set the chronics224 dash_app.callback([dash.dependencies.Output("chronic_names_dummy_output", "n_clicks")],225 [dash.dependencies.Input("chronic_names", "value")])(viz_server.set_chronics)226 # set the seed227 dash_app.callback([dash.dependencies.Output("set_seed_dummy_output", "n_clicks")],...
Using AI Code Generation
1import { MockBuilder, MockRender } from 'ng-mocks';2import { AppModule } from './app.module';3import { AppComponent } from './app.component';4describe('AppComponent', () => {5 beforeEach(() => MockBuilder(AppComponent).keep(AppModule));6 it('should create the app', () => {7 const fixture = MockRender(AppComponent);8 const app = fixture.point.componentInstance;9 expect(app).toBeTruthy();10 });11});12import { NgModule } from '@angular/core';13import { BrowserModule } from '@angular/platform-browser';14import { AppComponent } from './app.component';15@NgModule({16 imports: [BrowserModule],17})18export class AppModule {}19import { Component } from '@angular/core';20@Component({21 <h1>Welcome to {{ title }}!</h1>22 <button (click)="increment()">Increment</button>23 <h2>{{ counter }}</h2>24})25export class AppComponent {26 title = 'ng-mocks';27 counter = 0;28 increment(): void {29 this.counter++;30 }31}32import { MockBuilder, MockRender } from 'ng-mocks';33import { AppModule } from './app.module';34import { AppComponent } from './app.component';35describe('AppComponent', () => {36 beforeEach(() => MockBuilder(AppComponent).keep(AppModule));37 it('should create the app', () => {38 const fixture = MockRender(AppComponent);39 const app = fixture.point.componentInstance;40 expect(app).toBeTruthy();41 });42 it('should increment the counter', () => {43 const fixture = MockRender(AppComponent);44 const app = fixture.point.componentInstance;45 app.increment();46 expect(app.counter).toEqual(1);47 });48});49import { MockBuilder, MockRender } from 'ng-mocks';50import { AppModule } from './app.module';51import { AppComponent } from './app.component';52describe('AppComponent', () => {53 beforeEach(() => MockBuilder(AppComponent).keep(AppModule));54 it('should create the app', () => {55 const fixture = MockRender(AppComponent);56 const app = fixture.point.componentInstance;57 expect(app).toBeTruthy();58 });
Using AI Code Generation
1import { MockBuilder, MockRender } from 'ng-mocks';2import { AppModule } from './app.module';3describe('AppComponent', () => {4 beforeEach(() => MockBuilder(AppComponent, AppModule));5 it('should create the app', () => {6 const fixture = MockRender(AppComponent);7 const app = fixture.debugElement.componentInstance;8 expect(app).toBeTruthy();9 });10});11import { NgModule } from '@angular/core';12import { BrowserModule } from '@angular/platform-browser';13import { AppComponent } from './app.component';14import { HelloComponent } from './hello.component';15@NgModule({16 imports: [BrowserModule],17})18export class AppModule {}19import { Component } from '@angular/core';20@Component({21})22export class AppComponent {}23import { Component } from '@angular/core';24@Component({25})26export class HelloComponent {}27import { MockBuilder, MockRender } from 'ng-mocks';28import { HelloComponent } from './hello.component';29describe('HelloComponent', () => {30 beforeEach(() => MockBuilder(HelloComponent));31 it('should create the app', () => {32 const fixture = MockRender(HelloComponent);33 const app = fixture.debugElement.componentInstance;34 expect(app).toBeTruthy();35 });36});
Using AI Code Generation
1import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';2describe('TestComponent', () => {3 beforeEach(() => MockBuilder(TestComponent));4 it('should create', () => {5 const fixture = MockRender(TestComponent);6 const component = ngMocks.findInstance(TestComponent);7 expect(component).toBeTruthy();8 });9});10import { TestBed } from '@angular/core/testing';11import { TestComponent } from './test.component';12describe('TestComponent', () => {13 beforeEach(() => TestBed.configureTestingModule({14 })15 .compileComponents());16 it('should create', () => {17 const fixture = TestBed.createComponent(TestComponent);18 fixture.detectChanges();19 const component = fixture.componentInstance;20 expect(component).toBeTruthy();21 });22});
Using AI Code Generation
1import { MockBuilder, MockRender } from 'ng-mocks';2import { AppModule } from './app.module';3import { AppComponent } from './app.component';4MockBuilder(AppComponent, AppModule);5MockRender(AppComponent);6MockRender(AppComponent, '<div>My custom template</div>');7MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });8MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });9MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });10MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });11MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });12MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });13MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });14MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });15MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });16MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });17MockRender(AppComponent, '<div>My custom template</div>', { declarations: [MyCustomComponent] });18MockRender(AppComponent, '<div>My custom
Using AI Code Generation
1import { MockBuilder, MockRender, ngMocks } from 'ng-mocks';2import { HeaderComponent } from './header.component';3import { RouterTestingModule } from '@angular/router/testing';4import { AuthService } from '../auth/auth.service';5import { of } from 'rxjs';6import { MockAuthService } from '../auth/auth.service.mock';7describe('HeaderComponent', () => {8 const mockAuthService = new MockAuthService();9 MockBuilder(HeaderComponent, RouterTestingModule).mock(AuthService, mockAuthService);10 const component = MockRender(HeaderComponent).point.componentInstance;11 it('should call logout method', () => {12 const logoutSpy = spyOn(mockAuthService, 'logout');13 component.logout();14 expect(logoutSpy).toHaveBeenCalled();15 });16 it('should call isAuthenticated method', () => {17 const isAuthenticatedSpy = spyOn(mockAuthService, 'isAuthenticated');18 component.isAuthenticated();19 expect(isAuthenticatedSpy).toHaveBeenCalled();20 });21 it('should call getUserName method', () => {22 const getUserNameSpy = spyOn(mockAuthService, 'getUserName');23 component.getUserName();24 expect(getUserNameSpy).toHaveBeenCalled();25 });26 it('should call getUserName method', () => {27 const getUserNameSpy = spyOn(mockAuthService, 'getUserName');28 component.getUserName();29 expect(getUserNameSpy).toHaveBeenCalled();30 });31 it('should call getUserName method', () => {
Using AI Code Generation
1import { dependencies } from 'ng-mocks';2const mockComponent = dependencies({3 { provide: MyComponent, useValue: { name: 'Mocked' } },4});5import { dependencies } from 'ng-mocks';6describe('MyComponent', () => {7 beforeEach(() => {8 TestBed.configureTestingModule({9 });10 });11});12import { dependencies } from 'ng-mocks';13const mockService = dependencies({14 { provide: MyService, useValue: { name: 'Mocked' } },15});16import { dependencies } from 'ng-mocks';17describe('MyComponent', () => {18 beforeEach(() => {19 TestBed.configureTestingModule({20 });21 });22});23import { dependencies } from 'ng-mocks';24const mockPipe = dependencies({25 { provide: MyPipe, useValue: { name: 'Mocked' }
Using AI Code Generation
1import { dependencies } from 'ng-mocks';2const mockService = {3 getItems: () => {4 return ['item1', 'item2', 'item3'];5 },6};7const mockComponent = {8 getItems: () => {9 return ['item1', 'item2', 'item3'];10 },11};12const mockPipe = {13 transform: (value: string) => {14 return value.toUpperCase();15 },16};17const mockDirective = {18 getItems: () => {19 return ['item1', 'item2', 'item3'];20 },21};22const mockModule = {23 getItems: () => {24 return ['item1', 'item2', 'item3'];25 },26};27const mockFactory = {28 getItems: () => {29 return ['item1', 'item2', 'item3'];30 },31};32const mockProvider = {33 getItems: () => {34 return ['item1', 'item2', 'item3'];35 },36};37const mockValue = {38 getItems: () => {39 return ['item1', 'item2', 'item3'];40 },41};42const mockConstant = {43 getItems: () => {44 return ['item1', 'item2', 'item3'];45 },46};47const mockRun = {48 getItems: () => {49 return ['item1', 'item2', 'item3'];50 },51};52const mockConfig = {53 getItems: () => {54 return ['item1', 'item2', 'item3'];55 },56};57const mockController = {58 getItems: () => {
Using AI Code Generation
1import { mockService } from './test';2describe('test', () => {3 it('should test', () => {4 const mockService = TestBed.get(MockService);5 expect(mockService).toBeTruthy();6 });7});8import { MockService } from './test';9describe('test', () => {10 it('should test', () => {11 const mockService = TestBed.get(MockService);12 expect(mockService).toBeTruthy();13 });14});15import { MockService } from './test';16describe('test', () => {17 it('should test', () => {18 const mockService = TestBed.get(MockService);19 expect(mockService).toBeTruthy();20 });21});22import { MockService } from './test';23describe('test', () => {24 it('should test', () => {25 const mockService = TestBed.get(MockService);26 expect(mockService).toBeTruthy();27 });28});29import { MockService } from './test';30describe('test', () => {31 it('should test', () => {32 const mockService = TestBed.get(MockService);33 expect(mockService).toBeTruthy();34 });35});
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!