# command ## 목적 / 책임 외부 시스템(Git, Jenkins, FTP, Slack, iOS 빌드 등)과의 실제 연동을 구현하는 커맨드 계층과, 커맨드 파라미터 데이터 모델을 담당한다. ## 포함 경로 - `lib/oto/commands/` — 커맨드 구현체 (카테고리별 하위 폴더) - `lib/oto/data/` — 커맨드 파라미터 데이터 모델 (`*_data.dart`, `*.g.dart`) ## 제외 경로 - `lib/oto/pipeline/` — 실행 흐름 제어 (커맨드 dispatch 이전) - `lib/oto/core/` — 태그 치환, 데이터 합성 (커맨드 실행 이전) ## 주요 구성 요소 - `Command` (`command.dart`) — 커맨드 베이스 클래스, `CommandType` enum - `CommandRegistry` (`command_registry.dart`) — CommandType → Command 매핑 등록소 - `DataParam` (`base_data.dart`) — 모든 커맨드 파라미터의 베이스 - `DataCommand` (`command_data.dart`) — 모든 커맨드에 전달되는 통합 컨테이너 커맨드 카테고리: - `build/` — iOS/Flutter/Dart/MSBuild/.NET 빌드 - `file/` — 파일 복사·삭제·이름 변경·압축 - `git/` — Git, GitHub 연동 - `ftp/` — FTP 업로드·다운로드 - `notification/` — Slack, Mattermost 알림 - `jenkins/` — Jenkins API 연동 - `aws/`, `docker/`, `gradle/`, `proto/`, `jira/`, `infra/`, `shell/`, `web/`, `process/`, `util/` ## 유지할 패턴 - 새 커맨드는 반드시 `Command` 상속 후 `CommandRegistry`에 등록 - 파라미터 모델은 `DataParam` 상속 + `@JsonSerializable` - `*.g.dart`는 `dart run build_runner build`로 생성 (필요 시 직접 수정 가능) - `getWorkspace()`: workspace 필드 → `property['workspace']` → `commonData.workspace` 순으로 resolve ## 다른 도메인과의 경계 - **pipeline**: `Command.execute(DataCommand)`를 호출하는 시점이 경계. 커맨드는 흐름을 모른다 - **core**: 태그 치환은 core가 완료한 후 DataCommand가 커맨드에 전달됨 ## 금지 사항 - 커맨드에서 다른 커맨드를 직접 인스턴스화하거나 호출하지 않는다 - 흐름 제어(if/loop) 로직을 커맨드 내부에 넣지 않는다 - `CommandRegistry` 외 장소에서 CommandType 매핑을 추가하지 않는다