Skip to content

Commit

Permalink
Fix image tag for linux il2cpp. Force tests to use il2cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKahr committed Feb 19, 2024
1 parent 76cd6f5 commit cee104a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 917 deletions.
15 changes: 10 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions src/model/image-tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ImageTag {
buildPlatform,
containerRegistryRepository,
containerRegistryImageVersion,
providerStrategy,
} = imageProperties;

if (!ImageTag.versionPattern.test(editorVersion)) {
Expand All @@ -31,7 +32,11 @@ class ImageTag {
this.repository = containerRegistryRepository;
this.editorVersion = editorVersion;
this.targetPlatform = targetPlatform;
this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion);
this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(
targetPlatform,
editorVersion,
providerStrategy,
);
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(buildPlatform);
this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version.
}
Expand Down Expand Up @@ -72,7 +77,11 @@ class ImageTag {
}
}

static getTargetPlatformToTargetPlatformSuffixMap(platform: string, version: string): string {
static getTargetPlatformToTargetPlatformSuffixMap(
platform: string,
version: string,
providerStrategy: string,
): string {
const { generic, webgl, mac, windows, windowsIl2cpp, wsaPlayer, linux, linuxIl2cpp, android, ios, tvos, facebook } =
ImageTag.targetPlatformSuffixes;

Expand Down Expand Up @@ -100,8 +109,12 @@ class ImageTag {
return windows;
case Platform.types.StandaloneLinux64: {
// Unity versions before 2019.3 do not support il2cpp
if (process.env.USE_IL2CPP === 'true' && (major >= 2020 || (major === 2019 && minor >= 3))) {
return linuxIl2cpp;
if (major >= 2020 || (major === 2019 && minor >= 3)) {
if (providerStrategy === 'local') {
return linuxIl2cpp;
} else {
return process.env.USE_IL2CPP === 'true' ? linuxIl2cpp : linux;
}
}

return linux;
Expand Down
8 changes: 5 additions & 3 deletions test-project/ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,8 @@ PlayerSettings:
platformArchitecture: {}
scriptingBackend:
Android: 1
Server: 1
Standalone: 1
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
Expand All @@ -821,16 +823,16 @@ PlayerSettings:
apiCompatibilityLevelPerPlatform: {}
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: Template_3D
metroPackageVersion:
metroPackageName: Template3D
metroPackageVersion: 1.0.0.0
metroCertificatePath:
metroCertificatePassword:
metroCertificateSubject:
metroCertificateIssuer:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: Template_3D
wsaImages: {}
metroTileShortName:
metroTileShortName: TestProject
metroTileShowName: 0
metroMediumTileShowName: 0
metroLargeTileShowName: 0
Expand Down
Loading

0 comments on commit cee104a

Please sign in to comment.