mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-03 07:29:07 +08:00
43 lines
829 B
JavaScript
43 lines
829 B
JavaScript
import Platform from './platform';
|
|
|
|
class BuildParameters {
|
|
static create(parameters) {
|
|
const {
|
|
version,
|
|
targetPlatform,
|
|
projectPath,
|
|
buildName,
|
|
buildsPath,
|
|
buildMethod,
|
|
buildVersion,
|
|
customParameters,
|
|
} = parameters;
|
|
|
|
return {
|
|
version,
|
|
platform: targetPlatform,
|
|
projectPath,
|
|
buildName,
|
|
buildPath: `${buildsPath}/${targetPlatform}`,
|
|
buildFile: this.parseBuildFile(buildName, targetPlatform),
|
|
buildMethod,
|
|
buildVersion,
|
|
customParameters,
|
|
};
|
|
}
|
|
|
|
static parseBuildFile(filename, platform) {
|
|
if (Platform.isWindows(platform)) {
|
|
return `${filename}.exe`;
|
|
}
|
|
|
|
if (Platform.isAndroid(platform)) {
|
|
return `${filename}.apk`;
|
|
}
|
|
|
|
return filename;
|
|
}
|
|
}
|
|
|
|
export default BuildParameters;
|