This repository was archived by the owner on Jul 31, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
lib/fastlane/plugin/xcodegen/actions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ def self.run(params)
1212
1313 Actions ::BrewAction . run ( command : "tap yonaskolb/XcodeGen https://github.com/yonaskolb/XcodeGen.git" )
1414 Actions ::BrewAction . run ( command : "install XcodeGen" )
15- end )
15+ end ) unless params [ :executable ]
1616
17- cmd = [ "xcodegen" ]
17+ cmd = [ params [ :executable ] || "xcodegen" ]
1818 cmd += [ "--spec" , File . expand_path ( params [ :spec ] ) ] if params [ :spec ]
1919 cmd += [ "--project" , File . expand_path ( params [ :project ] ) ] if params [ :project ]
2020 cmd << "--quiet" if params [ :quiet ]
@@ -42,6 +42,10 @@ def self.details
4242
4343 def self . available_options
4444 [
45+ FastlaneCore ::ConfigItem . new ( key : :executable ,
46+ env_name : "XCODEGEN_EXECUTABLE" ,
47+ description : "The path to the `xcodegen` executable" ,
48+ optional : true ) ,
4549 FastlaneCore ::ConfigItem . new ( key : :spec ,
4650 env_name : "XCODEGEN_SPEC" ,
4751 description : "The path to the project spec file" ,
Original file line number Diff line number Diff line change 7575 xcodegen
7676 end" ) . runner . execute ( :test )
7777 end
78+ it "supports a custom executable" do
79+ expect ( Fastlane ::Actions ) . to_not receive ( :sh ) . with ( "which xcodegen" , anything )
80+ expect ( Fastlane ::Actions ::BrewAction ) . to_not receive ( :run )
81+ expect ( Fastlane ::Actions ) . to receive ( :sh ) . with ( "./bin/xcodegen" , "--quiet" )
82+
83+ Fastlane ::FastFile . new . parse ( "lane :test do
84+ xcodegen(executable: './bin/xcodegen', quiet: true)
85+ end" ) . runner . execute ( :test )
86+ end
7887 end
7988 end
8089end
You can’t perform that action at this time.
0 commit comments