<commit_before>import 'dart:io';

import 'package:compiler/compiler.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:path/path.dart' as p;

import 'constants.dart';

part 'build_artifacts.freezed.dart';
part 'build_artifacts.g.dart';

@freezed
abstract class BuildArtifactId implements _$BuildArtifactId {
  const factory BuildArtifactId(String path) = _BuildArtifactId;
  factory BuildArtifactId.fromJson(Map<String, dynamic> json) =>
      _$BuildArtifactIdFromJson(json);
  const BuildArtifactId._();

  BuildArtifactId child(String name) => BuildArtifactId('$path/$name');
}

class BuildArtifactManager {
  const BuildArtifactManager(this.projectDirectory);

  final Directory projectDirectory;
  String get _buildDirectory =>
      p.join(projectDirectory.path, buildDirectoryName);

  void delete([BuildArtifactId directoryId]) {
    final path = directoryId?.path ?? _buildDirectory;
    final dir = Directory(path);<commit_msg>fix(packages/compiler): resolve build artifact deletion path<commit_after>import 'dart:io';

import 'package:compiler/compiler.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:path/path.dart' as p;

import 'constants.dart';

part 'build_artifacts.freezed.dart';
part 'build_artifacts.g.dart';

@freezed
abstract class BuildArtifactId implements _$BuildArtifactId {
  const factory BuildArtifactId(String path) = _BuildArtifactId;
  factory BuildArtifactId.fromJson(Map<String, dynamic> json) =>
      _$BuildArtifactIdFromJson(json);
  const BuildArtifactId._();

  BuildArtifactId child(String name) => BuildArtifactId('$path/$name');
}

class BuildArtifactManager {
  const BuildArtifactManager(this.projectDirectory);

  final Directory projectDirectory;
  String get _buildDirectory =>
      p.join(projectDirectory.path, buildDirectoryName);

  void delete([BuildArtifactId directoryId]) {
    final path = directoryId != null ? toPath(directoryId) : _buildDirectory;
    final dir = Directory(path);
{'fraction_non_alphanumeric': 0.10646766169154229, 'fraction_numerical': 0.0, 'mean_word_length': 6.339416058394161, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4546680', 'n_tokens_mistral': 610, 'n_tokens_neox': 599, 'n_words': 126}