Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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

4 changes: 4 additions & 0 deletions source/ExportUnityPackage/export_unity_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -1851,6 +1851,10 @@ def importer_metadata(self):
if "Android" in platforms and cpu_string != "AnyCPU":
importer_metadata = Asset.set_cpu_for_android(
importer_metadata, cpu_string)
# Set validateReferences, if requested, which should be either 0 or 1
validateRef = safe_dict_get_value(self._json, "validateReferences", default_value=2)
if validateRef == 0 or validateRef == 1:
importer_metadata["PluginImporter"]["validateReferences"] = validateRef
else:
raise ProjectConfigurationError(
"Unknown importer type %s for package %s, paths %s" % (
Expand Down
32 changes: 24 additions & 8 deletions source/IOSResolver/src/IOSResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -843,25 +843,41 @@ public static void SettingsDialog() {
/// </summary>
internal static bool MultipleXcodeTargetsSupported {
get {
return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
"GetUnityMainTargetGuid", Type.EmptyTypes) != null;
try {
return MultipleXcodeTargetsSupportedInternal();
} catch (Exception e) {
return false;
}
}
}

private static bool MultipleXcodeTargetsSupportedInternal() {
return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
"GetUnityMainTargetGuid", Type.EmptyTypes) != null;
}

/// <summary>
/// Name of the Xcode main target generated by Unity.
/// </summary>
public static string XcodeMainTargetName {
get {
// NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
// longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
// so we'll use this constant as a relatively safe default.
return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
(string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
"GetUnityTargetName", null);
try {
return XcodeMainTargetNameInternal();
} catch (Exception e) {
return "Unity-iPhone";
}
}
}

private static string XcodeMainTargetNameInternal() {
// NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
// longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
// so we'll use this constant as a relatively safe default.
return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
(string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
"GetUnityTargetName", null);
}

/// <summary>
/// Name of the Xcode UnityFramework target generated by Unity 2019.3+
/// </summary>
Expand Down
Loading