Android Export support
parent
f2c9df8178
commit
ccf834321b
|
|
@ -74,6 +74,10 @@ inputs:
|
|||
required: false
|
||||
default: ''
|
||||
description: 'The android target API level.'
|
||||
exportAsGoogleAndroidProject:
|
||||
required: false
|
||||
default: 'false'
|
||||
description: 'To export Google Android Studio project.'
|
||||
sshAgent:
|
||||
required: false
|
||||
default: ''
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ const cli_1 = __nccwpck_require__(55651);
|
|||
class BuildParameters {
|
||||
static create() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const buildFile = this.parseBuildFile(input_1.default.buildName, input_1.default.targetPlatform, input_1.default.androidAppBundle);
|
||||
const buildFile = this.parseBuildFile(input_1.default.buildName, input_1.default.targetPlatform, input_1.default.androidAppBundle, input_1.default.exportAsGoogleAndroidProject);
|
||||
const editorVersion = unity_versioning_1.default.determineUnityVersion(input_1.default.projectPath, input_1.default.unityVersion);
|
||||
const buildVersion = yield versioning_1.default.determineBuildVersion(input_1.default.versioningStrategy, input_1.default.specifiedVersion);
|
||||
const androidVersionCode = android_versioning_1.default.determineVersionCode(buildVersion, input_1.default.androidVersionCode);
|
||||
|
|
@ -264,6 +264,8 @@ class BuildParameters {
|
|||
androidKeyaliasPass: input_1.default.androidKeyaliasPass,
|
||||
androidTargetSdkVersion: input_1.default.androidTargetSdkVersion,
|
||||
androidSdkManagerParameters,
|
||||
androidAppBundle: input_1.default.androidAppBundle,
|
||||
exportAsGoogleAndroidProject: input_1.default.exportAsGoogleAndroidProject,
|
||||
customParameters: input_1.default.customParameters,
|
||||
sshAgent: input_1.default.sshAgent,
|
||||
gitPrivateToken: input_1.default.gitPrivateToken || (yield github_cli_1.GithubCliReader.GetGitHubAuthToken()),
|
||||
|
|
@ -301,11 +303,11 @@ class BuildParameters {
|
|||
};
|
||||
});
|
||||
}
|
||||
static parseBuildFile(filename, platform, androidAppBundle) {
|
||||
static parseBuildFile(filename, platform, androidAppBundle, exportAsGoogleAndroidProject) {
|
||||
if (platform_1.default.isWindows(platform)) {
|
||||
return `${filename}.exe`;
|
||||
}
|
||||
if (platform_1.default.isAndroid(platform)) {
|
||||
if (platform_1.default.isAndroid(platform) && !exportAsGoogleAndroidProject) {
|
||||
return androidAppBundle ? `${filename}.aab` : `${filename}.apk`;
|
||||
}
|
||||
return filename;
|
||||
|
|
@ -4605,6 +4607,8 @@ class ImageEnvironmentFactory {
|
|||
{ name: 'ANDROID_KEYALIAS_PASS', value: parameters.androidKeyaliasPass },
|
||||
{ name: 'ANDROID_TARGET_SDK_VERSION', value: parameters.androidTargetSdkVersion },
|
||||
{ name: 'ANDROID_SDK_MANAGER_PARAMETERS', value: parameters.androidSdkManagerParameters },
|
||||
{ name: 'ANDROID_APP_BUNDLE', value: parameters.androidAppBundle },
|
||||
{ name: 'EXPORT_AS_GOOGLE_ANDROID_PROJECT', value: parameters.exportAsGoogleAndroidProject },
|
||||
{ name: 'CUSTOM_PARAMETERS', value: parameters.customParameters },
|
||||
{ name: 'CHOWN_FILES_TO', value: parameters.chownFilesTo },
|
||||
{ name: 'GITHUB_REF', value: process.env.GITHUB_REF },
|
||||
|
|
@ -5164,6 +5168,10 @@ class Input {
|
|||
const input = Input.getInput('androidAppBundle') || false;
|
||||
return input === 'true';
|
||||
}
|
||||
static get exportAsGoogleAndroidProject() {
|
||||
const input = Input.getInput('exportAsGoogleAndroidProject') || false;
|
||||
return input === 'true';
|
||||
}
|
||||
static get androidKeystoreName() {
|
||||
return Input.getInput('androidKeystoreName') || '';
|
||||
}
|
||||
|
|
@ -5504,6 +5512,8 @@ class SetupMac {
|
|||
process.env.ANDROID_KEYALIAS_PASS = buildParameters.androidKeyaliasPass;
|
||||
process.env.ANDROID_TARGET_SDK_VERSION = buildParameters.androidTargetSdkVersion;
|
||||
process.env.ANDROID_SDK_MANAGER_PARAMETERS = buildParameters.androidSdkManagerParameters;
|
||||
process.env.ANDROID_APP_BUNDLE = buildParameters.androidAppBundle ? 'true' : 'false';
|
||||
process.env.EXPORT_AS_GOOGLE_ANDROID_PROJECT = buildParameters.exportAsGoogleAndroidProject ? 'true' : 'false';
|
||||
process.env.CUSTOM_PARAMETERS = buildParameters.customParameters;
|
||||
process.env.CHOWN_FILES_TO = buildParameters.chownFilesTo;
|
||||
});
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -144,6 +144,8 @@ echo ""
|
|||
-androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \
|
||||
-androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \
|
||||
-androidTargetSdkVersion "$ANDROID_TARGET_SDK_VERSION" \
|
||||
-androidAppBundle "$ANDROID_APP_BUNDLE" \
|
||||
-exportAsGoogleAndroidProject "$EXPORT_AS_GOOGLE_ANDROID_PROJECT" \
|
||||
$CUSTOM_PARAMETERS \
|
||||
> "$UNITY_PROJECT_PATH/out.log" 2>&1
|
||||
|
||||
|
|
|
|||
|
|
@ -141,6 +141,8 @@ unity-editor \
|
|||
-androidKeyaliasName "$ANDROID_KEYALIAS_NAME" \
|
||||
-androidKeyaliasPass "$ANDROID_KEYALIAS_PASS" \
|
||||
-androidTargetSdkVersion "$ANDROID_TARGET_SDK_VERSION" \
|
||||
-androidAppBundle "$ANDROID_APP_BUNDLE" \
|
||||
-exportAsGoogleAndroidProject "$EXPORT_AS_GOOGLE_ANDROID_PROJECT" \
|
||||
$CUSTOM_PARAMETERS
|
||||
|
||||
# Catch exit code
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ class BuildParameters {
|
|||
public androidKeyaliasPass!: string;
|
||||
public androidTargetSdkVersion!: string;
|
||||
public androidSdkManagerParameters!: string;
|
||||
public androidAppBundle!: boolean;
|
||||
public exportAsGoogleAndroidProject!: boolean;
|
||||
public customParameters!: string;
|
||||
public sshAgent!: string;
|
||||
public cloudRunnerCluster!: string;
|
||||
|
|
@ -67,7 +69,12 @@ class BuildParameters {
|
|||
public isCliMode!: boolean;
|
||||
|
||||
static async create(): Promise<BuildParameters> {
|
||||
const buildFile = this.parseBuildFile(Input.buildName, Input.targetPlatform, Input.androidAppBundle);
|
||||
const buildFile = this.parseBuildFile(
|
||||
Input.buildName,
|
||||
Input.targetPlatform,
|
||||
Input.androidAppBundle,
|
||||
Input.exportAsGoogleAndroidProject,
|
||||
);
|
||||
const editorVersion = UnityVersioning.determineUnityVersion(Input.projectPath, Input.unityVersion);
|
||||
const buildVersion = await Versioning.determineBuildVersion(Input.versioningStrategy, Input.specifiedVersion);
|
||||
const androidVersionCode = AndroidVersioning.determineVersionCode(buildVersion, Input.androidVersionCode);
|
||||
|
|
@ -110,6 +117,8 @@ class BuildParameters {
|
|||
androidKeyaliasPass: Input.androidKeyaliasPass,
|
||||
androidTargetSdkVersion: Input.androidTargetSdkVersion,
|
||||
androidSdkManagerParameters,
|
||||
androidAppBundle: Input.androidAppBundle,
|
||||
exportAsGoogleAndroidProject: Input.exportAsGoogleAndroidProject,
|
||||
customParameters: Input.customParameters,
|
||||
sshAgent: Input.sshAgent,
|
||||
gitPrivateToken: Input.gitPrivateToken || (await GithubCliReader.GetGitHubAuthToken()),
|
||||
|
|
@ -147,12 +156,12 @@ class BuildParameters {
|
|||
};
|
||||
}
|
||||
|
||||
static parseBuildFile(filename, platform, androidAppBundle) {
|
||||
static parseBuildFile(filename, platform, androidAppBundle, exportAsGoogleAndroidProject) {
|
||||
if (Platform.isWindows(platform)) {
|
||||
return `${filename}.exe`;
|
||||
}
|
||||
|
||||
if (Platform.isAndroid(platform)) {
|
||||
if (Platform.isAndroid(platform) && !exportAsGoogleAndroidProject) {
|
||||
return androidAppBundle ? `${filename}.aab` : `${filename}.apk`;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ class ImageEnvironmentFactory {
|
|||
{ name: 'ANDROID_KEYALIAS_PASS', value: parameters.androidKeyaliasPass },
|
||||
{ name: 'ANDROID_TARGET_SDK_VERSION', value: parameters.androidTargetSdkVersion },
|
||||
{ name: 'ANDROID_SDK_MANAGER_PARAMETERS', value: parameters.androidSdkManagerParameters },
|
||||
{ name: 'ANDROID_APP_BUNDLE', value: parameters.androidAppBundle },
|
||||
{ name: 'EXPORT_AS_GOOGLE_ANDROID_PROJECT', value: parameters.exportAsGoogleAndroidProject },
|
||||
{ name: 'CUSTOM_PARAMETERS', value: parameters.customParameters },
|
||||
{ name: 'CHOWN_FILES_TO', value: parameters.chownFilesTo },
|
||||
{ name: 'GITHUB_REF', value: process.env.GITHUB_REF },
|
||||
|
|
|
|||
|
|
@ -143,6 +143,12 @@ class Input {
|
|||
return input === 'true';
|
||||
}
|
||||
|
||||
static get exportAsGoogleAndroidProject() {
|
||||
const input = Input.getInput('exportAsGoogleAndroidProject') || false;
|
||||
|
||||
return input === 'true';
|
||||
}
|
||||
|
||||
static get androidKeystoreName() {
|
||||
return Input.getInput('androidKeystoreName') || '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,6 +95,8 @@ class SetupMac {
|
|||
process.env.ANDROID_KEYALIAS_PASS = buildParameters.androidKeyaliasPass;
|
||||
process.env.ANDROID_TARGET_SDK_VERSION = buildParameters.androidTargetSdkVersion;
|
||||
process.env.ANDROID_SDK_MANAGER_PARAMETERS = buildParameters.androidSdkManagerParameters;
|
||||
process.env.ANDROID_APP_BUNDLE = buildParameters.androidAppBundle ? 'true' : 'false';
|
||||
process.env.EXPORT_AS_GOOGLE_ANDROID_PROJECT = buildParameters.exportAsGoogleAndroidProject ? 'true' : 'false';
|
||||
process.env.CUSTOM_PARAMETERS = buildParameters.customParameters;
|
||||
process.env.CHOWN_FILES_TO = buildParameters.chownFilesTo;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue