Conversation
Summary of ChangesHello @JassJam, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands xmake's capabilities by adding native support for C# projects. It allows developers to seamlessly integrate C# applications and libraries into their xmake-based build systems, providing a unified build experience across C++ and C# projects. The changes include core build rules for C#, integration with the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This is a great contribution that adds C# support to xmake, a long-requested feature. The implementation covers the build lifecycle (build, clean, install) and integrates with the Visual Studio project generator (vsxmake) to provide a seamless developer experience. The test projects are comprehensive and cover various scenarios like console apps, libraries, package dependencies, and web projects.
My review focuses on a few areas for improvement, mainly concerning the installation logic for correctness and efficiency, and some minor style issues in the test files. Overall, the core implementation is solid.
tests/projects/csharp/multiple_library/src/sample/sample.csproj
Outdated
Show resolved
Hide resolved
| if target:is_binary() then | ||
| local targetdir = target:targetdir() | ||
| if targetdir and os.isdir(targetdir) then | ||
| os.cp(path.join(targetdir, "**"), install_abs, {rootdir = targetdir}) | ||
| end | ||
| end |
There was a problem hiding this comment.
This os.cp operation for binary targets appears to be redundant. The dotnet publish command, which is executed earlier in this on_install hook, should already place all necessary files into the installation directory (install_abs). This block can likely be removed.
For better performance, consider refactoring the install logic. For binary targets, on_buildcmd already runs dotnet publish. The on_install hook could simply copy the artifacts from the build directory instead of running publish again.
|
This patch is too large, and I don't have much time to review and test it. Please split several smaller patches if possible. like this:
|
Note
Inspiration
Motivation
Normally one could achieve it directly by just using rules + calling
dotnetdirectly, but this was not enough for my greedy self :3, i wanted intellisense support without creating another sln file just for C#, unifying both C++ and C# into one sln file for ease of use and debugging!Prerequisites
dotnettool must be installed in order to use C# projects..csprojfile (contains packages, framework settings, SDK, etc...), so.csprojmust be part of the source set, and should not be auto generated by xmake, to not over-complicate it (just usedotnet new ...) .How it works
csharprule withadd_rules..csprojand.csfiles withadd_files.windows,linux,macos) with cross architecture (x64,x86,arm64,arm,riscv64).