Skip to content
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
54 changes: 0 additions & 54 deletions Sources/fxios/Commands/L10n/L10nProduct.swift

This file was deleted.

3 changes: 3 additions & 0 deletions Sources/fxios/Commands/Nimbus/Nimbus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ struct Nimbus: ParsableCommand {

// MARK: - Constants

// These paths are firefox-ios repo conventions, not values we discover at runtime. The Nimbus
// subcommands (add/remove/refresh) all touch this same set of files in lockstep, so if firefox-ios
// ever reorganizes the FeatureFlags or Nimbus directories these constants must be updated together.
enum NimbusConstants {
static let nimbusFmlPath = "firefox-ios/nimbus.fml.yaml"
static let nimbusFeaturesPath = "firefox-ios/nimbus-features"
Expand Down
56 changes: 56 additions & 0 deletions Sources/fxios/Core/Products.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import ArgumentParser
import Foundation

// Two product enums live here on purpose. They serve different command groups and
// carry different configuration, so keeping them as siblings makes the choice obvious:
// - BuildProduct: used by `build`, `run`, `test`, `clean` (Xcode schemes, configurations, bundle IDs)
// - L10nProduct: used by `l10n export`, `l10n import`, `l10n templates` (xliff names, Pontoon paths)

// MARK: - Build Product

/// Represents the available products that can be built, run, or tested
Expand Down Expand Up @@ -52,3 +57,54 @@ enum BuildProduct: String, ExpressibleByArgument, CaseIterable {
}
}
}

// MARK: - L10n Product

/// Product presets for l10n commands, providing default configuration values.
enum L10nProduct: String, ExpressibleByArgument, CaseIterable {
case firefox
case focus

var xliffName: String {
switch self {
case .firefox: return "firefox-ios.xliff"
case .focus: return "focus-ios.xliff"
}
}

var exportBasePath: String {
switch self {
case .firefox: return "/tmp/ios-localization"
case .focus: return "/tmp/ios-localization-focus"
}
}

var developmentRegion: String {
switch self {
case .firefox: return "en-US"
case .focus: return "en"
}
}

var projectName: String {
switch self {
case .firefox: return "Client.xcodeproj"
case .focus: return "Blockzilla.xcodeproj"
}
}

/// Relative path from repo root to .xcodeproj
var projectPath: String {
switch self {
case .firefox: return "firefox-ios/Client.xcodeproj"
case .focus: return "focus-ios/Blockzilla.xcodeproj"
}
}

var skipWidgetKit: Bool {
switch self {
case .firefox: return false
case .focus: return true
}
}
}
Loading