Commit Graph

4139 Commits

Author SHA1 Message Date
vis2k
851ad16a17
breaking: Weaver: add ReaderWriterProcessor [Runtime/InitializeOnLoad] Attributes without Reflection (#2893)
* breaking: Weaver: [InitializeOnLoad] attribute is now added without using Reflection.
(possibly a breaking change according to the comment, although it's not obvious why it would break)

* breaking: Weaver: [RuntimeInitializeOnLoad] attribute is now added without using Reflection.
(possibly a breaking change according to the comment, although it's not obvious why it would break)

* comments

* fix builds
2021-08-27 21:06:22 +08:00
vis2k
e87f1cb6eb Weaver: IsEditorAssembly moved into Helpers 2021-08-26 15:38:24 +08:00
vis2k
67418620fc Weave: WeaveFromFile simplified 2021-08-26 13:16:05 +08:00
vis2k
bf5b0e36ec Weaver: FindMirrorRuntime changed to FindCompilationPipelineAssembly 2021-08-26 13:08:31 +08:00
vis2k
6d1a13fc27 syntax 2021-08-26 13:06:59 +08:00
vis2k
bb8268dd06 typo 2021-08-26 13:05:02 +08:00
Shaun He
56910a1f70
* fix: The type or namespace name 'Exception' could not be found (#2889) 2021-08-25 12:17:02 +08:00
vis2k
95b009a126 Weaver WeaveFromFile: remove unused parameter 2021-08-24 23:15:36 +08:00
vis2k
e8cf20847d Weaver: move writing out of Weave() 2021-08-24 12:45:28 +08:00
vis2k
7088938bb7 Weaver: pass AssemblyResolver to Weave() so ReaderWriterProcessor can resolve Mirror.dll from CurrentAssembly's References instead of passing the AssemblyDefinition / using reflection / opening the file from Weaver / etc.
-> prepares for ILPostProcessor which needs to use the resolver to find it
2021-08-23 19:03:50 +08:00
vis2k
5d629b0fb7 syntax 2021-08-22 21:36:28 +08:00
vis2k
41f1c7abb8 syntax 2021-08-22 21:36:04 +08:00
vis2k
ad107e3b84 comments on why reflection is used 2021-08-22 21:33:19 +08:00
vis2k
46368df7fe rename 2021-08-22 21:30:19 +08:00
vis2k
c6b9b33a47 Weaver: ReaderWriterProcessor AddRuntimeInitializeOnLoadAttribute / AddInitializeOnLoadAttribute helper functions 2021-08-22 21:30:00 +08:00
vis2k
057d765656 syntax 2021-08-22 21:08:04 +08:00
vis2k
b7ec1ebfad Weaver: Weave() now requires MirrorAssembly parameter. we resolve it in CompilationFinishedHook instead of ReaderWriterProcessor.
-> all processors can easily access the mirror assembly if necessary
-> CompilationPipeline doesn't have to be referenced anymore, which would break ILPostProcessor
-> Weaver simply weaves given assemblies now, without opening anything
2021-08-22 21:02:24 +08:00
vis2k
38e6cfb893 syntax 2021-08-22 20:56:21 +08:00
vis2k
0c698df4ca rename 2021-08-22 20:55:21 +08:00
vis2k
20be56079c syntax 2021-08-22 20:54:33 +08:00
vis2k
9db804467c syntax 2021-08-22 20:52:58 +08:00
vis2k
08fdffd6ab comments 2021-08-22 20:49:37 +08:00
vis2k
852ef64034 Weaver: syntax 2021-08-22 20:42:11 +08:00
vis2k
16579ea9e8 Weaver CompilationFinishedHook: FindMirrorRuntime returns the assembly so we can use that later 2021-08-22 20:34:54 +08:00
vis2k
98737b8863 rename and clarify 2021-08-22 17:36:07 +08:00
vis2k
8db0f34f2c Weaver: add comment 2021-08-22 17:18:20 +08:00
vis2k
265a6384e1 ReaderWriterProcessor: ProcessMirrorAssemblyReaderWriterExtensions helper function for cleaner code 2021-08-22 17:08:31 +08:00
vis2k
2420a6d18b Weaver: add comments 2021-08-22 00:30:57 +08:00
vis2k
6ba4124724 Weaver: weaverTypes doesn't need to be public anymore 2021-08-21 16:31:44 +08:00
vis2k
59b2d731ea WeaverClientServerAttributeTests: remove dependencies on Weaver.weaverTypes 2021-08-21 16:31:34 +08:00
vis2k
eb04bb4d58 syntax 2021-08-21 16:14:53 +08:00
vis2k
9d43d3c6c6 remove xml comment 2021-08-21 16:14:29 +08:00
vis2k
737a2b1b28 syntax 2021-08-21 14:44:26 +08:00
vis2k
37cfdbbcae comment 2021-08-21 14:43:58 +08:00
vis2k
32d6eb0689 typo 2021-08-21 14:42:11 +08:00
vis2k
3b756ecdc8 WeaverTestsBuildFromTestName split into separate file 2021-08-21 13:56:39 +08:00
vis2k
7d0ac8e992 comment 2021-08-21 13:52:57 +08:00
vis2k
e1f04153b1 syntax 2021-08-21 13:52:08 +08:00
vis2k
de20998dcf syntax 2021-08-21 13:51:07 +08:00
vis2k
8af6e02420 remove unused 2021-08-21 13:50:04 +08:00
vis2k
d1a7dadb40 syntax 2021-08-21 13:49:43 +08:00
vis2k
69cd7c9d85 syntax 2021-08-21 13:48:18 +08:00
vis2k
b996b52c0f comment 2021-08-21 13:47:23 +08:00
vis2k
1d298fb588 syntax 2021-08-21 13:44:13 +08:00
vis2k
cf42e303ef syntax 2021-08-21 13:43:59 +08:00
vis2k
9cf66b511d syntax 2021-08-21 13:42:02 +08:00
vis2k
e9b86cf085 syntax 2021-08-21 13:41:58 +08:00
vis2k
e32ac5b3db Weaver: ModuleDefinition.ContainsClass extension 2021-08-21 13:39:11 +08:00
vis2k
eff4736f71 syntax 2021-08-21 13:33:18 +08:00
vis2k
63af62affd Weaver: WeaveModule remove unnecessary catch and rethrow 2021-08-21 13:32:56 +08:00
vis2k
d5a8a8b5b5 syntax 2021-08-21 13:31:13 +08:00
vis2k
4a45732fe1 fix 2019 error 2021-08-21 12:43:44 +08:00
vis2k
5b86754042 Weaver as instance class 2021-08-20 22:40:37 +08:00
vis2k
54cc3de33b remove unnecessary parameter 2021-08-20 22:32:15 +08:00
vis2k
a20c7a4c93 Weaver: make more fields private 2021-08-20 22:32:15 +08:00
vis2k
18d472edf7 Readers/Writers: remove static GeneratedCodeClass references 2021-08-20 22:32:15 +08:00
vis2k
98f9dcfc94 ReaderWriterProcessor: remove static GeneratedCodeClass reference 2021-08-20 22:32:15 +08:00
vis2k
f134e0c210 syntax 2021-08-20 22:32:15 +08:00
vis2k
afc82a36a1 NetworkBehaviourProcessor: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
9fe4608532 Writers: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
7762058b86 Resolvers: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
2a1929f7f1 Readers: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
c358358f1d ServerClientAttributeProcessor: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
298a7aef58 SyncVarProcessor: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
dfafd48f08 SyncObjectProcessor: remove static WeavingFailed reference 2021-08-20 22:32:15 +08:00
vis2k
b87096d5c9 MonoBehaviourProcessor: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
64964fb169 MethodProcessor: remove static WeavingFailed references 2021-08-20 22:32:15 +08:00
vis2k
081cd1d92c add comment 2021-08-20 22:32:15 +08:00
vis2k
71eb7cb91d Weaver: group allocations together 2021-08-20 22:32:15 +08:00
vis2k
4ad2af4f74 ReaderWriterProcessor: remove static Readers/Writers state 2021-08-20 22:32:15 +08:00
vis2k
e01a796b47 SyncObjectProcessor: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
9e9b9d3303 ServerClientAttributeProcessor: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
12084f6013 NetworkBehaviourProcessor: remove more static Log references 2021-08-20 22:32:15 +08:00
vis2k
f0747c5418 MethodProcessor: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
b430e29e8b NetworkBehaviourProcessor: remove more static Log references 2021-08-20 22:32:15 +08:00
vis2k
42d33b5b7c NetworkBehaviourProcessor: remove static Log references from all instance methods 2021-08-20 22:32:15 +08:00
vis2k
ce40488f20 MonoBehaviourProcessor: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
3f721c04ae Resolvers: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
21c6bea6b1 SyncVarProcessor: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
7320cd8a2f Writers: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
20405c76f9 Readers: remove static Log references 2021-08-20 22:32:15 +08:00
vis2k
a018f5dc37 Weaver: Logger as interface with MemberReference variants to avoid static Error/Warning methods 2021-08-20 22:32:15 +08:00
vis2k
1da0744875 Weaver: remove Error() function. Use Log.Error to prepare for static removal. 2021-08-20 22:32:15 +08:00
vis2k
7481057418 restore Log class, but as instance 2021-08-20 22:32:15 +08:00
vis2k
9462499c8b rename for consistency 2021-08-20 22:32:15 +08:00
vis2k
55580ba9f3 ProperySiteProcessor: remove static weaverLists references 2021-08-20 22:32:15 +08:00
vis2k
cffc983731 SyncVarProcessor: remove static weaverLists references 2021-08-20 22:32:15 +08:00
vis2k
3ccf9c51f5 NetworkBehaviourProcessor: remove static weaverLists references 2021-08-20 22:32:15 +08:00
vis2k
7101088d40 Writers: remove static weaverTypes references 2021-08-20 22:32:15 +08:00
vis2k
4c6af1ff6f Readers: remove static weaverTypes references 2021-08-20 22:32:15 +08:00
vis2k
00357d119a ReaderWriterProcessor: remove static weaverTypes reference 2021-08-20 22:32:15 +08:00
vis2k
7b205a23bb TargetRpcProcessor: remove static weaverTypes reference 2021-08-20 22:32:15 +08:00
vis2k
5e2a22b71a SyncVarProcessor: remove static weaverTypes reference 2021-08-20 22:32:15 +08:00
vis2k
c89cbd02c5 ServerClientAttributeProcessor: remove static weaverTypes reference 2021-08-20 22:32:15 +08:00
vis2k
3f9c40cafd SyncObjectInitializer: remove static weaverTypes reference 2021-08-20 22:32:15 +08:00
vis2k
cd190de21f NetworkBehaviourProcessor: remove static weaverTypes references 2021-08-20 22:32:15 +08:00
vis2k
133c4bb181 SyncVarProcessor: remove static Weaver.CurrentAssembly references 2021-08-20 22:32:15 +08:00
vis2k
e36b39f328 Weaver: SyncVarProcessor changed to instance class to prepare for non static ILostProcessor 2021-08-20 22:32:15 +08:00
vis2k
6af792e4c5 Extensions: remove Weaver.CurrentAssembly static references 2021-08-20 22:32:15 +08:00
vis2k
f471b85dcb NetworkBehaviourProcessor: remove Weaver.CurrentAssembly static reference 2021-08-20 22:32:15 +08:00