@xcodekit/xcode-node 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +118 -0
- package/index.js +319 -0
- package/package.json +34 -0
- package/types.d.ts +252 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/* auto-generated by NAPI-RS */
|
|
5
|
+
|
|
6
|
+
/** Parse a .pbxproj string into a JSON-compatible object. */
|
|
7
|
+
export declare function parse(text: string): any
|
|
8
|
+
/** Serialize a JSON object back to .pbxproj format. */
|
|
9
|
+
export declare function build(project: any): string
|
|
10
|
+
/**
|
|
11
|
+
* Serialize a JSON string back to .pbxproj format.
|
|
12
|
+
* Faster than `build()` — accepts `JSON.stringify(project)` directly,
|
|
13
|
+
* avoiding napi's recursive JS→Rust object marshalling.
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildFromJSON(json: string): string
|
|
16
|
+
/**
|
|
17
|
+
* Parse and immediately re-serialize a .pbxproj string.
|
|
18
|
+
* Fastest path — stays entirely in Rust, zero JS↔Rust marshalling.
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseAndBuild(text: string): string
|
|
21
|
+
/** XcodeProject class for high-level API. */
|
|
22
|
+
export declare class XcodeProject {
|
|
23
|
+
/** Open and parse a .pbxproj file from disk. */
|
|
24
|
+
static open(filePath: string): XcodeProject
|
|
25
|
+
/** Parse a .pbxproj string into an XcodeProject (no file on disk needed). */
|
|
26
|
+
static fromString(content: string): XcodeProject
|
|
27
|
+
/** Convert the project to a JSON-compatible object. */
|
|
28
|
+
toJSON(): any
|
|
29
|
+
/** Serialize the project back to .pbxproj format. */
|
|
30
|
+
toBuild(): string
|
|
31
|
+
/** Write the project back to its original file. */
|
|
32
|
+
save(): void
|
|
33
|
+
/** Get the file path this project was loaded from. */
|
|
34
|
+
get filePath(): string | null
|
|
35
|
+
/** Get the archive version. */
|
|
36
|
+
get archiveVersion(): number
|
|
37
|
+
/** Get the object version. */
|
|
38
|
+
get objectVersion(): number
|
|
39
|
+
/** Get all native target UUIDs. */
|
|
40
|
+
getNativeTargets(): Array<string>
|
|
41
|
+
/** Get a build setting value from a target. */
|
|
42
|
+
getBuildSetting(targetUuid: string, key: string): any
|
|
43
|
+
/** Set a build setting on all configurations for a target. */
|
|
44
|
+
setBuildSetting(targetUuid: string, key: string, value: string): boolean
|
|
45
|
+
/** Remove a build setting from all configurations for a target. */
|
|
46
|
+
removeBuildSetting(targetUuid: string, key: string): boolean
|
|
47
|
+
/**
|
|
48
|
+
* Find orphaned references (UUIDs referenced but not present in objects).
|
|
49
|
+
* Returns array of { referrerUuid, referrerIsa, property, orphanUuid }.
|
|
50
|
+
*/
|
|
51
|
+
findOrphanedReferences(): Array<any>
|
|
52
|
+
/** Find the main app target UUID. */
|
|
53
|
+
findMainAppTarget(platform?: string | undefined | null): string | null
|
|
54
|
+
/** Generate a unique UUID. */
|
|
55
|
+
getUniqueId(seed: string): string
|
|
56
|
+
/** Get the main group UUID. */
|
|
57
|
+
get mainGroupUuid(): string | null
|
|
58
|
+
/** Get children UUIDs of a group. */
|
|
59
|
+
getGroupChildren(groupUuid: string): Array<string>
|
|
60
|
+
/**
|
|
61
|
+
* Add a file reference to the project and a group.
|
|
62
|
+
* Returns the UUID of the new PBXFileReference.
|
|
63
|
+
*/
|
|
64
|
+
addFile(groupUuid: string, path: string): string | null
|
|
65
|
+
/**
|
|
66
|
+
* Create a group and add it as a child of a parent group.
|
|
67
|
+
* Returns the UUID of the new PBXGroup.
|
|
68
|
+
*/
|
|
69
|
+
addGroup(parentUuid: string, name: string): string | null
|
|
70
|
+
/**
|
|
71
|
+
* Add a build file to a build phase.
|
|
72
|
+
* Returns the UUID of the new PBXBuildFile.
|
|
73
|
+
*/
|
|
74
|
+
addBuildFile(phaseUuid: string, fileRefUuid: string): string | null
|
|
75
|
+
/**
|
|
76
|
+
* Find or create a build phase for a target.
|
|
77
|
+
* Returns the UUID of the build phase.
|
|
78
|
+
*/
|
|
79
|
+
ensureBuildPhase(targetUuid: string, phaseIsa: string): string | null
|
|
80
|
+
/**
|
|
81
|
+
* Add a framework to a target.
|
|
82
|
+
* Returns the UUID of the PBXBuildFile.
|
|
83
|
+
*/
|
|
84
|
+
addFramework(targetUuid: string, frameworkName: string): string | null
|
|
85
|
+
/**
|
|
86
|
+
* Create a native target with Debug/Release configs, standard build phases, and product ref.
|
|
87
|
+
* Returns the UUID of the new PBXNativeTarget.
|
|
88
|
+
*/
|
|
89
|
+
createNativeTarget(name: string, productType: string, bundleId: string): string | null
|
|
90
|
+
/**
|
|
91
|
+
* Add a dependency from one target to another.
|
|
92
|
+
* Returns the UUID of the PBXTargetDependency.
|
|
93
|
+
*/
|
|
94
|
+
addDependency(targetUuid: string, dependsOnUuid: string): string | null
|
|
95
|
+
/**
|
|
96
|
+
* Embed an extension target into a host app target.
|
|
97
|
+
* Creates PBXCopyFilesBuildPhase with correct dstSubfolderSpec.
|
|
98
|
+
* Returns the UUID of the copy files build phase.
|
|
99
|
+
*/
|
|
100
|
+
embedExtension(hostTargetUuid: string, extensionTargetUuid: string): string | null
|
|
101
|
+
/**
|
|
102
|
+
* Add a PBXFileSystemSynchronizedRootGroup to a target (Xcode 16+).
|
|
103
|
+
* Returns the UUID of the sync group.
|
|
104
|
+
*/
|
|
105
|
+
addFileSystemSyncGroup(targetUuid: string, path: string): string | null
|
|
106
|
+
/** Get a string property from any object. */
|
|
107
|
+
getObjectProperty(uuid: string, key: string): string | null
|
|
108
|
+
/** Set a string property on any object. */
|
|
109
|
+
setObjectProperty(uuid: string, key: string, value: string): boolean
|
|
110
|
+
/** Find all object UUIDs matching a given ISA type. */
|
|
111
|
+
findObjectsByIsa(isa: string): Array<string>
|
|
112
|
+
/** Get the name of a target. */
|
|
113
|
+
getTargetName(targetUuid: string): string | null
|
|
114
|
+
/** Set the name and productName of a target. */
|
|
115
|
+
setTargetName(targetUuid: string, name: string): boolean
|
|
116
|
+
/** Rename a target and cascade through the project (group paths, product refs, proxies). */
|
|
117
|
+
renameTarget(targetUuid: string, oldName: string, newName: string): boolean
|
|
118
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/* prettier-ignore */
|
|
4
|
+
|
|
5
|
+
/* auto-generated by NAPI-RS */
|
|
6
|
+
|
|
7
|
+
const { existsSync, readFileSync } = require('fs')
|
|
8
|
+
const { join } = require('path')
|
|
9
|
+
|
|
10
|
+
const { platform, arch } = process
|
|
11
|
+
|
|
12
|
+
let nativeBinding = null
|
|
13
|
+
let localFileExisted = false
|
|
14
|
+
let loadError = null
|
|
15
|
+
|
|
16
|
+
function isMusl() {
|
|
17
|
+
// For Node 10
|
|
18
|
+
if (!process.report || typeof process.report.getReport !== 'function') {
|
|
19
|
+
try {
|
|
20
|
+
const lddPath = require('child_process').execSync('which ldd').toString().trim()
|
|
21
|
+
return readFileSync(lddPath, 'utf8').includes('musl')
|
|
22
|
+
} catch (e) {
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
const { glibcVersionRuntime } = process.report.getReport().header
|
|
27
|
+
return !glibcVersionRuntime
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
switch (platform) {
|
|
32
|
+
case 'android':
|
|
33
|
+
switch (arch) {
|
|
34
|
+
case 'arm64':
|
|
35
|
+
localFileExisted = existsSync(join(__dirname, 'xcode.android-arm64.node'))
|
|
36
|
+
try {
|
|
37
|
+
if (localFileExisted) {
|
|
38
|
+
nativeBinding = require('./xcode.android-arm64.node')
|
|
39
|
+
} else {
|
|
40
|
+
nativeBinding = require('undefined-android-arm64')
|
|
41
|
+
}
|
|
42
|
+
} catch (e) {
|
|
43
|
+
loadError = e
|
|
44
|
+
}
|
|
45
|
+
break
|
|
46
|
+
case 'arm':
|
|
47
|
+
localFileExisted = existsSync(join(__dirname, 'xcode.android-arm-eabi.node'))
|
|
48
|
+
try {
|
|
49
|
+
if (localFileExisted) {
|
|
50
|
+
nativeBinding = require('./xcode.android-arm-eabi.node')
|
|
51
|
+
} else {
|
|
52
|
+
nativeBinding = require('undefined-android-arm-eabi')
|
|
53
|
+
}
|
|
54
|
+
} catch (e) {
|
|
55
|
+
loadError = e
|
|
56
|
+
}
|
|
57
|
+
break
|
|
58
|
+
default:
|
|
59
|
+
throw new Error(`Unsupported architecture on Android ${arch}`)
|
|
60
|
+
}
|
|
61
|
+
break
|
|
62
|
+
case 'win32':
|
|
63
|
+
switch (arch) {
|
|
64
|
+
case 'x64':
|
|
65
|
+
localFileExisted = existsSync(
|
|
66
|
+
join(__dirname, 'xcode.win32-x64-msvc.node')
|
|
67
|
+
)
|
|
68
|
+
try {
|
|
69
|
+
if (localFileExisted) {
|
|
70
|
+
nativeBinding = require('./xcode.win32-x64-msvc.node')
|
|
71
|
+
} else {
|
|
72
|
+
nativeBinding = require('undefined-win32-x64-msvc')
|
|
73
|
+
}
|
|
74
|
+
} catch (e) {
|
|
75
|
+
loadError = e
|
|
76
|
+
}
|
|
77
|
+
break
|
|
78
|
+
case 'ia32':
|
|
79
|
+
localFileExisted = existsSync(
|
|
80
|
+
join(__dirname, 'xcode.win32-ia32-msvc.node')
|
|
81
|
+
)
|
|
82
|
+
try {
|
|
83
|
+
if (localFileExisted) {
|
|
84
|
+
nativeBinding = require('./xcode.win32-ia32-msvc.node')
|
|
85
|
+
} else {
|
|
86
|
+
nativeBinding = require('undefined-win32-ia32-msvc')
|
|
87
|
+
}
|
|
88
|
+
} catch (e) {
|
|
89
|
+
loadError = e
|
|
90
|
+
}
|
|
91
|
+
break
|
|
92
|
+
case 'arm64':
|
|
93
|
+
localFileExisted = existsSync(
|
|
94
|
+
join(__dirname, 'xcode.win32-arm64-msvc.node')
|
|
95
|
+
)
|
|
96
|
+
try {
|
|
97
|
+
if (localFileExisted) {
|
|
98
|
+
nativeBinding = require('./xcode.win32-arm64-msvc.node')
|
|
99
|
+
} else {
|
|
100
|
+
nativeBinding = require('undefined-win32-arm64-msvc')
|
|
101
|
+
}
|
|
102
|
+
} catch (e) {
|
|
103
|
+
loadError = e
|
|
104
|
+
}
|
|
105
|
+
break
|
|
106
|
+
default:
|
|
107
|
+
throw new Error(`Unsupported architecture on Windows: ${arch}`)
|
|
108
|
+
}
|
|
109
|
+
break
|
|
110
|
+
case 'darwin':
|
|
111
|
+
localFileExisted = existsSync(join(__dirname, 'xcode.darwin-universal.node'))
|
|
112
|
+
try {
|
|
113
|
+
if (localFileExisted) {
|
|
114
|
+
nativeBinding = require('./xcode.darwin-universal.node')
|
|
115
|
+
} else {
|
|
116
|
+
nativeBinding = require('undefined-darwin-universal')
|
|
117
|
+
}
|
|
118
|
+
break
|
|
119
|
+
} catch {}
|
|
120
|
+
switch (arch) {
|
|
121
|
+
case 'x64':
|
|
122
|
+
localFileExisted = existsSync(join(__dirname, 'xcode.darwin-x64.node'))
|
|
123
|
+
try {
|
|
124
|
+
if (localFileExisted) {
|
|
125
|
+
nativeBinding = require('./xcode.darwin-x64.node')
|
|
126
|
+
} else {
|
|
127
|
+
nativeBinding = require('undefined-darwin-x64')
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
loadError = e
|
|
131
|
+
}
|
|
132
|
+
break
|
|
133
|
+
case 'arm64':
|
|
134
|
+
localFileExisted = existsSync(
|
|
135
|
+
join(__dirname, 'xcode.darwin-arm64.node')
|
|
136
|
+
)
|
|
137
|
+
try {
|
|
138
|
+
if (localFileExisted) {
|
|
139
|
+
nativeBinding = require('./xcode.darwin-arm64.node')
|
|
140
|
+
} else {
|
|
141
|
+
nativeBinding = require('undefined-darwin-arm64')
|
|
142
|
+
}
|
|
143
|
+
} catch (e) {
|
|
144
|
+
loadError = e
|
|
145
|
+
}
|
|
146
|
+
break
|
|
147
|
+
default:
|
|
148
|
+
throw new Error(`Unsupported architecture on macOS: ${arch}`)
|
|
149
|
+
}
|
|
150
|
+
break
|
|
151
|
+
case 'freebsd':
|
|
152
|
+
if (arch !== 'x64') {
|
|
153
|
+
throw new Error(`Unsupported architecture on FreeBSD: ${arch}`)
|
|
154
|
+
}
|
|
155
|
+
localFileExisted = existsSync(join(__dirname, 'xcode.freebsd-x64.node'))
|
|
156
|
+
try {
|
|
157
|
+
if (localFileExisted) {
|
|
158
|
+
nativeBinding = require('./xcode.freebsd-x64.node')
|
|
159
|
+
} else {
|
|
160
|
+
nativeBinding = require('undefined-freebsd-x64')
|
|
161
|
+
}
|
|
162
|
+
} catch (e) {
|
|
163
|
+
loadError = e
|
|
164
|
+
}
|
|
165
|
+
break
|
|
166
|
+
case 'linux':
|
|
167
|
+
switch (arch) {
|
|
168
|
+
case 'x64':
|
|
169
|
+
if (isMusl()) {
|
|
170
|
+
localFileExisted = existsSync(
|
|
171
|
+
join(__dirname, 'xcode.linux-x64-musl.node')
|
|
172
|
+
)
|
|
173
|
+
try {
|
|
174
|
+
if (localFileExisted) {
|
|
175
|
+
nativeBinding = require('./xcode.linux-x64-musl.node')
|
|
176
|
+
} else {
|
|
177
|
+
nativeBinding = require('undefined-linux-x64-musl')
|
|
178
|
+
}
|
|
179
|
+
} catch (e) {
|
|
180
|
+
loadError = e
|
|
181
|
+
}
|
|
182
|
+
} else {
|
|
183
|
+
localFileExisted = existsSync(
|
|
184
|
+
join(__dirname, 'xcode.linux-x64-gnu.node')
|
|
185
|
+
)
|
|
186
|
+
try {
|
|
187
|
+
if (localFileExisted) {
|
|
188
|
+
nativeBinding = require('./xcode.linux-x64-gnu.node')
|
|
189
|
+
} else {
|
|
190
|
+
nativeBinding = require('undefined-linux-x64-gnu')
|
|
191
|
+
}
|
|
192
|
+
} catch (e) {
|
|
193
|
+
loadError = e
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
break
|
|
197
|
+
case 'arm64':
|
|
198
|
+
if (isMusl()) {
|
|
199
|
+
localFileExisted = existsSync(
|
|
200
|
+
join(__dirname, 'xcode.linux-arm64-musl.node')
|
|
201
|
+
)
|
|
202
|
+
try {
|
|
203
|
+
if (localFileExisted) {
|
|
204
|
+
nativeBinding = require('./xcode.linux-arm64-musl.node')
|
|
205
|
+
} else {
|
|
206
|
+
nativeBinding = require('undefined-linux-arm64-musl')
|
|
207
|
+
}
|
|
208
|
+
} catch (e) {
|
|
209
|
+
loadError = e
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
localFileExisted = existsSync(
|
|
213
|
+
join(__dirname, 'xcode.linux-arm64-gnu.node')
|
|
214
|
+
)
|
|
215
|
+
try {
|
|
216
|
+
if (localFileExisted) {
|
|
217
|
+
nativeBinding = require('./xcode.linux-arm64-gnu.node')
|
|
218
|
+
} else {
|
|
219
|
+
nativeBinding = require('undefined-linux-arm64-gnu')
|
|
220
|
+
}
|
|
221
|
+
} catch (e) {
|
|
222
|
+
loadError = e
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
break
|
|
226
|
+
case 'arm':
|
|
227
|
+
if (isMusl()) {
|
|
228
|
+
localFileExisted = existsSync(
|
|
229
|
+
join(__dirname, 'xcode.linux-arm-musleabihf.node')
|
|
230
|
+
)
|
|
231
|
+
try {
|
|
232
|
+
if (localFileExisted) {
|
|
233
|
+
nativeBinding = require('./xcode.linux-arm-musleabihf.node')
|
|
234
|
+
} else {
|
|
235
|
+
nativeBinding = require('undefined-linux-arm-musleabihf')
|
|
236
|
+
}
|
|
237
|
+
} catch (e) {
|
|
238
|
+
loadError = e
|
|
239
|
+
}
|
|
240
|
+
} else {
|
|
241
|
+
localFileExisted = existsSync(
|
|
242
|
+
join(__dirname, 'xcode.linux-arm-gnueabihf.node')
|
|
243
|
+
)
|
|
244
|
+
try {
|
|
245
|
+
if (localFileExisted) {
|
|
246
|
+
nativeBinding = require('./xcode.linux-arm-gnueabihf.node')
|
|
247
|
+
} else {
|
|
248
|
+
nativeBinding = require('undefined-linux-arm-gnueabihf')
|
|
249
|
+
}
|
|
250
|
+
} catch (e) {
|
|
251
|
+
loadError = e
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
break
|
|
255
|
+
case 'riscv64':
|
|
256
|
+
if (isMusl()) {
|
|
257
|
+
localFileExisted = existsSync(
|
|
258
|
+
join(__dirname, 'xcode.linux-riscv64-musl.node')
|
|
259
|
+
)
|
|
260
|
+
try {
|
|
261
|
+
if (localFileExisted) {
|
|
262
|
+
nativeBinding = require('./xcode.linux-riscv64-musl.node')
|
|
263
|
+
} else {
|
|
264
|
+
nativeBinding = require('undefined-linux-riscv64-musl')
|
|
265
|
+
}
|
|
266
|
+
} catch (e) {
|
|
267
|
+
loadError = e
|
|
268
|
+
}
|
|
269
|
+
} else {
|
|
270
|
+
localFileExisted = existsSync(
|
|
271
|
+
join(__dirname, 'xcode.linux-riscv64-gnu.node')
|
|
272
|
+
)
|
|
273
|
+
try {
|
|
274
|
+
if (localFileExisted) {
|
|
275
|
+
nativeBinding = require('./xcode.linux-riscv64-gnu.node')
|
|
276
|
+
} else {
|
|
277
|
+
nativeBinding = require('undefined-linux-riscv64-gnu')
|
|
278
|
+
}
|
|
279
|
+
} catch (e) {
|
|
280
|
+
loadError = e
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
break
|
|
284
|
+
case 's390x':
|
|
285
|
+
localFileExisted = existsSync(
|
|
286
|
+
join(__dirname, 'xcode.linux-s390x-gnu.node')
|
|
287
|
+
)
|
|
288
|
+
try {
|
|
289
|
+
if (localFileExisted) {
|
|
290
|
+
nativeBinding = require('./xcode.linux-s390x-gnu.node')
|
|
291
|
+
} else {
|
|
292
|
+
nativeBinding = require('undefined-linux-s390x-gnu')
|
|
293
|
+
}
|
|
294
|
+
} catch (e) {
|
|
295
|
+
loadError = e
|
|
296
|
+
}
|
|
297
|
+
break
|
|
298
|
+
default:
|
|
299
|
+
throw new Error(`Unsupported architecture on Linux: ${arch}`)
|
|
300
|
+
}
|
|
301
|
+
break
|
|
302
|
+
default:
|
|
303
|
+
throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`)
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (!nativeBinding) {
|
|
307
|
+
if (loadError) {
|
|
308
|
+
throw loadError
|
|
309
|
+
}
|
|
310
|
+
throw new Error(`Failed to load native binding`)
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
const { parse, build, buildFromJSON, parseAndBuild, XcodeProject } = nativeBinding
|
|
314
|
+
|
|
315
|
+
module.exports.parse = parse
|
|
316
|
+
module.exports.build = build
|
|
317
|
+
module.exports.buildFromJSON = buildFromJSON
|
|
318
|
+
module.exports.parseAndBuild = parseAndBuild
|
|
319
|
+
module.exports.XcodeProject = XcodeProject
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xcodekit/xcode-node",
|
|
3
|
+
"version": "0.6.8",
|
|
4
|
+
"description": "Parse, manipulate, and serialize Xcode .pbxproj files — native Node.js addon (napi-rs)",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"index.d.ts",
|
|
10
|
+
"types.d.ts"
|
|
11
|
+
],
|
|
12
|
+
"optionalDependencies": {
|
|
13
|
+
"@xcodekit/xcode-darwin-arm64": "0.6.8",
|
|
14
|
+
"@xcodekit/xcode-darwin-x64": "0.6.8",
|
|
15
|
+
"@xcodekit/xcode-linux-arm64-gnu": "0.6.8",
|
|
16
|
+
"@xcodekit/xcode-linux-x64-gnu": "0.6.8",
|
|
17
|
+
"@xcodekit/xcode-win32-x64-msvc": "0.6.8"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/mozharovsky/xcode"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"keywords": [
|
|
25
|
+
"xcode",
|
|
26
|
+
"pbxproj",
|
|
27
|
+
"ios",
|
|
28
|
+
"apple",
|
|
29
|
+
"parser",
|
|
30
|
+
"native",
|
|
31
|
+
"napi",
|
|
32
|
+
"rust"
|
|
33
|
+
]
|
|
34
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supplemental type definitions for @xcodekit/xcode.
|
|
3
|
+
*
|
|
4
|
+
* These provide rich types for the parsed .pbxproj JSON structure
|
|
5
|
+
* beyond what napi-rs auto-generates.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/** ISA types for all known Xcode project object types. */
|
|
9
|
+
export type ISA =
|
|
10
|
+
| "PBXBuildFile"
|
|
11
|
+
| "PBXAppleScriptBuildPhase"
|
|
12
|
+
| "PBXCopyFilesBuildPhase"
|
|
13
|
+
| "PBXFrameworksBuildPhase"
|
|
14
|
+
| "PBXHeadersBuildPhase"
|
|
15
|
+
| "PBXResourcesBuildPhase"
|
|
16
|
+
| "PBXShellScriptBuildPhase"
|
|
17
|
+
| "PBXSourcesBuildPhase"
|
|
18
|
+
| "PBXRezBuildPhase"
|
|
19
|
+
| "PBXContainerItemProxy"
|
|
20
|
+
| "PBXFileReference"
|
|
21
|
+
| "PBXGroup"
|
|
22
|
+
| "PBXVariantGroup"
|
|
23
|
+
| "XCVersionGroup"
|
|
24
|
+
| "PBXFileSystemSynchronizedRootGroup"
|
|
25
|
+
| "PBXFileSystemSynchronizedBuildFileExceptionSet"
|
|
26
|
+
| "PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet"
|
|
27
|
+
| "PBXNativeTarget"
|
|
28
|
+
| "PBXAggregateTarget"
|
|
29
|
+
| "PBXLegacyTarget"
|
|
30
|
+
| "PBXProject"
|
|
31
|
+
| "PBXTargetDependency"
|
|
32
|
+
| "XCBuildConfiguration"
|
|
33
|
+
| "XCConfigurationList"
|
|
34
|
+
| "PBXBuildRule"
|
|
35
|
+
| "PBXReferenceProxy"
|
|
36
|
+
| "XCSwiftPackageProductDependency"
|
|
37
|
+
| "XCRemoteSwiftPackageReference"
|
|
38
|
+
| "XCLocalSwiftPackageReference";
|
|
39
|
+
|
|
40
|
+
/** A 24-character hexadecimal UUID string. */
|
|
41
|
+
export type UUID = string;
|
|
42
|
+
|
|
43
|
+
/** Boolean as 0 | 1 integer. */
|
|
44
|
+
export type BoolNumber = 0 | 1;
|
|
45
|
+
|
|
46
|
+
/** Boolean as YES/NO string. */
|
|
47
|
+
export type BoolString = "YES" | "NO" | "YES_ERROR" | "YES_AGGRESSIVE";
|
|
48
|
+
|
|
49
|
+
/** Source tree reference types. */
|
|
50
|
+
export type SourceTree = "BUILT_PRODUCTS_DIR" | "DEVELOPER_DIR" | "SOURCE_ROOT" | "SDKROOT" | "<group>" | "<absolute>";
|
|
51
|
+
|
|
52
|
+
/** CopyFilesBuildPhase destination subfolder spec. */
|
|
53
|
+
export enum SubFolder {
|
|
54
|
+
absolutePath = 0,
|
|
55
|
+
wrapper = 1,
|
|
56
|
+
executables = 6,
|
|
57
|
+
resources = 7,
|
|
58
|
+
frameworks = 10,
|
|
59
|
+
sharedFrameworks = 11,
|
|
60
|
+
sharedSupport = 12,
|
|
61
|
+
plugins = 13,
|
|
62
|
+
javaResources = 15,
|
|
63
|
+
productsDirectory = 16,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Container item proxy type. */
|
|
67
|
+
export enum ProxyType {
|
|
68
|
+
targetReference = 1,
|
|
69
|
+
reference = 2,
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Common file type UTIs. */
|
|
73
|
+
export type FileType =
|
|
74
|
+
| "sourcecode.swift"
|
|
75
|
+
| "sourcecode.c.c"
|
|
76
|
+
| "sourcecode.c.h"
|
|
77
|
+
| "sourcecode.c.objc"
|
|
78
|
+
| "sourcecode.cpp.cpp"
|
|
79
|
+
| "sourcecode.cpp.objcpp"
|
|
80
|
+
| "sourcecode.javascript"
|
|
81
|
+
| "wrapper.application"
|
|
82
|
+
| "wrapper.framework"
|
|
83
|
+
| "wrapper.app-extension"
|
|
84
|
+
| "wrapper.plug-in"
|
|
85
|
+
| "wrapper.xcframework"
|
|
86
|
+
| "compiled.mach-o.dylib"
|
|
87
|
+
| "archive.ar"
|
|
88
|
+
| "folder.assetcatalog"
|
|
89
|
+
| "text.plist.xml"
|
|
90
|
+
| "text.plist.strings"
|
|
91
|
+
| "text.plist.entitlements"
|
|
92
|
+
| "text.xcconfig"
|
|
93
|
+
| "file.storyboard"
|
|
94
|
+
| "file.xib"
|
|
95
|
+
| "file.intentdefinition"
|
|
96
|
+
| "image.png"
|
|
97
|
+
| "image.jpeg"
|
|
98
|
+
| "net.daringfireball.markdown"
|
|
99
|
+
| string;
|
|
100
|
+
|
|
101
|
+
/** Common product type UTIs. */
|
|
102
|
+
export type ProductType =
|
|
103
|
+
| "com.apple.product-type.application"
|
|
104
|
+
| "com.apple.product-type.application.on-demand-install-capable"
|
|
105
|
+
| "com.apple.product-type.app-extension"
|
|
106
|
+
| "com.apple.product-type.bundle"
|
|
107
|
+
| "com.apple.product-type.framework"
|
|
108
|
+
| "com.apple.product-type.library.dynamic"
|
|
109
|
+
| "com.apple.product-type.library.static"
|
|
110
|
+
| "com.apple.product-type.tool"
|
|
111
|
+
| "com.apple.product-type.unit-test-bundle"
|
|
112
|
+
| "com.apple.product-type.ui-testing-bundle"
|
|
113
|
+
| "com.apple.product-type.application.watchapp"
|
|
114
|
+
| "com.apple.product-type.application.watchapp2"
|
|
115
|
+
| "com.apple.product-type.watchkit-extension"
|
|
116
|
+
| "com.apple.product-type.extensionkit-extension"
|
|
117
|
+
| string;
|
|
118
|
+
|
|
119
|
+
/** Build settings dictionary. */
|
|
120
|
+
export interface BuildSettings {
|
|
121
|
+
ALWAYS_SEARCH_USER_PATHS?: BoolString;
|
|
122
|
+
ASSETCATALOG_COMPILER_APPICON_NAME?: string;
|
|
123
|
+
CLANG_ENABLE_MODULES?: BoolString;
|
|
124
|
+
CLANG_ENABLE_OBJC_ARC?: BoolString;
|
|
125
|
+
CODE_SIGN_ENTITLEMENTS?: string;
|
|
126
|
+
CODE_SIGN_IDENTITY?: string;
|
|
127
|
+
CODE_SIGN_STYLE?: "Automatic" | "Manual";
|
|
128
|
+
CURRENT_PROJECT_VERSION?: string;
|
|
129
|
+
DEBUG_INFORMATION_FORMAT?: "dwarf" | "dwarf-with-dsym";
|
|
130
|
+
DEVELOPMENT_TEAM?: string;
|
|
131
|
+
GCC_OPTIMIZATION_LEVEL?: string;
|
|
132
|
+
GCC_PREPROCESSOR_DEFINITIONS?: string | string[];
|
|
133
|
+
GENERATE_INFOPLIST_FILE?: BoolString;
|
|
134
|
+
INFOPLIST_FILE?: string;
|
|
135
|
+
INFOPLIST_KEY_CFBundleDisplayName?: string;
|
|
136
|
+
IPHONEOS_DEPLOYMENT_TARGET?: string;
|
|
137
|
+
MACOSX_DEPLOYMENT_TARGET?: string;
|
|
138
|
+
TVOS_DEPLOYMENT_TARGET?: string;
|
|
139
|
+
WATCHOS_DEPLOYMENT_TARGET?: string;
|
|
140
|
+
MARKETING_VERSION?: string;
|
|
141
|
+
PRODUCT_BUNDLE_IDENTIFIER?: string;
|
|
142
|
+
PRODUCT_NAME?: string;
|
|
143
|
+
SWIFT_VERSION?: string;
|
|
144
|
+
TARGETED_DEVICE_FAMILY?: string;
|
|
145
|
+
[key: string]: string | string[] | number | undefined;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Base object with isa field. */
|
|
149
|
+
export interface PBXObjectBase {
|
|
150
|
+
isa: ISA;
|
|
151
|
+
[key: string]: any;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** PBXBuildFile object. */
|
|
155
|
+
export interface PBXBuildFile extends PBXObjectBase {
|
|
156
|
+
isa: "PBXBuildFile";
|
|
157
|
+
fileRef?: UUID;
|
|
158
|
+
productRef?: UUID;
|
|
159
|
+
settings?: Record<string, any>;
|
|
160
|
+
platformFilter?: string;
|
|
161
|
+
platformFilters?: string[];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** PBXFileReference object. */
|
|
165
|
+
export interface PBXFileReference extends PBXObjectBase {
|
|
166
|
+
isa: "PBXFileReference";
|
|
167
|
+
fileEncoding?: number;
|
|
168
|
+
lastKnownFileType?: FileType;
|
|
169
|
+
explicitFileType?: FileType;
|
|
170
|
+
includeInIndex?: BoolNumber;
|
|
171
|
+
name?: string;
|
|
172
|
+
path?: string;
|
|
173
|
+
sourceTree?: SourceTree;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** PBXGroup object. */
|
|
177
|
+
export interface PBXGroup extends PBXObjectBase {
|
|
178
|
+
isa: "PBXGroup";
|
|
179
|
+
children: UUID[];
|
|
180
|
+
name?: string;
|
|
181
|
+
path?: string;
|
|
182
|
+
sourceTree?: SourceTree;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** Build phase (shared fields for all 8 types). */
|
|
186
|
+
export interface AbstractBuildPhase extends PBXObjectBase {
|
|
187
|
+
buildActionMask?: number;
|
|
188
|
+
files: UUID[];
|
|
189
|
+
runOnlyForDeploymentPostprocessing?: BoolNumber;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** PBXNativeTarget object. */
|
|
193
|
+
export interface PBXNativeTarget extends PBXObjectBase {
|
|
194
|
+
isa: "PBXNativeTarget";
|
|
195
|
+
buildConfigurationList: UUID;
|
|
196
|
+
buildPhases: UUID[];
|
|
197
|
+
buildRules: UUID[];
|
|
198
|
+
dependencies: UUID[];
|
|
199
|
+
name: string;
|
|
200
|
+
productName?: string;
|
|
201
|
+
productReference?: UUID;
|
|
202
|
+
productType: ProductType;
|
|
203
|
+
packageProductDependencies?: UUID[];
|
|
204
|
+
fileSystemSynchronizedGroups?: UUID[];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** PBXProject (root object). */
|
|
208
|
+
export interface PBXProject extends PBXObjectBase {
|
|
209
|
+
isa: "PBXProject";
|
|
210
|
+
buildConfigurationList: UUID;
|
|
211
|
+
compatibilityVersion: string;
|
|
212
|
+
developmentRegion: string;
|
|
213
|
+
hasScannedForEncodings: BoolNumber;
|
|
214
|
+
knownRegions: string[];
|
|
215
|
+
mainGroup: UUID;
|
|
216
|
+
productRefGroup?: UUID;
|
|
217
|
+
projectDirPath: string;
|
|
218
|
+
projectRoot: string;
|
|
219
|
+
targets: UUID[];
|
|
220
|
+
packageReferences?: UUID[];
|
|
221
|
+
attributes?: {
|
|
222
|
+
LastSwiftUpdateCheck?: string;
|
|
223
|
+
LastUpgradeCheck?: string;
|
|
224
|
+
TargetAttributes?: Record<UUID, Record<string, any>>;
|
|
225
|
+
[key: string]: any;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/** XCBuildConfiguration object. */
|
|
230
|
+
export interface XCBuildConfiguration extends PBXObjectBase {
|
|
231
|
+
isa: "XCBuildConfiguration";
|
|
232
|
+
name: string;
|
|
233
|
+
buildSettings: BuildSettings;
|
|
234
|
+
baseConfigurationReference?: UUID;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** XCConfigurationList object. */
|
|
238
|
+
export interface XCConfigurationList extends PBXObjectBase {
|
|
239
|
+
isa: "XCConfigurationList";
|
|
240
|
+
buildConfigurations: UUID[];
|
|
241
|
+
defaultConfigurationIsVisible?: BoolNumber;
|
|
242
|
+
defaultConfigurationName?: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** The top-level parsed .pbxproj structure. */
|
|
246
|
+
export interface ParsedProject {
|
|
247
|
+
archiveVersion: number;
|
|
248
|
+
classes: Record<string, any>;
|
|
249
|
+
objectVersion: number;
|
|
250
|
+
objects: Record<UUID, PBXObjectBase>;
|
|
251
|
+
rootObject: UUID;
|
|
252
|
+
}
|