Skip to content

chore: migrate exportoptions to v2 (STEP-2175)#333

Open
Badlazzor wants to merge 1 commit into
masterfrom
STEP-2175-exportoptions-v2
Open

chore: migrate exportoptions to v2 (STEP-2175)#333
Badlazzor wants to merge 1 commit into
masterfrom
STEP-2175-exportoptions-v2

Conversation

@Badlazzor

@Badlazzor Badlazzor commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds exportoptions as a v2 package under exportoptions/. Self-contained leaf migration — no internal go-xcode dependencies, only howett.net/plist + go-utils basics.

Jira: STEP-2175 (taking over from @lpusok — no branch/PR in flight)

What changed

  • New package exportoptions/ ported from v1 (4 source + 2 test files, ~975 LOC).
  • Module imports updated to /v2.
  • API swap inside WritePlistToFile / WritePlistToTmpFile:
    • fileutil.WriteBytesToFile(pth, b)fileutil.NewFileManager().WriteBytes(pth, b)
    • pathutil.NormalizedOSTempDirPath("output")pathutil.NewPathProvider().CreateTempDir("output")
  • Tests:
    • fileutil.ReadStringFromFile has no v2 equivalent on FileManager, so reads were switched to stdlib os.ReadFile with a string(content) conversion at the assertion site.

The public surface (ExportOptions interface, WritePlistToFile, WritePlistToTmpFile, AppStoreOptionsModel, NonAppStoreOptionsModel, all Method / key constants) is unchanged from v1.

What did NOT change

~15 v2 files still import v1 exportoptions (exportoptionsgenerator/, metaparser/, codesign/, autocodesign/localcodesignasset/, plus profileutil). Switching them is mechanical because public signatures match v1 — left for a follow-up PR to keep this one reviewable.

Test plan

  • go test ./exportoptions/... — all tests green (Manifest, AppStoreOptions, NonAppStoreOptions, WriteToFile golden plist, Upgrade method name).
  • go build ./... — whole repo compiles.
  • gofmt -l exportoptions/ — clean.
  • go vet ./exportoptions/... — clean.

🤖 Generated with Claude Code

Adds exportoptions as a v2 package with /v2 module imports.

API changes:
- fileutil.WriteBytesToFile(pth, b) → fileutil.NewFileManager().WriteBytes(pth, b)
- pathutil.NormalizedOSTempDirPath("output") → pathutil.NewPathProvider().CreateTempDir("output")
- Test reads switched from fileutil.ReadStringFromFile (v1-only, no v2
  equivalent on FileManager) to stdlib os.ReadFile + string() conversion.

Public API of the package is unchanged: ExportOptions interface,
WritePlistToFile, WritePlistToTmpFile, AppStoreOptionsModel,
NonAppStoreOptionsModel, all constants/Method types kept verbatim.

Internal v2 callers (exportoptionsgenerator/, metaparser/, codesign/,
autocodesign/) still import v1 exportoptions. Switching them is
mechanical (signatures unchanged) and will follow in a separate PR.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Badlazzor Badlazzor requested a review from a team June 12, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant