Skip to content

Conversation

michael-hawker
Copy link
Member

@michael-hawker michael-hawker commented Dec 2, 2022

Fixes #326

This approach removes another file that needs to be duplicated across experiments.

Instead of having hard-coded Propertes\AssemblyInfo.cs files, we generate the source for those via an msbuild task, WriteCodeFragment using AssemblyAttributes.

We do this with the msbuild task and populating the values before the build is setup with a custom target. We can then use reflection at runtime to get our custom assembly attribute which now stores the PackageProjectUrl from the root common props.

This will let us store various metadata needed for configuration of our sample app that can work across repositories when we use this infrastructure for the main toolkit.

TODO

@michael-hawker
Copy link
Member Author

michael-hawker commented Dec 6, 2022

Hmmm... Previous Metadata generation task worked fine on WASM in the CI, but the new fix to move it to obj folder failed:

/home/runner/work/Labs-Windows/Labs-Windows/common/Labs.Head.props(136,5): error MSB3713: The file "obj/Debug/net5.0/AssemblyInfo.g.cs" could not be created. Could not find a part of the path '/home/runner/work/Labs-Windows/Labs-Windows/platforms/CommunityToolkit.Labs.Wasm/obj/Debug/net5.0/AssemblyInfo.g.cs'. [/home/runner/work/Labs-Windows/Labs-Windows/platforms/CommunityToolkit.Labs.Wasm/CommunityToolkit.Labs.Wasm.csproj]

This is odd, as I tested on UWP, WinAppSDK, and WASM locally first.

I was able to follow the build workflow and reproduce on the command line locally though... will investigate.

@michael-hawker michael-hawker merged commit f69e533 into main Dec 8, 2022
@delete-merged-branch delete-merged-branch bot deleted the llama/assemblymetadata branch December 8, 2022 06:48
Arlodotexe added a commit to Avid29/Labs-Windows that referenced this pull request Dec 8, 2022
Arlodotexe added a commit to arcadiogarcia/Labs-Windows that referenced this pull request Dec 8, 2022
Martin1994 pushed a commit to Martin1994/Labs-Windows that referenced this pull request Sep 2, 2023
…ssemblymetadata

Generate AssemblyInfo from msbuild vs. including in all projects as file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Infra: "ToSourceUri" is hardcoded to labs

2 participants