unity-builder/src/model/build-parameters.js

43 lines
829 B
JavaScript
Raw Normal View History

import Platform from './platform';
class BuildParameters {
static create(parameters) {
const {
version,
targetPlatform,
projectPath,
buildName,
buildsPath,
buildMethod,
buildVersion,
2020-01-27 18:39:49 +00:00
customParameters,
} = parameters;
return {
version,
platform: targetPlatform,
projectPath,
buildName,
buildPath: `${buildsPath}/${targetPlatform}`,
buildFile: this.parseBuildFile(buildName, targetPlatform),
buildMethod,
buildVersion,
2020-01-27 18:39:49 +00:00
customParameters,
};
}
static parseBuildFile(filename, platform) {
if (Platform.isWindows(platform)) {
return `${filename}.exe`;
}
if (Platform.isAndroid(platform)) {
return `${filename}.apk`;
}
return filename;
}
}
export default BuildParameters;