def __init__(self): startupdir = 'startup' if helixpayload() and os.path.exists( os.path.join(helixpayload(), startupdir)): self._setstartuppath(os.path.join(helixpayload(), startupdir)) elif helixworkitempayload() and os.path.exists( os.path.join(helixworkitempayload(), startupdir)): self._setstartuppath( os.path.join(helixworkitempayload(), startupdir)) else: relpath = os.path.join(get_artifacts_directory(), startupdir) startupproj = os.path.join('..', '..', 'tools', 'ScenarioMeasurement', 'Startup', 'Startup.csproj') startup = CSharpProject( CSharpProjFile(startupproj, sys.path[0]), os.path.join( os.path.dirname(startupproj), os.path.join(get_artifacts_directory(), startupdir))) if not os.path.exists(relpath): startup.restore(get_packages_directory(), True, getruntimeidentifier()) startup.publish('Release', relpath, True, get_packages_directory(), None, getruntimeidentifier(), '--no-restore') self._setstartuppath(startup.bin_path)
def add_event_source(self, file: str, line: str, trace_statement: str): ''' Adds a copy of the event source to the project and inserts the correct call file: relative path to the root of the project (where the project file lives) line: Exact line to insert trace statement after trace_statement: Statement to insert ''' projpath = os.path.dirname(self.project.csproj_file) staticpath = os.path.join(get_repo_root_path(), "src", "scenarios", "staticdeps") if helixpayload(): staticpath = os.path.join(helixpayload(), "staticdeps") shutil.copyfile(os.path.join(staticpath, "PerfLab.cs"), os.path.join(projpath, "PerfLab.cs")) filepath = os.path.join(projpath, file) insert_after(filepath, line, trace_statement)
def __init__(self): payload = helixpayload() if payload: self._setstartuppath(os.path.join(payload, 'Startup')) else: startupproj = os.path.join('..', '..', 'tools', 'ScenarioMeasurement', 'Startup', 'Startup.csproj') startup = CSharpProject( CSharpProjFile(startupproj, sys.path[0]), os.path.join( os.path.dirname(startupproj), os.path.join(get_artifacts_directory(), 'startup'))) startup.restore(get_packages_directory(), True) startup.build(configuration='Release', verbose=True, packages_path=get_packages_directory(), output_to_bindir=True) self._setstartuppath(startup.bin_path)
def __init__(self): payload = helixpayload() if payload: self._setstartuppath(os.path.join(payload, 'Startup')) else: startupproj = os.path.join('..', '..', 'tools', 'ScenarioMeasurement', 'Startup', 'Startup.csproj') startup = CSharpProject( CSharpProjFile(startupproj, sys.path[0]), os.path.join( os.path.dirname(startupproj), os.path.join(get_artifacts_directory(), 'startup'))) startup.restore(get_packages_directory(), True, getruntimeidentifier()) startup.publish('Release', os.path.join(get_artifacts_directory(), 'startup'), True, get_packages_directory(), None, getruntimeidentifier(), '--no-restore') self._setstartuppath(startup.bin_path)