2020-05-21 15:44:56 +00:00
|
|
|
import Input from './input';
|
2020-01-20 23:06:14 +00:00
|
|
|
import Platform from './platform';
|
2020-05-21 15:44:56 +00:00
|
|
|
import Versioning from './versioning';
|
2020-01-20 23:06:14 +00:00
|
|
|
|
|
|
|
class BuildParameters {
|
2020-05-21 15:44:56 +00:00
|
|
|
static async create() {
|
|
|
|
const buildFile = this.parseBuildFile(Input.buildName, Input.targetPlatform);
|
|
|
|
const buildVersion = await Versioning.determineVersion(
|
|
|
|
Input.versioningStrategy,
|
|
|
|
Input.specifiedVersion,
|
|
|
|
);
|
2020-01-20 23:06:14 +00:00
|
|
|
|
|
|
|
return {
|
2020-05-21 15:44:56 +00:00
|
|
|
version: Input.unityVersion,
|
|
|
|
platform: Input.targetPlatform,
|
|
|
|
projectPath: Input.projectPath,
|
|
|
|
buildName: Input.buildName,
|
|
|
|
buildPath: `${Input.buildsPath}/${Input.targetPlatform}`,
|
|
|
|
buildFile,
|
|
|
|
buildMethod: Input.buildMethod,
|
2020-04-26 18:22:09 +00:00
|
|
|
buildVersion,
|
2020-05-21 15:44:56 +00:00
|
|
|
customParameters: Input.customParameters,
|
2020-01-20 23:06:14 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
static parseBuildFile(filename, platform) {
|
|
|
|
if (Platform.isWindows(platform)) {
|
|
|
|
return `${filename}.exe`;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Platform.isAndroid(platform)) {
|
|
|
|
return `${filename}.apk`;
|
|
|
|
}
|
|
|
|
|
|
|
|
return filename;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default BuildParameters;
|