"use strict";var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");_Object$defineProperty(exports, "__esModule", { value: true });exports.unUsedFiles = exports.TEMP = exports.SRC = exports.RELEASE_PRIVATE_KEY = exports.RELEASE_CERTIFICATE = exports.PROJECT_WEBPACK_CONFIG = exports.PROJECT_PATH = exports.PROJECT_CONFIG = exports.PLUGIN_COCOS_BUILD = exports.PLUGIN_COCOS = exports.MANIFEST = exports.ENTRY = exports.ENGINE = exports.DIST = exports.DEBUG_PRIVATE_KEY = exports.DEBUG_CERTIFICATE = exports.BUILDTEMP = exports.BUILD = void 0;exports.updateProject = updateProject;



var _path = _interopRequireDefault(require("path"));
var _index = require("../../cli-shared-utils/index.js");
var ct = _interopRequireWildcard(require("./constanst.js"));function _getRequireWildcardCache(e) {if ("function" != typeof _WeakMap) return null;var r = new _WeakMap(),t = new _WeakMap();return (_getRequireWildcardCache = function (e) {return e ? t : r;})(e);}function _interopRequireWildcard(e, r) {if (!r && e && e.__esModule) return e;if (null === e || "object" != typeof e && "function" != typeof e) return { default: e };var t = _getRequireWildcardCache(r);if (t && t.has(e)) return t.get(e);var n = { __proto__: null },a = _Object$defineProperty && _Object$getOwnPropertyDescriptor;for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null;i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u];}return n.default = e, t && t.set(e, n), n;} /**
 * 导出小游戏项目相关的路径
 */ // 小游戏工程目录
let PROJECT_PATH = exports.PROJECT_PATH = _index.projectPath;
// 小游戏工程src目录
let SRC = exports.SRC = _path.default.resolve(PROJECT_PATH, ct.SRC);
// 小游戏工程build目录
let BUILD = exports.BUILD = _path.default.resolve(PROJECT_PATH, ct.BUILD);
let BUILDTEMP = exports.BUILDTEMP = _path.default.resolve(PROJECT_PATH, ct.BUILDTEMP);
// 小游戏工程dist目录
let DIST = exports.DIST = _path.default.resolve(PROJECT_PATH, ct.DIST);
// 小游戏工程临时dist目录，打原整包时临时使用，打包完成删除
let TEMP = exports.TEMP = _path.default.resolve(PROJECT_PATH, ct.TEMP);
// 小游戏工程主入口 src/game.js
let ENTRY = exports.ENTRY = _path.default.resolve(SRC, ct.ENTRY);
// 小游戏工程的配置文件 src/manifest.json
let MANIFEST = exports.MANIFEST = _path.default.resolve(SRC, ct.MANIFEST);
// 小游戏工程src目录
let ENGINE = exports.ENGINE = _path.default.resolve(PROJECT_PATH, 'engine');

// 导出小游戏工程目录下的webpack配置文件，用于postHook
let PROJECT_WEBPACK_CONFIG = exports.PROJECT_WEBPACK_CONFIG = _path.default.join(PROJECT_PATH, 'config', ct.WEBPACK_CONFIG_FILE);
// 导出小游戏工程目录下的配置文件路径
let PROJECT_CONFIG = exports.PROJECT_CONFIG = _path.default.join(PROJECT_PATH, ct.MINIGAME_CONFIG);

// 导出证书路径
let DEBUG_PRIVATE_KEY = exports.DEBUG_PRIVATE_KEY = _path.default.join(__dirname, 'signature', 'debug', 'private.pem');
let DEBUG_CERTIFICATE = exports.DEBUG_CERTIFICATE = _path.default.join(__dirname, 'signature', 'debug', 'certificate.pem');
let RELEASE_PRIVATE_KEY = exports.RELEASE_PRIVATE_KEY = _path.default.join(PROJECT_PATH, 'sign', 'release', 'private.pem');
let RELEASE_CERTIFICATE = exports.RELEASE_CERTIFICATE = _path.default.join(PROJECT_PATH, 'sign', 'release', 'certificate.pem');

// 将根目录下的COCOS plugin也都copy到build目录下, 解决cocos2.3.4版本问题
let PLUGIN_COCOS = exports.PLUGIN_COCOS = _path.default.resolve(PROJECT_PATH, ct.COCOS_LIBRARY);
let PLUGIN_COCOS_BUILD = exports.PLUGIN_COCOS_BUILD = _path.default.resolve(BUILD, ct.COCOS_LIBRARY);

let unUsedFiles = exports.unUsedFiles = [];

function updateProject(newProjectPath) {
  (0, _index.updateProjectPath)(newProjectPath);
  exports.PROJECT_PATH = PROJECT_PATH = _index.projectPath;
  exports.SRC = SRC = _path.default.resolve(PROJECT_PATH, ct.SRC);
  exports.BUILD = BUILD = _path.default.resolve(PROJECT_PATH, ct.BUILD);
  exports.BUILDTEMP = BUILDTEMP = _path.default.resolve(PROJECT_PATH, ct.BUILDTEMP);
  exports.DIST = DIST = _path.default.resolve(PROJECT_PATH, ct.DIST);
  exports.TEMP = TEMP = _path.default.resolve(PROJECT_PATH, ct.TEMP);
  exports.ENTRY = ENTRY = _path.default.resolve(SRC, ct.ENTRY);
  exports.ENGINE = ENGINE = _path.default.resolve(PROJECT_PATH, 'engine');
  exports.MANIFEST = MANIFEST = _path.default.resolve(SRC, ct.MANIFEST);
  exports.PROJECT_WEBPACK_CONFIG = PROJECT_WEBPACK_CONFIG = _path.default.join(PROJECT_PATH, 'config', ct.WEBPACK_CONFIG_FILE);
  exports.PROJECT_CONFIG = PROJECT_CONFIG = _path.default.join(PROJECT_PATH, ct.MINIGAME_CONFIG);
  exports.DEBUG_PRIVATE_KEY = DEBUG_PRIVATE_KEY = _path.default.join(__dirname, 'signature', 'debug', 'private.pem');
  exports.DEBUG_CERTIFICATE = DEBUG_CERTIFICATE = _path.default.join(__dirname, 'signature', 'debug', 'certificate.pem');
  exports.RELEASE_PRIVATE_KEY = RELEASE_PRIVATE_KEY = _path.default.join(PROJECT_PATH, 'sign', 'release', 'private.pem');
  exports.RELEASE_CERTIFICATE = RELEASE_CERTIFICATE = _path.default.join(PROJECT_PATH, 'sign', 'release', 'certificate.pem');
  exports.PLUGIN_COCOS = PLUGIN_COCOS = _path.default.resolve(PROJECT_PATH, ct.COCOS_LIBRARY);
  exports.PLUGIN_COCOS_BUILD = PLUGIN_COCOS_BUILD = _path.default.resolve(BUILD, ct.COCOS_LIBRARY);
  exports.unUsedFiles = unUsedFiles = [];
}