Merge branch 'main' into aws-ts
commit
7e632cff17
|
|
@ -1,15 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using UnityBuilderAction.Input;
|
using UnityBuilderAction.Input;
|
||||||
using UnityBuilderAction.Reporting;
|
using UnityBuilderAction.Reporting;
|
||||||
using UnityBuilderAction.Versioning;
|
using UnityBuilderAction.Versioning;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.Build.Reporting;
|
using UnityEditor.Build.Reporting;
|
||||||
|
using UnityEngine;
|
||||||
#if USE_ADDRESSABLES
|
|
||||||
using UnityEditor.AddressableAssets.Settings;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace UnityBuilderAction
|
namespace UnityBuilderAction
|
||||||
{
|
{
|
||||||
|
|
@ -48,11 +45,28 @@ namespace UnityBuilderAction
|
||||||
if (buildPlayerOptions.target == BuildTarget.Android)
|
if (buildPlayerOptions.target == BuildTarget.Android)
|
||||||
AndroidSettings.Apply(options);
|
AndroidSettings.Apply(options);
|
||||||
|
|
||||||
// Execute default AddressableAsset content build, if the package is installed
|
// Execute default AddressableAsset content build, if the package is installed.
|
||||||
#if USE_ADDRESSABLES
|
// Version defines would be the best solution here, but Unity 2018 doesn't support that,
|
||||||
AddressableAssetSettings.CleanPlayerContent();
|
// so we fall back to using reflection instead.
|
||||||
AddressableAssetSettings.BuildPlayerContent();
|
var addressableAssetSettingsType = Type.GetType(
|
||||||
#endif
|
"UnityEditor.AddressableAssets.Settings.AddressableAssetSettings,Unity.Addressables.Editor");
|
||||||
|
if (addressableAssetSettingsType != null)
|
||||||
|
{
|
||||||
|
// ReSharper disable once PossibleNullReferenceException, used from try-catch
|
||||||
|
void CallAddressablesMethod(string methodName, object[] args) => addressableAssetSettingsType
|
||||||
|
.GetMethod(methodName, BindingFlags.Static | BindingFlags.Public)
|
||||||
|
.Invoke(null, args);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CallAddressablesMethod("CleanPlayerContent", new object[] { null });
|
||||||
|
CallAddressablesMethod("BuildPlayerContent", Array.Empty<object>());
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError($"Failed to run default addressables build:\n{e}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Perform build
|
// Perform build
|
||||||
BuildReport buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions);
|
BuildReport buildReport = BuildPipeline.BuildPlayer(buildPlayerOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "UnityBuilderAction",
|
"name": "UnityBuilderAction",
|
||||||
"references": [
|
"references": [],
|
||||||
"Unity.Addressables.Editor"
|
|
||||||
],
|
|
||||||
"includePlatforms": [
|
"includePlatforms": [
|
||||||
"Editor"
|
"Editor"
|
||||||
],
|
],
|
||||||
|
|
@ -12,12 +10,6 @@
|
||||||
"precompiledReferences": [],
|
"precompiledReferences": [],
|
||||||
"autoReferenced": true,
|
"autoReferenced": true,
|
||||||
"defineConstraints": [],
|
"defineConstraints": [],
|
||||||
"versionDefines": [
|
"versionDefines": [],
|
||||||
{
|
|
||||||
"name": "com.unity.addressables",
|
|
||||||
"expression": "1.0.0",
|
|
||||||
"define": "USE_ADDRESSABLES"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"noEngineReferences": false
|
"noEngineReferences": false
|
||||||
}
|
}
|
||||||
|
|
@ -5732,8 +5732,9 @@ xmlchars@^2.2.0:
|
||||||
integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==
|
integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==
|
||||||
|
|
||||||
y18n@^4.0.0:
|
y18n@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"
|
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4"
|
||||||
|
integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==
|
||||||
|
|
||||||
yallist@^4.0.0:
|
yallist@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue