-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate filename different modules overwrites output #9
Comments
You can customize the output directory by setting the SliceCompile.OutputDir item metadata see https://github.com/zeroc-ice/ice-builder-msbuild#customizing-the-slice-to-c-compilation-1 |
We are adding the .ice files via nuget content files. This would force us to touch .vcxproj and change it manually before we are operatable. Is there a better way while adding the ice files via nuget to the project? |
Not sure what you mean |
Files in a nuget package declared as content files as follow: Package.nuspec
Will add the defined files during the package installation to the .vcxproj resulting in Project.vcxproj
Entries. |
You can try to add a targets file to your NuGet package, that setups the OutputDir, in the target file you can have something like
This update syntax requires MSBuild version 16.6 and later, see https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-items?view=vs-2022#updating-metadata-on-items-in-an-itemgroup-outside-of-a-target |
This kinda works. It generates the following physical file output: generated/%(SliceCompile.RelativeDir)/Test.h 0kb Unfortunate the 0kb versions of the file are the ones which get added in Visual Studio. Whatever task creates those 0kb files does not expand the %(SliceCompile.RelativeDir) Macro. |
it is difficult to follow without a complete example to reproduce the issue |
Check the generated folder in the project folder after building the project. |
I see the problem, I think the Visual Studio IceBuilder plugin isn't expanding the item metadata correctly. This will work well for a pure MSBuild build, as a workaround you can try something like
|
Thanks for the effort. I will wait for the fix because I would need to touch a lot of projects to implement the workaround. |
Consider following situation:
Two slice files with the same name but different modules:
Test.ice
module AModule { struct Test { bool active; }; }
Test.ice
module AnotherModule { struct Test { bool active; }; }
The output file Test.h will be overwritten by the last .ice file compilation so that only one header file gets produced. This error usually occur when you use multiple services where possible .ice files have the same name. Our Solution is to use a custom compile script to run slice2cpp and appending the Module name to the output files. E.g. Test.AModule.h and Test.AnotherModule.h. Would be nice to have that as the default behaviour in this msbuild package :).
The text was updated successfully, but these errors were encountered: