-
-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor models to allow for build parameters...
Build parameters have to be parsed because they can no longer be implicitly passed, as they need to be interpreted for detecting extensions.
- Loading branch information
1 parent
a84535f
commit 1d1f81c
Showing
10 changed files
with
172 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import Platform from './platform'; | ||
|
||
class BuildParameters { | ||
static create(parameters) { | ||
const { | ||
unityVersion, | ||
targetPlatform, | ||
projectPath, | ||
buildName, | ||
buildsPath, | ||
buildMethod, | ||
} = parameters; | ||
|
||
return { | ||
version: unityVersion, | ||
platform: targetPlatform, | ||
projectPath, | ||
buildName, | ||
buildPath: `${buildsPath}/${targetPlatform}`, | ||
buildFile: this.parseBuildFile(buildName, targetPlatform), | ||
buildMethod, | ||
}; | ||
} | ||
|
||
static parseBuildFile(filename, platform) { | ||
if (Platform.isWindows(platform)) { | ||
return `${filename}.exe`; | ||
} | ||
|
||
if (Platform.isAndroid(platform)) { | ||
return `${filename}.apk`; | ||
} | ||
|
||
return filename; | ||
} | ||
} | ||
|
||
export default BuildParameters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,26 @@ | ||
import Platform from './platform'; | ||
|
||
const core = require('@actions/core'); | ||
|
||
export default class Input { | ||
class Input { | ||
static getFromUser() { | ||
// Input variables specified in workflows using "with" prop. | ||
const version = core.getInput('unityVersion'); | ||
const platform = core.getInput('targetPlatform'); | ||
const unityVersion = core.getInput('unityVersion'); | ||
const targetPlatform = core.getInput('targetPlatform') || Platform.default; | ||
const projectPath = core.getInput('projectPath'); | ||
const buildName = core.getInput('buildName'); | ||
const buildsPath = core.getInput('buildsPath'); | ||
const buildMethod = core.getInput('buildMethod'); | ||
const buildName = core.getInput('buildName') || targetPlatform; | ||
const buildsPath = core.getInput('buildsPath') || 'build'; | ||
const buildMethod = core.getInput('buildMethod'); // processed in docker file | ||
|
||
return { | ||
version, | ||
platform, | ||
unityVersion, | ||
targetPlatform, | ||
projectPath, | ||
buildName, | ||
buildsPath, | ||
method: buildMethod, | ||
buildMethod, | ||
}; | ||
} | ||
} | ||
|
||
export default Input; |
Oops, something went wrong.