Skip to content

Commit 9f684e0

Browse files
author
Joshua Peterson
authored
Merge pull request #1183 from Unity-Technologies/add-mising-codedom-unityaot
Compile ProcessImportedType in IDataContractSurrogate for unityaot
2 parents a69e92f + 0e66d19 commit 9f684e0

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

mcs/class/Facades/System.Runtime.Serialization.Xml/DataContractSerializerExtensions.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
#if !NO_CODEDOM
5+
#if !NO_CODEDOM || UNITY_AOT
66
using System.CodeDom;
77
#endif
88
using System.Collections.ObjectModel;
@@ -73,7 +73,7 @@ public Type GetReferencedTypeOnImport(string typeName, string typeNamespace, obj
7373
throw NotImplemented.ByDesign;
7474
}
7575

76-
#if !NO_CODEDOM
76+
#if !NO_CODEDOM || UNITY_AOT
7777
public CodeTypeDeclaration ProcessImportedType(CodeTypeDeclaration typeDeclaration, CodeCompileUnit compileUnit)
7878
{
7979
throw NotImplemented.ByDesign;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#if UNITY_AOT
2+
3+
public class CodeCompileUnit
4+
{
5+
}
6+
7+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#if UNITY_AOT
2+
3+
public class CodeTypeDeclaration
4+
{
5+
}
6+
7+
#endif

mcs/class/System/unityaot_System.dll.sources

+2
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
../System.Web/System.Web/HttpUtility.cs
33
../System.Web/System.Web.Util/Helpers.cs
44
../System.Web/System.Web.Util/HttpEncoder.cs
5+
System.CodeDom/CodeCompileUnit.cs
6+
System.CodeDom/CodeTypeDeclaration.cs

mcs/class/referencesource/System.Runtime.Serialization/System/Runtime/Serialization/IDataContractSurrogate.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public interface IDataContractSurrogate
1717
object GetCustomDataToExport(Type clrType, Type dataContractType);
1818
void GetKnownCustomDataTypes(Collection<Type> customDataTypes);
1919
Type GetReferencedTypeOnImport(string typeName, string typeNamespace, object customData);
20-
#if !NO_CODEDOM
20+
#if !NO_CODEDOM || UNITY_AOT
2121
CodeTypeDeclaration ProcessImportedType(CodeTypeDeclaration typeDeclaration, CodeCompileUnit compileUnit);
2222
#endif
2323
}
@@ -70,11 +70,11 @@ internal static Type GetReferencedTypeOnImport(IDataContractSurrogate surrogate,
7070
return null;
7171
return surrogate.GetReferencedTypeOnImport(typeName, typeNamespace, customData);
7272
}
73-
#if !NO_CODEDOM
73+
#if !NO_CODEDOM || UNITY_AOT
7474
internal static CodeTypeDeclaration ProcessImportedType(IDataContractSurrogate surrogate, CodeTypeDeclaration typeDeclaration, CodeCompileUnit compileUnit)
7575
{
7676
return surrogate.ProcessImportedType(typeDeclaration, compileUnit);
7777
}
7878
#endif
7979
}
80-
}
80+
}

0 commit comments

Comments
 (0)