uno icon indicating copy to clipboard operation
uno copied to clipboard

build: Include only generator dll

Open Youssef1313 opened this issue 3 years ago • 3 comments

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

Youssef1313 avatar Sep 15 '22 22:09 Youssef1313

gitpod-io[bot] avatar Sep 15 '22 22:09 gitpod-io[bot]

@Youssef1313 Roslyn is likely loading those files in the current appdomain, making the generator work as a result. We could make this work differently by adjusting this: https://github.com/unoplatform/uno/blob/cf70e8e8ec4389d80269122280b5083066724958/src/SourceGenerators/Uno.UI.SourceGenerators/Helpers/DependenciesInitializer.cs#L16-L51

jeromelaban avatar Sep 16 '22 11:09 jeromelaban

I think we should never need DependenciesInitializer actually. I'll see how this can be improved. One possible challenge is that Uno.UI.SourceGenerators is consumable via Uno.UI package and also via ProjectReferences in our solution. That makes handling its dependencies a bit harder.

I also don't think generators should need to manually include themselves via <Analyzer Include=...

@jeromelaban The <Analyzer Include=... part is only for Roslyn generators right? It has nothing to do with Uno.SourceGeneration?

Youssef1313 avatar Sep 16 '22 20:09 Youssef1313

@jeromelaban The <Analyzer Include=... part is only for Roslyn generators right? It has nothing to do with Uno.SourceGeneration?

Correct. Uno.Sourcegeneration does not use the Analyzer msbuild item.

jeromelaban avatar Sep 26 '22 01:09 jeromelaban