mirror of
https://github.com/expo/turtle.git
synced 2026-11-14 19:12:55 -10:00
Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9551c8773d | ||
|
|
470ff609fd | ||
|
|
addba74b9d | ||
|
|
b63e9e3f34 | ||
|
|
25aaa849f1 | ||
|
|
edc712d820 | ||
|
|
23c3e3509c | ||
|
|
406a3be4f1 | ||
|
|
dd60721270 | ||
|
|
469ead8df8 | ||
|
|
aa0ce81e98 | ||
|
|
dccccb7716 | ||
|
|
57f8404b6d | ||
|
|
ba7309bc4b |
No files matched your search
+24
-1
@@ -7,7 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Updated SDK 39 Android tarball
|
||||
### Fixed
|
||||
|
||||
- Always add expo-notifications for SDK >= 39 projects with android.enableDangerousExperimentalLeanBuilds enabled.
|
||||
|
||||
# [0.18.4] - 2020-10-06
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue with notifications ([expo/expo#10562](https://github.com/expo/expo/issues/10562)) in the Android SDK 39 tarball.
|
||||
|
||||
# [0.18.3] - 2020-10-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Update @expo/xdl to fix regression in SDK <= 39 splash
|
||||
|
||||
# [0.18.2] - 2020-10-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- Updated SDK 39 Android tarball.
|
||||
- Updated SDK 39 iOS tarball.
|
||||
- Updated iOS client tarball.
|
||||
- Update @expo/config and @expo/xdl. Temporarily bring in type definitions for color-string and xcode.
|
||||
|
||||
## [0.18.1] - 2020-09-22
|
||||
|
||||
|
||||
+4
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "turtle-cli",
|
||||
"version": "0.18.1",
|
||||
"version": "0.18.5",
|
||||
"description": "The command-line tool for building standalone Expo apps",
|
||||
"preferGlobal": true,
|
||||
"scripts": {
|
||||
@@ -68,6 +68,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@expo/babel-preset-cli": "^0.1.3",
|
||||
"@types/color-string": "^1.5.0",
|
||||
"@types/decompress": "^4.2.3",
|
||||
"@types/fs-extra": "^5.0.4",
|
||||
"@types/ioredis": "^4.16.6",
|
||||
@@ -104,9 +105,9 @@
|
||||
"typescript": "^3.9.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/config": "^3.2.14",
|
||||
"@expo/config": "~3.3.9",
|
||||
"@expo/spawn-async": "^1.4.2",
|
||||
"@expo/xdl": "57.9.35",
|
||||
"@expo/xdl": "58.0.13",
|
||||
"@google-cloud/logging-bunyan": "^2.0.3",
|
||||
"async-retry": "^1.2.1",
|
||||
"aws-sdk": "^2.226.1",
|
||||
|
||||
@@ -1 +1 @@
|
||||
s3://exp-artifacts/android-shell-builder-401ff3fb71a1350c00bd0886f7eb4fd462bdf0c0.tar.gz
|
||||
s3://exp-artifacts/android-shell-builder-b8193b76084128d714a240bbaa5c2450cc4a2c41.tar.gz
|
||||
@@ -1 +1 @@
|
||||
s3://exp-artifacts/ios-expo-client-1fd3a1b4c76b1303d011887fd335730534555601.tar.gz
|
||||
s3://exp-artifacts/ios-expo-client-401ff3fb71a1350c00bd0886f7eb4fd462bdf0c0.tar.gz
|
||||
@@ -1 +1 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-1fd3a1b4c76b1303d011887fd335730534555601.tar.gz
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-798b04f87b8f1518a0eb4009578cb216963922f0.tar.gz
|
||||
@@ -84,7 +84,7 @@ async function runShellAppBuilder(
|
||||
logger.info({ buildPhase: 'resolve native modules' }, 'Resolving universal modules dependencies');
|
||||
const packageJsonDependecies = _.get(manifest, 'dependencies');
|
||||
const enabledModules = _.get(manifest, 'android.enableDangerousExperimentalLeanBuilds')
|
||||
? await resolveNativeModules(workingDir, packageJsonDependecies)
|
||||
? await resolveNativeModules(workingDir, sdkVersion, packageJsonDependecies)
|
||||
: await resolveExplicitOptIn(workingDir, packageJsonDependecies);
|
||||
|
||||
try {
|
||||
|
||||
@@ -4,6 +4,7 @@ import keys from 'lodash/keys';
|
||||
import merge from 'lodash/merge';
|
||||
import values from 'lodash/values';
|
||||
import path from 'path';
|
||||
import semver from 'semver';
|
||||
import logger from 'turtle/logger';
|
||||
|
||||
export interface IUnimoduleEntry {
|
||||
@@ -19,21 +20,37 @@ interface IPackageInfo {
|
||||
dependencies: string[];
|
||||
}
|
||||
|
||||
export async function resolveExplicitOptIn(workingdir: string, packages?: string[]): Promise<IUnimoduleEntry[]> {
|
||||
export async function resolveExplicitOptIn(
|
||||
workingdir: string,
|
||||
packages?: string[],
|
||||
): Promise<IUnimoduleEntry[]> {
|
||||
const resolver = new Resolver(workingdir);
|
||||
await resolver.init();
|
||||
|
||||
const optionalModules = ['expo-branch'];
|
||||
resolver.addAll();
|
||||
const modules = packages
|
||||
? resolver.getModules().filter((mod) => !optionalModules.includes(mod.name) || packages.includes(mod.name))
|
||||
: resolver.getModules().filter((mod) => !optionalModules.includes(mod.name));
|
||||
? resolver
|
||||
.getModules()
|
||||
.filter(
|
||||
(mod) =>
|
||||
!optionalModules.includes(mod.name) || packages.includes(mod.name),
|
||||
)
|
||||
: resolver
|
||||
.getModules()
|
||||
.filter((mod) => !optionalModules.includes(mod.name));
|
||||
|
||||
modules.forEach(({ name, version }) => { logger.info(`Adding ${name}:${version}`); });
|
||||
modules.forEach(({ name, version }) => {
|
||||
logger.info(`Adding ${name}:${version}`);
|
||||
});
|
||||
return modules;
|
||||
}
|
||||
|
||||
export async function resolveNativeModules(workingdir: string, packages?: string[]): Promise<IUnimoduleEntry[]> {
|
||||
export async function resolveNativeModules(
|
||||
workingdir: string,
|
||||
sdkVersion: string,
|
||||
packages?: string[],
|
||||
): Promise<IUnimoduleEntry[]> {
|
||||
const resolver = new Resolver(workingdir);
|
||||
await resolver.init();
|
||||
|
||||
@@ -41,6 +58,13 @@ export async function resolveNativeModules(workingdir: string, packages?: string
|
||||
resolver.addAll();
|
||||
} else {
|
||||
const corePackages = await readCorePackages(workingdir);
|
||||
|
||||
// expo-notifications is required for shell apps in SDK >= 39
|
||||
// https://github.com/expo/expo/issues/10569
|
||||
if (semver.gte(sdkVersion, '39.0.0')) {
|
||||
resolver.addModule('expo-notifications');
|
||||
}
|
||||
|
||||
for (const pkg of corePackages) {
|
||||
if (resolver.isUnimodule(pkg)) {
|
||||
resolver.addModule(pkg);
|
||||
@@ -53,17 +77,36 @@ export async function resolveNativeModules(workingdir: string, packages?: string
|
||||
}
|
||||
}
|
||||
const modules = resolver.getModules();
|
||||
modules.forEach(({ name, version }) => { logger.info(`Adding ${name}:${version}`); });
|
||||
modules.forEach(({ name, version }) => {
|
||||
logger.info(`Adding ${name}:${version}`);
|
||||
});
|
||||
return modules;
|
||||
}
|
||||
|
||||
async function readCorePackages(workingdir: string) {
|
||||
const pkgJsonPath = path.join(workingdir, 'node_modules', 'react-native-unimodules', 'package.json');
|
||||
const expoPkgJsonPath = path.join(workingdir, 'packages', 'expo', 'package.json');
|
||||
if (await fs.pathExists(pkgJsonPath) && await fs.pathExists(expoPkgJsonPath)) {
|
||||
const pkgJsonPath = path.join(
|
||||
workingdir,
|
||||
'node_modules',
|
||||
'react-native-unimodules',
|
||||
'package.json',
|
||||
);
|
||||
const expoPkgJsonPath = path.join(
|
||||
workingdir,
|
||||
'packages',
|
||||
'expo',
|
||||
'package.json',
|
||||
);
|
||||
if (
|
||||
(await fs.pathExists(pkgJsonPath)) &&
|
||||
(await fs.pathExists(expoPkgJsonPath))
|
||||
) {
|
||||
const packageJson = JSON.parse(await fs.readFile(pkgJsonPath, 'utf-8'));
|
||||
const expoPackageJson = JSON.parse(await fs.readFile(expoPkgJsonPath, 'utf-8'));
|
||||
return keys(packageJson.dependencies).concat(keys(expoPackageJson.dependencies));
|
||||
const expoPackageJson = JSON.parse(
|
||||
await fs.readFile(expoPkgJsonPath, 'utf-8'),
|
||||
);
|
||||
return keys(packageJson.dependencies).concat(
|
||||
keys(expoPackageJson.dependencies),
|
||||
);
|
||||
} else {
|
||||
logger.warn('No core packages detected');
|
||||
return [];
|
||||
@@ -76,7 +119,7 @@ interface IDependencyInfo {
|
||||
|
||||
class Resolver {
|
||||
private workingdir: string;
|
||||
private modulesMap: {[key: string]: IUnimoduleEntry};
|
||||
private modulesMap: { [key: string]: IUnimoduleEntry };
|
||||
private dependencyMap: IDependencyInfo;
|
||||
|
||||
constructor(workingdir: string) {
|
||||
@@ -108,7 +151,7 @@ class Resolver {
|
||||
}
|
||||
|
||||
public getModules(): IUnimoduleEntry[] {
|
||||
return values(this.modulesMap);
|
||||
return values(this.modulesMap);
|
||||
}
|
||||
|
||||
private async resolveModule(moduleName: string) {
|
||||
@@ -127,7 +170,9 @@ class Resolver {
|
||||
}
|
||||
}
|
||||
|
||||
async function generateDependenciesInfo(workingdir: string): Promise<IDependencyInfo> {
|
||||
async function generateDependenciesInfo(
|
||||
workingdir: string,
|
||||
): Promise<IDependencyInfo> {
|
||||
const dir = await fs.readdir(path.join(workingdir, 'packages'));
|
||||
const map: IDependencyInfo = {};
|
||||
|
||||
@@ -140,7 +185,9 @@ async function generateDependenciesInfo(workingdir: string): Promise<IDependency
|
||||
}
|
||||
|
||||
// handle @unimodules directory
|
||||
const unimodulesDir = await fs.readdir(path.join(workingdir, 'packages', '@unimodules'));
|
||||
const unimodulesDir = await fs.readdir(
|
||||
path.join(workingdir, 'packages', '@unimodules'),
|
||||
);
|
||||
for (const pkgName of unimodulesDir) {
|
||||
const pkg = await getPackage(workingdir, path.join('@unimodules', pkgName));
|
||||
if (pkg) {
|
||||
@@ -155,19 +202,27 @@ async function generateDependenciesInfo(workingdir: string): Promise<IDependency
|
||||
return map;
|
||||
}
|
||||
|
||||
async function getPackage(workingdir: string, pkgName: string): Promise<IPackageInfo | null> {
|
||||
async function getPackage(
|
||||
workingdir: string,
|
||||
pkgName: string,
|
||||
): Promise<IPackageInfo | null> {
|
||||
const pkgPath = path.join(workingdir, 'packages', pkgName);
|
||||
const isAndroid = await fs.pathExists(path.join(pkgPath, 'android'));
|
||||
const isIos = await fs.pathExists(path.join(pkgPath, 'ios'));
|
||||
const isUnimodule = await fs.pathExists(path.join(pkgPath, 'unimodule.json'));
|
||||
const hasPackageJson = await fs.pathExists(path.join(pkgPath, 'package.json'));
|
||||
const hasPackageJson = await fs.pathExists(
|
||||
path.join(pkgPath, 'package.json'),
|
||||
);
|
||||
if (!isUnimodule || !hasPackageJson || (!isAndroid && !isIos)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(await fs.readFile(path.join(pkgPath, 'package.json'), 'utf-8'));
|
||||
const packageJson = JSON.parse(
|
||||
await fs.readFile(path.join(pkgPath, 'package.json'), 'utf-8'),
|
||||
);
|
||||
|
||||
const pkgDeps = merge({}, // reading everything to make sure
|
||||
const pkgDeps = merge(
|
||||
{}, // reading everything to make sure
|
||||
packageJson.dependencies,
|
||||
packageJson.peerDependencies,
|
||||
packageJson.unimodulePeerDependencies,
|
||||
|
||||
Vendored
+472
@@ -0,0 +1,472 @@
|
||||
interface pbxFile {
|
||||
basename: string;
|
||||
lastKnownFileType?: string;
|
||||
group?: string;
|
||||
path?: string;
|
||||
fileEncoding?: number;
|
||||
defaultEncoding?: number;
|
||||
sourceTree: string;
|
||||
includeInIndex?: number;
|
||||
explicitFileType?: unknown;
|
||||
settings?: object;
|
||||
uuid?: string;
|
||||
fileRef: string;
|
||||
target?: string;
|
||||
}
|
||||
|
||||
declare module 'xcode' {
|
||||
/**
|
||||
* UUID that is a key to each fragment of PBXProject.
|
||||
*/
|
||||
type UUID = string;
|
||||
|
||||
/**
|
||||
* if has following format `${UUID}_comment`
|
||||
*/
|
||||
type UUIDComment = string;
|
||||
|
||||
type XCObjectType =
|
||||
| 'PBXBuildFile'
|
||||
| 'PBXFileReference'
|
||||
| 'PBXFrameworksBuildPhase'
|
||||
| 'PBXGroup'
|
||||
| 'PBXNativeTarget'
|
||||
| 'PBXProject'
|
||||
| 'PBXResourcesBuildPhase'
|
||||
| 'PBXShellScriptBuildPhase'
|
||||
| 'PBXSourcesBuildPhase'
|
||||
| 'PBXVariantGroup'
|
||||
| 'XCBuildConfiguration'
|
||||
| 'XCConfigurationList';
|
||||
|
||||
type PBXFile = pbxFile;
|
||||
|
||||
interface PBXProject {
|
||||
isa: 'PBXProject';
|
||||
attributes: {
|
||||
LastUpgradeCheck: number;
|
||||
TargetAttributes: Record<
|
||||
UUID,
|
||||
{
|
||||
CreatedOnToolsVersion?: string;
|
||||
TestTargetID?: UUID;
|
||||
LastSwiftMigration?: number;
|
||||
ProvisioningStyle?: string;
|
||||
} & Record<string, undefined | number | string>
|
||||
>;
|
||||
};
|
||||
buildConfigurationList: UUID;
|
||||
buildConfigurationList_comment: string;
|
||||
compatibilityVersion: string;
|
||||
developmentRegion: string;
|
||||
hasScannedForEncodings: number;
|
||||
knownRegions: string[];
|
||||
mainGroup: UUID;
|
||||
productRefGroup: UUID;
|
||||
productRefGroup_comment: string;
|
||||
projectDirPath: string;
|
||||
projectRoot: string;
|
||||
targets: Array<{
|
||||
value: UUID;
|
||||
comment: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
interface PBXNativeTarget {
|
||||
isa: 'PBXNativeTarget';
|
||||
buildConfigurationList: UUID;
|
||||
buildConfigurationList_comment: string;
|
||||
buildPhases: Array<{
|
||||
value: UUID;
|
||||
comment: string;
|
||||
}>;
|
||||
buildRules: [];
|
||||
dependencies: [];
|
||||
name: string;
|
||||
productName: string;
|
||||
productReference: UUID;
|
||||
productReference_comment: string;
|
||||
productType: string;
|
||||
}
|
||||
|
||||
interface PBXBuildFile {
|
||||
isa: 'PBXBuildFile';
|
||||
fileRef: UUID;
|
||||
// "AppDelegate.m"
|
||||
fileRef_comment: string;
|
||||
}
|
||||
|
||||
interface XCConfigurationList {
|
||||
isa: 'XCConfigurationList';
|
||||
buildConfigurations: Array<{
|
||||
value: UUID;
|
||||
comment: string | 'Release' | 'Debug';
|
||||
}>;
|
||||
defaultConfigurationIsVisible: number;
|
||||
defaultConfigurationName: string;
|
||||
}
|
||||
|
||||
interface XCBuildConfiguration {
|
||||
isa: 'XCBuildConfiguration';
|
||||
baseConfigurationReference: UUID;
|
||||
baseConfigurationReference_comment: string;
|
||||
buildSettings: Record<string, string | undefined | number | Array<unknown>> & {
|
||||
// '"$(TARGET_NAME)"',
|
||||
PRODUCT_NAME?: string;
|
||||
// '"io.expo.demo.$(PRODUCT_NAME:rfc1034identifier)"',
|
||||
PRODUCT_BUNDLE_IDENTIFIER?: string;
|
||||
PROVISIONING_PROFILE_SPECIFIER?: string;
|
||||
// '"$(BUILT_PRODUCTS_DIR)/rni.app/rni"'
|
||||
TEST_HOST?: any;
|
||||
DEVELOPMENT_TEAM?: string;
|
||||
CODE_SIGN_IDENTITY?: string;
|
||||
CODE_SIGN_STYLE?: string;
|
||||
// '"$(TEST_HOST)"'
|
||||
BUNDLE_LOADER?: string;
|
||||
GCC_PREPROCESSOR_DEFINITIONS?: Array<unknown>;
|
||||
INFOPLIST_FILE?: string;
|
||||
IPHONEOS_DEPLOYMENT_TARGET?: string;
|
||||
LD_RUNPATH_SEARCH_PATHS?: string;
|
||||
OTHER_LDFLAGS?: Array<unknown>;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME?: string;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME?: string;
|
||||
CLANG_ANALYZER_NONNULL?: string;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS?: string;
|
||||
CLANG_WARN_INFINITE_RECURSION?: string;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE?: string;
|
||||
DEBUG_INFORMATION_FORMAT?: string;
|
||||
ENABLE_TESTABILITY?: string;
|
||||
GCC_NO_COMMON_BLOCKS?: string;
|
||||
// 'appletvos'
|
||||
SDKROOT?: string;
|
||||
TARGETED_DEVICE_FAMILY?: number | string;
|
||||
// '10.0'
|
||||
TVOS_DEPLOYMENT_TARGET?: string;
|
||||
};
|
||||
name: string;
|
||||
}
|
||||
|
||||
type ProductType =
|
||||
| 'com.apple.product-type.application'
|
||||
| 'com.apple.product-type.app-extension'
|
||||
| 'com.apple.product-type.bundle'
|
||||
| 'com.apple.product-type.tool'
|
||||
| 'com.apple.product-type.library.dynamic'
|
||||
| 'com.apple.product-type.framework'
|
||||
| 'com.apple.product-type.library.static'
|
||||
| 'com.apple.product-type.bundle.unit-test'
|
||||
| 'com.apple.product-type.application.watchapp'
|
||||
| 'com.apple.product-type.application.watchapp2'
|
||||
| 'com.apple.product-type.watchkit-extension'
|
||||
| 'com.apple.product-type.watchkit2-extension';
|
||||
|
||||
interface PBXGroup {
|
||||
isa: 'PBXGroup';
|
||||
children: Array<{
|
||||
value: UUID;
|
||||
comment?: string;
|
||||
}>;
|
||||
name: string;
|
||||
path?: string;
|
||||
sourceTree: '"<group>"' | unknown;
|
||||
}
|
||||
|
||||
export class XcodeProject {
|
||||
|
||||
/**
|
||||
* `.pbxproj` file path.
|
||||
*/
|
||||
public filepath: string;
|
||||
|
||||
// Ex: '$(TARGET_NAME)'
|
||||
public productName: string;
|
||||
|
||||
public hash: {
|
||||
headComment: string;
|
||||
project: {
|
||||
archiveVersion: number;
|
||||
objectVersion: number;
|
||||
objects: {
|
||||
[T in XCObjectType]: Record<
|
||||
string,
|
||||
{
|
||||
isa: T;
|
||||
name: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
>;
|
||||
};
|
||||
rootObject: string;
|
||||
rootObject_comment: string;
|
||||
};
|
||||
};
|
||||
constructor(pbxprojPath: string);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
//
|
||||
// `.pbxproj` related operation - starting & ending point.
|
||||
//
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* First step to be executed while working with `.pbxproj` file.
|
||||
*/
|
||||
public parse(callback?: (err: Error | null, results?: string) => void): this;
|
||||
|
||||
public parseSync(): void;
|
||||
|
||||
/**
|
||||
* @returns Content of .pbxproj file.
|
||||
*/
|
||||
public writeSync(options?: { omitEmptyValues?: boolean }): string;
|
||||
|
||||
public allUuids(): UUID[];
|
||||
public generateUuid(): UUID;
|
||||
|
||||
public addPluginFile(path: unknown, opt: unknown): unknown;
|
||||
public removePluginFile(path: unknown, opt: unknown): unknown;
|
||||
public addProductFile(targetPath: unknown, opt: unknown): unknown;
|
||||
public removeProductFile(path: unknown, opt: unknown): unknown;
|
||||
public addSourceFile(path: string, opt: unknown, group: string): unknown;
|
||||
public removeSourceFile(path: string, opt: unknown, group: string): unknown;
|
||||
public addHeaderFile(path: string, opt: unknown, group: string): unknown;
|
||||
public removeHeaderFile(path: string, opt: unknown, group: string): unknown;
|
||||
public addResourceFile(path: string, opt: unknown, group: string): unknown;
|
||||
public removeResourceFile(path: string, opt: unknown, group: string): unknown;
|
||||
public addFramework(fpath: unknown, opt: unknown): unknown;
|
||||
public removeFramework(fpath: unknown, opt: unknown): unknown;
|
||||
public addCopyfile(fpath: unknown, opt: unknown): unknown;
|
||||
public pbxCopyfilesBuildPhaseObj(target: unknown): unknown;
|
||||
public addToPbxCopyfilesBuildPhase(file: unknown): void;
|
||||
public removeCopyfile(fpath: unknown, opt: unknown): unknown;
|
||||
public removeFromPbxCopyfilesBuildPhase(file: unknown): void;
|
||||
public addStaticLibrary(path: unknown, opt: unknown): unknown;
|
||||
/**
|
||||
* Adds to `PBXBuildFile` section
|
||||
*/
|
||||
public addToPbxBuildFileSection(file: PBXFile): void;
|
||||
public removeFromPbxBuildFileSection(file: unknown): void;
|
||||
public addPbxGroup(
|
||||
filePathsArray: string[],
|
||||
name: string,
|
||||
path: string,
|
||||
sourceTree?: string,
|
||||
): { uuid: UUID; pbxGroup: PBXGroup };
|
||||
public removePbxGroup(groupName: unknown): void;
|
||||
public addToPbxProjectSection(target: unknown): void;
|
||||
public addToPbxNativeTargetSection(target: unknown): void;
|
||||
public addToPbxFileReferenceSection(file: any): void;
|
||||
public removeFromPbxFileReferenceSection(file: unknown): unknown;
|
||||
public addToXcVersionGroupSection(file: unknown): void;
|
||||
public addToPluginsPbxGroup(file: unknown): void;
|
||||
public removeFromPluginsPbxGroup(file: unknown): unknown;
|
||||
public addToResourcesPbxGroup(file: unknown): void;
|
||||
public removeFromResourcesPbxGroup(file: unknown): unknown;
|
||||
public addToFrameworksPbxGroup(file: unknown): void;
|
||||
public removeFromFrameworksPbxGroup(file: unknown): unknown;
|
||||
public addToPbxEmbedFrameworksBuildPhase(file: unknown): void;
|
||||
public removeFromPbxEmbedFrameworksBuildPhase(file: unknown): void;
|
||||
public addToProductsPbxGroup(file: unknown): void;
|
||||
public removeFromProductsPbxGroup(file: unknown): unknown;
|
||||
public addToPbxSourcesBuildPhase(file: unknown): void;
|
||||
public removeFromPbxSourcesBuildPhase(file: unknown): void;
|
||||
/**
|
||||
* Adds to PBXResourcesBuildPhase` section
|
||||
* @param resourcesBuildPhaseSectionKey Because there's might more than one `Resources` build phase we need to ensure file is placed under correct one.
|
||||
*/
|
||||
public addToPbxResourcesBuildPhase(file: PBXFile): void;
|
||||
public removeFromPbxResourcesBuildPhase(file: unknown): void;
|
||||
public addToPbxFrameworksBuildPhase(file: unknown): void;
|
||||
public removeFromPbxFrameworksBuildPhase(file: unknown): void;
|
||||
public addXCConfigurationList(
|
||||
configurationObjectsArray: unknown,
|
||||
defaultConfigurationName: unknown,
|
||||
comment: unknown,
|
||||
): {
|
||||
uuid: unknown;
|
||||
xcConfigurationList: {
|
||||
isa: string;
|
||||
buildConfigurations: Array<unknown>;
|
||||
defaultConfigurationIsVisible: number;
|
||||
defaultConfigurationName: unknown;
|
||||
};
|
||||
};
|
||||
public addTargetDependency(
|
||||
target: unknown,
|
||||
dependencyTargets: unknown,
|
||||
): {
|
||||
uuid: unknown;
|
||||
target: unknown;
|
||||
};
|
||||
public addBuildPhase(
|
||||
filePathsArray: unknown,
|
||||
buildPhaseType: unknown,
|
||||
comment: unknown,
|
||||
target: unknown,
|
||||
optionsOrFolderType: unknown,
|
||||
subfolderPath: unknown,
|
||||
): {
|
||||
uuid: unknown;
|
||||
buildPhase: {
|
||||
isa: unknown;
|
||||
buildActionMask: number;
|
||||
files: Array<unknown>;
|
||||
runOnlyForDeploymentPostprocessing: number;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Retrieves main part describing PBXProjects that are available in `.pbxproj` file.
|
||||
*/
|
||||
public pbxProjectSection(): Record<UUID, PBXProject> & Record<UUIDComment, string>;
|
||||
public pbxBuildFileSection(): Record<UUID, PBXBuildFile> & Record<UUIDComment, string>;
|
||||
public pbxXCBuildConfigurationSection(): Record<UUID, XCBuildConfiguration> &
|
||||
Record<UUIDComment, string>;
|
||||
public pbxFileReferenceSection(): Record<UUID, PBXFile> & Record<UUIDComment, string>;
|
||||
public pbxNativeTargetSection(): Record<UUID, PBXNativeTarget> & Record<UUIDComment, string>;
|
||||
public xcVersionGroupSection(): unknown;
|
||||
public pbxXCConfigurationList(): Record<UUID, XCConfigurationList> & Record<UUIDComment, string>;
|
||||
public pbxGroupByName(name: string): PBXGroup | undefined;
|
||||
/**
|
||||
* @param targetName in most cases it's the name of the application
|
||||
*/
|
||||
public pbxTargetByName(targetName: string): PBXNativeTarget | undefined;
|
||||
public findTargetKey(name: string): string;
|
||||
public pbxItemByComment(name: string, pbxSectionName: unknown): unknown;
|
||||
public pbxSourcesBuildPhaseObj(target: unknown): unknown;
|
||||
public pbxResourcesBuildPhaseObj(target: unknown): unknown;
|
||||
public pbxFrameworksBuildPhaseObj(target: unknown): unknown;
|
||||
public pbxEmbedFrameworksBuildPhaseObj(target: unknown): unknown;
|
||||
public buildPhase(group: unknown, target: unknown): string;
|
||||
public buildPhaseObject(name: string, group: unknown, target: unknown): unknown;
|
||||
public addBuildProperty(prop: unknown, value: unknown, build_name: unknown): void;
|
||||
public removeBuildProperty(prop: unknown, build_name: unknown): void;
|
||||
public updateBuildProperty(prop: string, value: unknown, build: string): void;
|
||||
public updateProductName(name: string): void;
|
||||
public removeFromFrameworkSearchPaths(file: unknown): void;
|
||||
public addToFrameworkSearchPaths(file: unknown): void;
|
||||
public removeFromLibrarySearchPaths(file: unknown): void;
|
||||
public addToLibrarySearchPaths(file: unknown): void;
|
||||
public removeFromHeaderSearchPaths(file: unknown): void;
|
||||
public addToHeaderSearchPaths(file: unknown): void;
|
||||
public addToOtherLinkerFlags(flag: unknown): void;
|
||||
public removeFromOtherLinkerFlags(flag: unknown): void;
|
||||
public addToBuildSettings(buildSetting: unknown, value: unknown): void;
|
||||
public removeFromBuildSettings(buildSetting: unknown): void;
|
||||
/**
|
||||
* Checks whether there is a file with given `filePath` in the project.
|
||||
*/
|
||||
public hasFile(filePath: string): PBXFile | false;
|
||||
public addTarget(
|
||||
name: unknown,
|
||||
type: unknown,
|
||||
subfolder: unknown,
|
||||
): {
|
||||
uuid: unknown;
|
||||
pbxNativeTarget: {
|
||||
isa: string;
|
||||
name: string;
|
||||
productName: string;
|
||||
productReference: unknown;
|
||||
productType: string;
|
||||
buildConfigurationList: unknown;
|
||||
buildPhases: Array<unknown>;
|
||||
buildRules: Array<unknown>;
|
||||
dependencies: Array<unknown>;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Get First PBXProject that can be found in `.pbxproj` file.
|
||||
*/
|
||||
public getFirstProject(): { uuid: UUID; firstProject: PBXProject };
|
||||
public getFirstTarget(): {
|
||||
uuid: UUID;
|
||||
firstTarget: unknown;
|
||||
};
|
||||
/**
|
||||
* Retrieves PBXNativeTarget by the type
|
||||
*/
|
||||
public getTarget(productType: ProductType): { uuid: UUID; target: PBXNativeTarget } | null;
|
||||
public addToPbxGroupType(file: unknown, groupKey: unknown, groupType: unknown): void;
|
||||
public addToPbxVariantGroup(file: unknown, groupKey: unknown): void;
|
||||
public addToPbxGroup(file: PBXFile, groupKey: UUID): void;
|
||||
public pbxCreateGroupWithType(name: unknown, pathName: unknown, groupType: unknown): unknown;
|
||||
public pbxCreateVariantGroup(name: unknown): unknown;
|
||||
public pbxCreateGroup(name: string, pathName: string): UUID;
|
||||
public removeFromPbxGroupAndType(file: unknown, groupKey: unknown, groupType: unknown): void;
|
||||
public removeFromPbxGroup(file: unknown, groupKey: unknown): void;
|
||||
public removeFromPbxVariantGroup(file: unknown, groupKey: unknown): void;
|
||||
public getPBXGroupByKeyAndType(key: unknown, groupType: unknown): unknown;
|
||||
/**
|
||||
* @param groupKey UUID.
|
||||
*/
|
||||
public getPBXGroupByKey(groupKey: string): PBXGroup | undefined;
|
||||
public getPBXVariantGroupByKey(key: unknown): unknown;
|
||||
public findPBXGroupKeyAndType(criteria: unknown, groupType: unknown): string;
|
||||
/**
|
||||
* @param criteria Params that should be used to locate desired PBXGroup.
|
||||
*/
|
||||
public findPBXGroupKey(criteria: { name?: string; path?: string }): UUID | undefined;
|
||||
public findPBXVariantGroupKey(criteria: unknown): string;
|
||||
public addLocalizationVariantGroup(
|
||||
name: unknown,
|
||||
): {
|
||||
uuid: unknown;
|
||||
fileRef: unknown;
|
||||
basename: unknown;
|
||||
};
|
||||
public addKnownRegion(name: string): void;
|
||||
public removeKnownRegion(name: string): void;
|
||||
public hasKnownRegion(name: string): boolean;
|
||||
public getPBXObject(name: string): unknown;
|
||||
/**
|
||||
* - creates `PBXFile`
|
||||
* - adds to `PBXFileReference` section
|
||||
* - adds to `PBXGroup` or `PBXVariantGroup` if applicable
|
||||
* @returns `null` if file is already in `pbxproj`.
|
||||
*/
|
||||
public addFile(
|
||||
path: string,
|
||||
group?: string,
|
||||
opt?: {
|
||||
plugin?: string;
|
||||
target?: string;
|
||||
variantGroup?: string;
|
||||
lastKnownFileType?: string;
|
||||
defaultEncoding?: 4;
|
||||
customFramework?: true;
|
||||
explicitFileType?: number;
|
||||
weak?: true;
|
||||
compilerFLags?: string;
|
||||
embed?: boolean;
|
||||
sign?: boolean;
|
||||
},
|
||||
): PBXFile | null;
|
||||
public removeFile(path: unknown, group: unknown, opt: unknown): unknown;
|
||||
public getBuildProperty(prop: unknown, build: unknown): unknown;
|
||||
public getBuildConfigByName(name: unknown): object;
|
||||
public addDataModelDocument(filePath: unknown, group: unknown, opt: unknown): unknown;
|
||||
public addTargetAttribute(prop: unknown, value: unknown, target: unknown): void;
|
||||
public removeTargetAttribute(prop: unknown, target: unknown): void;
|
||||
}
|
||||
|
||||
export function project(projectPath: string): XcodeProject;
|
||||
}
|
||||
|
||||
declare module 'xcode/lib/pbxFile' {
|
||||
export default class PBXFile implements pbxFile {
|
||||
public basename: string;
|
||||
public lastKnownFileType?: string;
|
||||
public group?: string;
|
||||
public path?: string;
|
||||
public fileEncoding?: number;
|
||||
public defaultEncoding?: number;
|
||||
public sourceTree: string;
|
||||
public includeInIndex?: number;
|
||||
public explicitFileType?: unknown;
|
||||
public settings?: object;
|
||||
public uuid?: string;
|
||||
public fileRef: string;
|
||||
public target?: string;
|
||||
constructor(file: string);
|
||||
}
|
||||
}
|
||||
+6
-1
@@ -10,5 +10,10 @@
|
||||
},
|
||||
"rulesDirectory": [
|
||||
"node_modules/tslint-eslint-rules/dist/rules"
|
||||
]
|
||||
],
|
||||
"linterOptions": {
|
||||
"exclude": [
|
||||
"src/types/xcode.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user