rn-ml
Version:
React Native cli tools
39 lines (38 loc) • 1.59 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.findXcodeProject = exports.IC_LAUNCHER = exports.resAndroidDir = exports.ANDROID_PLAY_STORE_SIZE = exports.LIST_PLATFORM = exports.DEFAULT_PLATFORM = exports.DEFAULT_ANDROID_SOURCE = exports.DEFAULT_IOS_SOURCE = exports.DEFAULT_ICON_IOS = exports.DEFAULT_ANDROID_FLAVOR = void 0;
const path_1 = __importDefault(require("path"));
exports.DEFAULT_ANDROID_FLAVOR = "main";
exports.DEFAULT_ICON_IOS = "AppIcon";
exports.DEFAULT_IOS_SOURCE = "./ios";
exports.DEFAULT_ANDROID_SOURCE = "./android";
exports.DEFAULT_PLATFORM = ["android", "ios"];
exports.LIST_PLATFORM = ["android", "ios", "ipad", "all"];
exports.ANDROID_PLAY_STORE_SIZE = 512;
const resAndroidDir = (flavor = "main") => `app/src/${flavor}/res`;
exports.resAndroidDir = resAndroidDir;
exports.IC_LAUNCHER = "ic_launcher";
function findXcodeProject(files) {
const sortedFiles = files.sort();
for (let i = sortedFiles.length - 1; i >= 0; i--) {
const fileName = files[i];
const ext = path_1.default.extname(fileName);
if (ext === ".xcworkspace") {
return {
name: fileName,
isWorkspace: true,
};
}
if (ext === ".xcodeproj") {
return {
name: fileName,
isWorkspace: false,
};
}
}
return null;
}
exports.findXcodeProject = findXcodeProject;
;