Feat: Update fourier to use system tuist whenever possible (#3950)
This commit is contained in:
parent
d9c0d31598
commit
722206ebac
|
@ -1,4 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
./fourier lint swift
|
||||
./fourier lint ruby
|
||||
./fourier lint all
|
|
@ -46,9 +46,9 @@ module Fourier
|
|||
desc "encrypt", "Encrypt content in the repository"
|
||||
subcommand "encrypt", Commands::Encrypt
|
||||
|
||||
desc "focus TARGET", "Generate Tuist's project focusing on the target TARGET"
|
||||
def focus(target = nil)
|
||||
Services::Focus.call(target: target)
|
||||
desc "focus TARGETS", "Generate Tuist's project focusing on the target TARGET"
|
||||
def focus(*targets)
|
||||
Services::Focus.call(targets: targets)
|
||||
end
|
||||
|
||||
desc "tuist", "Runs Tuist"
|
||||
|
|
|
@ -8,7 +8,6 @@ module Fourier
|
|||
def call
|
||||
dependencies = ["dependencies", "fetch"]
|
||||
Utilities::System.tuist(*dependencies)
|
||||
|
||||
Utilities::System.tuist("build", "--generate")
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
module Fourier
|
||||
module Services
|
||||
class Focus < Base
|
||||
attr_reader :target
|
||||
attr_reader :targets
|
||||
|
||||
def initialize(target:)
|
||||
@target = target
|
||||
def initialize(targets:)
|
||||
@targets = targets
|
||||
end
|
||||
|
||||
def call
|
||||
|
@ -16,8 +16,7 @@ module Fourier
|
|||
cache_warm = ["cache", "warm", "--dependencies-only"]
|
||||
Utilities::System.tuist(*cache_warm)
|
||||
|
||||
focus = ["focus"]
|
||||
focus << "#{target}" if target != nil
|
||||
focus = ["focus"] + targets
|
||||
Utilities::System.tuist(*focus)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,7 +8,6 @@ module Fourier
|
|||
def call
|
||||
dependencies = ["dependencies", "fetch"]
|
||||
Utilities::System.tuist(*dependencies)
|
||||
|
||||
Utilities::System.tuist("test")
|
||||
Dir.chdir(Constants::TUIST_DIRECTORY) do
|
||||
Utilities::System.system("swift", "test")
|
||||
|
|
|
@ -12,7 +12,7 @@ module Fourier
|
|||
def call
|
||||
Utilities::SwiftPackageManager.build_product("ProjectAutomation")
|
||||
Utilities::SwiftPackageManager.build_product("ProjectDescription")
|
||||
Utilities::System.tuist(*arguments)
|
||||
Utilities::System.tuist(*arguments, from_source: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,12 +9,17 @@ module Fourier
|
|||
Kernel.system(*args) || exit(1)
|
||||
end
|
||||
|
||||
def self.tuist(*args)
|
||||
Dir.chdir(Constants::TUIST_DIRECTORY) do
|
||||
self.system("swift", "build")
|
||||
@tuist = ".build/debug/tuist"
|
||||
self.system(@tuist, *args)
|
||||
def self.tuist(*args, **kwargs)
|
||||
@tuist = "/usr/local/bin/tuist"
|
||||
|
||||
if kwargs[:from_source] || !File.exist?(@tuist)
|
||||
Dir.chdir(Constants::TUIST_DIRECTORY) do
|
||||
self.system("swift", "build")
|
||||
@tuist = ".build/debug/tuist"
|
||||
end
|
||||
end
|
||||
|
||||
self.system(@tuist, *args)
|
||||
end
|
||||
|
||||
def self.fixturegen(*args)
|
||||
|
|
|
@ -13,13 +13,13 @@ module Fourier
|
|||
Utilities::System
|
||||
.expects(:tuist)
|
||||
.with("dependencies", "fetch")
|
||||
target = "TuistSupport"
|
||||
targets = ["TuistSupport", "TuistSupportTests"]
|
||||
Utilities::System
|
||||
.expects(:tuist)
|
||||
.with("focus", target)
|
||||
.with("focus", *targets)
|
||||
|
||||
# Then
|
||||
Services::Focus.call(target: target)
|
||||
Services::Focus.call(targets: targets)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue