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
23
node_modules/@trapezedev/gradle-parse/LICENSE
generated
vendored
Normal file
23
node_modules/@trapezedev/gradle-parse/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Copyright 2015-present Drifty Co.
|
||||
http://drifty.com/
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
BIN
node_modules/@trapezedev/gradle-parse/capacitor-gradle-parse.jar
generated
vendored
Normal file
BIN
node_modules/@trapezedev/gradle-parse/capacitor-gradle-parse.jar
generated
vendored
Normal file
Binary file not shown.
0
node_modules/@trapezedev/gradle-parse/index.js
generated
vendored
Normal file
0
node_modules/@trapezedev/gradle-parse/index.js
generated
vendored
Normal file
BIN
node_modules/@trapezedev/gradle-parse/lib/groovy-3.0.9.jar
generated
vendored
Normal file
BIN
node_modules/@trapezedev/gradle-parse/lib/groovy-3.0.9.jar
generated
vendored
Normal file
Binary file not shown.
BIN
node_modules/@trapezedev/gradle-parse/lib/json-20210307.jar
generated
vendored
Normal file
BIN
node_modules/@trapezedev/gradle-parse/lib/json-20210307.jar
generated
vendored
Normal file
Binary file not shown.
17
node_modules/@trapezedev/gradle-parse/package.json
generated
vendored
Normal file
17
node_modules/@trapezedev/gradle-parse/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "@trapezedev/gradle-parse",
|
||||
"version": "7.1.3",
|
||||
"description": "Simple, acurrent Gradle parsing tool for tool modifications to Gradle files",
|
||||
"author": "Ionic Team <hi@ionic.io> (https://ionicframework.com) ",
|
||||
"license": "SEE LICENSE",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
"lib",
|
||||
"capacitor-gradle-parse.jar"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "",
|
||||
"build-jar": "bash build.sh"
|
||||
},
|
||||
"gitHead": "3b4f9f02d6a74247a5606fe1c0688c9a1ec3fd4b"
|
||||
}
|
||||
23
node_modules/@trapezedev/project/LICENSE
generated
vendored
Normal file
23
node_modules/@trapezedev/project/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
Copyright 2015-present Drifty Co.
|
||||
http://drifty.com/
|
||||
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
90
node_modules/@trapezedev/project/dist/android/gradle-file.d.ts
generated
vendored
Normal file
90
node_modules/@trapezedev/project/dist/android/gradle-file.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
import { VFS, VFSStorable } from '../vfs';
|
||||
import { AndroidGradleInjectType } from '../definitions';
|
||||
export type GradleAST = any;
|
||||
export interface GradleASTNode {
|
||||
type: string;
|
||||
name: string;
|
||||
children?: GradleASTNode[];
|
||||
source: {
|
||||
line: number;
|
||||
column: number;
|
||||
lastLine: number;
|
||||
lastColumn: number;
|
||||
};
|
||||
}
|
||||
export declare class GradleFile extends VFSStorable {
|
||||
filename: string;
|
||||
private vfs;
|
||||
private source;
|
||||
private parsed;
|
||||
private tempFile;
|
||||
constructor(filename: string, vfs: VFS);
|
||||
getDocument(): string | null;
|
||||
/**
|
||||
* Replace the given properties at the specified point in the Gradle file or insert
|
||||
* if the replacement doesn't exist
|
||||
*
|
||||
* exact specifies whether the pathObject should be exact from the root of the document or
|
||||
* if it can match on a sub-object
|
||||
**/
|
||||
replaceProperties(pathObject: any, toReplace: any, exact?: boolean): Promise<void>;
|
||||
_makeReplacePathObject(pathObject: any, injectKey: string): any;
|
||||
/**
|
||||
* Replace an entry in the gradle file.
|
||||
*/
|
||||
private replaceInGradleFile;
|
||||
/**
|
||||
* Insert the given properties at the specified point in the Gradle file.
|
||||
* exact specifies whether the pathObject should be exact from the root of the document or
|
||||
* if it can match on a sub-object
|
||||
**/
|
||||
insertProperties(pathObject: any, toInject: any[], type?: AndroidGradleInjectType, exact?: boolean): Promise<void>;
|
||||
/**
|
||||
* Inject the given properties at the specified point in the Gradle file.
|
||||
* exact specifies whether the pathObject should be exact from the root of the document or
|
||||
* if it can match on a sub-object
|
||||
**/
|
||||
insertFragment(pathObject: any, toInject: string, exact?: boolean): Promise<void>;
|
||||
/**
|
||||
* Parse the underlying Gradle file and build the AST. Note: this calls out to
|
||||
* a Java process which incurs some overhead and requires java to be installed
|
||||
* This is because Gradle is actually a DSL for the Groovy language, which is
|
||||
* a JVM language. Additionally, the Groovy parser is based on a modified version
|
||||
* of the Antlr project that is tightly bound to the JVM. Ultimatley, this means
|
||||
* the only safe, accurate way to feasibly build a Gradle AST is to use the Groovy
|
||||
* parser API which this uses under the hood.
|
||||
*/
|
||||
parse(): Promise<any>;
|
||||
/**
|
||||
* Inject a modification into the gradle file.
|
||||
*/
|
||||
private insertIntoGradleFile;
|
||||
find(pathObject: any | null, exact?: boolean): {
|
||||
node: GradleASTNode;
|
||||
depth: number;
|
||||
}[];
|
||||
private _find;
|
||||
getSource(node: GradleASTNode): string;
|
||||
private getDepth;
|
||||
private matchesExact;
|
||||
private isTargetNode;
|
||||
getJava(): Promise<string | null>;
|
||||
getGradleParserPath(): string;
|
||||
setApplicationId(applicationId: string): Promise<void>;
|
||||
getApplicationId(): Promise<string | null>;
|
||||
setVersionCode(versionCode: number): Promise<void>;
|
||||
getVersionCode(): Promise<number | null>;
|
||||
incrementVersionCode(): Promise<void>;
|
||||
setVersionName(versionName: string): Promise<void>;
|
||||
getVersionName(): Promise<string | null>;
|
||||
setVersionNameSuffix(versionNameSuffix: string): Promise<void>;
|
||||
getVersionNameSuffix(): Promise<string | null>;
|
||||
getNamespace(): Promise<string | null>;
|
||||
setNamespace(namespace: string): Promise<void>;
|
||||
private createGradleSource;
|
||||
private getGradleSource;
|
||||
private gradleParseError;
|
||||
private gradleCommitFn;
|
||||
private gradleDiffFn;
|
||||
}
|
||||
//# sourceMappingURL=gradle-file.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/android/gradle-file.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/android/gradle-file.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"gradle-file.d.ts","sourceRoot":"","sources":["../../src/android/gradle-file.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,GAAG,EAAW,WAAW,EAAW,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAIzD,MAAM,MAAM,SAAS,GAAG,GAAG,CAAC;AAC5B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,qBAAa,UAAW,SAAQ,WAAW;IAKtB,QAAQ,EAAE,MAAM;IAAE,OAAO,CAAC,GAAG;IAJhD,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,QAAQ,CAAuB;gBAEpB,QAAQ,EAAE,MAAM,EAAU,GAAG,EAAE,GAAG;IAIrD,WAAW;IAIX;;;;;;QAMI;IACE,iBAAiB,CAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAkCtF,sBAAsB,CAAC,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM;IAsBzD;;OAEG;YAIW,mBAAmB;IAsDjC;;;;QAII;IACE,gBAAgB,CAAC,UAAU,EA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AgB;IAIxB,OAAO,CAAC,cAAc,CAMpB;IAEF,OAAO,CAAC,YAAY,CAUlB;CACH"}
|
||||
629
node_modules/@trapezedev/project/dist/android/gradle-file.js
generated
vendored
Normal file
629
node_modules/@trapezedev/project/dist/android/gradle-file.js
generated
vendored
Normal file
|
|
@ -0,0 +1,629 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GradleFile = void 0;
|
||||
const path_1 = require("path");
|
||||
const os_1 = __importDefault(require("os"));
|
||||
const tempy_1 = __importDefault(require("tempy"));
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const subprocess_1 = require("../util/subprocess");
|
||||
const text_1 = require("../util/text");
|
||||
const vfs_1 = require("../vfs");
|
||||
const detect_indent_1 = __importDefault(require("../util/detect-indent"));
|
||||
const logger_1 = require("../logger");
|
||||
const fs_1 = require("../util/fs");
|
||||
class GradleFile extends vfs_1.VFSStorable {
|
||||
constructor(filename, vfs) {
|
||||
super();
|
||||
this.filename = filename;
|
||||
this.vfs = vfs;
|
||||
this.source = null;
|
||||
this.parsed = null;
|
||||
this.tempFile = null;
|
||||
this.gradleCommitFn = async (file) => {
|
||||
await (0, fs_1.assertParentDirs)(file.getFilename());
|
||||
return (0, utils_fs_1.writeFile)(file.getFilename(), file.getData().getDocument());
|
||||
};
|
||||
this.gradleDiffFn = async (file) => {
|
||||
var _a;
|
||||
let old = '';
|
||||
try {
|
||||
old = await (0, utils_fs_1.readFile)(file.getFilename(), { encoding: 'utf-8' });
|
||||
}
|
||||
catch (e) { }
|
||||
return {
|
||||
old,
|
||||
new: (_a = this.source) !== null && _a !== void 0 ? _a : '',
|
||||
};
|
||||
};
|
||||
}
|
||||
getDocument() {
|
||||
return this.source;
|
||||
}
|
||||
/**
|
||||
* Replace the given properties at the specified point in the Gradle file or insert
|
||||
* if the replacement doesn't exist
|
||||
*
|
||||
* exact specifies whether the pathObject should be exact from the root of the document or
|
||||
* if it can match on a sub-object
|
||||
**/
|
||||
async replaceProperties(pathObject, toReplace, exact = false) {
|
||||
await this.parse();
|
||||
if (!this.parsed) {
|
||||
throw new Error('Call parse() first to load Gradle file');
|
||||
}
|
||||
const found = this.find(pathObject, exact);
|
||||
if (!found.length) {
|
||||
// Create a parent selector object since we're going to insert instead
|
||||
const parent = this._makeReplacePathObject(pathObject, Object.keys(toReplace)[0]);
|
||||
const foundParent = this.find(parent, exact);
|
||||
if (foundParent.length) {
|
||||
this.insertIntoGradleFile([toReplace], foundParent[0], "infer" /* AndroidGradleInjectType.Infer */);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
throw new Error('Unable to find target in Gradle file to replace or insert');
|
||||
}
|
||||
}
|
||||
const target = found[0];
|
||||
return this.replaceInGradleFile(toReplace, target);
|
||||
}
|
||||
// Build a new pathObject that is the path to the parent rather than
|
||||
// the path in pathObject
|
||||
_makeReplacePathObject(pathObject, injectKey) {
|
||||
let x = {};
|
||||
let y = x;
|
||||
let a = pathObject;
|
||||
while (a) {
|
||||
const keys = Object.keys(a);
|
||||
if (keys[0] === injectKey || !keys.length) {
|
||||
return y;
|
||||
}
|
||||
const o = {};
|
||||
x[keys[0]] = o;
|
||||
x = o;
|
||||
a = a[keys[0]];
|
||||
}
|
||||
return y;
|
||||
}
|
||||
/**
|
||||
* Replace an entry in the gradle file.
|
||||
*/
|
||||
// This is a beast, sorry. Hey, at least there's tests
|
||||
// In the future, this could be moved to the Java `gradle-parse` package provided in this monorepo
|
||||
// along with modifying the AST to inject our script but this works fine for now
|
||||
async replaceInGradleFile(toInject, targetNode) {
|
||||
var _a;
|
||||
// These values are 1-indexed not 0-indexed
|
||||
//let { line, column, lastLine, lastColumn } = targetNode.node.source;
|
||||
let { line, column, lastLine, lastColumn } = targetNode.node.source;
|
||||
const source = (_a = (await this.getGradleSource())) !== null && _a !== void 0 ? _a : '';
|
||||
const sourceLines = source.split(/\r?\n/);
|
||||
if (line == -1) {
|
||||
// Set to first line (remember, 1-indexed)
|
||||
line = 1;
|
||||
}
|
||||
if (lastLine === -1) {
|
||||
// Set to last line (remember, 1-indexed)
|
||||
lastLine = sourceLines.length + 1;
|
||||
}
|
||||
const detectedIndent = (0, detect_indent_1.default)(source);
|
||||
let lines = [];
|
||||
this.createGradleSource([toInject], lines /* out */, detectedIndent.indent, undefined, targetNode.node, "infer" /* AndroidGradleInjectType.Infer */);
|
||||
const resolvedLastLine = lastLine < 0 ? sourceLines.length : lastLine;
|
||||
const formatted = lines.join('\n');
|
||||
const indentAmount = targetNode.depth;
|
||||
const indented = (0, text_1.indent)(formatted, detectedIndent.indent, indentAmount - 1);
|
||||
// Replace the target lines with our new source line
|
||||
const newSource = sourceLines.slice(0, Math.max(0, line - 1)).join('\n') +
|
||||
'\n' +
|
||||
indented +
|
||||
'\n' +
|
||||
sourceLines
|
||||
.slice(Math.max(0, resolvedLastLine), sourceLines.length)
|
||||
.join('\n');
|
||||
this.source = newSource;
|
||||
}
|
||||
/**
|
||||
* Insert the given properties at the specified point in the Gradle file.
|
||||
* exact specifies whether the pathObject should be exact from the root of the document or
|
||||
* if it can match on a sub-object
|
||||
**/
|
||||
async insertProperties(pathObject, toInject, type = "method" /* AndroidGradleInjectType.Method */, exact = false) {
|
||||
await this.parse();
|
||||
if (!this.parsed) {
|
||||
throw new Error('Call parse() first to load Gradle file');
|
||||
}
|
||||
const found = this.find(pathObject, exact);
|
||||
if (!found.length) {
|
||||
throw new Error('Unable to find method in Gradle file to inject');
|
||||
}
|
||||
const target = found[0];
|
||||
return this.insertIntoGradleFile(toInject, target, type);
|
||||
}
|
||||
/**
|
||||
* Inject the given properties at the specified point in the Gradle file.
|
||||
* exact specifies whether the pathObject should be exact from the root of the document or
|
||||
* if it can match on a sub-object
|
||||
**/
|
||||
async insertFragment(pathObject, toInject, exact = false) {
|
||||
await this.parse();
|
||||
if (!this.parsed) {
|
||||
throw new Error('Call parse() first to load Gradle file');
|
||||
}
|
||||
const found = this.find(pathObject, exact);
|
||||
if (!found.length) {
|
||||
throw new Error('Unable to find method in Gradle file to inject');
|
||||
}
|
||||
const target = found[0];
|
||||
return this.insertIntoGradleFile(toInject, target, "infer" /* AndroidGradleInjectType.Infer */);
|
||||
}
|
||||
/**
|
||||
* Parse the underlying Gradle file and build the AST. Note: this calls out to
|
||||
* a Java process which incurs some overhead and requires java to be installed
|
||||
* This is because Gradle is actually a DSL for the Groovy language, which is
|
||||
* a JVM language. Additionally, the Groovy parser is based on a modified version
|
||||
* of the Antlr project that is tightly bound to the JVM. Ultimatley, this means
|
||||
* the only safe, accurate way to feasibly build a Gradle AST is to use the Groovy
|
||||
* parser API which this uses under the hood.
|
||||
*/
|
||||
async parse() {
|
||||
var _a, _b;
|
||||
if (!(await (0, utils_fs_1.pathExists)(this.filename))) {
|
||||
throw new Error(`Unable to locate file at ${this.filename}`);
|
||||
}
|
||||
const vfsRef = this.vfs.get(this.filename);
|
||||
// We keep a temp file updated with the latest source so the parser can operate
|
||||
// on the current state of the file so we can handle multiple modifications to it
|
||||
// in sequence
|
||||
if (!this.tempFile) {
|
||||
// If the temp file doesn't exist yet, create it and write the current file source to it
|
||||
const gradleContents = await this.getGradleSource();
|
||||
this.tempFile = tempy_1.default.file({ extension: 'gradle' });
|
||||
await (0, utils_fs_1.writeFile)(this.tempFile, gradleContents);
|
||||
}
|
||||
else if (vfsRef) {
|
||||
// Otherwise if it already exists then write the current vfs data to it
|
||||
if ((_a = vfsRef === null || vfsRef === void 0 ? void 0 : vfsRef.getData()) === null || _a === void 0 ? void 0 : _a.getDocument()) {
|
||||
await (0, utils_fs_1.writeFile)(this.tempFile, (_b = vfsRef === null || vfsRef === void 0 ? void 0 : vfsRef.getData()) === null || _b === void 0 ? void 0 : _b.getDocument());
|
||||
}
|
||||
}
|
||||
const parserRoot = this.getGradleParserPath();
|
||||
const java = await this.getJava();
|
||||
if (!java) {
|
||||
throw new Error(this.gradleParseError());
|
||||
}
|
||||
logger_1.Logger.v('gradle', 'parse', `running Gradle parse with Java path ${java}`);
|
||||
logger_1.Logger.v('gradle', 'parse', `read gradle file at ${this.filename}`);
|
||||
try {
|
||||
let json = null;
|
||||
if (os_1.default.platform() === 'win32') {
|
||||
json = await (0, subprocess_1.spawnCommand)(java, [
|
||||
'-cp',
|
||||
'lib/groovy-3.0.9.jar;lib/json-20210307.jar;capacitor-gradle-parse.jar;.',
|
||||
'com.capacitorjs.gradle.Parse',
|
||||
this.tempFile,
|
||||
], {
|
||||
cwd: parserRoot,
|
||||
stdio: 'pipe',
|
||||
});
|
||||
}
|
||||
else {
|
||||
json = await (0, subprocess_1.spawnCommand)(java, [
|
||||
'-cp',
|
||||
'lib/*:capacitor-gradle-parse.jar:.',
|
||||
'com.capacitorjs.gradle.Parse',
|
||||
this.tempFile,
|
||||
], {
|
||||
cwd: parserRoot,
|
||||
stdio: 'pipe',
|
||||
});
|
||||
}
|
||||
this.parsed = JSON.parse(json || '{}');
|
||||
return this.parsed;
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`Unable to load or parse gradle file: ${e}`);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Inject a modification into the gradle file.
|
||||
*/
|
||||
// This is a beast, sorry. Hey, at least there's tests
|
||||
// In the future, this could be moved to the Java `gradle-parse` package provided in this monorepo
|
||||
// along with modifying the AST to inject our script but this works fine forn ow
|
||||
async insertIntoGradleFile(toInject, targetNode, type) {
|
||||
var _a;
|
||||
// These values are 1-indexed not 0-indexed
|
||||
let { line, column, lastLine, lastColumn } = targetNode.node.source;
|
||||
const source = (_a = (await this.getGradleSource())) !== null && _a !== void 0 ? _a : '';
|
||||
const sourceLines = source.split(/\r?\n/);
|
||||
if (line == -1) {
|
||||
// Set to first line (remember, 1-indexed)
|
||||
line = 1;
|
||||
}
|
||||
if (lastLine === -1) {
|
||||
// Set to last line (remember, 1-indexed)
|
||||
lastLine = sourceLines.length + 1;
|
||||
}
|
||||
const detectedIndent = (0, detect_indent_1.default)(source);
|
||||
let lines = [];
|
||||
if (Array.isArray(toInject)) {
|
||||
this.createGradleSource(toInject, lines /* out */, detectedIndent.indent, undefined, targetNode.node, type);
|
||||
}
|
||||
else {
|
||||
lines = toInject.split(/\r?\n/);
|
||||
}
|
||||
const resolvedLastLine = lastLine < 0 ? sourceLines.length : lastLine;
|
||||
const formatted = lines.join('\n');
|
||||
const indentAmount = targetNode.depth;
|
||||
let newSource = null;
|
||||
if (line === lastLine) {
|
||||
// Block is empty, like dependencies {}
|
||||
const indented = (0, text_1.indent)(formatted, detectedIndent.indent, indentAmount);
|
||||
const sourceLine = sourceLines[line - 1];
|
||||
// The new line is the slice from the start of the line to one character before the end (remember,
|
||||
// the lines and columns are 1-indexed so lastColumn - 2 is one character before the end
|
||||
const newLine = sourceLine.slice(0, Math.max(0, lastColumn - 2)) +
|
||||
'\n' +
|
||||
indented +
|
||||
'\n' +
|
||||
(0, text_1.indent)(sourceLine.slice(Math.max(0, lastColumn - 2)).trim(), detectedIndent.indent, Math.max(0, indentAmount - 1));
|
||||
newSource =
|
||||
sourceLines.slice(0, Math.max(0, resolvedLastLine - 1)).join('\n') +
|
||||
'\n' +
|
||||
newLine +
|
||||
'\n' +
|
||||
sourceLines
|
||||
.slice(Math.max(0, resolvedLastLine), sourceLines.length)
|
||||
.join('\n');
|
||||
}
|
||||
else {
|
||||
const indented = (0, text_1.indent)(formatted, detectedIndent.indent, indentAmount);
|
||||
newSource =
|
||||
sourceLines.slice(0, Math.max(0, resolvedLastLine - 1)).join('\n') +
|
||||
'\n' +
|
||||
indented +
|
||||
'\n' +
|
||||
sourceLines
|
||||
.slice(Math.max(0, resolvedLastLine - 1), sourceLines.length)
|
||||
.join('\n');
|
||||
}
|
||||
this.source = newSource;
|
||||
}
|
||||
find(pathObject, exact = false) {
|
||||
var _a;
|
||||
if (!this.parsed) {
|
||||
throw new Error('Call parse() first to load Gradle file');
|
||||
}
|
||||
// Null or empty object means the root node
|
||||
if (!pathObject || !Object.keys(pathObject).length) {
|
||||
const firstChild = (_a = this.parsed.children) === null || _a === void 0 ? void 0 : _a[0];
|
||||
if (firstChild) {
|
||||
return [{ node: firstChild, depth: 0 }];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
const found = [];
|
||||
this._find(pathObject, this.parsed, pathObject, exact, [], found);
|
||||
return found;
|
||||
}
|
||||
_find(pathObject, node, pathNode, exact, pathToNode, found, depth = 0) {
|
||||
var _a, _b;
|
||||
if (!pathNode) {
|
||||
return;
|
||||
}
|
||||
const targetKey = (_a = Object.keys(pathNode)) === null || _a === void 0 ? void 0 : _a[0];
|
||||
if (!targetKey) {
|
||||
return;
|
||||
}
|
||||
for (const c of ((_b = node.children) !== null && _b !== void 0 ? _b : [])) {
|
||||
if (this.isTargetNode(c) && c.name === targetKey) {
|
||||
pathNode = pathNode[targetKey];
|
||||
if (!pathNode || Object.keys(pathNode).length == 0) {
|
||||
// We've run out of path nodes to match
|
||||
if (!exact) {
|
||||
found.push({ node: c, depth });
|
||||
}
|
||||
else if (exact && this.matchesExact(pathObject, c, [...pathToNode, c])) {
|
||||
found.push({ node: c, depth });
|
||||
}
|
||||
}
|
||||
}
|
||||
const newPathToNode = this.isTargetNode(node) ? [...pathToNode, node] : pathToNode;
|
||||
this._find(pathObject, c, pathNode, exact, newPathToNode, found, c.type === 'block' ? depth + 1 : depth);
|
||||
}
|
||||
}
|
||||
getSource(node) {
|
||||
if (!this.parsed || !this.source) {
|
||||
throw new Error('Call parse() first to load Gradle file');
|
||||
}
|
||||
const lines = this.source.split(/\r?\n/);
|
||||
const sourceLines = lines.slice(node.source.line - 1, node.source.lastLine);
|
||||
const firstLine = sourceLines[0].slice(Math.max(0, node.source.column - 1));
|
||||
const lastLine = sourceLines[sourceLines.length - 1].slice(0, node.source.lastColumn);
|
||||
if (sourceLines.length > 2) {
|
||||
return [firstLine, ...sourceLines.slice(1, sourceLines.length - 1), lastLine].join('\n');
|
||||
}
|
||||
else if (sourceLines.length == 2) {
|
||||
return [firstLine, lastLine].join('\n');
|
||||
}
|
||||
else {
|
||||
return firstLine;
|
||||
}
|
||||
}
|
||||
getDepth(pathObject) {
|
||||
let depth = 0;
|
||||
let n = pathObject;
|
||||
while (n) {
|
||||
const keys = Object.keys(n);
|
||||
if (keys.length > 0) {
|
||||
depth++;
|
||||
n = n[keys[0]];
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return depth;
|
||||
}
|
||||
// When doing an exact match, need to check the path to the node
|
||||
// and verify the hierarchy matches
|
||||
matchesExact(pathObject, node, pathToNode) {
|
||||
var _a;
|
||||
const targetDepth = this.getDepth(pathObject);
|
||||
const currentDepth = pathToNode.length;
|
||||
if (currentDepth != targetDepth) {
|
||||
return false;
|
||||
}
|
||||
let n = pathObject;
|
||||
let m = pathToNode;
|
||||
while (n && m) {
|
||||
const key = Object.keys(n)[0];
|
||||
if (key && key !== ((_a = m[0]) === null || _a === void 0 ? void 0 : _a.name)) {
|
||||
return false;
|
||||
}
|
||||
n = n[key];
|
||||
m = m.slice(1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
isTargetNode(node) {
|
||||
return node.type === 'method' || node.type === 'variable';
|
||||
}
|
||||
async getJava() {
|
||||
try {
|
||||
if (process.env.JAVA_HOME) {
|
||||
return (0, path_1.join)(process.env.JAVA_HOME, 'bin', 'java');
|
||||
}
|
||||
const v = await (0, subprocess_1.spawnCommand)('java', ['-version'], {
|
||||
stdio: 'pipe',
|
||||
combineStreams: true
|
||||
});
|
||||
if (!v) {
|
||||
throw new Error('Unable to find java on PATH');
|
||||
}
|
||||
return 'java';
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
getGradleParserPath() {
|
||||
return (0, path_1.dirname)(require.resolve('@trapezedev/gradle-parse'));
|
||||
}
|
||||
async setApplicationId(applicationId) {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
this.source = source.replace(/(applicationId\s+)["'][^"']+["']/, `$1"${applicationId}"`);
|
||||
}
|
||||
}
|
||||
async getApplicationId() {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
const applicationId = source.match(/applicationId\s+["']([^"']+)["']/);
|
||||
if (!applicationId) {
|
||||
return null;
|
||||
}
|
||||
return applicationId[1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async setVersionCode(versionCode) {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
logger_1.Logger.v('gradle', 'setVersionCode', `to ${versionCode} in ${this.filename}`);
|
||||
return this.replaceProperties({
|
||||
android: {
|
||||
defaultConfig: {
|
||||
versionCode: {}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
versionCode
|
||||
});
|
||||
}
|
||||
}
|
||||
async getVersionCode() {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
const versionCode = source.match(/versionCode\s+(\w+)/);
|
||||
if (!versionCode) {
|
||||
return null;
|
||||
}
|
||||
return parseInt(versionCode[1]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async incrementVersionCode() {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
const versionCode = source.match(/versionCode\s+(\w+)/);
|
||||
if (!versionCode) {
|
||||
return;
|
||||
}
|
||||
const num = parseInt(versionCode[1]);
|
||||
if (!isNaN(num)) {
|
||||
logger_1.Logger.v('gradle', 'incrementVersionCode', `to ${num} in ${this.filename}`);
|
||||
return this.setVersionCode(num + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
async setVersionName(versionName) {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
logger_1.Logger.v('gradle', 'setVersionName', `to ${versionName} in ${this.filename}`);
|
||||
return this.replaceProperties({
|
||||
android: {
|
||||
defaultConfig: {
|
||||
versionName: {}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
versionName: `"${versionName}"`
|
||||
});
|
||||
}
|
||||
}
|
||||
async getVersionName() {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
const versionName = source.match(/versionName\s+["']([^"']+)["']/) || null;
|
||||
if (!versionName) {
|
||||
return null;
|
||||
}
|
||||
return versionName[1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async setVersionNameSuffix(versionNameSuffix) {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
logger_1.Logger.v('gradle', 'setVersionNameSuffix', `to ${versionNameSuffix} in ${this.filename}`);
|
||||
return this.replaceProperties({
|
||||
android: {
|
||||
defaultConfig: {
|
||||
versionNameSuffix: {}
|
||||
}
|
||||
}
|
||||
}, {
|
||||
versionNameSuffix: `"${versionNameSuffix}"`
|
||||
});
|
||||
}
|
||||
}
|
||||
async getVersionNameSuffix() {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
const versionName = source.match(/versionNameSuffix\s+["']([^"']+)["']/) || null;
|
||||
if (!versionName) {
|
||||
return null;
|
||||
}
|
||||
return versionName[1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async getNamespace() {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
const namespace = source.match(/namespace\s+["']([^"']+)["']/);
|
||||
if (!namespace) {
|
||||
return null;
|
||||
}
|
||||
return namespace[1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async setNamespace(namespace) {
|
||||
const source = await this.getGradleSource();
|
||||
if (source) {
|
||||
logger_1.Logger.v('gradle', 'setNamespace', `to ${namespace} in ${this.filename}`);
|
||||
return this.replaceProperties({
|
||||
android: {
|
||||
namespace: {}
|
||||
}
|
||||
}, {
|
||||
namespace: `"${namespace}"`
|
||||
});
|
||||
}
|
||||
}
|
||||
/*
|
||||
Generate a fragment of Gradle/Groovy code given the inject object
|
||||
|
||||
A gradle edit will be of the form:
|
||||
|
||||
[
|
||||
{
|
||||
maven: [{
|
||||
url: 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1',
|
||||
name: 'Duo-SDK-Feed'
|
||||
}]
|
||||
}
|
||||
]
|
||||
*/
|
||||
createGradleSource(injectObj, lines, indentation, depth = 0, targetNode, type) {
|
||||
for (const entry of injectObj) {
|
||||
const keys = Object.keys(entry);
|
||||
for (const key of keys) {
|
||||
const editEntry = entry[key];
|
||||
if (Array.isArray(editEntry)) {
|
||||
if (typeof editEntry[0] === 'object') {
|
||||
lines.push(`${key} {`);
|
||||
this.createGradleSource(editEntry, lines, indentation, depth + 1, targetNode, type);
|
||||
lines.push('}');
|
||||
}
|
||||
else {
|
||||
// Create a variable entry if the target node type is a variable or
|
||||
// the provided type is a variable
|
||||
if (targetNode.type === 'variable' || type === "variable" /* AndroidGradleInjectType.Variable */) {
|
||||
lines.push(`${key} = ${JSON.stringify(editEntry)}`);
|
||||
}
|
||||
else {
|
||||
lines.push(`${key} ${editEntry}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof editEntry === 'string' ||
|
||||
typeof editEntry === 'number' ||
|
||||
typeof editEntry === 'boolean') {
|
||||
if (targetNode.type === 'variable' || type === "variable" /* AndroidGradleInjectType.Variable */) {
|
||||
lines.push((0, text_1.indent)(`${key} = ${editEntry}`, indentation, depth));
|
||||
}
|
||||
else {
|
||||
lines.push((0, text_1.indent)(`${key} ${editEntry}`, indentation, depth));
|
||||
}
|
||||
}
|
||||
else {
|
||||
const fields = Object.keys(editEntry);
|
||||
for (const fieldKey of fields) {
|
||||
const fieldEntry = editEntry[fieldKey];
|
||||
if (typeof fieldEntry === 'string') {
|
||||
lines.push((0, text_1.indent)(`${fieldKey} ${fieldEntry}`, indentation, depth));
|
||||
}
|
||||
else if (Array.isArray(fieldEntry)) {
|
||||
lines.push('{');
|
||||
this.createGradleSource(fieldEntry, lines, indentation, depth + 1, targetNode, type);
|
||||
lines.push('}');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
async getGradleSource() {
|
||||
var _a, _b;
|
||||
const ref = this.vfs.get(this.filename);
|
||||
if (ref) {
|
||||
return (_b = (_a = ref.getData()) === null || _a === void 0 ? void 0 : _a.getDocument()) !== null && _b !== void 0 ? _b : '';
|
||||
}
|
||||
const contents = await (0, utils_fs_1.readFile)(this.filename, { encoding: 'utf-8' });
|
||||
this.source = contents;
|
||||
this.vfs.open(this.filename, this, this.gradleCommitFn, this.gradleDiffFn);
|
||||
return contents;
|
||||
}
|
||||
gradleParseError() {
|
||||
return `java not found on path and JAVA_HOME not set. Please set JAVA_HOME to the root of your Java installation.\n\nGradle parse functionality depends on a local Java install for accurate Gradle file modification.`;
|
||||
}
|
||||
}
|
||||
exports.GradleFile = GradleFile;
|
||||
//# sourceMappingURL=gradle-file.js.map
|
||||
1
node_modules/@trapezedev/project/dist/android/gradle-file.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/android/gradle-file.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
71
node_modules/@trapezedev/project/dist/android/project.d.ts
generated
vendored
Normal file
71
node_modules/@trapezedev/project/dist/android/project.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { MobileProject } from '../project';
|
||||
import { AndroidResDir } from '../definitions';
|
||||
import { GradleFile } from './gradle-file';
|
||||
import { XmlFile } from '../xml';
|
||||
import { PropertiesFile } from '../properties';
|
||||
import { PlatformProject } from '../platform-project';
|
||||
export declare class AndroidProject extends PlatformProject {
|
||||
private manifest;
|
||||
private buildGradle;
|
||||
private appBuildGradle;
|
||||
constructor(project: MobileProject);
|
||||
load(): Promise<void>;
|
||||
getBuildGradle(): GradleFile | null;
|
||||
getAppBuildGradle(): GradleFile | null;
|
||||
getAndroidManifest(): XmlFile;
|
||||
/**
|
||||
* Get a project file container for the given path in the project root.
|
||||
* This will return an existing file container or create a new one.
|
||||
*/
|
||||
getProjectFile<T>(path: string, create: (filename: string) => T): T | null;
|
||||
getResourceXmlFile(resourcePath: string): XmlFile | null;
|
||||
getXmlFile(path: string): XmlFile | null;
|
||||
getPropertiesFile(path: string): PropertiesFile | null;
|
||||
getGradleFile(path: string): Promise<GradleFile | null>;
|
||||
setAppName(appName: string): Promise<void>;
|
||||
/**
|
||||
* Update the Android package name. This renames the package in `AndroidManifest.xml`,
|
||||
* the `applicationId` in `app/build.gradle`, and renames the java
|
||||
* package for the `MainActivity.java` file.
|
||||
*
|
||||
* This action will mutate the project on disk!
|
||||
*/
|
||||
setPackageName(packageName: string): Promise<void>;
|
||||
getMainActivityFilename(): string;
|
||||
getMainActivityPath(): Promise<string>;
|
||||
getGradlePluginVersion(): Promise<string | null>;
|
||||
getPackageName(): Promise<string | null | undefined>;
|
||||
setVersionCode(versionCode: number): Promise<void> | undefined;
|
||||
getVersionCode(): Promise<number | null>;
|
||||
incrementVersionCode(): Promise<void>;
|
||||
setVersionName(versionName: string): Promise<void> | undefined;
|
||||
getVersionName(): Promise<string | null>;
|
||||
setVersionNameSuffix(versionNameSuffix: string): Promise<void> | undefined;
|
||||
getVersionNameSuffix(): Promise<string | null>;
|
||||
/**
|
||||
* Add a new file to the given resources directory with the given contents and
|
||||
* given file name
|
||||
**/
|
||||
getResource(resDir: AndroidResDir, file: string, options?: {
|
||||
encoding: 'utf-8' | string;
|
||||
} | null): Promise<string> | Promise<Buffer> | undefined;
|
||||
/**
|
||||
* Add a new file to the given resources directory with the given contents and
|
||||
* given file name
|
||||
**/
|
||||
addResource(resDir: AndroidResDir, file: string, contents: string): Promise<void>;
|
||||
copyFile(src: string, dest: string): Promise<void>;
|
||||
/**
|
||||
* Copy the given source into the given resources directory with the
|
||||
* given file name
|
||||
**/
|
||||
copyToResources(resDir: AndroidResDir, file: string, source: string): Promise<void>;
|
||||
private getAndroidManifestPath;
|
||||
getResourcesPath(): string;
|
||||
getResourcesRoot(): string | null;
|
||||
private getAppRoot;
|
||||
private loadGradle;
|
||||
}
|
||||
//# sourceMappingURL=project.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/android/project.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/android/project.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/android/project.ts"],"names":[],"mappings":";;AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtD,qBAAa,cAAe,SAAQ,eAAe;IACjD,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,cAAc,CAA2B;gBAErC,OAAO,EAAE,aAAa;IAO5B,IAAI;IAUV,cAAc;IAId,iBAAiB;IAIjB,kBAAkB;IAIlB;;;OAGG;IACH,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI;IAkB1E,kBAAkB,CAAC,YAAY,EAAE,MAAM;IAIvC,UAAU,CAAC,IAAI,EAAE,MAAM;IAOvB,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAOxB,aAAa,CAAC,IAAI,EAAE,MAAM;IAU1B,UAAU,CAAC,OAAO,EAAE,MAAM;IAkChC;;;;;;OAMG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM;IA6FxC,uBAAuB;IAejB,mBAAmB;IAQnB,sBAAsB;IAkBtB,cAAc;IAUpB,cAAc,CAAC,WAAW,EAAE,MAAM;IAQ5B,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI9C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,cAAc,CAAC,WAAW,EAAE,MAAM;IAIlC,cAAc,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIxC,oBAAoB,CAAC,iBAAiB,EAAE,MAAM;IAI9C,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI9C;;;QAGI;IACJ,WAAW,CACT,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;QAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,GAAG,IAA4B;IAexE;;;QAGI;IACE,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAiBjE,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBxD;;;QAGI;IACE,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAkBzE,OAAO,CAAC,sBAAsB;IAa9B,gBAAgB,IAAI,MAAM;IAI1B,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAQjC,OAAO,CAAC,UAAU;YASJ,UAAU;CAQzB"}
|
||||
348
node_modules/@trapezedev/project/dist/android/project.js
generated
vendored
Normal file
348
node_modules/@trapezedev/project/dist/android/project.js
generated
vendored
Normal file
|
|
@ -0,0 +1,348 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AndroidProject = void 0;
|
||||
const path_1 = require("path");
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const gradle_file_1 = require("./gradle-file");
|
||||
const xml_1 = require("../xml");
|
||||
const properties_1 = require("../properties");
|
||||
const platform_project_1 = require("../platform-project");
|
||||
const read_src_1 = require("../read-src");
|
||||
const logger_1 = require("../logger");
|
||||
class AndroidProject extends platform_project_1.PlatformProject {
|
||||
constructor(project) {
|
||||
super(project);
|
||||
this.buildGradle = null;
|
||||
this.appBuildGradle = null;
|
||||
const manifestPath = this.getAndroidManifestPath();
|
||||
this.manifest = new xml_1.XmlFile(manifestPath, project.vfs);
|
||||
}
|
||||
async load() {
|
||||
try {
|
||||
await this.manifest.load();
|
||||
this.buildGradle = await this.loadGradle('build.gradle');
|
||||
this.appBuildGradle = await this.loadGradle('app/build.gradle');
|
||||
}
|
||||
catch (e) {
|
||||
this.setError(e);
|
||||
}
|
||||
}
|
||||
getBuildGradle() {
|
||||
return this.buildGradle;
|
||||
}
|
||||
getAppBuildGradle() {
|
||||
return this.appBuildGradle;
|
||||
}
|
||||
getAndroidManifest() {
|
||||
return this.manifest;
|
||||
}
|
||||
/**
|
||||
* Get a project file container for the given path in the project root.
|
||||
* This will return an existing file container or create a new one.
|
||||
*/
|
||||
getProjectFile(path, create) {
|
||||
var _a;
|
||||
const root = (_a = this.project.config.android) === null || _a === void 0 ? void 0 : _a.path;
|
||||
if (!root) {
|
||||
return null;
|
||||
}
|
||||
const filename = (0, path_1.join)(root, path);
|
||||
const existing = this.project.vfs.get(filename);
|
||||
if (existing) {
|
||||
return existing.getData();
|
||||
}
|
||||
return create(filename);
|
||||
}
|
||||
getResourceXmlFile(resourcePath) {
|
||||
return this.getXmlFile((0, path_1.join)(this.getResourcesPath(), resourcePath));
|
||||
}
|
||||
getXmlFile(path) {
|
||||
return this.getProjectFile(path, (filename) => new xml_1.XmlFile(filename, this.project.vfs));
|
||||
}
|
||||
getPropertiesFile(path) {
|
||||
return this.getProjectFile(path, (filename) => new properties_1.PropertiesFile(filename, this.project.vfs));
|
||||
}
|
||||
async getGradleFile(path) {
|
||||
if (path === 'build.gradle') {
|
||||
return this.buildGradle;
|
||||
}
|
||||
else if (path === 'app/build.gradle') {
|
||||
return this.appBuildGradle;
|
||||
}
|
||||
return this.loadGradle(path);
|
||||
}
|
||||
async setAppName(appName) {
|
||||
const application = this.manifest.find('manifest/application');
|
||||
if (!application) {
|
||||
logger_1.Logger.v('android', 'setAppName', `No <application> node found in <manifest>`);
|
||||
return;
|
||||
}
|
||||
const label = application[0].getAttribute('android:label');
|
||||
logger_1.Logger.v('android', 'setAppName', `current app label is ${label}`);
|
||||
if (label) {
|
||||
if (label.indexOf('@string') === 0) {
|
||||
logger_1.Logger.v('android', 'setAppName', 'android:label pointing to strings.xml resource file. Reading values/strings.xml');
|
||||
const stringsFile = await this.getResourceXmlFile('values/strings.xml');
|
||||
if (!stringsFile) {
|
||||
logger_1.Logger.v('android', 'setAppName', 'Unable to load values/strings.xml resource file');
|
||||
return;
|
||||
}
|
||||
await stringsFile.load();
|
||||
const attr = label.replace('@string/', '');
|
||||
// TODO: use the value specified in the @strings attribute
|
||||
logger_1.Logger.v('android', 'setAppName', `Updated values/strings.xml <string name="${attr}"> to <string name="${attr}">${appName}</string>`);
|
||||
stringsFile.replaceFragment(`resources/string[@name="${attr}"]`, `<string name="${attr}">${appName}</string>`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
logger_1.Logger.v('android', 'setAppName', `No android:label on <application> node, setting value directly`);
|
||||
application[0].setAttribute('android:label', appName);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Update the Android package name. This renames the package in `AndroidManifest.xml`,
|
||||
* the `applicationId` in `app/build.gradle`, and renames the java
|
||||
* package for the `MainActivity.java` file.
|
||||
*
|
||||
* This action will mutate the project on disk!
|
||||
*/
|
||||
async setPackageName(packageName) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const sourceDir = (0, path_1.join)(this.getAppRoot(), 'src', 'main', 'java');
|
||||
let hadPackageAttr = false;
|
||||
let oldPackageName = await ((_a = this.manifest
|
||||
.getDocumentElement()) === null || _a === void 0 ? void 0 : _a.getAttribute('package'));
|
||||
if (!oldPackageName) {
|
||||
oldPackageName = await ((_b = this.appBuildGradle) === null || _b === void 0 ? void 0 : _b.getApplicationId());
|
||||
}
|
||||
else {
|
||||
hadPackageAttr = true;
|
||||
}
|
||||
const oldPackageParts = (_c = oldPackageName === null || oldPackageName === void 0 ? void 0 : oldPackageName.split('.')) !== null && _c !== void 0 ? _c : [];
|
||||
logger_1.Logger.v('android', 'setPackageName', 'setting Android package name to', packageName, 'from', oldPackageName);
|
||||
if (packageName === oldPackageName) {
|
||||
return;
|
||||
}
|
||||
const existingPackage = (0, path_1.join)(sourceDir, ...oldPackageParts);
|
||||
if (!(await (0, utils_fs_1.pathExists)(existingPackage))) {
|
||||
throw new Error('Current Java package name and directory structure do not match the <manifest> package attribute. Ensure these match before modifying the project package name');
|
||||
}
|
||||
let activityName = '.MainActivity';
|
||||
if (hadPackageAttr) {
|
||||
(_d = this.manifest.getDocumentElement()) === null || _d === void 0 ? void 0 : _d.setAttribute('package', packageName);
|
||||
activityName = `${packageName}.MainActivity`;
|
||||
}
|
||||
await ((_e = this.appBuildGradle) === null || _e === void 0 ? void 0 : _e.setApplicationId(packageName));
|
||||
await ((_f = this.appBuildGradle) === null || _f === void 0 ? void 0 : _f.setNamespace(packageName));
|
||||
logger_1.Logger.v('android', 'setPackageName', `set manifest package attribute and applicationId to ${packageName}`);
|
||||
this.manifest.setAttrs('manifest/application/activity', {
|
||||
'android:name': activityName
|
||||
});
|
||||
logger_1.Logger.v('android', 'setPackageName', `set <activity android:name="${packageName}.MainActivity"`);
|
||||
if (!this.getAppRoot()) {
|
||||
return;
|
||||
}
|
||||
const newPackageParts = packageName.split('.');
|
||||
const destDir = (0, path_1.join)(sourceDir, ...newPackageParts);
|
||||
const mainActivityName = this.getMainActivityFilename();
|
||||
logger_1.Logger.v('android', 'setPackageName', `Got main activity name ${mainActivityName}`);
|
||||
let activityFile = (0, path_1.join)(sourceDir, ...oldPackageParts, mainActivityName);
|
||||
logger_1.Logger.v('android', 'setPackageName', `Looking for old activity file at ${activityFile}`);
|
||||
// Make the new directory tree and any missing parents
|
||||
await (0, utils_fs_1.mkdirp)(destDir);
|
||||
// Move the old activity file over
|
||||
await (0, utils_fs_1.move)(activityFile, (0, path_1.join)(destDir, 'MainActivity.java'));
|
||||
// Try to delete the empty directories we left behind, starting
|
||||
// from the deepest
|
||||
let sourceDirLeaf = (0, path_1.join)(sourceDir, ...oldPackageParts);
|
||||
logger_1.Logger.v('android', 'setPackageName', `removing old source dirs for old package (${sourceDirLeaf})`);
|
||||
for (const _ of oldPackageParts) {
|
||||
try {
|
||||
await (0, utils_fs_1.rmdir)(sourceDirLeaf);
|
||||
}
|
||||
catch (ex) {
|
||||
// This will fail if directory is not empty, that's fine, we won't delete those
|
||||
}
|
||||
sourceDirLeaf = (0, path_1.join)(sourceDirLeaf, '..');
|
||||
}
|
||||
// Rename the package in the main source file
|
||||
activityFile = (0, path_1.join)(sourceDir, ...newPackageParts, this.getMainActivityFilename());
|
||||
if (await (0, utils_fs_1.pathExists)(activityFile)) {
|
||||
logger_1.Logger.v('android', 'setPackageName', `renaming package in source for activity file ${activityFile}`);
|
||||
const activitySource = await (0, utils_fs_1.readFile)(activityFile, {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
const newActivitySource = activitySource === null || activitySource === void 0 ? void 0 : activitySource.replace(/(package\s+)[^;]+/, `$1${packageName}`);
|
||||
await (0, utils_fs_1.writeFile)(activityFile, newActivitySource);
|
||||
}
|
||||
}
|
||||
getMainActivityFilename() {
|
||||
const activity = this.manifest.find('manifest/application/activity');
|
||||
if (!activity) {
|
||||
return 'MainActivity.java';
|
||||
}
|
||||
const activityName = activity[0].getAttribute('android:name');
|
||||
const parts = activityName === null || activityName === void 0 ? void 0 : activityName.split('.');
|
||||
if (!parts) {
|
||||
return '';
|
||||
}
|
||||
return `${parts[parts.length - 1]}.java`;
|
||||
}
|
||||
async getMainActivityPath() {
|
||||
var _a, _b;
|
||||
const packageName = await ((_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.getApplicationId());
|
||||
const activityName = this.getMainActivityFilename();
|
||||
const packageParts = (_b = packageName === null || packageName === void 0 ? void 0 : packageName.split('.')) !== null && _b !== void 0 ? _b : [];
|
||||
return (0, path_1.join)('app', 'src', 'main', 'java', ...packageParts, activityName);
|
||||
}
|
||||
async getGradlePluginVersion() {
|
||||
var _a, _b, _c, _d;
|
||||
await ((_a = this.buildGradle) === null || _a === void 0 ? void 0 : _a.parse());
|
||||
const found = (_b = this.buildGradle) === null || _b === void 0 ? void 0 : _b.find({
|
||||
buildscript: {
|
||||
dependencies: {
|
||||
classpath: {}
|
||||
}
|
||||
}
|
||||
});
|
||||
const sources = (found !== null && found !== void 0 ? found : []).map(f => { var _a, _b; return (_b = (_a = this.buildGradle) === null || _a === void 0 ? void 0 : _a.getSource(f.node)) !== null && _b !== void 0 ? _b : ''; });
|
||||
const gradleLine = sources.find(s => s.indexOf('com.android.tools.build:gradle:'));
|
||||
return (_d = (_c = gradleLine === null || gradleLine === void 0 ? void 0 : gradleLine.match(/:([\d.]+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : null;
|
||||
}
|
||||
async getPackageName() {
|
||||
var _a, _b;
|
||||
const namespace = await ((_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.getNamespace());
|
||||
if (namespace) {
|
||||
return namespace;
|
||||
}
|
||||
return (_b = this.manifest.getDocumentElement()) === null || _b === void 0 ? void 0 : _b.getAttribute('package');
|
||||
}
|
||||
setVersionCode(versionCode) {
|
||||
var _a;
|
||||
if (versionCode === '') {
|
||||
versionCode = 1;
|
||||
}
|
||||
return (_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.setVersionCode(typeof versionCode === 'number' ? versionCode : parseInt(versionCode, 10));
|
||||
}
|
||||
async getVersionCode() {
|
||||
var _a, _b;
|
||||
return (_b = (await ((_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.getVersionCode()))) !== null && _b !== void 0 ? _b : null;
|
||||
}
|
||||
incrementVersionCode() {
|
||||
var _a, _b;
|
||||
return (_b = (_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.incrementVersionCode()) !== null && _b !== void 0 ? _b : Promise.resolve();
|
||||
}
|
||||
setVersionName(versionName) {
|
||||
var _a;
|
||||
return (_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.setVersionName(versionName);
|
||||
}
|
||||
getVersionName() {
|
||||
var _a, _b;
|
||||
return (_b = (_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.getVersionName()) !== null && _b !== void 0 ? _b : Promise.resolve(null);
|
||||
}
|
||||
setVersionNameSuffix(versionNameSuffix) {
|
||||
var _a;
|
||||
return (_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.setVersionNameSuffix(versionNameSuffix);
|
||||
}
|
||||
getVersionNameSuffix() {
|
||||
var _a, _b;
|
||||
return (_b = (_a = this.appBuildGradle) === null || _a === void 0 ? void 0 : _a.getVersionNameSuffix()) !== null && _b !== void 0 ? _b : Promise.resolve(null);
|
||||
}
|
||||
/**
|
||||
* Add a new file to the given resources directory with the given contents and
|
||||
* given file name
|
||||
**/
|
||||
getResource(resDir, file, options = { encoding: 'utf-8' }) {
|
||||
const root = this.getResourcesRoot();
|
||||
if (!root) {
|
||||
return;
|
||||
}
|
||||
const dir = (0, path_1.join)(root, resDir);
|
||||
if (!options) {
|
||||
return (0, utils_fs_1.readFile)((0, path_1.join)(dir, file));
|
||||
}
|
||||
return (0, utils_fs_1.readFile)((0, path_1.join)(dir, file), options);
|
||||
}
|
||||
/**
|
||||
* Add a new file to the given resources directory with the given contents and
|
||||
* given file name
|
||||
**/
|
||||
async addResource(resDir, file, contents) {
|
||||
const root = this.getResourcesRoot();
|
||||
if (!root) {
|
||||
return;
|
||||
}
|
||||
const dir = (0, path_1.join)(root, resDir);
|
||||
logger_1.Logger.v(`android`, 'addResource', `add res file ${file} to ${resDir}`);
|
||||
if (!(await (0, utils_fs_1.pathExists)(dir))) {
|
||||
await (0, utils_fs_1.mkdir)(dir);
|
||||
}
|
||||
return (0, utils_fs_1.writeFile)((0, path_1.join)(dir, file), contents);
|
||||
}
|
||||
async copyFile(src, dest) {
|
||||
var _a, _b, _c;
|
||||
if (!((_c = (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.android) === null || _c === void 0 ? void 0 : _c.path)) {
|
||||
return Promise.reject();
|
||||
}
|
||||
const destPath = (0, path_1.join)(this.project.config.android.path, dest);
|
||||
logger_1.Logger.v(`android`, `copyFile`, `copying ${src} to ${destPath}`);
|
||||
if (/^(https?:\/\/)/.test(src)) {
|
||||
const res = await fetch(src);
|
||||
return (0, utils_fs_1.writeFile)(destPath, Buffer.from(await res.arrayBuffer()));
|
||||
}
|
||||
const srcPath = (0, path_1.join)(this.project.config.android.path, src);
|
||||
return (0, utils_fs_1.copy)(srcPath, destPath);
|
||||
}
|
||||
/**
|
||||
* Copy the given source into the given resources directory with the
|
||||
* given file name
|
||||
**/
|
||||
async copyToResources(resDir, file, source) {
|
||||
const root = this.getResourcesRoot();
|
||||
if (!root) {
|
||||
return;
|
||||
}
|
||||
const dir = (0, path_1.join)(root, resDir);
|
||||
if (!(await (0, utils_fs_1.pathExists)(dir))) {
|
||||
await (0, utils_fs_1.mkdir)(dir);
|
||||
}
|
||||
logger_1.Logger.v(`android`, `copyToResources`, `copying ${file} to Android resources at ${(0, path_1.join)(dir, file)}`);
|
||||
const sourceData = await (0, read_src_1.readSource)(source);
|
||||
return (0, utils_fs_1.writeFile)((0, path_1.join)(dir, file), sourceData);
|
||||
}
|
||||
getAndroidManifestPath() {
|
||||
var _a, _b;
|
||||
if (!((_a = this.project.config.android) === null || _a === void 0 ? void 0 : _a.path)) {
|
||||
return null;
|
||||
}
|
||||
return (0, path_1.join)((_b = this.project.config.android) === null || _b === void 0 ? void 0 : _b.path, 'app', 'src', 'main', 'AndroidManifest.xml');
|
||||
}
|
||||
getResourcesPath() {
|
||||
return (0, path_1.join)('app', 'src', 'main', 'res');
|
||||
}
|
||||
getResourcesRoot() {
|
||||
var _a, _b;
|
||||
if (!((_a = this.project.config.android) === null || _a === void 0 ? void 0 : _a.path)) {
|
||||
return null;
|
||||
}
|
||||
return (0, path_1.join)((_b = this.project.config.android) === null || _b === void 0 ? void 0 : _b.path, this.getResourcesPath());
|
||||
}
|
||||
getAppRoot() {
|
||||
var _a, _b;
|
||||
if (!((_a = this.project.config.android) === null || _a === void 0 ? void 0 : _a.path)) {
|
||||
return null;
|
||||
}
|
||||
// TODO: Don't hard-code app
|
||||
return (0, path_1.join)((_b = this.project.config.android) === null || _b === void 0 ? void 0 : _b.path, 'app');
|
||||
}
|
||||
async loadGradle(path) {
|
||||
var _a, _b;
|
||||
if (!((_a = this.project.config.android) === null || _a === void 0 ? void 0 : _a.path)) {
|
||||
return null;
|
||||
}
|
||||
const filename = (0, path_1.join)((_b = this.project.config.android) === null || _b === void 0 ? void 0 : _b.path, path);
|
||||
return new gradle_file_1.GradleFile(filename, this.project.vfs);
|
||||
}
|
||||
}
|
||||
exports.AndroidProject = AndroidProject;
|
||||
//# sourceMappingURL=project.js.map
|
||||
1
node_modules/@trapezedev/project/dist/android/project.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/android/project.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
node_modules/@trapezedev/project/dist/config.d.ts
generated
vendored
Normal file
12
node_modules/@trapezedev/project/dist/config.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export interface MobileProjectConfig {
|
||||
projectRoot?: string;
|
||||
ios?: {
|
||||
path: string;
|
||||
};
|
||||
android?: {
|
||||
path: string;
|
||||
};
|
||||
enableAndroid?: boolean;
|
||||
enableIos?: boolean;
|
||||
}
|
||||
//# sourceMappingURL=config.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/config.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/config.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAA;IACD,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
||||
3
node_modules/@trapezedev/project/dist/config.js
generated
vendored
Normal file
3
node_modules/@trapezedev/project/dist/config.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=config.js.map
|
||||
1
node_modules/@trapezedev/project/dist/config.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/config.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":""}
|
||||
50
node_modules/@trapezedev/project/dist/definitions.d.ts
generated
vendored
Normal file
50
node_modules/@trapezedev/project/dist/definitions.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/**
|
||||
* ios definitions
|
||||
*/
|
||||
export interface IosPbxProject {
|
||||
writeSync: () => string;
|
||||
[key: string]: any;
|
||||
}
|
||||
export interface IosEntitlements {
|
||||
[key: string]: any;
|
||||
}
|
||||
export interface IosBuildSettings {
|
||||
[key: string]: any;
|
||||
}
|
||||
export interface IosTarget {
|
||||
id: string;
|
||||
name: string;
|
||||
productName: string;
|
||||
productType: string;
|
||||
buildConfigurations: IosTargetBuildConfiguration[];
|
||||
[key: string]: any;
|
||||
}
|
||||
export interface IosTargetBuildConfiguration {
|
||||
name: string;
|
||||
buildSettings: IosBuildSettings;
|
||||
}
|
||||
export type IosFramework = string;
|
||||
export interface IosFrameworkOpts {
|
||||
customFramework?: boolean;
|
||||
/**
|
||||
* Default: true
|
||||
*/
|
||||
link?: boolean;
|
||||
/**
|
||||
* Whether to embed the framework. Default: false
|
||||
*/
|
||||
embed?: boolean;
|
||||
}
|
||||
export type IosBuildName = 'Debug' | 'Release' | string;
|
||||
export type IosTargetName = string;
|
||||
export type IosProjectName = string;
|
||||
/**
|
||||
* Android definitions
|
||||
*/
|
||||
export type AndroidResDir = 'anim' | 'animator' | 'color' | 'drawable' | 'font' | 'interpolator' | 'layout' | 'menu' | 'mipmap' | 'navigation' | 'raw' | 'transition' | 'values' | 'xml' | string;
|
||||
export declare const enum AndroidGradleInjectType {
|
||||
Infer = "infer",
|
||||
Method = "method",
|
||||
Variable = "variable"
|
||||
}
|
||||
//# sourceMappingURL=definitions.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/definitions.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/definitions.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;IAExB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,2BAA2B,EAAE,CAAC;IACnD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,MAAM,WAAW,gBAAgB;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AACnC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC;;GAEG;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,KAAK,GAAG,YAAY,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AAElM,0BAAkB,uBAAuB;IACvC,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB"}
|
||||
3
node_modules/@trapezedev/project/dist/definitions.js
generated
vendored
Normal file
3
node_modules/@trapezedev/project/dist/definitions.js
generated
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=definitions.js.map
|
||||
1
node_modules/@trapezedev/project/dist/definitions.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/definitions.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../src/definitions.ts"],"names":[],"mappings":""}
|
||||
7
node_modules/@trapezedev/project/dist/frameworks/capacitor.d.ts
generated
vendored
Normal file
7
node_modules/@trapezedev/project/dist/frameworks/capacitor.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class CapacitorFramework extends Framework {
|
||||
constructor();
|
||||
static getFramework(project: MobileProject): Promise<CapacitorFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=capacitor.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/capacitor.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/capacitor.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"capacitor.d.ts","sourceRoot":"","sources":["../../src/frameworks/capacitor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,kBAAmB,SAAQ,SAAS;;WAKlC,YAAY,CAAC,OAAO,EAAE,aAAa;CAajD"}
|
||||
23
node_modules/@trapezedev/project/dist/frameworks/capacitor.js
generated
vendored
Normal file
23
node_modules/@trapezedev/project/dist/frameworks/capacitor.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CapacitorFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const _1 = require(".");
|
||||
class CapacitorFramework extends _1.Framework {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static async getFramework(project) {
|
||||
if (!project.config.projectRoot) {
|
||||
return null;
|
||||
}
|
||||
const paths = ['capacitor.config.ts', 'capacitor.config.js', 'capacitor.config.json'];
|
||||
if ((await Promise.all(paths.map(p => (0, utils_fs_1.pathExists)((0, path_1.join)(project.config.projectRoot, p))))).some(s => s)) {
|
||||
return new CapacitorFramework();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.CapacitorFramework = CapacitorFramework;
|
||||
//# sourceMappingURL=capacitor.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/capacitor.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/capacitor.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"capacitor.js","sourceRoot":"","sources":["../../src/frameworks/capacitor.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,+BAA4B;AAC5B,wBAA8B;AAG9B,MAAa,kBAAmB,SAAQ,YAAS;IAC/C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,IAAI,CAAC;SACb;QAED,MAAM,KAAK,GAAG,CAAC,qBAAqB,EAAE,qBAAqB,EAAE,uBAAuB,CAAC,CAAC;QAEtF,IAAI,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YACtG,OAAO,IAAI,kBAAkB,EAAE,CAAC;SACjC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlBD,gDAkBC"}
|
||||
7
node_modules/@trapezedev/project/dist/frameworks/cordova.d.ts
generated
vendored
Normal file
7
node_modules/@trapezedev/project/dist/frameworks/cordova.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class CordovaFramework extends Framework {
|
||||
constructor();
|
||||
static getFramework(project: MobileProject): Promise<CordovaFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=cordova.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/cordova.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/cordova.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"cordova.d.ts","sourceRoot":"","sources":["../../src/frameworks/cordova.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,gBAAiB,SAAQ,SAAS;;WAKhC,YAAY,CAAC,OAAO,EAAE,aAAa;CAajD"}
|
||||
23
node_modules/@trapezedev/project/dist/frameworks/cordova.js
generated
vendored
Normal file
23
node_modules/@trapezedev/project/dist/frameworks/cordova.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CordovaFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const _1 = require(".");
|
||||
class CordovaFramework extends _1.Framework {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static async getFramework(project) {
|
||||
if (!project.config.projectRoot) {
|
||||
return null;
|
||||
}
|
||||
const paths = ['config.xml'];
|
||||
if ((await Promise.all(paths.map(p => (0, utils_fs_1.pathExists)((0, path_1.join)(project.config.projectRoot, p))))).some(s => s)) {
|
||||
return new CordovaFramework();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
exports.CordovaFramework = CordovaFramework;
|
||||
//# sourceMappingURL=cordova.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/cordova.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/cordova.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"cordova.js","sourceRoot":"","sources":["../../src/frameworks/cordova.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,+BAA4B;AAC5B,wBAA8B;AAG9B,MAAa,gBAAiB,SAAQ,YAAS;IAC7C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,IAAI,CAAC;SACb;QAED,MAAM,KAAK,GAAG,CAAC,YAAY,CAAC,CAAC;QAE7B,IAAI,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;YACtG,OAAO,IAAI,gBAAgB,EAAE,CAAC;SAC/B;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAlBD,4CAkBC"}
|
||||
7
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.d.ts
generated
vendored
Normal file
7
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class DotNetMauiFramework extends Framework {
|
||||
constructor();
|
||||
static getFramework(project: MobileProject): Promise<DotNetMauiFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=dotnet-maui.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"dotnet-maui.d.ts","sourceRoot":"","sources":["../../src/frameworks/dotnet-maui.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,mBAAoB,SAAQ,SAAS;;WAKnC,YAAY,CAAC,OAAO,EAAE,aAAa;CAWjD"}
|
||||
22
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.js
generated
vendored
Normal file
22
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DotNetMauiFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const _1 = require(".");
|
||||
class DotNetMauiFramework extends _1.Framework {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static async getFramework(project) {
|
||||
if (!project.config.projectRoot) {
|
||||
return null;
|
||||
}
|
||||
if (!(await (0, utils_fs_1.pathExists)((0, path_1.join)(project.config.projectRoot, 'App.xaml')))) {
|
||||
return null;
|
||||
}
|
||||
return new DotNetMauiFramework();
|
||||
}
|
||||
}
|
||||
exports.DotNetMauiFramework = DotNetMauiFramework;
|
||||
//# sourceMappingURL=dotnet-maui.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/dotnet-maui.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"dotnet-maui.js","sourceRoot":"","sources":["../../src/frameworks/dotnet-maui.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,+BAA4B;AAE5B,wBAA8B;AAG9B,MAAa,mBAAoB,SAAQ,YAAS;IAChD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,IAAI,CAAC;SACb;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE;YACrE,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,mBAAmB,EAAE,CAAC;IACnC,CAAC;CACF;AAhBD,kDAgBC"}
|
||||
7
node_modules/@trapezedev/project/dist/frameworks/flutter.d.ts
generated
vendored
Normal file
7
node_modules/@trapezedev/project/dist/frameworks/flutter.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class FlutterFramework extends Framework {
|
||||
constructor();
|
||||
static getFramework(project: MobileProject): Promise<FlutterFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=flutter.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/flutter.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/flutter.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"flutter.d.ts","sourceRoot":"","sources":["../../src/frameworks/flutter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,gBAAiB,SAAQ,SAAS;;WAKhC,YAAY,CAAC,OAAO,EAAE,aAAa;CAWjD"}
|
||||
22
node_modules/@trapezedev/project/dist/frameworks/flutter.js
generated
vendored
Normal file
22
node_modules/@trapezedev/project/dist/frameworks/flutter.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FlutterFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const _1 = require(".");
|
||||
class FlutterFramework extends _1.Framework {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static async getFramework(project) {
|
||||
if (!project.config.projectRoot) {
|
||||
return false;
|
||||
}
|
||||
if (!(await (0, utils_fs_1.pathExists)((0, path_1.join)(project.config.projectRoot, 'pubspec.yaml')))) {
|
||||
return null;
|
||||
}
|
||||
return new FlutterFramework();
|
||||
}
|
||||
}
|
||||
exports.FlutterFramework = FlutterFramework;
|
||||
//# sourceMappingURL=flutter.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/flutter.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/flutter.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"flutter.js","sourceRoot":"","sources":["../../src/frameworks/flutter.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,+BAA4B;AAE5B,wBAA8B;AAG9B,MAAa,gBAAiB,SAAQ,YAAS;IAC7C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,KAAK,CAAC;SACd;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE;YACzE,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAChC,CAAC;CACF;AAhBD,4CAgBC"}
|
||||
5
node_modules/@trapezedev/project/dist/frameworks/index.d.ts
generated
vendored
Normal file
5
node_modules/@trapezedev/project/dist/frameworks/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { MobileProject } from "../project";
|
||||
export declare class Framework {
|
||||
static getFramework(project: MobileProject): Promise<Framework | null>;
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/frameworks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,SAAS;IACpB,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;CAGvE"}
|
||||
10
node_modules/@trapezedev/project/dist/frameworks/index.js
generated
vendored
Normal file
10
node_modules/@trapezedev/project/dist/frameworks/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Framework = void 0;
|
||||
class Framework {
|
||||
static getFramework(project) {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
exports.Framework = Framework;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/index.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/frameworks/index.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAS;IACpB,MAAM,CAAC,YAAY,CAAC,OAAsB;QACxC,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAJD,8BAIC"}
|
||||
7
node_modules/@trapezedev/project/dist/frameworks/native-android.d.ts
generated
vendored
Normal file
7
node_modules/@trapezedev/project/dist/frameworks/native-android.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class NativeAndroidFramework extends Framework {
|
||||
constructor();
|
||||
static getFramework(project: MobileProject): Promise<NativeAndroidFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=native-android.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/native-android.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/native-android.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"native-android.d.ts","sourceRoot":"","sources":["../../src/frameworks/native-android.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,sBAAuB,SAAQ,SAAS;;WAKtC,YAAY,CAAC,OAAO,EAAE,aAAa;CAWjD"}
|
||||
22
node_modules/@trapezedev/project/dist/frameworks/native-android.js
generated
vendored
Normal file
22
node_modules/@trapezedev/project/dist/frameworks/native-android.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NativeAndroidFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const _1 = require(".");
|
||||
class NativeAndroidFramework extends _1.Framework {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static async getFramework(project) {
|
||||
if (!project.config.projectRoot) {
|
||||
return false;
|
||||
}
|
||||
if (!(await (0, utils_fs_1.pathExists)((0, path_1.join)(project.config.projectRoot, 'build.gradle')))) {
|
||||
return null;
|
||||
}
|
||||
return new NativeAndroidFramework();
|
||||
}
|
||||
}
|
||||
exports.NativeAndroidFramework = NativeAndroidFramework;
|
||||
//# sourceMappingURL=native-android.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/native-android.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/native-android.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"native-android.js","sourceRoot":"","sources":["../../src/frameworks/native-android.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,+BAA4B;AAE5B,wBAA8B;AAG9B,MAAa,sBAAuB,SAAQ,YAAS;IACnD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,KAAK,CAAC;SACd;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE;YACzE,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,sBAAsB,EAAE,CAAC;IACtC,CAAC;CACF;AAhBD,wDAgBC"}
|
||||
7
node_modules/@trapezedev/project/dist/frameworks/native-ios.d.ts
generated
vendored
Normal file
7
node_modules/@trapezedev/project/dist/frameworks/native-ios.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class NativeIosFramework extends Framework {
|
||||
constructor();
|
||||
static getFramework(project: MobileProject): Promise<NativeIosFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=native-ios.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/native-ios.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/native-ios.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"native-ios.d.ts","sourceRoot":"","sources":["../../src/frameworks/native-ios.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,kBAAmB,SAAQ,SAAS;;WAKlC,YAAY,CAAC,OAAO,EAAE,aAAa;CAajD"}
|
||||
22
node_modules/@trapezedev/project/dist/frameworks/native-ios.js
generated
vendored
Normal file
22
node_modules/@trapezedev/project/dist/frameworks/native-ios.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NativeIosFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const _1 = require(".");
|
||||
class NativeIosFramework extends _1.Framework {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static async getFramework(project) {
|
||||
if (!project.config.projectRoot) {
|
||||
return false;
|
||||
}
|
||||
const files = await (0, utils_fs_1.readdir)(project.config.projectRoot);
|
||||
if (!(files.some(f => f.indexOf('.xcodeproj') >= 0))) {
|
||||
return null;
|
||||
}
|
||||
return new NativeIosFramework();
|
||||
}
|
||||
}
|
||||
exports.NativeIosFramework = NativeIosFramework;
|
||||
//# sourceMappingURL=native-ios.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/native-ios.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/native-ios.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"native-ios.js","sourceRoot":"","sources":["../../src/frameworks/native-ios.ts"],"names":[],"mappings":";;;AAAA,8CAAsD;AAGtD,wBAA8B;AAG9B,MAAa,kBAAmB,SAAQ,YAAS;IAC/C;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,KAAK,CAAC;SACd;QAED,MAAM,KAAK,GAAG,MAAM,IAAA,kBAAO,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAExD,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;YACpD,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,kBAAkB,EAAE,CAAC;IAClC,CAAC;CACF;AAlBD,gDAkBC"}
|
||||
7
node_modules/@trapezedev/project/dist/frameworks/nativescript.d.ts
generated
vendored
Normal file
7
node_modules/@trapezedev/project/dist/frameworks/nativescript.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class NativeScriptFramework extends Framework {
|
||||
constructor();
|
||||
static getFramework(project: MobileProject): Promise<NativeScriptFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=nativescript.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/nativescript.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/nativescript.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"nativescript.d.ts","sourceRoot":"","sources":["../../src/frameworks/nativescript.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,qBAAsB,SAAQ,SAAS;;WAKrC,YAAY,CAAC,OAAO,EAAE,aAAa;CAWjD"}
|
||||
22
node_modules/@trapezedev/project/dist/frameworks/nativescript.js
generated
vendored
Normal file
22
node_modules/@trapezedev/project/dist/frameworks/nativescript.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NativeScriptFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const _1 = require(".");
|
||||
class NativeScriptFramework extends _1.Framework {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
static async getFramework(project) {
|
||||
if (!project.config.projectRoot) {
|
||||
return false;
|
||||
}
|
||||
if (!(await (0, utils_fs_1.pathExists)((0, path_1.join)(project.config.projectRoot, 'nativescript.config.ts')))) {
|
||||
return null;
|
||||
}
|
||||
return new NativeScriptFramework();
|
||||
}
|
||||
}
|
||||
exports.NativeScriptFramework = NativeScriptFramework;
|
||||
//# sourceMappingURL=nativescript.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/nativescript.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/nativescript.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"nativescript.js","sourceRoot":"","sources":["../../src/frameworks/nativescript.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,+BAA4B;AAE5B,wBAA8B;AAG9B,MAAa,qBAAsB,SAAQ,YAAS;IAClD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,KAAK,CAAC;SACd;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAC,CAAC,EAAE;YACnF,OAAO,IAAI,CAAC;SACb;QAED,OAAO,IAAI,qBAAqB,EAAE,CAAC;IACrC,CAAC;CACF;AAhBD,sDAgBC"}
|
||||
8
node_modules/@trapezedev/project/dist/frameworks/react-native.d.ts
generated
vendored
Normal file
8
node_modules/@trapezedev/project/dist/frameworks/react-native.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { Framework } from ".";
|
||||
import { MobileProject } from "../project";
|
||||
export declare class ReactNativeFramework extends Framework {
|
||||
isExpo: boolean;
|
||||
constructor(isExpo: boolean);
|
||||
static getFramework(project: MobileProject): Promise<ReactNativeFramework | null>;
|
||||
}
|
||||
//# sourceMappingURL=react-native.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/react-native.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/react-native.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"react-native.d.ts","sourceRoot":"","sources":["../../src/frameworks/react-native.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qBAAa,oBAAqB,SAAQ,SAAS;IAC9B,MAAM,EAAE,OAAO;gBAAf,MAAM,EAAE,OAAO;WAIrB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;CA0BxF"}
|
||||
35
node_modules/@trapezedev/project/dist/frameworks/react-native.js
generated
vendored
Normal file
35
node_modules/@trapezedev/project/dist/frameworks/react-native.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ReactNativeFramework = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const _1 = require(".");
|
||||
class ReactNativeFramework extends _1.Framework {
|
||||
constructor(isExpo) {
|
||||
super();
|
||||
this.isExpo = isExpo;
|
||||
}
|
||||
static async getFramework(project) {
|
||||
var _a;
|
||||
if (!project.config.projectRoot) {
|
||||
return null;
|
||||
}
|
||||
if (!(await (0, utils_fs_1.pathExists)((0, path_1.join)(project.config.projectRoot, 'app.json')))) {
|
||||
return null;
|
||||
}
|
||||
const packageJson = (_a = (await (0, utils_fs_1.readJSON)((0, path_1.join)(project.config.projectRoot, 'package.json')))) !== null && _a !== void 0 ? _a : {};
|
||||
const deps = {
|
||||
...packageJson.dependencies,
|
||||
...packageJson.devDependencies
|
||||
};
|
||||
if (!('react-native' in deps)) {
|
||||
return null;
|
||||
}
|
||||
if ('expo' in deps) {
|
||||
return new ReactNativeFramework(true);
|
||||
}
|
||||
return new ReactNativeFramework(false);
|
||||
}
|
||||
}
|
||||
exports.ReactNativeFramework = ReactNativeFramework;
|
||||
//# sourceMappingURL=react-native.js.map
|
||||
1
node_modules/@trapezedev/project/dist/frameworks/react-native.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/frameworks/react-native.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"react-native.js","sourceRoot":"","sources":["../../src/frameworks/react-native.ts"],"names":[],"mappings":";;;AAAA,8CAAuD;AACvD,+BAA4B;AAE5B,wBAA8B;AAG9B,MAAa,oBAAqB,SAAQ,YAAS;IACjD,YAAmB,MAAe;QAChC,KAAK,EAAE,CAAC;QADS,WAAM,GAAN,MAAM,CAAS;IAElC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,OAAsB;;QAC9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE;YAC/B,OAAO,IAAI,CAAC;SACb;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE;YACrE,OAAO,IAAI,CAAC;SACb;QAED,MAAM,WAAW,GAAG,MAAA,CAAC,MAAM,IAAA,mBAAQ,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC;QAE7F,MAAM,IAAI,GAAG;YACX,GAAG,WAAW,CAAC,YAAY;YAC3B,GAAG,WAAW,CAAC,eAAe;SAC/B,CAAC;QAEF,IAAI,CAAC,CAAC,cAAc,IAAI,IAAI,CAAC,EAAE;YAC7B,OAAO,IAAI,CAAC;SACb;QAED,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,OAAO,IAAI,oBAAoB,CAAC,IAAI,CAAC,CAAC;SACvC;QAED,OAAO,IAAI,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACF;AA/BD,oDA+BC"}
|
||||
14
node_modules/@trapezedev/project/dist/index.d.ts
generated
vendored
Normal file
14
node_modules/@trapezedev/project/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
export * from './definitions';
|
||||
export * from './frameworks';
|
||||
export * from './config';
|
||||
export * from './logger';
|
||||
export * from './project';
|
||||
export * from './xml';
|
||||
export * from './json';
|
||||
export * from './plist';
|
||||
export * from './properties';
|
||||
export * from './strings';
|
||||
export * from './xcconfig';
|
||||
export * from './vfs';
|
||||
export * from './util/plist';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/index.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/index.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC"}
|
||||
30
node_modules/@trapezedev/project/dist/index.js
generated
vendored
Normal file
30
node_modules/@trapezedev/project/dist/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./definitions"), exports);
|
||||
__exportStar(require("./frameworks"), exports);
|
||||
__exportStar(require("./config"), exports);
|
||||
__exportStar(require("./logger"), exports);
|
||||
__exportStar(require("./project"), exports);
|
||||
__exportStar(require("./xml"), exports);
|
||||
__exportStar(require("./json"), exports);
|
||||
__exportStar(require("./plist"), exports);
|
||||
__exportStar(require("./properties"), exports);
|
||||
__exportStar(require("./strings"), exports);
|
||||
__exportStar(require("./xcconfig"), exports);
|
||||
__exportStar(require("./vfs"), exports);
|
||||
__exportStar(require("./util/plist"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@trapezedev/project/dist/index.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/index.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,+CAA6B;AAC7B,2CAAyB;AACzB,2CAAyB;AACzB,4CAA0B;AAC1B,wCAAsB;AACtB,yCAAuB;AACvB,0CAAwB;AACxB,+CAA6B;AAC7B,4CAA0B;AAC1B,6CAA2B;AAC3B,wCAAsB;AACtB,+CAA6B"}
|
||||
184
node_modules/@trapezedev/project/dist/ios/project.d.ts
generated
vendored
Normal file
184
node_modules/@trapezedev/project/dist/ios/project.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
import plist from 'plist';
|
||||
import { MobileProject } from "../project";
|
||||
import { IosPbxProject, IosEntitlements, IosFramework, IosBuildName, IosTarget, IosTargetName, IosTargetBuildConfiguration, IosFrameworkOpts } from '../definitions';
|
||||
import { XmlFile } from '../xml';
|
||||
import { PlistFile } from '../plist';
|
||||
import { PlatformProject } from '../platform-project';
|
||||
/**
|
||||
* An instance of an IosProject in a mobile project
|
||||
*/
|
||||
export declare class IosProject extends PlatformProject {
|
||||
private pbxProject;
|
||||
constructor(project: MobileProject);
|
||||
private log;
|
||||
load(): Promise<void>;
|
||||
/**
|
||||
* Get a project file container for the given path in the project root.
|
||||
* This will return an existing file container or create a new one.
|
||||
*/
|
||||
getProjectFile<T>(path: string, create: (filename: string) => T): T | null;
|
||||
getXmlFile(path: string): Promise<XmlFile | null>;
|
||||
getPlistFile(path: string): Promise<PlistFile | null>;
|
||||
getPbxProject(): IosPbxProject | null;
|
||||
/**
|
||||
* Get all targets in the project
|
||||
*/
|
||||
getTargets(): IosTarget[] | null;
|
||||
/**
|
||||
* Get the target with the given name
|
||||
*/
|
||||
getTarget(name: string): IosTarget | null;
|
||||
/**
|
||||
* Get the main app target in the project.
|
||||
*/
|
||||
getAppTarget(): IosTarget | null;
|
||||
/**
|
||||
* Get the name of the main app target in the project
|
||||
*/
|
||||
getAppTargetName(): string | null;
|
||||
/**
|
||||
* Get the bundle id (aka the PRODUCT_BUNDLE_IDENTIFIER) for the given target and build. If build is null
|
||||
* the value for all build targets (Debug and Release) will be set to the same value. If target is null
|
||||
* the default app target will be used.
|
||||
*/
|
||||
getBundleId(targetName: IosTargetName | null, buildName?: string): string | null;
|
||||
/**
|
||||
* Set the bundle id (aka the PRODUCT_BUNDLE_IDENTIFIER) for the given target and build. If build is null
|
||||
* the value for all build targets (Debug and Release) will be set to the same value. If target is null
|
||||
* the default app target will be used.
|
||||
*/
|
||||
setBundleId(targetName: IosTargetName | null, buildName: IosBuildName | null, bundleId: string): void;
|
||||
/**
|
||||
* Get the build configurations for a given target.
|
||||
*/
|
||||
getBuildConfigurations(targetName: IosTargetName | null): IosTargetBuildConfiguration[];
|
||||
/**
|
||||
* Get the build configuration names (ex: Debug, Release) for a given target.
|
||||
*/
|
||||
getBuildConfigurationNames(targetName: IosTargetName | null): string[];
|
||||
/**
|
||||
* Set the product name for the given target. If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
setProductName(targetName: IosTargetName | null, productName: string): void;
|
||||
/**
|
||||
* Get the product name for the given target. If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
getProductName(targetName?: IosTargetName | undefined): string | null;
|
||||
/**
|
||||
* Set the build number (aka the `CURRENT_PROJECT_VERSION`) for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
setBuild(targetName: IosTargetName | null, buildName: IosBuildName | null, buildNumber: number | string | null): Promise<void>;
|
||||
/**
|
||||
* Get the build number (aka the `CURRENT_PROJECT_VERSION`) for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
getBuild(targetName: IosTargetName | null, buildName?: IosBuildName | null | undefined): Promise<any>;
|
||||
/**
|
||||
* Increment the build number for the given build name. If the build
|
||||
* name is not specified, both Debug and Release builds are incremented.
|
||||
*/
|
||||
incrementBuild(targetName?: IosTargetName | undefined | null, buildName?: IosBuildName | null | undefined): Promise<void>;
|
||||
/**
|
||||
* Set the version (aka `MARKETING_VERSION`) for the given build (Debug/Release/etc)
|
||||
*/
|
||||
setVersion(targetName: IosTargetName | null, buildName: IosBuildName | null, version: string): Promise<void>;
|
||||
/**
|
||||
* Get the version (aka the `MARKETING_VERSION`) for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
getVersion(targetName: IosTargetName | null, buildName: IosBuildName | null): any;
|
||||
/**
|
||||
* Set the build property for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
setBuildProperty(targetName: IosTargetName | null, buildName: IosBuildName | null, key: string, value: string): void;
|
||||
/**
|
||||
* Get the build property for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
getBuildProperty(targetName: IosTargetName | null, buildName: IosBuildName | null, key: string): string;
|
||||
/**
|
||||
* Add a framework for the given target.
|
||||
* If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
addFramework(targetName: IosTargetName | null, framework: IosFramework, opts?: IosFrameworkOpts): void;
|
||||
/**
|
||||
* Get the frameworks for the given target
|
||||
* If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
getFrameworks(targetName: IosTargetName | null): IosFramework[];
|
||||
/**
|
||||
* Get the path to the entitlements file for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
getEntitlementsFile(targetName: IosTargetName | null, buildName?: IosBuildName | undefined): string;
|
||||
/**
|
||||
* Add entitlements for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
addEntitlements(targetName: IosTargetName | null, buildName: IosBuildName | null, entitlements: IosEntitlements): Promise<void>;
|
||||
/**
|
||||
* Set entitlements for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
setEntitlements(targetName: IosTargetName | null, buildName: IosBuildName | null, entitlements: IosEntitlements): Promise<void>;
|
||||
/**
|
||||
* Get the parsed plist of the entitlements for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
getEntitlements(targetName: IosTargetName | null, buildName?: IosBuildName | undefined): Promise<plist.PlistObject | null | undefined>;
|
||||
/**
|
||||
* Gets the relative Info plist file from the build settings.
|
||||
*/
|
||||
getInfoPlist(targetName: IosTargetName | null, buildName?: IosBuildName | null | undefined): Promise<string>;
|
||||
/**
|
||||
* Gets the full relative path to the Info plist after getting the relative path
|
||||
* from the build settings and resolving it with the app path
|
||||
*/
|
||||
getInfoPlistFilename(targetName: IosTargetName, buildName?: IosBuildName | null | undefined): Promise<string | null>;
|
||||
/**
|
||||
* Set the display name for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
setDisplayName(targetName: IosTargetName | null, buildName: IosBuildName | null, displayName: string): Promise<void>;
|
||||
/**
|
||||
* Get the display name for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
getDisplayName(targetName: IosTargetName | null, buildName?: IosBuildName | null | undefined): Promise<string | null>;
|
||||
/**
|
||||
* Update the Info plist for the given target and build. The entries will be merged
|
||||
* into the existing plist file.
|
||||
*
|
||||
* Pass null as the `targetName` to use the main app target
|
||||
*/
|
||||
updateInfoPlist(targetName: IosTargetName | null, buildName: IosBuildName | null, entries: any, mergeMode?: {
|
||||
replace: boolean;
|
||||
}): Promise<void>;
|
||||
copyFile(src: string, dest: string): Promise<void>;
|
||||
/**
|
||||
* Add a source file to the project. this attemps to add the file
|
||||
* to the main "app" target, or adds it to the empty group (i.e. the root of
|
||||
* the project tree) if the app target can't be found.
|
||||
*/
|
||||
addFile(path: string): Promise<void>;
|
||||
private assertEntitlementsFile;
|
||||
private assertTargetName;
|
||||
private makeTargets;
|
||||
private makeBuildConfigurations;
|
||||
private plist;
|
||||
private iosProjectRoot;
|
||||
private pbxFilename;
|
||||
xcodeprojName(): Promise<string>;
|
||||
pbxprojName(): Promise<string>;
|
||||
private pbx;
|
||||
private pbxCommitFn;
|
||||
}
|
||||
//# sourceMappingURL=project.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/ios/project.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/ios/project.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/ios/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAErK,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA0BtD;;GAEG;AACH,qBAAa,UAAW,SAAQ,eAAe;IAC7C,OAAO,CAAC,UAAU,CAA8B;gBAEpC,OAAO,EAAE,aAAa;IAIlC,OAAO,CAAC,GAAG;IAIL,IAAI;IAUV;;;OAGG;IACH,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI;IAkBpE,UAAU,CAAC,IAAI,EAAE,MAAM;IAIvB,YAAY,CAAC,IAAI,EAAE,MAAM;IAI/B,aAAa;IAIb;;OAEG;IACH,UAAU,IAAI,SAAS,EAAE,GAAG,IAAI;IAUhC;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAIzC;;OAEG;IACH,YAAY,IAAI,SAAS,GAAG,IAAI;IAIhC;;OAEG;IACH,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC;;;;OAIG;IACH,WAAW,CAAC,UAAU,EAAE,aAAa,G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WAAW,EAAE,MAAM;IAgB1G;;;;OAIG;IACG,cAAc,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAa3H;;;;;OAKG;IACG,eAAe,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI,EAAE,SAAS,EAAE,YAAY,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE;QAChH,OAAO,EAAE,OAAO,CAAA;KACjB;IAkBK,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAexD;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAmB5B,sBAAsB;IA8BpC,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,uBAAuB;YAgBjB,KAAK;IAcnB,OAAO,CAAC,cAAc;YAKR,WAAW;IAeZ,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKhC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;YAQ7B,GAAG;IAUjB,OAAO,CAAC,WAAW,CAIlB;CACF"}
|
||||
620
node_modules/@trapezedev/project/dist/ios/project.js
generated
vendored
Normal file
620
node_modules/@trapezedev/project/dist/ios/project.js
generated
vendored
Normal file
|
|
@ -0,0 +1,620 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.IosProject = void 0;
|
||||
const path_1 = __importStar(require("path"));
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const pbx_1 = require("../util/pbx");
|
||||
const xml_1 = require("../xml");
|
||||
const plist_1 = require("../plist");
|
||||
const platform_project_1 = require("../platform-project");
|
||||
const logger_1 = require("../logger");
|
||||
const defaultEntitlementsPlist = `
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
||||
`;
|
||||
const defaultInfoPlist = `
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
</dict>
|
||||
</plist>
|
||||
`;
|
||||
/* Some of the types are unwieldy in this file but the
|
||||
pbxProject methods are sensitive to null vs undefined
|
||||
so I've tried to accurately map what it expects. */
|
||||
/**
|
||||
* An instance of an IosProject in a mobile project
|
||||
*/
|
||||
class IosProject extends platform_project_1.PlatformProject {
|
||||
constructor(project) {
|
||||
super(project);
|
||||
this.pbxProject = null;
|
||||
this.pbxCommitFn = async (file) => {
|
||||
if (this.pbxProject) {
|
||||
await (0, utils_fs_1.writeFile)(file.getFilename(), this.pbxProject.writeSync());
|
||||
}
|
||||
};
|
||||
}
|
||||
log(op, targetName, buildName, msg) {
|
||||
logger_1.Logger.v(`ios`, op, `(target: ${targetName}, build: ${buildName}): ${msg}`);
|
||||
}
|
||||
async load() {
|
||||
try {
|
||||
const proj = await this.pbx();
|
||||
this.pbxProject = proj;
|
||||
}
|
||||
catch (e) {
|
||||
this.setError(e);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Get a project file container for the given path in the project root.
|
||||
* This will return an existing file container or create a new one.
|
||||
*/
|
||||
getProjectFile(path, create) {
|
||||
var _a;
|
||||
const root = (_a = this.project.config.ios) === null || _a === void 0 ? void 0 : _a.path;
|
||||
if (!root) {
|
||||
return null;
|
||||
}
|
||||
const filename = (0, path_1.join)(root, path);
|
||||
const existing = this.project.vfs.get(filename);
|
||||
if (existing) {
|
||||
return existing.getData();
|
||||
}
|
||||
return create(filename);
|
||||
}
|
||||
async getXmlFile(path) {
|
||||
return this.getProjectFile(path, (filename) => new xml_1.XmlFile(filename, this.project.vfs));
|
||||
}
|
||||
async getPlistFile(path) {
|
||||
return this.getProjectFile(path, (filename) => new plist_1.PlistFile(filename, this.project.vfs, this.project));
|
||||
}
|
||||
getPbxProject() {
|
||||
return this.pbxProject;
|
||||
}
|
||||
/**
|
||||
* Get all targets in the project
|
||||
*/
|
||||
getTargets() {
|
||||
var _a;
|
||||
if (!this.pbxProject) {
|
||||
return null;
|
||||
}
|
||||
const pbxNative = (_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.pbxNativeTargetSection();
|
||||
return this.makeTargets(this.pbxProject, pbxNative);
|
||||
}
|
||||
/**
|
||||
* Get the target with the given name
|
||||
*/
|
||||
getTarget(name) {
|
||||
var _a;
|
||||
return ((_a = this.getTargets()) === null || _a === void 0 ? void 0 : _a.find(t => t.name === name || t.name === `\"${name}\"`)) || null;
|
||||
}
|
||||
/**
|
||||
* Get the main app target in the project.
|
||||
*/
|
||||
getAppTarget() {
|
||||
var _a;
|
||||
return ((_a = this.getTargets()) === null || _a === void 0 ? void 0 : _a.find(t => t.productType === '"com.apple.product-type.application"')) || null;
|
||||
}
|
||||
/**
|
||||
* Get the name of the main app target in the project
|
||||
*/
|
||||
getAppTargetName() {
|
||||
var _a, _b;
|
||||
return ((_b = (_a = this.getTargets()) === null || _a === void 0 ? void 0 : _a.find(t => t.productType === '"com.apple.product-type.application"')) === null || _b === void 0 ? void 0 : _b.name) || null;
|
||||
}
|
||||
/**
|
||||
* Get the bundle id (aka the PRODUCT_BUNDLE_IDENTIFIER) for the given target and build. If build is null
|
||||
* the value for all build targets (Debug and Release) will be set to the same value. If target is null
|
||||
* the default app target will be used.
|
||||
*/
|
||||
getBundleId(targetName, buildName) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
targetName = this.assertTargetName(targetName);
|
||||
if (buildName) {
|
||||
return (_c = (_b = (_a = this.getTarget(targetName)) === null || _a === void 0 ? void 0 : _a.buildConfigurations.find(c => c.name === buildName)) === null || _b === void 0 ? void 0 : _b.buildSettings) === null || _c === void 0 ? void 0 : _c['PRODUCT_BUNDLE_IDENTIFIER'];
|
||||
}
|
||||
return (_f = (_e = (_d = this.getTarget(targetName)) === null || _d === void 0 ? void 0 : _d.buildConfigurations[0]) === null || _e === void 0 ? void 0 : _e.buildSettings) === null || _f === void 0 ? void 0 : _f['PRODUCT_BUNDLE_IDENTIFIER'];
|
||||
}
|
||||
/**
|
||||
* Set the bundle id (aka the PRODUCT_BUNDLE_IDENTIFIER) for the given target and build. If build is null
|
||||
* the value for all build targets (Debug and Release) will be set to the same value. If target is null
|
||||
* the default app target will be used.
|
||||
*/
|
||||
setBundleId(targetName, buildName, bundleId) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName);
|
||||
this.log('setBundleId', targetName, buildName, `to ${bundleId}`);
|
||||
(_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.updateBuildProperty('PRODUCT_BUNDLE_IDENTIFIER', (0, pbx_1.pbxSerializeString)(bundleId), buildName, targetName);
|
||||
}
|
||||
/**
|
||||
* Get the build configurations for a given target.
|
||||
*/
|
||||
getBuildConfigurations(targetName) {
|
||||
var _a, _b;
|
||||
targetName = this.assertTargetName(targetName);
|
||||
return (_b = (_a = this.getTarget(targetName)) === null || _a === void 0 ? void 0 : _a.buildConfigurations) !== null && _b !== void 0 ? _b : [];
|
||||
}
|
||||
/**
|
||||
* Get the build configuration names (ex: Debug, Release) for a given target.
|
||||
*/
|
||||
getBuildConfigurationNames(targetName) {
|
||||
return this.getBuildConfigurations(targetName).map(c => c.name);
|
||||
}
|
||||
/**
|
||||
* Set the product name for the given target. If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
setProductName(targetName, productName) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName);
|
||||
this.log(`setProductName`, targetName, null, `PRODUCT_NAME to ${productName}`);
|
||||
(_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.updateBuildProperty('PRODUCT_NAME', (0, pbx_1.pbxSerializeString)(productName), null, targetName);
|
||||
}
|
||||
/**
|
||||
* Get the product name for the given target. If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
getProductName(targetName) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
return ((_a = this.getTarget(targetName)) === null || _a === void 0 ? void 0 : _a.productName) || null;
|
||||
}
|
||||
/**
|
||||
* Set the build number (aka the `CURRENT_PROJECT_VERSION`) for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
async setBuild(targetName, buildName, buildNumber) {
|
||||
var _a, _b, _c, _d;
|
||||
if (buildNumber === '') {
|
||||
// This shouldn't happen but can
|
||||
buildNumber = 1;
|
||||
(_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.updateBuildProperty('CURRENT_PROJECT_VERSION', 1, buildName, targetName);
|
||||
}
|
||||
else if (typeof buildNumber === 'string') {
|
||||
// Don't parse version strings
|
||||
if (buildNumber.indexOf('.') < 0) {
|
||||
buildNumber = parseInt(buildNumber, 10);
|
||||
}
|
||||
}
|
||||
(_b = this.pbxProject) === null || _b === void 0 ? void 0 : _b.updateBuildProperty('CURRENT_PROJECT_VERSION', buildNumber !== null && buildNumber !== void 0 ? buildNumber : 1, buildName, targetName);
|
||||
this.log(`setBuild`, targetName, buildName, `to ${buildNumber !== null && buildNumber !== void 0 ? buildNumber : 1}`);
|
||||
const file = await this.getInfoPlist(targetName, buildName !== null && buildName !== void 0 ? buildName : undefined);
|
||||
if (!file || !((_d = (_c = this.project) === null || _c === void 0 ? void 0 : _c.config.ios) === null || _d === void 0 ? void 0 : _d.path)) {
|
||||
throw new Error('Unable to load plist file');
|
||||
}
|
||||
const filename = (0, path_1.join)(this.project.config.ios.path, file);
|
||||
const parsed = await this.plist(filename);
|
||||
parsed.set({ 'CFBundleVersion': '$(CURRENT_PROJECT_VERSION)' });
|
||||
this.log(`setBuild`, targetName, buildName, `CFBundleVersion to $(CURRENT_PROJECT_VERSION)`);
|
||||
this.project.vfs.set(filename, parsed);
|
||||
}
|
||||
/**
|
||||
* Get the build number (aka the `CURRENT_PROJECT_VERSION`) for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
async getBuild(targetName, buildName) {
|
||||
var _a, _b, _c, _d;
|
||||
const currentProjectVersion = (_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.getBuildProperty('CURRENT_PROJECT_VERSION', buildName ? buildName : undefined /* must use undefined if null */, targetName);
|
||||
if (currentProjectVersion) {
|
||||
return currentProjectVersion;
|
||||
}
|
||||
const file = await this.getInfoPlist(targetName, buildName !== null && buildName !== void 0 ? buildName : undefined);
|
||||
if (!file || !((_c = (_b = this.project) === null || _b === void 0 ? void 0 : _b.config.ios) === null || _c === void 0 ? void 0 : _c.path)) {
|
||||
throw new Error('Unable to load plist file');
|
||||
}
|
||||
const filename = (0, path_1.join)(this.project.config.ios.path, file);
|
||||
const parsed = await this.plist(filename);
|
||||
const doc = (_d = parsed.getDocument()) !== null && _d !== void 0 ? _d : {};
|
||||
return doc['CFBundleVersion'];
|
||||
}
|
||||
/**
|
||||
* Increment the build number for the given build name. If the build
|
||||
* name is not specified, both Debug and Release builds are incremented.
|
||||
*/
|
||||
async incrementBuild(targetName, buildName) {
|
||||
var _a, _b;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
const num = await this.getBuild(targetName !== null && targetName !== void 0 ? targetName : null, buildName);
|
||||
if (!isNaN(num)) {
|
||||
if (typeof num === 'number') {
|
||||
// If the value is a number, increment it
|
||||
return this.setBuild(targetName !== null && targetName !== void 0 ? targetName : null, buildName !== null && buildName !== void 0 ? buildName : null, num + 1);
|
||||
}
|
||||
else if (typeof num === 'string') {
|
||||
if (num.indexOf('.') < 0) {
|
||||
// If the value is a string and doesn't contain a period, increment it
|
||||
return this.setBuild(targetName !== null && targetName !== void 0 ? targetName : null, buildName !== null && buildName !== void 0 ? buildName : null, parseInt(num, 10) + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Otherwise, we need to check if there's a build property set for CURRENT_PROJECT_VERSION and create it if not
|
||||
let currentProjectVersion = (_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.getBuildProperty('CURRENT_PROJECT_VERSION', buildName ? buildName : undefined /* must use undefined if null */, targetName);
|
||||
if (!currentProjectVersion) {
|
||||
this.log(`incrementBuild`, targetName, buildName, `Setting initial value for CURRENT_PROJECT_VERSION to ensure incremented build number works`);
|
||||
// Set an initial value for CURRENT_PROJECT_VERSION
|
||||
(_b = this.pbxProject) === null || _b === void 0 ? void 0 : _b.updateBuildProperty('CURRENT_PROJECT_VERSION', 1, buildName, targetName);
|
||||
}
|
||||
else {
|
||||
// There's already a CURRENT_PROJECT_VERSION set, which shouldn't happen, so do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Set the version (aka `MARKETING_VERSION`) for the given build (Debug/Release/etc)
|
||||
*/
|
||||
async setVersion(targetName, buildName, version) {
|
||||
var _a, _b, _c;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
(_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.updateBuildProperty('MARKETING_VERSION', (0, pbx_1.pbxSerializeString)(version), buildName, targetName);
|
||||
this.log(`setVersion`, targetName, buildName, `to ${(0, pbx_1.pbxSerializeString)(version)}`);
|
||||
const file = await this.getInfoPlist(targetName, buildName !== null && buildName !== void 0 ? buildName : undefined);
|
||||
if (!file || !((_c = (_b = this.project) === null || _b === void 0 ? void 0 : _b.config.ios) === null || _c === void 0 ? void 0 : _c.path)) {
|
||||
throw new Error('Unable to load plist file');
|
||||
}
|
||||
const filename = (0, path_1.join)(this.project.config.ios.path, file);
|
||||
const parsed = await this.plist(filename);
|
||||
this.log(`setVersion`, targetName, buildName, `Updated CFBundleShortVersionString to $(MARKETING_VERSION) to ensure updated version works`);
|
||||
parsed.set({ 'CFBundleShortVersionString': '$(MARKETING_VERSION)' });
|
||||
this.project.vfs.set(filename, parsed);
|
||||
}
|
||||
/**
|
||||
* Get the version (aka the `MARKETING_VERSION`) for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
getVersion(targetName, buildName) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
return (_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.getBuildProperty('MARKETING_VERSION', buildName ? buildName : undefined /* must use undefined if null */, targetName);
|
||||
}
|
||||
/**
|
||||
* Set the build property for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
setBuildProperty(targetName, buildName, key, value) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
this.log(`setBuildProperty`, targetName, buildName, `Setting iOS build property ${key} = ${value}`);
|
||||
(_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.updateBuildProperty(key, (0, pbx_1.pbxSerializeString)(value), buildName ? buildName : undefined /* must use undefined if null */, targetName);
|
||||
}
|
||||
/**
|
||||
* Get the build property for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the value is set for both builds (Debug/Release);
|
||||
*/
|
||||
getBuildProperty(targetName, buildName, key) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
return (0, pbx_1.pbxReadString)((_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.getBuildProperty(key, buildName ? buildName : undefined /* must use undefined if null */, targetName));
|
||||
}
|
||||
/**
|
||||
* Add a framework for the given target.
|
||||
* If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
addFramework(targetName, framework, opts = {}) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
const target = this.getTarget(targetName);
|
||||
(_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.addFramework(framework, {
|
||||
target: target === null || target === void 0 ? void 0 : target.id,
|
||||
...opts
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Get the frameworks for the given target
|
||||
* If the `targetName` is null the main app target is used.
|
||||
*/
|
||||
getFrameworks(targetName) {
|
||||
var _a, _b, _c;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
const target = this.getTarget(targetName);
|
||||
if (!target) {
|
||||
return [];
|
||||
}
|
||||
return (_c = (_b = (_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.pbxFrameworksBuildPhaseObj(target.id)) === null || _b === void 0 ? void 0 : _b.files) === null || _c === void 0 ? void 0 : _c.map((f) => f.comment.split(' ')[0]);
|
||||
}
|
||||
/**
|
||||
* Get the path to the entitlements file for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
getEntitlementsFile(targetName, buildName) {
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
return this.getBuildProperty(targetName, buildName !== null && buildName !== void 0 ? buildName : null, 'CODE_SIGN_ENTITLEMENTS');
|
||||
}
|
||||
/**
|
||||
* Add entitlements for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
async addEntitlements(targetName, buildName, entitlements) {
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
let file = await this.assertEntitlementsFile(targetName, buildName);
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
const filename = (0, path_1.join)(this.project.config.ios.path, file);
|
||||
const parsed = await this.plist(filename);
|
||||
parsed.update(entitlements);
|
||||
this.project.vfs.set(filename, parsed);
|
||||
}
|
||||
/**
|
||||
* Set entitlements for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
async setEntitlements(targetName, buildName, entitlements) {
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
let file = await this.assertEntitlementsFile(targetName, buildName);
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
const filename = (0, path_1.join)(this.project.config.ios.path, file);
|
||||
const parsed = await this.plist(filename);
|
||||
parsed.update(entitlements, true);
|
||||
this.project.vfs.set(filename, parsed);
|
||||
}
|
||||
/**
|
||||
* Get the parsed plist of the entitlements for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
async getEntitlements(targetName, buildName) {
|
||||
var _a, _b, _c;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
const file = this.getEntitlementsFile(targetName, buildName);
|
||||
if (!file || !((_c = (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.ios) === null || _c === void 0 ? void 0 : _c.path)) {
|
||||
return;
|
||||
}
|
||||
const filename = (0, path_1.join)(this.project.config.ios.path, file);
|
||||
const plistFile = await this.plist(filename);
|
||||
return plistFile.getDocument();
|
||||
}
|
||||
/**
|
||||
* Gets the relative Info plist file from the build settings.
|
||||
*/
|
||||
async getInfoPlist(targetName, buildName) {
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
return this.getBuildProperty(targetName, buildName !== null && buildName !== void 0 ? buildName : null, 'INFOPLIST_FILE');
|
||||
}
|
||||
/**
|
||||
* Gets the full relative path to the Info plist after getting the relative path
|
||||
* from the build settings and resolving it with the app path
|
||||
*/
|
||||
async getInfoPlistFilename(targetName, buildName) {
|
||||
var _a, _b;
|
||||
const file = await this.getInfoPlist(targetName, buildName);
|
||||
if (!((_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config.ios) === null || _b === void 0 ? void 0 : _b.path)) {
|
||||
return null;
|
||||
}
|
||||
return (0, path_1.join)(this.project.config.ios.path, file);
|
||||
}
|
||||
/**
|
||||
* Set the display name for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
async setDisplayName(targetName, buildName, displayName) {
|
||||
var _a, _b;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
const file = await this.getInfoPlist(targetName, buildName !== null && buildName !== void 0 ? buildName : undefined);
|
||||
if (!file || !((_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config.ios) === null || _b === void 0 ? void 0 : _b.path)) {
|
||||
throw new Error('Unable to load plist file');
|
||||
}
|
||||
const filename = (0, path_1.join)(this.project.config.ios.path, file);
|
||||
const parsed = await this.plist(filename);
|
||||
parsed.set({ 'CFBundleDisplayName': displayName });
|
||||
this.log(`setDisplayName`, targetName, buildName, `Setting CFBundleDisplayName to ${displayName}`);
|
||||
this.project.vfs.set(filename, parsed);
|
||||
}
|
||||
/**
|
||||
* Get the display name for the given target and build.
|
||||
* If the `targetName` is null the main app target is used. If the `buildName` is null the first
|
||||
* build name is used.
|
||||
*/
|
||||
async getDisplayName(targetName, buildName) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
const filename = await this.getInfoPlistFilename(targetName, buildName);
|
||||
if (!filename) {
|
||||
return null;
|
||||
}
|
||||
const parsed = await this.plist(filename);
|
||||
const doc = (_a = parsed.getDocument()) !== null && _a !== void 0 ? _a : {};
|
||||
return doc['CFBundleDisplayName'];
|
||||
}
|
||||
/**
|
||||
* Update the Info plist for the given target and build. The entries will be merged
|
||||
* into the existing plist file.
|
||||
*
|
||||
* Pass null as the `targetName` to use the main app target
|
||||
*/
|
||||
async updateInfoPlist(targetName, buildName, entries, mergeMode) {
|
||||
var _a;
|
||||
targetName = this.assertTargetName(targetName || null);
|
||||
const filename = await this.getInfoPlistFilename(targetName, buildName !== null && buildName !== void 0 ? buildName : undefined);
|
||||
if (!filename) {
|
||||
throw new Error('Unable to get plist filename to update');
|
||||
}
|
||||
if (!await (0, utils_fs_1.pathExists)(filename)) {
|
||||
await (0, utils_fs_1.writeFile)(filename, defaultInfoPlist);
|
||||
}
|
||||
const parsed = await this.plist(filename);
|
||||
parsed.update(entries, (_a = mergeMode === null || mergeMode === void 0 ? void 0 : mergeMode.replace) !== null && _a !== void 0 ? _a : false);
|
||||
this.project.vfs.set(filename, parsed);
|
||||
}
|
||||
async copyFile(src, dest) {
|
||||
var _a, _b, _c;
|
||||
if (!((_c = (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.ios) === null || _c === void 0 ? void 0 : _c.path)) {
|
||||
return Promise.reject();
|
||||
}
|
||||
const destPath = (0, path_1.join)(this.project.config.ios.path, dest);
|
||||
if (/^(https?:\/\/)/.test(src)) {
|
||||
const res = await fetch(src);
|
||||
return (0, utils_fs_1.writeFile)(destPath, Buffer.from(await res.arrayBuffer()));
|
||||
}
|
||||
const srcPath = (0, path_1.join)(this.project.config.ios.path, src);
|
||||
return (0, utils_fs_1.copy)(srcPath, destPath);
|
||||
}
|
||||
/**
|
||||
* Add a source file to the project. this attemps to add the file
|
||||
* to the main "app" target, or adds it to the empty group (i.e. the root of
|
||||
* the project tree) if the app target can't be found.
|
||||
*/
|
||||
async addFile(path) {
|
||||
var _a, _b, _c, _d;
|
||||
const groups = (_b = (_a = this.pbxProject) === null || _a === void 0 ? void 0 : _a.hash.project.objects['PBXGroup']) !== null && _b !== void 0 ? _b : [];
|
||||
const emptyGroup = Object.entries(groups).find(([key, value]) => {
|
||||
return value.isa === 'PBXGroup' && typeof value.name === 'undefined';
|
||||
});
|
||||
const appTarget = this.getAppTargetName();
|
||||
const appGroup = Object.entries(groups).find(([key, value]) => {
|
||||
return value.isa === 'PBXGroup' && (value.name === appTarget || value.path === appTarget);
|
||||
});
|
||||
const pathSplit = path.split(path_1.sep);
|
||||
if (pathSplit[0] === appTarget && appGroup) {
|
||||
(_c = this.pbxProject) === null || _c === void 0 ? void 0 : _c.addSourceFile(pathSplit.slice(1).join(path_1.sep), {}, appGroup === null || appGroup === void 0 ? void 0 : appGroup[0]);
|
||||
}
|
||||
else {
|
||||
(_d = this.pbxProject) === null || _d === void 0 ? void 0 : _d.addSourceFile(path, {}, emptyGroup === null || emptyGroup === void 0 ? void 0 : emptyGroup[0]);
|
||||
}
|
||||
}
|
||||
async assertEntitlementsFile(targetName, buildName) {
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
let file = this.getEntitlementsFile(targetName, buildName !== null && buildName !== void 0 ? buildName : undefined);
|
||||
if (!file) {
|
||||
if ((_c = (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.ios) === null || _c === void 0 ? void 0 : _c.path) {
|
||||
const targetDir = targetName || 'App';
|
||||
const fname = `${(targetName || 'App').split(/\s+/).join('_')}.entitlements`;
|
||||
// Create the default entitlements file
|
||||
const target = (0, path_1.join)(this.project.config.ios.path, targetDir, fname);
|
||||
await (0, utils_fs_1.writeFile)(target, defaultEntitlementsPlist);
|
||||
// Always use posix paths
|
||||
file = (0, path_1.join)(targetDir, fname).split(path_1.default.sep).join(path_1.default.posix.sep);
|
||||
this.setBuildProperty(targetName, buildName, 'CODE_SIGN_ENTITLEMENTS', file);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
if (!file || !((_f = (_e = (_d = this.project) === null || _d === void 0 ? void 0 : _d.config) === null || _e === void 0 ? void 0 : _e.ios) === null || _f === void 0 ? void 0 : _f.path)) {
|
||||
return null;
|
||||
}
|
||||
return file;
|
||||
}
|
||||
// Used to get the target name for operations, defaulting to the main app target
|
||||
// if no targetName was provided
|
||||
assertTargetName(targetName) {
|
||||
if (!targetName) {
|
||||
const appTargetName = this.getAppTargetName();
|
||||
if (!appTargetName) {
|
||||
throw new Error('No target supplied and unable to find the main app target');
|
||||
}
|
||||
return appTargetName;
|
||||
}
|
||||
if (!this.getTarget(targetName)) {
|
||||
throw new Error(`Target '${targetName}' not found in project`);
|
||||
}
|
||||
return targetName;
|
||||
}
|
||||
makeTargets(proj, pbxNativeSection) {
|
||||
return Object.keys(pbxNativeSection).filter(k => k.indexOf('_comment') < 0).map(k => {
|
||||
const n = pbxNativeSection[k];
|
||||
return {
|
||||
id: k,
|
||||
name: n.name.replace(/"/g, ''),
|
||||
productName: n.productName,
|
||||
productType: n.productType,
|
||||
buildConfigurations: this.makeBuildConfigurations(proj, n)
|
||||
};
|
||||
});
|
||||
}
|
||||
makeBuildConfigurations(proj, pbxNativeEntry) {
|
||||
// const config = proj.pbxXCBuildConfigurationSection();
|
||||
const config = proj.pbxXCConfigurationList();
|
||||
const buildConfigs = proj.pbxXCBuildConfigurationSection();
|
||||
const buildConfiguration = config[pbxNativeEntry.buildConfigurationList];
|
||||
return buildConfiguration.buildConfigurations.map((bc) => {
|
||||
const c = buildConfigs[bc.value];
|
||||
return {
|
||||
name: c.name.replace(/"/g, ''),
|
||||
buildSettings: c.buildSettings,
|
||||
};
|
||||
});
|
||||
}
|
||||
async plist(filename) {
|
||||
const open = this.project.vfs.get(filename);
|
||||
if (open) {
|
||||
return open.getData();
|
||||
}
|
||||
const plistFile = new plist_1.PlistFile(filename, this.project.vfs, this.project);
|
||||
await plistFile.load();
|
||||
return plistFile;
|
||||
}
|
||||
iosProjectRoot() {
|
||||
var _a, _b, _c;
|
||||
return (_c = (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config.ios) === null || _b === void 0 ? void 0 : _b.path) !== null && _c !== void 0 ? _c : '';
|
||||
}
|
||||
// Get the filename of the pbxproj
|
||||
async pbxFilename() {
|
||||
var _a, _b;
|
||||
if (!((_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.config.ios) === null || _b === void 0 ? void 0 : _b.path)) {
|
||||
return null;
|
||||
}
|
||||
const xcodeprojName = await this.xcodeprojName();
|
||||
const pbxprojName = await this.pbxprojName();
|
||||
return (0, path_1.join)(this.project.config.ios.path, xcodeprojName, pbxprojName);
|
||||
}
|
||||
async xcodeprojName() {
|
||||
var _a;
|
||||
const files = await (0, utils_fs_1.readdir)(this.iosProjectRoot());
|
||||
return (_a = files.find(f => f.indexOf('.xcodeproj') >= 0)) !== null && _a !== void 0 ? _a : '';
|
||||
}
|
||||
async pbxprojName() {
|
||||
var _a;
|
||||
const xcodeprojName = await this.xcodeprojName();
|
||||
const xcodeprojDir = (0, path_1.join)(this.iosProjectRoot(), xcodeprojName);
|
||||
const files = await (0, utils_fs_1.readdir)(xcodeprojDir);
|
||||
return (_a = files.find(f => f.indexOf('.pbxproj') >= 0)) !== null && _a !== void 0 ? _a : '';
|
||||
}
|
||||
// Parse and return a pbx project
|
||||
async pbx() {
|
||||
const filename = await this.pbxFilename();
|
||||
if (!filename) {
|
||||
throw new Error('Unable to load pbxproj');
|
||||
}
|
||||
const pbxParsed = await (0, pbx_1.parsePbxProject)(filename);
|
||||
this.project.vfs.open(filename, pbxParsed, this.pbxCommitFn);
|
||||
return pbxParsed;
|
||||
}
|
||||
}
|
||||
exports.IosProject = IosProject;
|
||||
//# sourceMappingURL=project.js.map
|
||||
1
node_modules/@trapezedev/project/dist/ios/project.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/ios/project.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
node_modules/@trapezedev/project/dist/json.d.ts
generated
vendored
Normal file
15
node_modules/@trapezedev/project/dist/json.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { VFS, VFSStorable } from './vfs';
|
||||
export declare class JsonFile extends VFSStorable {
|
||||
private path;
|
||||
private vfs;
|
||||
private json;
|
||||
constructor(path: string, vfs: VFS);
|
||||
getDocument(): Record<string, any> | null;
|
||||
exists(): Promise<boolean>;
|
||||
load(): Promise<void>;
|
||||
set(properties: any): Promise<void>;
|
||||
merge(properties: any): Promise<void>;
|
||||
private commitFn;
|
||||
private diffFn;
|
||||
}
|
||||
//# sourceMappingURL=json.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/json.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/json.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAmB,WAAW,EAAE,MAAM,OAAO,CAAC;AAE1D,qBAAa,QAAS,SAAQ,WAAW;IAG3B,OAAO,CAAC,IAAI;IAAU,OAAO,CAAC,GAAG;IAF7C,OAAO,CAAC,IAAI,CAAoC;gBAE5B,IAAI,EAAE,MAAM,EAAU,GAAG,EAAE,GAAG;IAIlD,WAAW;IAIL,MAAM;IAIN,IAAI;IAeJ,GAAG,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCnC,KAAK,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAc3C,OAAO,CAAC,QAAQ,CAKd;IAEF,OAAO,CAAC,MAAM,CAQb;CACF"}
|
||||
97
node_modules/@trapezedev/project/dist/json.js
generated
vendored
Normal file
97
node_modules/@trapezedev/project/dist/json.js
generated
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.JsonFile = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const lodash_1 = require("lodash");
|
||||
const logger_1 = require("./logger");
|
||||
const fs_1 = require("./util/fs");
|
||||
const vfs_1 = require("./vfs");
|
||||
class JsonFile extends vfs_1.VFSStorable {
|
||||
constructor(path, vfs) {
|
||||
super();
|
||||
this.path = path;
|
||||
this.vfs = vfs;
|
||||
this.json = null;
|
||||
this.commitFn = async (file) => {
|
||||
var _a;
|
||||
await (0, fs_1.assertParentDirs)(file.getFilename());
|
||||
return (0, utils_fs_1.writeJson)(file.getFilename(), (_a = file.getData()) === null || _a === void 0 ? void 0 : _a.getDocument(), {
|
||||
spaces: 2
|
||||
});
|
||||
};
|
||||
this.diffFn = async (file) => {
|
||||
var _a;
|
||||
const oldJson = await (0, utils_fs_1.readFile)(file.getFilename(), { encoding: 'utf-8' });
|
||||
const newJson = JSON.stringify((_a = file.getData()) === null || _a === void 0 ? void 0 : _a.getDocument(), null, 2);
|
||||
return {
|
||||
old: oldJson,
|
||||
new: newJson
|
||||
};
|
||||
};
|
||||
}
|
||||
getDocument() {
|
||||
return this.json;
|
||||
}
|
||||
async exists() {
|
||||
return (0, utils_fs_1.pathExists)(this.path);
|
||||
}
|
||||
async load() {
|
||||
if (this.vfs.isOpen(this.path)) {
|
||||
return;
|
||||
}
|
||||
if (await this.exists()) {
|
||||
this.json = await (0, utils_fs_1.readJson)(this.path);
|
||||
}
|
||||
else {
|
||||
this.json = {};
|
||||
}
|
||||
logger_1.Logger.v('json', 'read', this.json);
|
||||
this.vfs.open(this.path, this, this.commitFn, this.diffFn);
|
||||
}
|
||||
async set(properties) {
|
||||
if (!this.json) {
|
||||
return;
|
||||
}
|
||||
const merged = (0, lodash_1.mergeWith)(this.json, properties, (objValue, srcValue) => {
|
||||
// Override the default merge behavior for arrays of objects that have the
|
||||
// same sub-key. Otherwise lodash merge doesn't work how we need it to
|
||||
if (Array.isArray(objValue)) {
|
||||
//if (replace) {
|
||||
return srcValue;
|
||||
//}
|
||||
/*
|
||||
const firstObjValue = objValue[0];
|
||||
const firstSrcValue = srcValue[0];
|
||||
|
||||
// https://github.com/ionic-team/capacitor-configure/issues/32
|
||||
// When merging an array of dicts, like when modifying
|
||||
// CFBundleURLTypes, we don't want to union the two arrays because that
|
||||
// would result in duplicated array of dicts. Instead, we want to merge as-is.
|
||||
// This check makes sure we're not trying to union an array of dicts
|
||||
if (typeof firstObjValue !== 'object' && typeof firstSrcValue !== 'object') {
|
||||
return union(objValue, srcValue);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else if (typeof objValue === 'object' && objValue !== null) {
|
||||
//if (replace) {
|
||||
return srcValue;
|
||||
//}
|
||||
}
|
||||
});
|
||||
Object.assign(this.json, merged);
|
||||
}
|
||||
async merge(properties) {
|
||||
if (!this.json) {
|
||||
return;
|
||||
}
|
||||
const merged = (0, lodash_1.mergeWith)(this.json, properties, (objValue, srcValue) => {
|
||||
if (Array.isArray(objValue)) {
|
||||
return (0, lodash_1.union)(objValue, srcValue);
|
||||
}
|
||||
});
|
||||
Object.assign(this.json, merged);
|
||||
}
|
||||
}
|
||||
exports.JsonFile = JsonFile;
|
||||
//# sourceMappingURL=json.js.map
|
||||
1
node_modules/@trapezedev/project/dist/json.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/json.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"json.js","sourceRoot":"","sources":["../src/json.ts"],"names":[],"mappings":";;;AAAA,8CAAuF;AACvF,mCAA0C;AAC1C,qCAAkC;AAClC,kCAA6C;AAE7C,+BAA0D;AAE1D,MAAa,QAAS,SAAQ,iBAAW;IAGvC,YAAoB,IAAY,EAAU,GAAQ;QAChD,KAAK,EAAE,CAAC;Q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CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;CAkBF;AAhGD,4BAgGC"}
|
||||
8
node_modules/@trapezedev/project/dist/logger.d.ts
generated
vendored
Normal file
8
node_modules/@trapezedev/project/dist/logger.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export declare class Logger {
|
||||
static debug(...args: any[]): void;
|
||||
static v(platform: string, op: string, ...args: any[]): void;
|
||||
static log(...args: any[]): void;
|
||||
static warn(...args: any[]): void;
|
||||
static error(...args: any[]): void;
|
||||
}
|
||||
//# sourceMappingURL=logger.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/logger.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/logger.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,qBAAa,MAAM;IACjB,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;IAM3B,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAIrD,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;IAIzB,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;IAI1B,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE;CAG5B"}
|
||||
28
node_modules/@trapezedev/project/dist/logger.js
generated
vendored
Normal file
28
node_modules/@trapezedev/project/dist/logger.js
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Logger = void 0;
|
||||
const kleur_1 = __importDefault(require("kleur"));
|
||||
class Logger {
|
||||
static debug(...args) {
|
||||
if (process.env.VERBOSE !== 'false') {
|
||||
console.log(kleur_1.default.bold().grey('[log]'), ...args);
|
||||
}
|
||||
}
|
||||
static v(platform, op, ...args) {
|
||||
this.debug(`${kleur_1.default.yellow(platform)}(${kleur_1.default.cyan(op)})`, ...args);
|
||||
}
|
||||
static log(...args) {
|
||||
console.log(...args);
|
||||
}
|
||||
static warn(...args) {
|
||||
console.warn(...args);
|
||||
}
|
||||
static error(...args) {
|
||||
console.warn(...args);
|
||||
}
|
||||
}
|
||||
exports.Logger = Logger;
|
||||
//# sourceMappingURL=logger.js.map
|
||||
1
node_modules/@trapezedev/project/dist/logger.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/logger.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,MAAa,MAAM;IACjB,MAAM,CAAC,KAAK,CAAC,GAAG,IAAW;QACzB,IAAG,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,OAAO,EAAE;YAClC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;SAClD;IACH,CAAC;IAED,MAAM,CAAC,CAAC,CAAC,QAAgB,EAAE,EAAU,EAAE,GAAG,IAAW;QACnD,IAAI,CAAC,KAAK,CAAC,GAAG,eAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,eAAK,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,GAAG,IAAW;QACvB,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,IAAW;QACxB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,IAAW;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACxB,CAAC;CACF;AAtBD,wBAsBC"}
|
||||
9
node_modules/@trapezedev/project/dist/platform-project.d.ts
generated
vendored
Normal file
9
node_modules/@trapezedev/project/dist/platform-project.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { MobileProject } from "./project";
|
||||
export declare class PlatformProject {
|
||||
protected project: MobileProject;
|
||||
private error;
|
||||
constructor(project: MobileProject);
|
||||
getError(): Error | null;
|
||||
setError(error: Error): void;
|
||||
}
|
||||
//# sourceMappingURL=platform-project.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/platform-project.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/platform-project.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"platform-project.d.ts","sourceRoot":"","sources":["../src/platform-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,qBAAa,eAAe;IAEd,SAAS,CAAC,OAAO,EAAE,aAAa;IAD5C,OAAO,CAAC,KAAK,CAAsB;gBACb,OAAO,EAAE,aAAa;IAC5C,QAAQ,IAAI,KAAK,GAAG,IAAI;IAGxB,QAAQ,CAAC,KAAK,EAAE,KAAK;CAGtB"}
|
||||
17
node_modules/@trapezedev/project/dist/platform-project.js
generated
vendored
Normal file
17
node_modules/@trapezedev/project/dist/platform-project.js
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PlatformProject = void 0;
|
||||
class PlatformProject {
|
||||
constructor(project) {
|
||||
this.project = project;
|
||||
this.error = null;
|
||||
}
|
||||
getError() {
|
||||
return this.error;
|
||||
}
|
||||
setError(error) {
|
||||
this.error = error;
|
||||
}
|
||||
}
|
||||
exports.PlatformProject = PlatformProject;
|
||||
//# sourceMappingURL=platform-project.js.map
|
||||
1
node_modules/@trapezedev/project/dist/platform-project.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/platform-project.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"platform-project.js","sourceRoot":"","sources":["../src/platform-project.ts"],"names":[],"mappings":";;;AAEA,MAAa,eAAe;IAE1B,YAAsB,OAAsB;QAAtB,YAAO,GAAP,OAAO,CAAe;QADpC,UAAK,GAAiB,IAAI,CAAC;IACY,CAAC;IAChD,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IACD,QAAQ,CAAC,KAAY;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AATD,0CASC"}
|
||||
28
node_modules/@trapezedev/project/dist/plist.d.ts
generated
vendored
Normal file
28
node_modules/@trapezedev/project/dist/plist.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import plist, { PlistObject } from "plist";
|
||||
import { VFS, VFSFile, VFSStorable } from "./vfs";
|
||||
import { MobileProject } from "./project";
|
||||
export declare class PlistFile extends VFSStorable {
|
||||
private path;
|
||||
private vfs;
|
||||
private project?;
|
||||
doc: PlistObject | null;
|
||||
constructor(path: string, vfs: VFS, project?: MobileProject | undefined);
|
||||
getDocument(): plist.PlistObject | null;
|
||||
setDocument(doc: any): void;
|
||||
exists(): Promise<boolean>;
|
||||
load(): Promise<void>;
|
||||
private plistCommitFn;
|
||||
plistDiffFn: (file: VFSFile) => Promise<{
|
||||
old: string;
|
||||
new: string;
|
||||
}>;
|
||||
setFromXml(xml: string): Promise<void>;
|
||||
set(properties: any): Promise<void>;
|
||||
merge(properties: any): Promise<void>;
|
||||
/**
|
||||
* This is confusing but this uses a different set algorithm than the above set and merge.
|
||||
* TODO: Get rid of this or make this behavior the default for set or merge
|
||||
*/
|
||||
update(entries: any, replace?: boolean): void;
|
||||
}
|
||||
//# sourceMappingURL=plist.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/plist.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/plist.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"plist.d.ts","sourceRoot":"","sources":["../src/plist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAc,MAAM,OAAO,CAAC;AAMvD,OAAO,EAAE,GAAG,EAAU,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAI1C,qBAAa,SAAU,SAAQ,WAAW;IAG5B,OAAO,CAAC,IAAI;IAAU,OAAO,CAAC,GAAG;IAAO,OAAO,CAAC,OAAO,CAAC;IAFpE,GAAG,EAAE,WAAW,GAAG,IAAI,CAAQ;gBAEX,IAAI,EAAE,MAAM,EAAU,GAAG,EAAE,GAAG,EAAU,OAAO,CAAC,2BAAe;IAInF,WAAW;IAIX,WAAW,CAAC,GAAG,EAAE,GAAG;IAId,MAAM;IAIN,IAAI;IAqBV,OAAO,CAAC,aAAa,CASpB;IAED,WAAW;;;OAiBV;IAEK,UAAU,CAAC,GAAG,EAAE,MAAM;IAMtB,GAAG,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCnC,KAAK,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAc3C;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,UAAQ;CA6BrC"}
|
||||
161
node_modules/@trapezedev/project/dist/plist.js
generated
vendored
Normal file
161
node_modules/@trapezedev/project/dist/plist.js
generated
vendored
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PlistFile = void 0;
|
||||
const plist_1 = __importDefault(require("plist"));
|
||||
const path_1 = require("path");
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const lodash_1 = require("lodash");
|
||||
const plist_2 = require("./util/plist");
|
||||
const vfs_1 = require("./vfs");
|
||||
const logger_1 = require("./logger");
|
||||
const fs_1 = require("./util/fs");
|
||||
class PlistFile extends vfs_1.VFSStorable {
|
||||
constructor(path, vfs, project) {
|
||||
super();
|
||||
this.path = path;
|
||||
this.vfs = vfs;
|
||||
this.project = project;
|
||||
this.doc = null;
|
||||
this.plistCommitFn = async (file) => {
|
||||
var _a;
|
||||
const data = file.getData();
|
||||
const xml = plist_1.default.build((_a = data.getDocument()) !== null && _a !== void 0 ? _a : {}, {
|
||||
indent: ' ',
|
||||
offset: -1,
|
||||
newline: '\n'
|
||||
});
|
||||
await (0, fs_1.assertParentDirs)(file.getFilename());
|
||||
return (0, utils_fs_1.writeFile)(file.getFilename(), xml);
|
||||
};
|
||||
this.plistDiffFn = async (file) => {
|
||||
var _a;
|
||||
let old = '';
|
||||
try {
|
||||
old = await (0, utils_fs_1.readFile)(file.getFilename(), { encoding: 'utf-8' });
|
||||
}
|
||||
catch (e) { }
|
||||
const data = file.getData();
|
||||
const xml = plist_1.default.build((_a = data.getDocument()) !== null && _a !== void 0 ? _a : {}, {
|
||||
indent: ' ',
|
||||
offset: -1,
|
||||
newline: '\n'
|
||||
});
|
||||
return {
|
||||
old,
|
||||
new: xml
|
||||
};
|
||||
};
|
||||
}
|
||||
getDocument() {
|
||||
return this.doc;
|
||||
}
|
||||
setDocument(doc) {
|
||||
this.doc = doc;
|
||||
}
|
||||
async exists() {
|
||||
return (0, utils_fs_1.pathExists)(this.path);
|
||||
}
|
||||
async load() {
|
||||
var _a, _b, _c;
|
||||
if (this.vfs.isOpen(this.path)) {
|
||||
return;
|
||||
}
|
||||
if (await this.exists()) {
|
||||
this.doc = await (0, plist_2.parsePlist)(this.path);
|
||||
}
|
||||
else {
|
||||
this.doc = {};
|
||||
// Add the file to the project
|
||||
if (this.project) {
|
||||
const rel = (0, path_1.relative)((_b = (_a = this.project.config.ios) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : '', this.path);
|
||||
(_c = this.project.ios) === null || _c === void 0 ? void 0 : _c.addFile(rel);
|
||||
}
|
||||
}
|
||||
logger_1.Logger.v('plist', 'read', `Loaded plist file at ${this.path}`, this.doc);
|
||||
this.vfs.open(this.path, this, this.plistCommitFn, this.plistDiffFn);
|
||||
}
|
||||
async setFromXml(xml) {
|
||||
const parsed = (0, plist_2.parsePlistString)(xml);
|
||||
this.doc = parsed;
|
||||
}
|
||||
async set(properties) {
|
||||
if (!this.doc) {
|
||||
return;
|
||||
}
|
||||
const merged = (0, lodash_1.mergeWith)(this.doc, properties, (objValue, srcValue) => {
|
||||
// Override the default merge behavior for arrays of objects that have the
|
||||
// same sub-key. Otherwise lodash merge doesn't work how we need it to
|
||||
if (Array.isArray(objValue)) {
|
||||
//if (replace) {
|
||||
return srcValue;
|
||||
//}
|
||||
/*
|
||||
const firstObjValue = objValue[0];
|
||||
const firstSrcValue = srcValue[0];
|
||||
|
||||
// https://github.com/ionic-team/capacitor-configure/issues/32
|
||||
// When merging an array of dicts, like when modifying
|
||||
// CFBundleURLTypes, we don't want to union the two arrays because that
|
||||
// would result in duplicated array of dicts. Instead, we want to merge as-is.
|
||||
// This check makes sure we're not trying to union an array of dicts
|
||||
if (typeof firstObjValue !== 'object' && typeof firstSrcValue !== 'object') {
|
||||
return union(objValue, srcValue);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else if (typeof objValue === 'object' && objValue !== null) {
|
||||
//if (replace) {
|
||||
return srcValue;
|
||||
//}
|
||||
}
|
||||
});
|
||||
Object.assign(this.doc, merged);
|
||||
}
|
||||
async merge(properties) {
|
||||
if (!this.doc) {
|
||||
return;
|
||||
}
|
||||
const merged = (0, lodash_1.mergeWith)(this.doc, properties, (objValue, srcValue) => {
|
||||
if (Array.isArray(objValue)) {
|
||||
return (0, lodash_1.union)(objValue, srcValue);
|
||||
}
|
||||
});
|
||||
Object.assign(this.doc, merged);
|
||||
}
|
||||
/**
|
||||
* This is confusing but this uses a different set algorithm than the above set and merge.
|
||||
* TODO: Get rid of this or make this behavior the default for set or merge
|
||||
*/
|
||||
update(entries, replace = false) {
|
||||
const merged = (0, lodash_1.mergeWith)(this.doc, entries, (objValue, srcValue) => {
|
||||
// Override the default merge behavior for arrays of objects that have the
|
||||
// same sub-key. Otherwise lodash merge doesn't work how we need it to
|
||||
if (Array.isArray(objValue)) {
|
||||
if (replace) {
|
||||
return srcValue;
|
||||
}
|
||||
const firstObjValue = objValue[0];
|
||||
const firstSrcValue = srcValue[0];
|
||||
// https://github.com/ionic-team/capacitor-configure/issues/32
|
||||
// When merging an array of dicts, like when modifying
|
||||
// CFBundleURLTypes, we don't want to union the two arrays because that
|
||||
// would result in duplicated array of dicts. Instead, we want to merge as-is.
|
||||
// This check makes sure we're not trying to union an array of dicts
|
||||
if (typeof firstObjValue !== 'object' && typeof firstSrcValue !== 'object') {
|
||||
return (0, lodash_1.union)(objValue, srcValue);
|
||||
}
|
||||
}
|
||||
else if (typeof objValue === 'object' && objValue !== null) {
|
||||
if (replace) {
|
||||
return srcValue;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.setDocument(merged);
|
||||
}
|
||||
}
|
||||
exports.PlistFile = PlistFile;
|
||||
//# sourceMappingURL=plist.js.map
|
||||
1
node_modules/@trapezedev/project/dist/plist.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/plist.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"plist.js","sourceRoot":"","sources":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AAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,OAAY,EAAE,OAAO,GAAG,KAAK;QAClC,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;YACjE,0EAA0E;YAC1E,sEAAsE;YACtE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAC3B,IAAI,OAAO,EAAE;oBACX,OAAO,QAAQ,CAAC;iBACjB;gBAED,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAClC,MAAM,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAElC,8DAA8D;gBAC9D,sDAAsD;gBACtD,uEAAuE;gBACvE,8EAA8E;gBAC9E,oEAAoE;gBACpE,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;oBAC1E,OAAO,IAAA,cAAK,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;iBAClC;aACF;iBAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE;gBAC5D,IAAI,OAAO,EAAE;oBACX,OAAO,QAAQ,CAAC;iBACjB;aACF;QACH,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,CAAC;CACF;AA/JD,8BA+JC"}
|
||||
19
node_modules/@trapezedev/project/dist/project.d.ts
generated
vendored
Normal file
19
node_modules/@trapezedev/project/dist/project.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { AndroidProject } from './android/project';
|
||||
import { MobileProjectConfig } from './config';
|
||||
import { Framework } from './frameworks';
|
||||
import { IosProject } from './ios/project';
|
||||
import { VFS } from './vfs';
|
||||
export declare class MobileProject {
|
||||
projectRoot: string;
|
||||
config: MobileProjectConfig;
|
||||
framework: Framework | null;
|
||||
ios: IosProject | null;
|
||||
android: AndroidProject | null;
|
||||
vfs: VFS;
|
||||
constructor(projectRoot: string, config?: MobileProjectConfig);
|
||||
detectFramework(): Promise<Framework | null>;
|
||||
load(): Promise<void>;
|
||||
commit(): Promise<void>;
|
||||
copyFile(src: string, dest: string): Promise<void>;
|
||||
}
|
||||
//# sourceMappingURL=project.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/project.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/project.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAM5B,qBAAa,aAAa;IAOf,WAAW,EAAE,MAAM;IACnB,MAAM,EAAE,mBAAmB;IAP7B,SAAS,EAAE,SAAS,GAAG,IAAI,CAAQ;IACnC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAQ;IAC9B,OAAO,EAAE,cAAc,GAAG,IAAI,CAAQ;IAC7C,GAAG,EAAE,GAAG,CAAC;gBAGA,WAAW,EAAE,MAAM,EACnB,MAAM,GAAE,mBAAwB;IAwBnC,eAAe,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAkB5C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB3B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAazD"}
|
||||
87
node_modules/@trapezedev/project/dist/project.js
generated
vendored
Normal file
87
node_modules/@trapezedev/project/dist/project.js
generated
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.MobileProject = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const project_1 = require("./android/project");
|
||||
const capacitor_1 = require("./frameworks/capacitor");
|
||||
const cordova_1 = require("./frameworks/cordova");
|
||||
const flutter_1 = require("./frameworks/flutter");
|
||||
const dotnet_maui_1 = require("./frameworks/dotnet-maui");
|
||||
const react_native_1 = require("./frameworks/react-native");
|
||||
const project_2 = require("./ios/project");
|
||||
const vfs_1 = require("./vfs");
|
||||
const native_ios_1 = require("./frameworks/native-ios");
|
||||
const native_android_1 = require("./frameworks/native-android");
|
||||
const nativescript_1 = require("./frameworks/nativescript");
|
||||
const logger_1 = require("./logger");
|
||||
class MobileProject {
|
||||
constructor(projectRoot, config = {}) {
|
||||
var _a, _b;
|
||||
this.projectRoot = projectRoot;
|
||||
this.config = config;
|
||||
this.framework = null;
|
||||
this.ios = null;
|
||||
this.android = null;
|
||||
this.vfs = new vfs_1.VFS();
|
||||
this.config.projectRoot = projectRoot;
|
||||
if (typeof config.enableAndroid === 'undefined') {
|
||||
config.enableAndroid = true;
|
||||
}
|
||||
if (typeof config.enableIos === 'undefined') {
|
||||
config.enableIos = true;
|
||||
}
|
||||
if (this.config.ios) {
|
||||
this.config.ios.path = (0, path_1.join)(this.projectRoot, (_a = this.config.ios.path) !== null && _a !== void 0 ? _a : '');
|
||||
}
|
||||
if (this.config.android) {
|
||||
this.config.android.path = (0, path_1.join)(this.projectRoot, (_b = this.config.android.path) !== null && _b !== void 0 ? _b : '');
|
||||
}
|
||||
}
|
||||
async detectFramework() {
|
||||
var _a;
|
||||
const frameworks = [
|
||||
flutter_1.FlutterFramework,
|
||||
react_native_1.ReactNativeFramework,
|
||||
capacitor_1.CapacitorFramework,
|
||||
cordova_1.CordovaFramework,
|
||||
dotnet_maui_1.DotNetMauiFramework,
|
||||
nativescript_1.NativeScriptFramework,
|
||||
native_ios_1.NativeIosFramework,
|
||||
native_android_1.NativeAndroidFramework,
|
||||
];
|
||||
const results = await Promise.all(frameworks.map(f => f.getFramework(this)));
|
||||
return (_a = results.filter(f => f).find(f => !!f)) !== null && _a !== void 0 ? _a : null;
|
||||
}
|
||||
async load() {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
||||
if (((_a = this.config) === null || _a === void 0 ? void 0 : _a.enableAndroid) &&
|
||||
((_c = (_b = this.config) === null || _b === void 0 ? void 0 : _b.android) === null || _c === void 0 ? void 0 : _c.path) &&
|
||||
(await (0, utils_fs_1.pathExists)((_d = this.config.android) === null || _d === void 0 ? void 0 : _d.path))) {
|
||||
this.android = new project_1.AndroidProject(this);
|
||||
await ((_e = this.android) === null || _e === void 0 ? void 0 : _e.load());
|
||||
}
|
||||
if (((_f = this.config) === null || _f === void 0 ? void 0 : _f.enableIos) &&
|
||||
((_h = (_g = this.config) === null || _g === void 0 ? void 0 : _g.ios) === null || _h === void 0 ? void 0 : _h.path) &&
|
||||
(await (0, utils_fs_1.pathExists)((_j = this.config.ios) === null || _j === void 0 ? void 0 : _j.path))) {
|
||||
this.ios = new project_2.IosProject(this);
|
||||
await ((_k = this.ios) === null || _k === void 0 ? void 0 : _k.load());
|
||||
}
|
||||
this.framework = await this.detectFramework();
|
||||
}
|
||||
commit() {
|
||||
return this.vfs.commitAll(this);
|
||||
}
|
||||
async copyFile(src, dest) {
|
||||
const destPath = (0, path_1.join)(this.projectRoot, dest);
|
||||
logger_1.Logger.v(`project`, `copyFile`, `copying ${src} to ${destPath}`);
|
||||
if (/^(https?:\/\/)/.test(src)) {
|
||||
const res = await fetch(src);
|
||||
return (0, utils_fs_1.writeFile)(destPath, Buffer.from(await res.arrayBuffer()));
|
||||
}
|
||||
const srcPath = (0, path_1.join)(this.projectRoot, src);
|
||||
return (0, utils_fs_1.copy)(srcPath, destPath);
|
||||
}
|
||||
}
|
||||
exports.MobileProject = MobileProject;
|
||||
//# sourceMappingURL=project.js.map
|
||||
1
node_modules/@trapezedev/project/dist/project.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/project.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"project.js","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":";;;AAAA,8CAA8D;AAC9D,+BAA4B;AAE5B,+CAAmD;AAGnD,sDAA4D;AAC5D,kDAAwD;AACxD,kDAAwD;AACxD,0DAA+D;AAC/D,4DAAiE;AACjE,2CAA2C;AAC3C,+BAA4B;AAC5B,wDAA6D;AAC7D,gEAAqE;AACrE,4DAAkE;AAClE,qCAAkC;AAElC,MAAa,aAAa;IAMxB,YACS,WAAmB,EACnB,SAA8B,EAAE;;QADhC,gBAAW,GAAX,WAAW,CAAQ;QACnB,WAAM,GAAN,MAAM,CAA0B;QAPlC,cAAS,GAAqB,IAAI,CAAC;QACnC,QAAG,GAAsB,IAAI,CAAC;QAC9B,YAAO,GAA0B,IAAI,CAAC;QAO3C,IAAI,CAAC,GAAG,GAAG,IAAI,SAAG,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;QAEtC,IAAI,OAAO,MAAM,CAAC,aAAa,KAAK,WAAW,EAAE;YAC/C,MAAM,CAAC,aAAa,GAAG,IAAI,CAAC;SAC7B;QAED,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,WAAW,EAAE;YAC3C,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;SACzB;QAED,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;YACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,IAAA,WAAI,EAAC,IAAI,CAAC,WAAW,EAAE,MAAA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normal file
12
node_modules/@trapezedev/project/dist/properties.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { VFS, VFSStorable } from './vfs';
|
||||
export declare class PropertiesFile extends VFSStorable {
|
||||
path: string;
|
||||
private vfs;
|
||||
private doc;
|
||||
constructor(path: string, vfs: VFS);
|
||||
getProperties(): any;
|
||||
updateProperties(properties: any): Promise<void>;
|
||||
load(): Promise<void>;
|
||||
private commitFn;
|
||||
}
|
||||
//# sourceMappingURL=properties.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/properties.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/properties.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAW,WAAW,EAAE,MAAM,OAAO,CAAC;AAElD,qBAAa,cAAe,SAAQ,WAAW;IAE1B,IAAI,EAAE,MAAM;IAAE,OAAO,CAAC,GAAG;IAD5C,OAAO,CAAC,GAAG,CAAM;gBACE,IAAI,EAAE,MAAM,EAAU,GAAG,EAAE,GAAG;IAIjD,aAAa;IAIP,gBAAgB,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAqChD,IAAI;IAaV,OAAO,CAAC,QAAQ,CAGf;CACF"}
|
||||
70
node_modules/@trapezedev/project/dist/properties.js
generated
vendored
Normal file
70
node_modules/@trapezedev/project/dist/properties.js
generated
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PropertiesFile = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const lodash_1 = require("lodash");
|
||||
const logger_1 = require("./logger");
|
||||
const fs_1 = require("./util/fs");
|
||||
const properties_1 = require("./util/properties");
|
||||
const vfs_1 = require("./vfs");
|
||||
class PropertiesFile extends vfs_1.VFSStorable {
|
||||
constructor(path, vfs) {
|
||||
super();
|
||||
this.path = path;
|
||||
this.vfs = vfs;
|
||||
this.commitFn = async (file) => {
|
||||
await (0, fs_1.assertParentDirs)(file.getFilename());
|
||||
return (0, properties_1.writeProperties)(file.getFilename(), file.getData());
|
||||
};
|
||||
}
|
||||
getProperties() {
|
||||
return this.doc;
|
||||
}
|
||||
async updateProperties(properties) {
|
||||
if (!this.doc) {
|
||||
return;
|
||||
}
|
||||
logger_1.Logger.v('properties', 'update', `${this.path} - ${properties}`);
|
||||
const merged = (0, lodash_1.mergeWith)(this.doc, properties, (objValue, srcValue) => {
|
||||
// Override the default merge behavior for arrays of objects that have the
|
||||
// same sub-key. Otherwise lodash merge doesn't work how we need it to
|
||||
if (Array.isArray(objValue)) {
|
||||
//if (replace) {
|
||||
return srcValue;
|
||||
//}
|
||||
/*
|
||||
const firstObjValue = objValue[0];
|
||||
const firstSrcValue = srcValue[0];
|
||||
|
||||
// https://github.com/ionic-team/capacitor-configure/issues/32
|
||||
// When merging an array of dicts, like when modifying
|
||||
// CFBundleURLTypes, we don't want to union the two arrays because that
|
||||
// would result in duplicated array of dicts. Instead, we want to merge as-is.
|
||||
// This check makes sure we're not trying to union an array of dicts
|
||||
if (typeof firstObjValue !== 'object' && typeof firstSrcValue !== 'object') {
|
||||
return union(objValue, srcValue);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else if (typeof objValue === 'object' && objValue !== null) {
|
||||
//if (replace) {
|
||||
return srcValue;
|
||||
//}
|
||||
}
|
||||
});
|
||||
Object.assign(this.doc, merged);
|
||||
}
|
||||
async load() {
|
||||
if (this.vfs.isOpen(this.path)) {
|
||||
return;
|
||||
}
|
||||
if (!await (0, utils_fs_1.pathExists)(this.path)) {
|
||||
throw new Error(`Unable to locate file at ${this.path}`);
|
||||
}
|
||||
this.doc = await (0, properties_1.parseProperties)(this.path);
|
||||
logger_1.Logger.v('properties', 'load', `at ${this.path}`, this.doc);
|
||||
this.vfs.open(this.path, this.doc, this.commitFn);
|
||||
}
|
||||
}
|
||||
exports.PropertiesFile = PropertiesFile;
|
||||
//# sourceMappingURL=properties.js.map
|
||||
1
node_modules/@trapezedev/project/dist/properties.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/properties.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":";;;AAAA,8CAA6C;AAC7C,mCAAmC;AACnC,qCAAkC;AAClC,kCAA6C;AAC7C,kDAAqE;AACrE,+BAAkD;AAElD,MAAa,cAAe,SAAQ,iBAAW;IAE7C,YAAmB,IAAY,EAAU,GAAQ;QAC/C,KAAK,EAAE,CAAC;QADS,SAAI,GAAJ,IAAI,CAAQ;QAAU,QAAG,GAAH,GAAG,CAAK;QA0DzC,aAAQ,GAAG,KAAK,EAAE,IAAa,EAAE,EAAE;YACzC,MAAM,IAAA,qBAAgB,EAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;YAC3C,OAAO,IAAA,4BAAe,EAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7D,CAAC,CAAA;IA3DD,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,UAAe;QACpC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;YACb,OAAO;SACR;QAED,eAAM,CAAC,CAAC,CAAC,YAAY,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,IAAI,MAAM,UAAU,EAAE,CAAC,CAAC;QAEjE,MAAM,MAAM,GAAG,IAAA,kBAAS,EAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE;YACpE,0EAA0E;YAC1E,sEAAsE;YACtE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAC3B,gBAAgB;gBACd,OAAO,QAAQ,CAAC;gBAClB,GAAG;gBAEH;;;;;;;;;;;;kBAYE;aACH;iBAAM,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,EAAE;gBAC5D,gBAAgB;gBACd,OAAO,QAAQ,CAAC;gBAClB,GAAG;aACJ;QACH,CAAC,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC9B,OAAO;SACR;QAED,IAAI,CAAC,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;SAC1D;QACD,IAAI,CAAC,GAAG,GAAG,MAAM,IAAA,4BAAe,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,eAAM,CAAC,CAAC,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;CAMF;AAhED,wCAgEC"}
|
||||
4
node_modules/@trapezedev/project/dist/read-src.d.ts
generated
vendored
Normal file
4
node_modules/@trapezedev/project/dist/read-src.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
export declare function readSource(pathOrUrl: string): Promise<string | Buffer>;
|
||||
//# sourceMappingURL=read-src.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/read-src.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/read-src.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"read-src.d.ts","sourceRoot":"","sources":["../src/read-src.ts"],"names":[],"mappings":";;AAGA,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,4BAOjD"}
|
||||
14
node_modules/@trapezedev/project/dist/read-src.js
generated
vendored
Normal file
14
node_modules/@trapezedev/project/dist/read-src.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.readSource = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
// Supporting reading files from either a path or URL
|
||||
async function readSource(pathOrUrl) {
|
||||
if (/^(https?:\/\/)/.test(pathOrUrl)) {
|
||||
const res = await fetch(pathOrUrl);
|
||||
return res.text();
|
||||
}
|
||||
return (0, utils_fs_1.readFile)(pathOrUrl);
|
||||
}
|
||||
exports.readSource = readSource;
|
||||
//# sourceMappingURL=read-src.js.map
|
||||
1
node_modules/@trapezedev/project/dist/read-src.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/read-src.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"read-src.js","sourceRoot":"","sources":["../src/read-src.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAE3C,qDAAqD;AAC9C,KAAK,UAAU,UAAU,CAAC,SAAiB;IAChD,IAAI,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QACpC,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,CAAC;QACnC,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;KACnB;IAED,OAAO,IAAA,mBAAQ,EAAC,SAAS,CAAC,CAAC;AAC7B,CAAC;AAPD,gCAOC"}
|
||||
21
node_modules/@trapezedev/project/dist/strings.d.ts
generated
vendored
Normal file
21
node_modules/@trapezedev/project/dist/strings.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { MobileProject } from './project';
|
||||
import { StringsEntries } from './util/strings';
|
||||
import { VFS, VFSStorable } from './vfs';
|
||||
/**
|
||||
* iOS .strings files
|
||||
*/
|
||||
export declare class StringsFile extends VFSStorable {
|
||||
path: string;
|
||||
private vfs;
|
||||
private project?;
|
||||
private doc;
|
||||
constructor(path: string, vfs: VFS, project?: MobileProject | undefined);
|
||||
getDocument(): StringsEntries;
|
||||
setFromJson(jsonFile: any): Promise<void>;
|
||||
set(values: any): Promise<void>;
|
||||
load(): Promise<void>;
|
||||
generate(): string;
|
||||
private parse;
|
||||
private commitFn;
|
||||
}
|
||||
//# sourceMappingURL=strings.d.ts.map
|
||||
1
node_modules/@trapezedev/project/dist/strings.d.ts.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/strings.d.ts.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAiC,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,GAAG,EAAW,WAAW,EAAE,MAAM,OAAO,CAAC;AAElD;;GAEG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAEvB,IAAI,EAAE,MAAM;IAAE,OAAO,CAAC,GAAG;IAAO,OAAO,CAAC,OAAO,CAAC;IADnE,OAAO,CAAC,GAAG,CAAsB;gBACd,IAAI,EAAE,MAAM,EAAU,GAAG,EAAE,GAAG,EAAU,OAAO,CAAC,2BAAe;IAIlF,WAAW;IAIL,WAAW,CAAC,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAMzC,GAAG,CAAC,MAAM,EAAE,GAAG;IA4Cf,IAAI;IAmBV,QAAQ;YAIM,KAAK;IAKnB,OAAO,CAAC,QAAQ,CAKf;CACF"}
|
||||
101
node_modules/@trapezedev/project/dist/strings.js
generated
vendored
Normal file
101
node_modules/@trapezedev/project/dist/strings.js
generated
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.StringsFile = void 0;
|
||||
const utils_fs_1 = require("@ionic/utils-fs");
|
||||
const path_1 = require("path");
|
||||
const logger_1 = require("./logger");
|
||||
const fs_1 = require("./util/fs");
|
||||
const strings_1 = require("./util/strings");
|
||||
const vfs_1 = require("./vfs");
|
||||
/**
|
||||
* iOS .strings files
|
||||
*/
|
||||
class StringsFile extends vfs_1.VFSStorable {
|
||||
constructor(path, vfs, project) {
|
||||
super();
|
||||
this.path = path;
|
||||
this.vfs = vfs;
|
||||
this.project = project;
|
||||
this.doc = [];
|
||||
this.commitFn = async (file) => {
|
||||
const f = file.getData();
|
||||
const src = (0, strings_1.generateStrings)(f.doc);
|
||||
await (0, fs_1.assertParentDirs)(file.getFilename());
|
||||
return (0, utils_fs_1.writeFile)(file.getFilename(), src);
|
||||
};
|
||||
}
|
||||
getDocument() {
|
||||
return this.doc;
|
||||
}
|
||||
async setFromJson(jsonFile) {
|
||||
const json = JSON.parse(await (0, utils_fs_1.readFile)(jsonFile, { encoding: 'utf-8' }));
|
||||
this.set(json);
|
||||
}
|
||||
async set(values) {
|
||||
if (!this.doc) {
|
||||
return;
|
||||
}
|
||||
logger_1.Logger.v('strings', 'update', `${this.path}`);
|
||||
Object.keys(values).forEach(k => {
|
||||
let found = false;
|
||||
this.doc = this.doc.map(e => {
|
||||
if (e.key === k) {
|
||||
found = true;
|
||||
return {
|
||||
...e,
|
||||
value: values[k]
|
||||
};
|
||||
}
|
||||
return e;
|
||||
});
|
||||
const lastEntry = this.doc[Math.max(0, this.doc.length - 1)];
|
||||
if (!found) {
|
||||
if (lastEntry) {
|
||||
this.doc.push({
|
||||
content: '\n\n',
|
||||
startLine: lastEntry ? lastEntry.endLine + 1 : 0,
|
||||
startCol: 0,
|
||||
endLine: lastEntry ? lastEntry.endLine + 2 : 0,
|
||||
endCol: 0
|
||||
});
|
||||
}
|
||||
this.doc.push({
|
||||
key: k,
|
||||
value: values[k],
|
||||
startLine: lastEntry ? lastEntry.endLine + 3 : 0,
|
||||
startCol: 0,
|
||||
endLine: lastEntry ? lastEntry.endLine + 4 : 0,
|
||||
endCol: 0
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
async load() {
|
||||
var _a, _b, _c, _d;
|
||||
if (this.vfs.isOpen(this.path)) {
|
||||
return;
|
||||
}
|
||||
if (!await (0, utils_fs_1.pathExists)(this.path)) {
|
||||
this.doc = [];
|
||||
// Add the file to the iOS project
|
||||
if (this.project) {
|
||||
const rel = (0, path_1.relative)((_b = (_a = this.project.config.ios) === null || _a === void 0 ? void 0 : _a.path) !== null && _b !== void 0 ? _b : '', this.path);
|
||||
(_d = (_c = this.project) === null || _c === void 0 ? void 0 : _c.ios) === null || _d === void 0 ? void 0 : _d.addFile(rel);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.doc = await this.parse(this.path);
|
||||
}
|
||||
logger_1.Logger.v('strings', 'load', `at ${this.path}`);
|
||||
this.vfs.open(this.path, this, this.commitFn);
|
||||
}
|
||||
generate() {
|
||||
return (0, strings_1.generateStrings)(this.doc);
|
||||
}
|
||||
async parse(path) {
|
||||
const contents = await (0, utils_fs_1.readFile)(path, { encoding: 'utf-8' });
|
||||
return (0, strings_1.parseStrings)(contents);
|
||||
}
|
||||
}
|
||||
exports.StringsFile = StringsFile;
|
||||
//# sourceMappingURL=strings.js.map
|
||||
1
node_modules/@trapezedev/project/dist/strings.js.map
generated
vendored
Normal file
1
node_modules/@trapezedev/project/dist/strings.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"strings.js","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":";;;AAAA,8CAAkE;AAClE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A8FC"}
|
||||
19
node_modules/@trapezedev/project/dist/util/detect-indent.d.ts
generated
vendored
Normal file
19
node_modules/@trapezedev/project/dist/util/detect-indent.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/**
|
||||
* MIT License
|
||||
|
||||
from https://github.com/sindresorhus/detect-indent, copied here due to misconfigured package
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
export default function detectIndent(string: string): {
|
||||
amount: number;
|
||||
type: string | undefined;
|
||||
indent: string;
|
||||
};
|
||||
//# sourceMappingURL=detect-indent.d.ts.map
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue