From 140ec88f6a63c53683d74b0cab6d725c9a257943 Mon Sep 17 00:00:00 2001 From: toki Date: Tue, 3 Mar 2026 15:30:13 +0900 Subject: [PATCH] =?UTF-8?q?ArchiveiOS=20xcodeproj=20=EC=A7=80=EC=9B=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BuildiOS와 동일하게 xcworkspaceFilePath, xcodeProjectFilePath 중 하나를 선택하여 사용할 수 있도록 수정. Co-Authored-By: Claude Sonnet 4.6 --- lib/oto/commands/build/build_ios.dart | 17 +++++++++++++++-- lib/oto/data/command_data.dart | 3 ++- lib/oto/data/command_data.g.dart | 4 +++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/oto/commands/build/build_ios.dart b/lib/oto/commands/build/build_ios.dart index 05acb10..90c9712 100644 --- a/lib/oto/commands/build/build_ios.dart +++ b/lib/oto/commands/build/build_ios.dart @@ -516,13 +516,26 @@ class ArchiveiOS extends Command { @override Future execute(DataCommand command) async { var data = DataArchiveiOS.fromJson(getParam(command)); - var workspacePath = Command.getPathNormal(data.xcworkspaceFilePath); + var xcodeProjectPath = + data.xcworkspaceFilePath ?? data.xcodeProjectFilePath; + if (xcodeProjectPath == null) { + throw Exception( + '"xcodeProjectFilePath" or "xcworkspaceFilePath" must set at least one.'); + } + var projectPath = Command.getPathNormal(xcodeProjectPath); var archivePath = Command.getPathNormal(data.archivePath); var destination = data.destination ?? "'generic/platform=iOS'"; + var project = ''; + if (data.xcworkspaceFilePath != null) { + project = '-workspace $projectPath'; + } else { + project = '-project $projectPath'; + } + var shell = StringBuffer(); shell.write( - 'xcodebuild -workspace $workspacePath -scheme ${data.scheme} -destination $destination -archivePath $archivePath archive'); + 'xcodebuild $project -scheme ${data.scheme} -destination $destination -archivePath $archivePath archive'); var process = await ProcessExecutor.start(shell, workspace: workspace, diff --git a/lib/oto/data/command_data.dart b/lib/oto/data/command_data.dart index c577f64..ccb5ff9 100644 --- a/lib/oto/data/command_data.dart +++ b/lib/oto/data/command_data.dart @@ -310,7 +310,8 @@ class DataNotarize extends DataParam { class DataArchiveiOS extends DataParam { DataArchiveiOS(); - late String xcworkspaceFilePath; + late String? xcworkspaceFilePath; + late String? xcodeProjectFilePath; late String scheme; late String archivePath; late String? destination; diff --git a/lib/oto/data/command_data.g.dart b/lib/oto/data/command_data.g.dart index cd1fbf2..a9de1e6 100644 --- a/lib/oto/data/command_data.g.dart +++ b/lib/oto/data/command_data.g.dart @@ -563,7 +563,8 @@ DataArchiveiOS _$DataArchiveiOSFromJson(Map json) => ..setResult = json['setResult'] as String? ..setExitCode = json['setExitCode'] as String? ..showPrint = json['showPrint'] as bool? - ..xcworkspaceFilePath = json['xcworkspaceFilePath'] as String + ..xcworkspaceFilePath = json['xcworkspaceFilePath'] as String? + ..xcodeProjectFilePath = json['xcodeProjectFilePath'] as String? ..scheme = json['scheme'] as String ..archivePath = json['archivePath'] as String ..destination = json['destination'] as String?; @@ -576,6 +577,7 @@ Map _$DataArchiveiOSToJson(DataArchiveiOS instance) => 'setExitCode': instance.setExitCode, 'showPrint': instance.showPrint, 'xcworkspaceFilePath': instance.xcworkspaceFilePath, + 'xcodeProjectFilePath': instance.xcodeProjectFilePath, 'scheme': instance.scheme, 'archivePath': instance.archivePath, 'destination': instance.destination,