Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ inputs:
does without an action specified (usually `build`)
required: false
default: test
derived-data-path:
description: |
Path to which `xcodebuild` will write its derived data.
Leave unset and `xcodebuild` decides itself.
required: false
code-coverage:
description: Enables code coverage
required: false
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ async function main() {
const identity = getIdentity(core.getInput('code-sign-identity'), platform)
const currentVerbosity = verbosity()
const workspace = core.getInput('workspace')
const derivedDataPath = core.getInput('derived-data-path')

core.info(`» Selected Xcode ${selected}`)

Expand All @@ -60,7 +61,7 @@ async function main() {
await configureKeychain()
await configureProvisioningProfiles()

await build(await getScheme(workspace), workspace, arch)
await build(await getScheme(workspace), workspace, arch, derivedDataPath)

if (core.getInput('upload-logs') == 'always') {
await uploadLogs()
Expand Down Expand Up @@ -187,11 +188,16 @@ async function main() {
await createProvisioningProfiles(mobileProfiles, profiles)
}

async function build(scheme?: string, workspace?: string, arch?: Arch) {
async function build(
scheme?: string,
workspace?: string,
arch?: Arch,
derivedDataPath?: string
) {
if (warningsAsErrors && actionIsTestable(action)) {
await xcodebuild('build', scheme, workspace, arch)
await xcodebuild('build', scheme, workspace, arch, derivedDataPath)
}
await xcodebuild(action, scheme, workspace, arch)
await xcodebuild(action, scheme, workspace, arch, derivedDataPath)
}

//// helper funcs
Expand All @@ -200,7 +206,8 @@ async function main() {
action?: string,
scheme?: string,
workspace?: string,
arch?: Arch
arch?: Arch,
derivedDataPath?: string
) {
if (action === 'none') return

Expand All @@ -210,6 +217,9 @@ async function main() {
if (scheme) args = args.concat(['-scheme', scheme])
if (arch) args = args.concat([`-arch=${arch}`])
if (workspace) args = args.concat(['-workspace', workspace])
if (derivedDataPath) {
args = args.concat(['-derivedDataPath', derivedDataPath])
}
if (identity) args = args.concat(identity)
if (currentVerbosity == 'quiet') args.push('-quiet')
if (configuration) args = args.concat(['-configuration', configuration])
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"noImplicitAny": true,
"moduleResolution": "node"
"moduleResolution": "node",
"outDir": "./build"
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
}