1 line
1.6 KiB
Plaintext
1 line
1.6 KiB
Plaintext
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/xcode/index.ts"],"names":[],"mappings":";;;AAEA;;;;GAIG;AACH,SAAgB,0BAA0B,CACxC,UAAwB,EACxB,QAAgB,EAChB,EAAE,MAAM,EAAE,KAAK,EAAiC;IAEhD,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE;QAC/C,iBAAiB,EAAE,iBAAiB;QACpC,eAAe,EAAE,CAAC;QAClB,MAAM;KACP,CAAC,CAAC;IACH,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACvD;IACD,OAAO,UAAU,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC;IAC3E,OAAO,UAAU,CAAC,uBAAuB,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC;IAEzE,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC,YAAY,EAAE,CAAC;IACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IAErB,UAAU,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC1C,UAAU,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC;AArBD,gEAqBC","sourcesContent":["import { XcodeProject, UUID } from 'xcode';\n\n/**\n * @param filePath\n * @param param1.target PBXNativeTarget reference\n * @param param1.group PBXGroup reference\n */\nexport function addStoryboardFileToProject(\n pbxProject: XcodeProject,\n filePath: string,\n { target, group }: { target: UUID; group: UUID }\n) {\n const file = pbxProject.addFile(filePath, group, {\n lastKnownFileType: 'file.storyboard',\n defaultEncoding: 4,\n target,\n });\n if (!file) {\n throw new Error('File already exists in the project');\n }\n delete pbxProject.pbxFileReferenceSection()[file.fileRef].explicitFileType;\n delete pbxProject.pbxFileReferenceSection()[file.fileRef].includeInIndex;\n\n file.uuid = pbxProject.generateUuid();\n file.target = target;\n\n pbxProject.addToPbxBuildFileSection(file);\n pbxProject.addToPbxResourcesBuildPhase(file);\n}\n"]} |