forked from olcxjas-softworks/LarpixClient
Add capacitorjs runtime
This commit is contained in:
parent
d0ece489ee
commit
f90c0e6c40
8362 changed files with 1502407 additions and 1 deletions
6
node_modules/xcode/AUTHORS
generated
vendored
Normal file
6
node_modules/xcode/AUTHORS
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
Andrew Lunny (@alunny)
|
||||
Anis Kadri (@imhotep)
|
||||
Mike Reinstein (@mreinstein)
|
||||
Filip Maj (@filmaj)
|
||||
Brett Rudd (@goya)
|
||||
Bob Easterday (@bobeast)
|
||||
37
node_modules/xcode/CONTRIBUTING.md
generated
vendored
Normal file
37
node_modules/xcode/CONTRIBUTING.md
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
-->
|
||||
|
||||
# Contributing to Apache Cordova
|
||||
|
||||
Anyone can contribute to Cordova. And we need your contributions.
|
||||
|
||||
There are multiple ways to contribute: report bugs, improve the docs, and
|
||||
contribute code.
|
||||
|
||||
For instructions on this, start with the
|
||||
[contribution overview](http://cordova.apache.org/contribute/).
|
||||
|
||||
The details are explained there, but the important items are:
|
||||
- Check for Github issues that corresponds to your contribution and link or create them if necessary.
|
||||
- Run the tests so your patch doesn't break existing functionality.
|
||||
|
||||
We look forward to your contributions!
|
||||
|
||||
202
node_modules/xcode/LICENSE
generated
vendored
Normal file
202
node_modules/xcode/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
24
node_modules/xcode/Makefile
generated
vendored
Normal file
24
node_modules/xcode/Makefile
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
tests:
|
||||
nodeunit test/* test/parser/*
|
||||
|
||||
parser:
|
||||
pegjs lib/parser/pbxproj.pegjs
|
||||
5
node_modules/xcode/NOTICE
generated
vendored
Normal file
5
node_modules/xcode/NOTICE
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
Apache Cordova
|
||||
Copyright 2012-2020 The Apache Software Foundation
|
||||
|
||||
This product includes software developed at
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
72
node_modules/xcode/README.md
generated
vendored
Normal file
72
node_modules/xcode/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
-->
|
||||
|
||||
# cordova-node-xcode
|
||||
|
||||
[](https://nodei.co/npm/xcode/)
|
||||
|
||||
[](https://github.com/apache/cordova-node-xcode/actions?query=branch%3Amaster)
|
||||
|
||||
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](https://github.com/alunny/node-xcode)
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
// API is a bit wonky right now
|
||||
var xcode = require('xcode'),
|
||||
fs = require('fs'),
|
||||
projectPath = 'myproject.xcodeproj/project.pbxproj',
|
||||
myProj = xcode.project(projectPath);
|
||||
|
||||
// parsing is async, in a different process
|
||||
myProj.parse(function (err) {
|
||||
myProj.addHeaderFile('foo.h');
|
||||
myProj.addSourceFile('foo.m');
|
||||
myProj.addFramework('FooKit.framework');
|
||||
|
||||
fs.writeFileSync(projectPath, myProj.writeSync());
|
||||
console.log('new project written');
|
||||
});
|
||||
```
|
||||
|
||||
## Working on the parser
|
||||
|
||||
If there's a problem parsing, you will want to edit the grammar under
|
||||
`lib/parser/pbxproj.pegjs`. You can test it online with the PEGjs online thingy
|
||||
at https://pegjs.org/online - I have had some mixed results though.
|
||||
|
||||
Tests under the `test/parser` directory will compile the parser from the
|
||||
grammar. Other tests will use the prebuilt parser (`lib/parser/pbxproj.js`).
|
||||
|
||||
To rebuild the parser js file after editing the grammar, run:
|
||||
|
||||
npm run pegjs
|
||||
|
||||
(and be sure to restore the Apache license notice in
|
||||
`lib/parser/pbxproj.js` before committing)
|
||||
|
||||
## License
|
||||
|
||||
Apache V2
|
||||
77
node_modules/xcode/RELEASENOTES.md
generated
vendored
Normal file
77
node_modules/xcode/RELEASENOTES.md
generated
vendored
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<!--
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
-->
|
||||
# Cordova-node-xcode Release Notes
|
||||
|
||||
### 3.0.1 (May 15, 2020)
|
||||
|
||||
* [GH-109](https://github.com/apache/cordova-node-xcode/pull/109) Add targetName to paramter to getBuildProperty
|
||||
|
||||
### 3.0.0 (Apr 09, 2020)
|
||||
|
||||
* node-xcode-3.0.0 Added NOTICE for release
|
||||
* [GH-107](https://github.com/apache/cordova-node-xcode/pull/107) doc(README): fix CI badge url
|
||||
* [GH-106](https://github.com/apache/cordova-node-xcode/pull/106) Update build property by `targetname`
|
||||
* [GH-79](https://github.com/apache/cordova-node-xcode/pull/79) feat: add new optional paramter to `pbxProject.addTarget`
|
||||
* [GH-96](https://github.com/apache/cordova-node-xcode/pull/96) ci: switch travis ci for github actions
|
||||
* [GH-94](https://github.com/apache/cordova-node-xcode/pull/94) breaking(npm): bump dependencies
|
||||
* `simple-plist@^1.1.0`
|
||||
* `uuid@^7.0.3`
|
||||
* [GH-93](https://github.com/apache/cordova-node-xcode/pull/93) chore(npm): use short notation for repo & bugs
|
||||
* [GH-90](https://github.com/apache/cordova-node-xcode/pull/90) ci(travis): removes Node.js v6 and v8 from testing
|
||||
* [GH-92](https://github.com/apache/cordova-node-xcode/pull/92) chore: bump node requirement (`>=10`)
|
||||
* [GH-89](https://github.com/apache/cordova-node-xcode/pull/89) chore(npm): improve ignore list
|
||||
|
||||
### 2.1.0 (December 12, 2019)
|
||||
* Add target test coverage ([#82](https://github.com/apache/cordova-node-xcode/pull/82))
|
||||
* ensure coverage for addTargetDependency with invalid input ([#81](https://github.com/apache/cordova-node-xcode/pull/81))
|
||||
* Support watch2 apps/extensions ([#56](https://github.com/apache/cordova-node-xcode/pull/56))
|
||||
* Test coverage: `addTarget` add to main project as dependency ([#76](https://github.com/apache/cordova-node-xcode/pull/76))
|
||||
* remove internal propReplace function not needed ([#69](https://github.com/apache/cordova-node-xcode/pull/69))
|
||||
* Add proper `filetypeForProducttype` test coverage ([#72](https://github.com/apache/cordova-node-xcode/pull/72))
|
||||
* Test existing WatchKit support ([#71](https://github.com/apache/cordova-node-xcode/pull/71))
|
||||
* fix a comment in lib/pbxProject.js ([#68](https://github.com/apache/cordova-node-xcode/pull/68))
|
||||
* Test coverage for `app_extension` target types ([#66](https://github.com/apache/cordova-node-xcode/pull/66))
|
||||
* add dependencies for per-file testing ([#67](https://github.com/apache/cordova-node-xcode/pull/67))
|
||||
* Add Node.js 12 to CI Services ([#51](https://github.com/apache/cordova-node-xcode/pull/51))
|
||||
* Update writeObjectsSections to match current Xcode format ([#46](https://github.com/apache/cordova-node-xcode/pull/46))
|
||||
|
||||
### 2.0.0 (Jan 15, 2019)
|
||||
* Updated to use ECMAScript 2015 Object.assign. ([#14](https://github.com/apache/cordova-node-xcode/pull/14))
|
||||
* fix: simple-plist@1 update in dependencies ([#30](https://github.com/apache/cordova-node-xcode/pull/30))
|
||||
* drop support for Node.js pre-6.0 [#29](https://github.com/apache/cordova-node-xcode/pull/29)
|
||||
|
||||
### 1.1.0 (Dec 19, 2018)
|
||||
* feat: omit objects with empty values ([#24](https://github.com/apache/cordova-node-xcode/pull/24))
|
||||
* Resolve issue with `pbxFile` extension ([#31](https://github.com/apache/cordova-node-xcode/pull/31))
|
||||
* uuid@3 update ([#40](https://github.com/apache/cordova-node-xcode/pull/40))
|
||||
* move `pegjs` to `devDependencies` in `package.json` ([#10](https://github.com/apache/cordova-node-xcode/pull/10))
|
||||
* Fixed bug where comment is not removed on removing embedded frameworks. ([#5](https://github.com/apache/cordova-node-xcode/pull/5))
|
||||
* Remove trailing whitespace from `lib/pbxWriter.js` ([#35](https://github.com/apache/cordova-node-xcode/pull/35))
|
||||
* docs(readme): highlight code example ([#25](https://github.com/apache/cordova-node-xcode/pull/25))
|
||||
* update invalid link to PEGjs in `README.md` ([#8](https://github.com/apache/cordova-node-xcode/pull/8))
|
||||
* [CB-14145](https://issues.apache.org/jira/browse/CB-14145) explicit nodeunit@^0.11.3 update in `devDependencies` ([#10](https://github.com/apache/cordova-node-xcode/pull/10))
|
||||
|
||||
### 1.0.0 (Oct 4, 2017)
|
||||
* Bump version to 1.0.0 to represent stability and follow semver more closely
|
||||
* Fix null-access errors in `addTo/removeFrom*PbxGroup` methods
|
||||
* Fix possible null-access error in `removeFromFrameworksPbxGroup`
|
||||
* add check for `isArray` so that strings don't cause an error when calling `.filter`
|
||||
* Updated License, Copyright, Contributors and repo url, in prep for contributing this project to Apache Cordova
|
||||
18
node_modules/xcode/index.js
generated
vendored
Normal file
18
node_modules/xcode/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
'License'); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
exports.project = require('./lib/pbxProject')
|
||||
32
node_modules/xcode/lib/parseJob.js
generated
vendored
Normal file
32
node_modules/xcode/lib/parseJob.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
'License'); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
// parsing is slow and blocking right now
|
||||
// so we do it in a separate process
|
||||
var fs = require('fs'),
|
||||
parser = require('./parser/pbxproj'),
|
||||
path = process.argv[2],
|
||||
fileContents, obj;
|
||||
|
||||
try {
|
||||
fileContents = fs.readFileSync(path, 'utf-8');
|
||||
obj = parser.parse(fileContents);
|
||||
process.send(obj);
|
||||
} catch (e) {
|
||||
process.send(e);
|
||||
process.exitCode = 1;
|
||||
}
|
||||
1904
node_modules/xcode/lib/parser/pbxproj.js
generated
vendored
Normal file
1904
node_modules/xcode/lib/parser/pbxproj.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
280
node_modules/xcode/lib/parser/pbxproj.pegjs
generated
vendored
Normal file
280
node_modules/xcode/lib/parser/pbxproj.pegjs
generated
vendored
Normal file
|
|
@ -0,0 +1,280 @@
|
|||
/**
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
'License'); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
{
|
||||
function merge_obj(obj, secondObj) {
|
||||
if (!obj)
|
||||
return secondObj;
|
||||
|
||||
for(var i in secondObj)
|
||||
obj[i] = merge_obj(obj[i], secondObj[i]);
|
||||
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Project: point of entry from pbxproj file
|
||||
*/
|
||||
Project
|
||||
= headComment:SingleLineComment? InlineComment? _ obj:Object NewLine _
|
||||
{
|
||||
var proj = Object.create(null)
|
||||
proj.project = obj
|
||||
|
||||
if (headComment) {
|
||||
proj.headComment = headComment
|
||||
}
|
||||
|
||||
return proj;
|
||||
}
|
||||
|
||||
/*
|
||||
* Object: basic hash data structure with Assignments
|
||||
*/
|
||||
Object
|
||||
= "{" obj:(AssignmentList / EmptyBody) "}"
|
||||
{ return obj }
|
||||
|
||||
EmptyBody
|
||||
= _
|
||||
{ return Object.create(null) }
|
||||
|
||||
AssignmentList
|
||||
= _ list:((a:Assignment / d:DelimitedSection) _)+
|
||||
{
|
||||
var returnObject = list[0][0];
|
||||
for(var i = 1; i < list.length; i++){
|
||||
var another = list[i][0];
|
||||
returnObject = merge_obj(returnObject, another);
|
||||
}
|
||||
return returnObject;
|
||||
}
|
||||
|
||||
/*
|
||||
* Assignments
|
||||
* can be simple "key = value"
|
||||
* or commented "key /* real key * / = value"
|
||||
*/
|
||||
Assignment
|
||||
= SimpleAssignment / CommentedAssignment
|
||||
|
||||
SimpleAssignment
|
||||
= id:Identifier _ "=" _ val:Value ";"
|
||||
{
|
||||
var result = Object.create(null);
|
||||
result[id] = val
|
||||
return result
|
||||
}
|
||||
|
||||
CommentedAssignment
|
||||
= commentedId:CommentedIdentifier _ "=" _ val:Value ";"
|
||||
{
|
||||
var result = Object.create(null),
|
||||
commentKey = commentedId.id + '_comment';
|
||||
|
||||
result[commentedId.id] = val;
|
||||
result[commentKey] = commentedId[commentKey];
|
||||
return result;
|
||||
|
||||
}
|
||||
/
|
||||
id:Identifier _ "=" _ commentedVal:CommentedValue ";"
|
||||
{
|
||||
var result = Object.create(null);
|
||||
result[id] = commentedVal.value;
|
||||
result[id + "_comment"] = commentedVal.comment;
|
||||
return result;
|
||||
}
|
||||
|
||||
CommentedIdentifier
|
||||
= id:Identifier _ comment:InlineComment
|
||||
{
|
||||
var result = Object.create(null);
|
||||
result.id = id;
|
||||
result[id + "_comment"] = comment.trim();
|
||||
return result
|
||||
}
|
||||
|
||||
CommentedValue
|
||||
= literal:Value _ comment:InlineComment
|
||||
{
|
||||
var result = Object.create(null)
|
||||
result.comment = comment.trim();
|
||||
result.value = literal.trim();
|
||||
return result;
|
||||
}
|
||||
|
||||
InlineComment
|
||||
= InlineCommentOpen body:[^*]+ InlineCommentClose
|
||||
{ return body.join('') }
|
||||
|
||||
InlineCommentOpen
|
||||
= "/*"
|
||||
|
||||
InlineCommentClose
|
||||
= "*/"
|
||||
|
||||
/*
|
||||
* DelimitedSection - ad hoc project structure pbxproj files use
|
||||
*/
|
||||
DelimitedSection
|
||||
= begin:DelimitedSectionBegin _ fields:(AssignmentList / EmptyBody) _ DelimitedSectionEnd
|
||||
{
|
||||
var section = Object.create(null);
|
||||
section[begin.name] = fields
|
||||
|
||||
return section
|
||||
}
|
||||
|
||||
DelimitedSectionBegin
|
||||
= "/* Begin " sectionName:Identifier " section */" NewLine
|
||||
{ return { name: sectionName } }
|
||||
|
||||
DelimitedSectionEnd
|
||||
= "/* End " sectionName:Identifier " section */" NewLine
|
||||
{ return { name: sectionName } }
|
||||
|
||||
/*
|
||||
* Arrays: lists of values, possible wth comments
|
||||
*/
|
||||
Array
|
||||
= "(" arr:(ArrayBody / EmptyArray ) ")" { return arr }
|
||||
|
||||
EmptyArray
|
||||
= _ { return [] }
|
||||
|
||||
ArrayBody
|
||||
= _ head:ArrayEntry _ tail:ArrayBody? _
|
||||
{
|
||||
if (tail) {
|
||||
tail.unshift(head);
|
||||
return tail;
|
||||
} else {
|
||||
return [head];
|
||||
}
|
||||
}
|
||||
|
||||
ArrayEntry
|
||||
= SimpleArrayEntry / CommentedArrayEntry
|
||||
|
||||
SimpleArrayEntry
|
||||
= val:Value EndArrayEntry { return val }
|
||||
|
||||
CommentedArrayEntry
|
||||
= val:Value _ comment:InlineComment EndArrayEntry
|
||||
{
|
||||
var result = Object.create(null);
|
||||
result.value = val.trim();
|
||||
result.comment = comment.trim();
|
||||
return result;
|
||||
}
|
||||
|
||||
EndArrayEntry
|
||||
= "," / _ &")"
|
||||
|
||||
/*
|
||||
* Identifiers and Values
|
||||
*/
|
||||
Identifier
|
||||
= id:[A-Za-z0-9_.]+ { return id.join('') }
|
||||
/ QuotedString
|
||||
|
||||
Value
|
||||
= Object / Array / NumberValue / StringValue
|
||||
|
||||
NumberValue
|
||||
= DecimalValue / IntegerValue
|
||||
|
||||
DecimalValue
|
||||
= decimal:(IntegerValue "." IntegerValue)
|
||||
{
|
||||
// store decimals as strings
|
||||
// as JS doesn't differentiate bw strings and numbers
|
||||
return decimal.join('')
|
||||
}
|
||||
|
||||
IntegerValue
|
||||
= !Alpha number:Digit+ !NonTerminator
|
||||
{ return parseInt(number.join(''), 10) }
|
||||
|
||||
StringValue
|
||||
= QuotedString / LiteralString
|
||||
|
||||
QuotedString
|
||||
= DoubleQuote str:QuotedBody DoubleQuote { return '"' + str + '"' }
|
||||
|
||||
QuotedBody
|
||||
= str:NonQuote+ { return str.join('') }
|
||||
|
||||
NonQuote
|
||||
= EscapedQuote / !DoubleQuote char:. { return char }
|
||||
|
||||
EscapedQuote
|
||||
= "\\" DoubleQuote { return '\\"' }
|
||||
|
||||
LiteralString
|
||||
= literal:LiteralChar+ { return literal.join('') }
|
||||
|
||||
LiteralChar
|
||||
= !InlineCommentOpen !LineTerminator char:NonTerminator
|
||||
{ return char }
|
||||
|
||||
NonTerminator
|
||||
= [^;,\n]
|
||||
|
||||
/*
|
||||
* SingleLineComment - used for the encoding comment
|
||||
*/
|
||||
SingleLineComment
|
||||
= "//" _ contents:OneLineString NewLine
|
||||
{ return contents }
|
||||
|
||||
OneLineString
|
||||
= contents:NonLine*
|
||||
{ return contents.join('') }
|
||||
|
||||
/*
|
||||
* Simple character checking rules
|
||||
*/
|
||||
Digit
|
||||
= [0-9]
|
||||
|
||||
Alpha
|
||||
= [A-Za-z]
|
||||
|
||||
DoubleQuote
|
||||
= '"'
|
||||
|
||||
_ "whitespace"
|
||||
= whitespace*
|
||||
|
||||
whitespace
|
||||
= NewLine / [\t ]
|
||||
|
||||
NonLine
|
||||
= !NewLine char:Char
|
||||
{ return char }
|
||||
|
||||
LineTerminator
|
||||
= NewLine / ";"
|
||||
|
||||
NewLine
|
||||
= [\n\r]
|
||||
|
||||
Char
|
||||
= .
|
||||
233
node_modules/xcode/lib/pbxFile.js
generated
vendored
Normal file
233
node_modules/xcode/lib/pbxFile.js
generated
vendored
Normal file
|
|
@ -0,0 +1,233 @@
|
|||
/**
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
'License'); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
var path = require('path'),
|
||||
util = require('util');
|
||||
|
||||
var DEFAULT_SOURCETREE = '"<group>"',
|
||||
DEFAULT_PRODUCT_SOURCETREE = 'BUILT_PRODUCTS_DIR',
|
||||
DEFAULT_FILEENCODING = 4,
|
||||
DEFAULT_GROUP = 'Resources',
|
||||
DEFAULT_FILETYPE = 'unknown';
|
||||
|
||||
var FILETYPE_BY_EXTENSION = {
|
||||
a: 'archive.ar',
|
||||
app: 'wrapper.application',
|
||||
appex: 'wrapper.app-extension',
|
||||
bundle: 'wrapper.plug-in',
|
||||
dylib: 'compiled.mach-o.dylib',
|
||||
framework: 'wrapper.framework',
|
||||
h: 'sourcecode.c.h',
|
||||
m: 'sourcecode.c.objc',
|
||||
markdown: 'text',
|
||||
mdimporter: 'wrapper.cfbundle',
|
||||
octest: 'wrapper.cfbundle',
|
||||
pch: 'sourcecode.c.h',
|
||||
plist: 'text.plist.xml',
|
||||
sh: 'text.script.sh',
|
||||
swift: 'sourcecode.swift',
|
||||
tbd: 'sourcecode.text-based-dylib-definition',
|
||||
xcassets: 'folder.assetcatalog',
|
||||
xcconfig: 'text.xcconfig',
|
||||
xcdatamodel: 'wrapper.xcdatamodel',
|
||||
xcodeproj: 'wrapper.pb-project',
|
||||
xctest: 'wrapper.cfbundle',
|
||||
xib: 'file.xib',
|
||||
strings: 'text.plist.strings'
|
||||
},
|
||||
GROUP_BY_FILETYPE = {
|
||||
'archive.ar': 'Frameworks',
|
||||
'compiled.mach-o.dylib': 'Frameworks',
|
||||
'sourcecode.text-based-dylib-definition': 'Frameworks',
|
||||
'wrapper.framework': 'Frameworks',
|
||||
'embedded.framework': 'Embed Frameworks',
|
||||
'sourcecode.c.h': 'Resources',
|
||||
'sourcecode.c.objc': 'Sources',
|
||||
'sourcecode.swift': 'Sources'
|
||||
},
|
||||
PATH_BY_FILETYPE = {
|
||||
'compiled.mach-o.dylib': 'usr/lib/',
|
||||
'sourcecode.text-based-dylib-definition': 'usr/lib/',
|
||||
'wrapper.framework': 'System/Library/Frameworks/'
|
||||
},
|
||||
SOURCETREE_BY_FILETYPE = {
|
||||
'compiled.mach-o.dylib': 'SDKROOT',
|
||||
'sourcecode.text-based-dylib-definition': 'SDKROOT',
|
||||
'wrapper.framework': 'SDKROOT'
|
||||
},
|
||||
ENCODING_BY_FILETYPE = {
|
||||
'sourcecode.c.h': 4,
|
||||
'sourcecode.c.h': 4,
|
||||
'sourcecode.c.objc': 4,
|
||||
'sourcecode.swift': 4,
|
||||
'text': 4,
|
||||
'text.plist.xml': 4,
|
||||
'text.script.sh': 4,
|
||||
'text.xcconfig': 4,
|
||||
'text.plist.strings': 4
|
||||
};
|
||||
|
||||
|
||||
function unquoted(text){
|
||||
return text == null ? '' : text.replace (/(^")|("$)/g, '')
|
||||
}
|
||||
|
||||
function detectType(filePath) {
|
||||
var extension = path.extname(filePath).substring(1),
|
||||
filetype = FILETYPE_BY_EXTENSION[unquoted(extension)];
|
||||
|
||||
if (!filetype) {
|
||||
return DEFAULT_FILETYPE;
|
||||
}
|
||||
|
||||
return filetype;
|
||||
}
|
||||
|
||||
function defaultExtension(fileRef) {
|
||||
var filetype = fileRef.lastKnownFileType && fileRef.lastKnownFileType != DEFAULT_FILETYPE ?
|
||||
fileRef.lastKnownFileType : fileRef.explicitFileType;
|
||||
|
||||
for(var extension in FILETYPE_BY_EXTENSION) {
|
||||
if(FILETYPE_BY_EXTENSION.hasOwnProperty(unquoted(extension)) ) {
|
||||
if(FILETYPE_BY_EXTENSION[unquoted(extension)] === unquoted(filetype) )
|
||||
return extension;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function defaultEncoding(fileRef) {
|
||||
var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
|
||||
encoding = ENCODING_BY_FILETYPE[unquoted(filetype)];
|
||||
|
||||
if (encoding) {
|
||||
return encoding;
|
||||
}
|
||||
}
|
||||
|
||||
function detectGroup(fileRef, opt) {
|
||||
var extension = path.extname(fileRef.basename).substring(1),
|
||||
filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
|
||||
groupName = GROUP_BY_FILETYPE[unquoted(filetype)];
|
||||
|
||||
if (extension === 'xcdatamodeld') {
|
||||
return 'Sources';
|
||||
}
|
||||
|
||||
if (opt.customFramework && opt.embed) {
|
||||
return GROUP_BY_FILETYPE['embedded.framework'];
|
||||
}
|
||||
|
||||
if (!groupName) {
|
||||
return DEFAULT_GROUP;
|
||||
}
|
||||
|
||||
return groupName;
|
||||
}
|
||||
|
||||
function detectSourcetree(fileRef) {
|
||||
|
||||
var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
|
||||
sourcetree = SOURCETREE_BY_FILETYPE[unquoted(filetype)];
|
||||
|
||||
if (fileRef.explicitFileType) {
|
||||
return DEFAULT_PRODUCT_SOURCETREE;
|
||||
}
|
||||
|
||||
if (fileRef.customFramework) {
|
||||
return DEFAULT_SOURCETREE;
|
||||
}
|
||||
|
||||
if (!sourcetree) {
|
||||
return DEFAULT_SOURCETREE;
|
||||
}
|
||||
|
||||
return sourcetree;
|
||||
}
|
||||
|
||||
function defaultPath(fileRef, filePath) {
|
||||
var filetype = fileRef.lastKnownFileType || fileRef.explicitFileType,
|
||||
defaultPath = PATH_BY_FILETYPE[unquoted(filetype)];
|
||||
|
||||
if (fileRef.customFramework) {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
if (defaultPath) {
|
||||
return path.join(defaultPath, path.basename(filePath));
|
||||
}
|
||||
|
||||
return filePath;
|
||||
}
|
||||
|
||||
function defaultGroup(fileRef) {
|
||||
var groupName = GROUP_BY_FILETYPE[fileRef.lastKnownFileType];
|
||||
|
||||
if (!groupName) {
|
||||
return DEFAULT_GROUP;
|
||||
}
|
||||
|
||||
return defaultGroup;
|
||||
}
|
||||
|
||||
function pbxFile(filepath, opt) {
|
||||
var opt = opt || {};
|
||||
|
||||
this.basename = path.basename(filepath);
|
||||
this.lastKnownFileType = opt.lastKnownFileType || detectType(filepath);
|
||||
this.group = detectGroup(this, opt);
|
||||
|
||||
// for custom frameworks
|
||||
if (opt.customFramework == true) {
|
||||
this.customFramework = true;
|
||||
this.dirname = path.dirname(filepath).replace(/\\/g, '/');
|
||||
}
|
||||
|
||||
this.path = defaultPath(this, filepath).replace(/\\/g, '/');
|
||||
this.fileEncoding = this.defaultEncoding = opt.defaultEncoding || defaultEncoding(this);
|
||||
|
||||
// When referencing products / build output files
|
||||
if (opt.explicitFileType) {
|
||||
this.explicitFileType = opt.explicitFileType;
|
||||
this.basename = this.basename + '.' + defaultExtension(this);
|
||||
delete this.path;
|
||||
delete this.lastKnownFileType;
|
||||
delete this.group;
|
||||
delete this.defaultEncoding;
|
||||
}
|
||||
|
||||
this.sourceTree = opt.sourceTree || detectSourcetree(this);
|
||||
this.includeInIndex = 0;
|
||||
|
||||
if (opt.weak && opt.weak === true)
|
||||
this.settings = { ATTRIBUTES: ['Weak'] };
|
||||
|
||||
if (opt.compilerFlags) {
|
||||
if (!this.settings)
|
||||
this.settings = {};
|
||||
this.settings.COMPILER_FLAGS = util.format('"%s"', opt.compilerFlags);
|
||||
}
|
||||
|
||||
if (opt.embed && opt.sign) {
|
||||
if (!this.settings)
|
||||
this.settings = {};
|
||||
if (!this.settings.ATTRIBUTES)
|
||||
this.settings.ATTRIBUTES = [];
|
||||
this.settings.ATTRIBUTES.push('CodeSignOnCopy');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = pbxFile;
|
||||
2201
node_modules/xcode/lib/pbxProject.js
generated
vendored
Normal file
2201
node_modules/xcode/lib/pbxProject.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
309
node_modules/xcode/lib/pbxWriter.js
generated
vendored
Normal file
309
node_modules/xcode/lib/pbxWriter.js
generated
vendored
Normal file
|
|
@ -0,0 +1,309 @@
|
|||
/**
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
'License'); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
var pbxProj = require('./pbxProject'),
|
||||
util = require('util'),
|
||||
f = util.format,
|
||||
INDENT = '\t',
|
||||
COMMENT_KEY = /_comment$/,
|
||||
QUOTED = /^"(.*)"$/,
|
||||
EventEmitter = require('events').EventEmitter
|
||||
|
||||
// indentation
|
||||
function i(x) {
|
||||
if (x <=0)
|
||||
return '';
|
||||
else
|
||||
return INDENT + i(x-1);
|
||||
}
|
||||
|
||||
function comment(key, parent) {
|
||||
var text = parent[key + '_comment'];
|
||||
|
||||
if (text)
|
||||
return text;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
// copied from underscore
|
||||
function isObject(obj) {
|
||||
return obj === Object(obj)
|
||||
}
|
||||
|
||||
function isArray(obj) {
|
||||
return Array.isArray(obj)
|
||||
}
|
||||
|
||||
function pbxWriter(contents, options) {
|
||||
if (!options) {
|
||||
options = {}
|
||||
}
|
||||
if (options.omitEmptyValues === undefined) {
|
||||
options.omitEmptyValues = false
|
||||
}
|
||||
|
||||
this.contents = contents;
|
||||
this.sync = false;
|
||||
this.indentLevel = 0;
|
||||
this.omitEmptyValues = options.omitEmptyValues
|
||||
}
|
||||
|
||||
util.inherits(pbxWriter, EventEmitter);
|
||||
|
||||
pbxWriter.prototype.write = function (str) {
|
||||
var fmt = f.apply(null, arguments);
|
||||
|
||||
if (this.sync) {
|
||||
this.buffer += f("%s%s", i(this.indentLevel), fmt);
|
||||
} else {
|
||||
// do stream write
|
||||
}
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeFlush = function (str) {
|
||||
var oldIndent = this.indentLevel;
|
||||
|
||||
this.indentLevel = 0;
|
||||
|
||||
this.write.apply(this, arguments)
|
||||
|
||||
this.indentLevel = oldIndent;
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeSync = function () {
|
||||
this.sync = true;
|
||||
this.buffer = "";
|
||||
|
||||
this.writeHeadComment();
|
||||
this.writeProject();
|
||||
|
||||
return this.buffer;
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeHeadComment = function () {
|
||||
if (this.contents.headComment) {
|
||||
this.write("// %s\n", this.contents.headComment)
|
||||
}
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeProject = function () {
|
||||
var proj = this.contents.project,
|
||||
key, cmt, obj;
|
||||
|
||||
this.write("{\n")
|
||||
|
||||
if (proj) {
|
||||
this.indentLevel++;
|
||||
|
||||
for (key in proj) {
|
||||
// skip comments
|
||||
if (COMMENT_KEY.test(key)) continue;
|
||||
|
||||
cmt = comment(key, proj);
|
||||
obj = proj[key];
|
||||
|
||||
if (isArray(obj)) {
|
||||
this.writeArray(obj, key)
|
||||
} else if (isObject(obj)) {
|
||||
this.write("%s = {\n", key);
|
||||
this.indentLevel++;
|
||||
|
||||
if (key === 'objects') {
|
||||
this.writeObjectsSections(obj)
|
||||
} else {
|
||||
this.writeObject(obj)
|
||||
}
|
||||
|
||||
this.indentLevel--;
|
||||
this.write("};\n");
|
||||
} else if (this.omitEmptyValues && (obj === undefined || obj === null)) {
|
||||
continue;
|
||||
} else if (cmt) {
|
||||
this.write("%s = %s /* %s */;\n", key, obj, cmt)
|
||||
} else {
|
||||
this.write("%s = %s;\n", key, obj)
|
||||
}
|
||||
}
|
||||
|
||||
this.indentLevel--;
|
||||
}
|
||||
|
||||
this.write("}\n")
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeObject = function (object) {
|
||||
var key, obj, cmt;
|
||||
|
||||
for (key in object) {
|
||||
if (COMMENT_KEY.test(key)) continue;
|
||||
|
||||
cmt = comment(key, object);
|
||||
obj = object[key];
|
||||
|
||||
if (isArray(obj)) {
|
||||
this.writeArray(obj, key)
|
||||
} else if (isObject(obj)) {
|
||||
this.write("%s = {\n", key);
|
||||
this.indentLevel++;
|
||||
|
||||
this.writeObject(obj)
|
||||
|
||||
this.indentLevel--;
|
||||
this.write("};\n");
|
||||
} else {
|
||||
if (this.omitEmptyValues && (obj === undefined || obj === null)) {
|
||||
continue;
|
||||
} else if (cmt) {
|
||||
this.write("%s = %s /* %s */;\n", key, obj, cmt)
|
||||
} else {
|
||||
this.write("%s = %s;\n", key, obj)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeObjectsSections = function (objects) {
|
||||
var key, obj;
|
||||
|
||||
for (key in objects) {
|
||||
this.writeFlush("\n")
|
||||
|
||||
obj = objects[key];
|
||||
|
||||
if (isObject(obj)) {
|
||||
this.writeSectionComment(key, true);
|
||||
|
||||
this.writeSection(obj);
|
||||
|
||||
this.writeSectionComment(key, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeArray = function (arr, name) {
|
||||
var i, entry;
|
||||
|
||||
this.write("%s = (\n", name);
|
||||
this.indentLevel++;
|
||||
|
||||
for (i=0; i < arr.length; i++) {
|
||||
entry = arr[i]
|
||||
|
||||
if (entry.value && entry.comment) {
|
||||
this.write('%s /* %s */,\n', entry.value, entry.comment);
|
||||
} else if (isObject(entry)) {
|
||||
this.write('{\n');
|
||||
this.indentLevel++;
|
||||
|
||||
this.writeObject(entry);
|
||||
|
||||
this.indentLevel--;
|
||||
this.write('},\n');
|
||||
} else {
|
||||
this.write('%s,\n', entry);
|
||||
}
|
||||
}
|
||||
|
||||
this.indentLevel--;
|
||||
this.write(");\n");
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeSectionComment = function (name, begin) {
|
||||
if (begin) {
|
||||
this.writeFlush("/* Begin %s section */\n", name)
|
||||
} else { // end
|
||||
this.writeFlush("/* End %s section */\n", name)
|
||||
}
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeSection = function (section) {
|
||||
var key, obj, cmt;
|
||||
|
||||
// section should only contain objects
|
||||
for (key in section) {
|
||||
if (COMMENT_KEY.test(key)) continue;
|
||||
|
||||
cmt = comment(key, section);
|
||||
obj = section[key]
|
||||
|
||||
if (obj.isa == 'PBXBuildFile' || obj.isa == 'PBXFileReference') {
|
||||
this.writeInlineObject(key, cmt, obj);
|
||||
} else {
|
||||
if (cmt) {
|
||||
this.write("%s /* %s */ = {\n", key, cmt);
|
||||
} else {
|
||||
this.write("%s = {\n", key);
|
||||
}
|
||||
|
||||
this.indentLevel++
|
||||
|
||||
this.writeObject(obj)
|
||||
|
||||
this.indentLevel--
|
||||
this.write("};\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pbxWriter.prototype.writeInlineObject = function (n, d, r) {
|
||||
var output = [];
|
||||
var self = this
|
||||
|
||||
var inlineObjectHelper = function (name, desc, ref) {
|
||||
var key, cmt, obj;
|
||||
|
||||
if (desc) {
|
||||
output.push(f("%s /* %s */ = {", name, desc));
|
||||
} else {
|
||||
output.push(f("%s = {", name));
|
||||
}
|
||||
|
||||
for (key in ref) {
|
||||
if (COMMENT_KEY.test(key)) continue;
|
||||
|
||||
cmt = comment(key, ref);
|
||||
obj = ref[key];
|
||||
|
||||
if (isArray(obj)) {
|
||||
output.push(f("%s = (", key));
|
||||
|
||||
for (var i=0; i < obj.length; i++) {
|
||||
output.push(f("%s, ", obj[i]))
|
||||
}
|
||||
|
||||
output.push("); ");
|
||||
} else if (isObject(obj)) {
|
||||
inlineObjectHelper(key, cmt, obj)
|
||||
} else if (self.omitEmptyValues && (obj === undefined || obj === null)) {
|
||||
continue;
|
||||
} else if (cmt) {
|
||||
output.push(f("%s = %s /* %s */; ", key, obj, cmt))
|
||||
} else {
|
||||
output.push(f("%s = %s; ", key, obj))
|
||||
}
|
||||
}
|
||||
|
||||
output.push("}; ");
|
||||
}
|
||||
|
||||
inlineObjectHelper(n, d, r);
|
||||
|
||||
this.write("%s\n", output.join('').trim());
|
||||
}
|
||||
|
||||
module.exports = pbxWriter;
|
||||
61
node_modules/xcode/package.json
generated
vendored
Normal file
61
node_modules/xcode/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"author": "Apache Software Foundation",
|
||||
"name": "xcode",
|
||||
"description": "parser for xcodeproj/project.pbxproj files",
|
||||
"version": "3.0.1",
|
||||
"main": "index.js",
|
||||
"repository": "github:apache/cordova-node-xcode",
|
||||
"bugs": "https://github.com/apache/cordova-node-xcode/issues",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"simple-plist": "^1.1.0",
|
||||
"uuid": "^7.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodeunit": "^0.11.3",
|
||||
"nyc": "^15.0.0",
|
||||
"pegjs": "^0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"pegjs": "node_modules/.bin/pegjs lib/parser/pbxproj.pegjs",
|
||||
"test": "npm run cover",
|
||||
"test:unit": "nodeunit test/parser test",
|
||||
"cover": "nyc npm run test:unit"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Andrew Lunny",
|
||||
"email": "alunny@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Anis Kadri"
|
||||
},
|
||||
{
|
||||
"name": "Mike Reinstein"
|
||||
},
|
||||
{
|
||||
"name": "Filip Maj"
|
||||
},
|
||||
{
|
||||
"name": "Brett Rudd",
|
||||
"email": "goya@apache.org"
|
||||
},
|
||||
{
|
||||
"name": "Bob Easterday"
|
||||
}
|
||||
],
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"exclude": [
|
||||
"coverage/",
|
||||
"test/"
|
||||
],
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"text"
|
||||
]
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue