///<reference path=".d.ts"/>
"use strict";
var path = require("path");
var StaticConfigBase = (function () {
function StaticConfigBase($injector) {
this.$injector = $injector;
this.PROJECT_FILE_NAME = null;
this.CLIENT_NAME = null;
this.ANALYTICS_API_KEY = null;
this.ANALYTICS_INSTALLATION_ID_SETTING_NAME = null;
this.TRACK_FEATURE_USAGE_SETTING_NAME = null;
this.ERROR_REPORT_SETTING_NAME = null;
this.APP_RESOURCES_DIR_NAME = "App_Resources";
this.COMMAND_HELP_FILE_NAME = 'command-help.json';
this.RESOURCE_DIR_PATH = __dirname;
this.version = null;
this._adbFilePath = null;
}
Object.defineProperty(StaticConfigBase.prototype, "helpTextPath", {
get: function () {
return null;
},
enumerable: true,
configurable: true
});
StaticConfigBase.prototype.getAdbFilePath = function () {
var _this = this;
return (function () {
if (!_this._adbFilePath) {
_this._adbFilePath = _this.getAdbFilePathCore().wait();
}
return _this._adbFilePath;
}).future()();
};
Object.defineProperty(StaticConfigBase.prototype, "MAN_PAGES_DIR", {
get: function () {
return path.join(__dirname, "../../", "docs", "man_pages");
},
enumerable: true,
configurable: true
});
Object.defineProperty(StaticConfigBase.prototype, "HTML_PAGES_DIR", {
get: function () {
return path.join(__dirname, "../../", "docs", "html");
},
enumerable: true,
configurable: true
});
Object.defineProperty(StaticConfigBase.prototype, "HTML_COMMON_HELPERS_DIR", {
get: function () {
return path.join(__dirname, "docs", "helpers");
},
enumerable: true,
configurable: true
});
StaticConfigBase.prototype.getAdbFilePathCore = function () {
var _this = this;
return (function () {
var defaultAdbFilePath = path.join(__dirname, "resources/platform-tools/android/" + process.platform + "/adb");
var $childProcess = _this.$injector.resolve("$childProcess");
try {
var proc = $childProcess.spawnFromEvent("adb", ["version"], "exit", undefined, { throwError: false }).wait();
if (proc.stderr) {
return defaultAdbFilePath;
}
}
catch (e) {
if (e.code === "ENOENT") {
return defaultAdbFilePath;
}
}
return "adb";
}).future()();
};
return StaticConfigBase;
})();
exports.StaticConfigBase = StaticConfigBase;
|