var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.getPlatformProjectDir=exports.ejectPlatform=exports.getOriginalPlatformTemplatesDir=exports.getTemplateRootDir=exports.getTemplateProjectDir=exports.getPlatformOutputDir=exports.getPlatformBuildDir=void 0;var _path=_interopRequireDefault(require("path"));
var _common=require("../core/common");
var _logger=require("../core/systemManager/logger");
var _constants=require("../core/constants");











var _fileutils=require("../core/systemManager/fileutils");
var _resolve=require("../core/resolve");


var getPlatformBuildDir=function getPlatformBuildDir(c){return(0,_common.getAppFolder)(c);};exports.getPlatformBuildDir=getPlatformBuildDir;

var getPlatformOutputDir=function getPlatformOutputDir(){
(0,_logger.logError)('core engine does not support getPlatformOutputDir');
return null;
};exports.getPlatformOutputDir=getPlatformOutputDir;

var getTemplateProjectDir=function getTemplateProjectDir(c){
var dir=(0,_common.getTemplateDir)(c);
var output;
switch(c.platform){
case _constants.TIZEN:
case _constants.TIZEN_WATCH:
case _constants.TIZEN_MOBILE:
case _constants.WEBOS:
case _constants.KAIOS:
case _constants.WEB:
case _constants.FIREFOX_OS:
case _constants.FIREFOX_TV:
case _constants.CHROMECAST:
output=_path.default.join(dir,_constants.RNV_PROJECT_DIR_NAME);
break;
default:
output=dir;}

return output;
};exports.getTemplateProjectDir=getTemplateProjectDir;

var getTemplateRootDir=function getTemplateRootDir(c,platform){
var dir=c.paths.project.platformTemplatesDirs[platform];
return dir;
};exports.getTemplateRootDir=getTemplateRootDir;

var getOriginalPlatformTemplatesDir=function getOriginalPlatformTemplatesDir(){return _path.default.join((0,_resolve.doResolve)('@rnv/engine-rn-web'),'platformTemplates');};exports.getOriginalPlatformTemplatesDir=getOriginalPlatformTemplatesDir;

var ejectPlatform=function ejectPlatform(c,platform,destFolder){
var sourcePlatformDir=getTemplateRootDir(c,platform);
(0,_fileutils.copyFolderContentsRecursiveSync)(
_path.default.join(sourcePlatformDir,platform),
destFolder);

(0,_fileutils.copyFolderContentsRecursiveSync)(
_path.default.join(sourcePlatformDir,'_shared'),
destFolder);

};exports.ejectPlatform=ejectPlatform;

var getPlatformProjectDir=function getPlatformProjectDir(c){
var dir=getPlatformBuildDir(c);
var output;
switch(c.platform){
case _constants.TIZEN:
case _constants.TIZEN_WATCH:
case _constants.TIZEN_MOBILE:
case _constants.WEBOS:
case _constants.KAIOS:
case _constants.WEB:
case _constants.FIREFOX_OS:
case _constants.FIREFOX_TV:
case _constants.CHROMECAST:
output=_path.default.join(dir,_constants.RNV_PROJECT_DIR_NAME);
break;
default:
output=dir;}

return output;
};exports.getPlatformProjectDir=getPlatformProjectDir;
//# sourceMappingURL=commonEngine.js.map