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