Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐ŸŽ๏ธ Speed up the process of deleting sources #372

Merged
merged 3 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions Docs/commands-help/shortcuts/cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,19 @@
> Run the build and use commands.

Options:
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --warmup * Warmup cache with this endpoint. โ”‚
โ”‚ -s, --sdk * Build SDK: sim or ios. โ”‚
โ”‚ -a, --arch * Build architecture: auto, x86_64 or arm64. โ”‚
โ”‚ -c, --config * Build configuration. (Debug) โ”‚
โ”‚ -t, --targets [] * Target names to select. Empty means all targets. โ”‚
โ”‚ -g, --targets-as-regex [] * Regular expression patterns to select targets. โ”‚
โ”‚ -e, --except [] * Target names to exclude. โ”‚
โ”‚ -x, --except-as-regex [] * Regular expression patterns to exclude targets. โ”‚
โ”‚ --result-bundle-path * Path to xcresult bundle. โ”‚
โ”‚ -o, --output * Output mode: fold, multiline, silent, raw. โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --warmup * Warmup cache with this endpoint. โ”‚
โ”‚ --headers [] * Extra HTTP header fields for warmup ("s3-key: my-secret-key"). โ”‚
โ”‚ -s, --sdk * Build SDK: sim or ios. โ”‚
โ”‚ -a, --arch * Build architecture: auto, x86_64 or arm64. โ”‚
โ”‚ -c, --config * Build configuration. (Debug) โ”‚
โ”‚ -t, --targets [] * Target names to select. Empty means all targets. โ”‚
โ”‚ -g, --targets-as-regex [] * Regular expression patterns to select targets. โ”‚
โ”‚ -e, --except [] * Target names to exclude. โ”‚
โ”‚ -x, --except-as-regex [] * Regular expression patterns to exclude targets. โ”‚
โ”‚ --result-bundle-path * Path to xcresult bundle. โ”‚
โ”‚ -o, --output * Output mode: fold, multiline, silent, raw. โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Flags:
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ -r, --rollback * Restore projects state before the last Rugby usage. โ”‚
Expand Down
4 changes: 4 additions & 0 deletions Sources/Rugby/Commands/Mixed/Shortcuts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ extension Shortcuts {
@Option(help: "Warmup cache with this endpoint.")
var warmup: String?

@Option(help: "Extra HTTP header fields for warmup (\"s3-key: my-secret-key\").")
var headers: [String] = []

@OptionGroup
var buildOptions: BuildOptions

Expand Down Expand Up @@ -120,6 +123,7 @@ extension Shortcuts.Cache: RunnableCommand {
warmup.commonOptions = commonOptions
warmup.timeout = Self.settings.warmupTimeout
warmup.maxConnections = Self.settings.warmupMaximumConnectionsPerHost
warmup.headers = headers
runnableCommands.append(("Warmup", warmup))
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Rugby/Core/Help/HelpPrinter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

final class HelpPrinter {
private let terminalWidth = Terminal.columns() ?? 80
private let terminalWidth = Terminal.columns() ?? Int.max

Check warning on line 9 in Sources/Rugby/Core/Help/HelpPrinter.swift

View check run for this annotation

Codecov / codecov/patch

Sources/Rugby/Core/Help/HelpPrinter.swift#L9

Added line #L9 was not covered by tests
private let arguments: [(String, ArgumentInfoV0.KindV0)] = [
("Arguments", .positional),
("Options", .option),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,10 @@
try dictionary[target.project.uuid, default: [:]][target.uuid] = target
}
let targets = try await targetsDataSource.targets
targetsByProject.forEach { _, targetsForRemove in
try targetsByProject.forEach { _, targetsForRemove in

Check warning on line 71 in Sources/RugbyFoundation/XcodeProject/Services/XcodeTargetsEditor.swift

View check run for this annotation

Codecov / codecov/patch

Sources/RugbyFoundation/XcodeProject/Services/XcodeTargetsEditor.swift#L71

Added line #L71 was not covered by tests
guard let project = targetsForRemove.values.first?.project else { return }
project.deleteTargetGroups(targetsForRemove, targets: targets)
let projectTargets = try targets.filter { try $0.value.project.uuid == project.uuid }
project.deleteTargetGroups(targetsForRemove, targets: projectTargets)

Check warning on line 74 in Sources/RugbyFoundation/XcodeProject/Services/XcodeTargetsEditor.swift

View check run for this annotation

Codecov / codecov/patch

Sources/RugbyFoundation/XcodeProject/Services/XcodeTargetsEditor.swift#L73-L74

Added lines #L73 - L74 were not covered by tests
}
}

Expand Down
Loading