initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

1
node_modules/xcode/.npmignore generated vendored Normal file
View File

@@ -0,0 +1 @@
test/

6
node_modules/xcode/AUTHORS generated vendored Normal file
View File

@@ -0,0 +1,6 @@
Andrew Lunny (@alunny)
Anis Kadri (@imhotep)
Mike Reinstein (@mreinstein)
Filip Maj (@filmaj)
Brett Rudd (@goya)
Bob Easterday (@bobeast)

14
node_modules/xcode/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,14 @@
Copyright 2012 Andrew Lunny, Adobe Systems
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.

5
node_modules/xcode/Makefile generated vendored Normal file
View File

@@ -0,0 +1,5 @@
tests:
nodeunit test/* test/parser/*
parser:
pegjs lib/parser/pbxproj.pegjs

42
node_modules/xcode/README.md generated vendored Normal file
View File

@@ -0,0 +1,42 @@
# node-xcode
> parser/toolkit for xcodeproj project files
Allows you to edit xcodeproject files and write them back out.
## Example
// 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 http://pegjs.majda.cz/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:
./node_modules/.bin/pegjs lib/parser/pbxproj.pegjs
(easier if `./node_modules/.bin` is in your path)
## License
Apache V2

1
node_modules/xcode/index.js generated vendored Normal file
View File

@@ -0,0 +1 @@
exports.project = require('./lib/pbxProject')

15
node_modules/xcode/lib/parseJob.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
// 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;
}

1899
node_modules/xcode/lib/parser/pbxproj.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

263
node_modules/xcode/lib/parser/pbxproj.pegjs generated vendored Normal file
View File

@@ -0,0 +1,263 @@
{
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
= .

215
node_modules/xcode/lib/pbxFile.js generated vendored Normal file
View File

@@ -0,0 +1,215 @@
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.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.explicitFileType;
for(var extension in FILETYPE_BY_EXTENSION) {
if(FILETYPE_BY_EXTENSION.hasOwnProperty(unquoted(extension)) ) {
if(FILETYPE_BY_EXTENSION[unquoted(extension)] === 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;

2059
node_modules/xcode/lib/pbxProject.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

282
node_modules/xcode/lib/pbxWriter.js generated vendored Normal file
View File

@@ -0,0 +1,282 @@
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) {
this.contents = contents;
this.sync = false;
this.indentLevel = 0;
}
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 (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 (cmt) {
this.write("%s = %s /* %s */;\n", key, obj, cmt)
} else {
this.write("%s = %s;\n", key, obj)
}
}
}
}
pbxWriter.prototype.writeObjectsSections = function (objects) {
var first = true,
key, obj;
for (key in objects) {
if (!first) {
this.writeFlush("\n")
} else {
first = false;
}
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 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 (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;

122
node_modules/xcode/package.json generated vendored Normal file
View File

@@ -0,0 +1,122 @@
{
"_args": [
[
"xcode@^0.9.1",
"/home/bernhard/freifunk-app/node_modules/react-native"
]
],
"_from": "xcode@>=0.9.1 <0.10.0",
"_id": "xcode@0.9.3",
"_inCache": true,
"_installable": true,
"_location": "/xcode",
"_nodeVersion": "6.9.5",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/xcode-0.9.3.tgz_1491573003748_0.7576456561218947"
},
"_npmUser": {
"email": "anis.kadri@gmail.com",
"name": "anis"
},
"_npmVersion": "3.10.10",
"_phantomChildren": {},
"_requested": {
"name": "xcode",
"raw": "xcode@^0.9.1",
"rawSpec": "^0.9.1",
"scope": null,
"spec": ">=0.9.1 <0.10.0",
"type": "range"
},
"_requiredBy": [
"/react-native"
],
"_resolved": "https://registry.npmjs.org/xcode/-/xcode-0.9.3.tgz",
"_shasum": "910a89c16aee6cc0b42ca805a6d0b4cf87211cf3",
"_shrinkwrap": null,
"_spec": "xcode@^0.9.1",
"_where": "/home/bernhard/freifunk-app/node_modules/react-native",
"author": {
"email": "alunny@gmail.com",
"name": "Andrew Lunny"
},
"bugs": {
"url": "https://github.com/alunny/node-xcode/issues"
},
"contributors": [
{
"name": "Andrew Lunny",
"url": "@alunny"
},
{
"name": "Anis Kadri",
"url": "@imhotep"
},
{
"name": "Mike Reinstein",
"url": "@mreinstein"
},
{
"name": "Filip Maj",
"url": "@filmaj"
},
{
"name": "Brett Rudd",
"url": "@goya"
},
{
"name": "Bob Easterday",
"url": "@bobeast"
}
],
"dependencies": {
"pegjs": "^0.10.0",
"simple-plist": "^0.2.1",
"uuid": "3.0.1"
},
"description": "parser for xcodeproj/project.pbxproj files",
"devDependencies": {
"nodeunit": "^0.11.0"
},
"directories": {},
"dist": {
"shasum": "910a89c16aee6cc0b42ca805a6d0b4cf87211cf3",
"tarball": "https://registry.npmjs.org/xcode/-/xcode-0.9.3.tgz"
},
"engines": {
"node": ">=0.6.7"
},
"gitHead": "1cd220819906b62fc06c8833f905897600a53127",
"homepage": "https://github.com/alunny/node-xcode#readme",
"license": "Apache-2.0",
"main": "index.js",
"maintainers": [
{
"name": "alunny",
"email": "alunny@gmail.com"
},
{
"name": "filmaj",
"email": "maj.fil@gmail.com"
},
{
"name": "shepheb",
"email": "braden.shepherdson@gmail.com"
},
{
"name": "anis",
"email": "anis.kadri@gmail.com"
}
],
"name": "xcode",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"url": "git+https://github.com/alunny/node-xcode.git"
},
"scripts": {
"test": "nodeunit test/parser test"
},
"version": "0.9.3"
}