chore: restrict writing to certain object keys (#176) Block ‘prototype’, ‘proto‘& ‘constructor’ Updated ‘addBuildPhase’ to ensure buildPhaseType does not accept restricted key. Updated ‘addTargetAttribute’ to ensure target.uuid does not accept restricted key. Updated ‘pbxCreateGroupWithType’ to ensure groupType does not accept restricted key. Updated tests for ‘addBuildPhase’ & ‘addTargetAttribute’ Added test case for ‘pbxCreateGroupWithType’ Small test update to correct spelling of build phase type ‘PBXFrameworksBuildPhase’
chore: restrict writing to certain object keys (#176)
Parser utility for xcodeproj project files
Allows you to edit xcodeproject files and write them back out.
based on donated code from alunny / node-xcode
const fs = require('node:fs'); const xcode = require('xcode'); // Path to the Xcode project's project.pbxproj file. const projectPath = 'myproject.xcodeproj/project.pbxproj'; // Create a PBXProject instance for the project. const myProj = xcode.project(projectPath); // Parse the project file asynchronously before making changes. myProj.parse(function (err) { myProj.addHeaderFile('foo.h'); myProj.addSourceFile('foo.m'); myProj.addFramework('FooKit.framework'); // Write the updated project back to disk. fs.writeFileSync(projectPath, myProj.writeSync()); console.log('New project written'); });
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
cordova-node-xcode
Parser utility for xcodeproj project files
Allows you to edit xcodeproject files and write them back out.
based on donated code from alunny / node-xcode
Example