def build( BENCHMARKS_CSPROJ: dotnet.CSharpProject, configuration: str, target_framework_monikers: list, incremental: str, verbose: bool) -> None: '''Restores and builds the benchmarks''' packages = get_packages_directory() if incremental == 'no': __log_script_header("Removing packages, bin and obj folders.") binary_folders = [ packages, path.join(BENCHMARKS_CSPROJ.bin_path), ] for binary_folder in binary_folders: remove_directory(path=binary_folder) # dotnet restore __log_script_header("Restoring .NET micro benchmarks") BENCHMARKS_CSPROJ.restore(packages_path=packages, verbose=verbose) # dotnet build build_title = "Building .NET micro benchmarks for '{}'".format( ' '.join(target_framework_monikers)) __log_script_header(build_title) BENCHMARKS_CSPROJ.build( configuration=configuration, target_framework_monikers=target_framework_monikers, verbose=verbose, packages_path=packages)
def build( configuration: str, frameworks: list, incremental: str, verbose: bool) -> None: '''Restores and builds the benchmarks''' packages = path.join(get_repo_root_path(), 'packages') if incremental == 'no': __log_script_header("Removing packages, bin and obj folders.") binary_folders = [ packages, path.join(BENCHMARKS_CSPROJ.working_directory, 'bin'), path.join(BENCHMARKS_CSPROJ.working_directory, 'obj'), ] for binary_folder in binary_folders: remove_directory(path=binary_folder) # dotnet restore __log_script_header("Restoring .NET micro benchmarks") BENCHMARKS_CSPROJ.restore(packages_path=packages, verbose=verbose) # dotnet build build_title = "Building .NET micro benchmarks for '{}'".format( ' '.join(frameworks)) __log_script_header(build_title) BENCHMARKS_CSPROJ.build(configuration, frameworks, verbose)
def install(): ''' Downloads scripts that serialize/upload performance data to BenchView. ''' __log_script_header() url_str = __get_latest_benchview_script_version() benchview_path = BenchView.get_scripts_directory() if path.isdir(benchview_path): remove_directory(benchview_path) if not path.exists(benchview_path): make_directory(benchview_path) getLogger().info('%s -> %s', url_str, benchview_path) zipfile_path = __download_zip_file(url_str, benchview_path) __unzip_file(zipfile_path, benchview_path)
def build(BENCHMARKS_CSPROJ: dotnet.CSharpProject, configuration: str, target_framework_monikers: list, incremental: str, run_isolated: bool, verbose: bool) -> None: '''Restores and builds the benchmarks''' packages = get_packages_directory() if incremental == 'no': __log_script_header("Removing packages, bin and obj folders.") binary_folders = [ packages, path.join(BENCHMARKS_CSPROJ.bin_path), ] for binary_folder in binary_folders: remove_directory(path=binary_folder) # dotnet restore __log_script_header("Restoring .NET micro benchmarks") BENCHMARKS_CSPROJ.restore(packages_path=packages, verbose=verbose) # dotnet build build_title = "Building .NET micro benchmarks for '{}'".format( ' '.join(target_framework_monikers)) __log_script_header(build_title) BENCHMARKS_CSPROJ.build( configuration=configuration, target_framework_monikers=target_framework_monikers, output_to_bindir=run_isolated, verbose=verbose, packages_path=packages) # When running isolated, artifacts/obj/{project_name} will still be # there, and would interfere with any subsequent builds. So, remove # that if run_isolated: objDir = path.join(get_artifacts_directory(), 'obj', BENCHMARKS_CSPROJ.project_name) remove_directory(objDir)
''' post cleanup script ''' from performance.common import remove_directory from shared.const import BINDIR, PUBDIR, APPDIR, TRACEDIR, TMPDIR remove_directory(BINDIR) remove_directory(PUBDIR) remove_directory(APPDIR) remove_directory(TRACEDIR) remove_directory(TMPDIR)
def clean_directories(): to_remove = (APPDIR, TMPDIR, TRACEDIR, PUBDIR, BINDIR, CROSSGENDIR, "emsdk") print(f"Removing {','.join(to_remove)} if exist ...") for dir in to_remove: remove_directory(dir)
def clean_directories(): to_remove = (APPDIR, TMPDIR, TRACEDIR, PUBDIR, BINDIR) for dir in to_remove: remove_directory(dir)