What is the simplest way in MSBuild to override the output for all projects in a solution to go to a single folder?
You have to specify an absolute path for /p:OutputPath= because a relative path will go relative to each project file.
Set $(OutDir) to gather output of all the projects in one location.
Related
I've got main project structure in 1 folder, and units tests closed in another folder(2 different meson instances). In unit tests i need to include one file from main project(element to be tested). I dont want to specify relative path as i want to be portable between other programmers.
How can i instruct meson to first go back from current folder and then look through application files if there is file i'm looking for? I want to make it that way so any change in code can be tested right away without any copying or modifications.
C:\Users\User1\Project\application
C:\Users\User1\Project\unittests
I need to be able to see files from application while beeing currently on unittests
Declare project dependency at top level meson.build like
project_dep = declare_dependency(include_directories: inc_dir, sources: srcs, dependencies:[...])
Make sure that your main is not in the sources. In test level meson.build
include project_dep like this:
unit_tests_exec = executable('UnitTests', gtest_srcs,
dependencies :[gtest_dep, gmock_dep, project_dep])
You can check how I organized project using meson for Tdd session here:
https://github.com/elvisoric/tdd_session
For a Visual Studio Team Services Build Definition step Build Solution (Visual Studio Build), how would one structure a pattern to both include and exclude files/folders. For example, to include all .sln files I'm able to use **\*.sln and to exclude node_modules I could us !node_modules. How could I combine this within the Solution field of the Build Solution edit UI?
**\*.sln,!node_modules returns an invalid pattern error. Is there a separator that I can use to specify multiple glob patterns?
Thank you for any help you can provide.
Try to use this value instead:
**\*.sln;-:**\node_modules\**
I have X projects in solution:
AllPlatformProject1, AllPlatformProject2...
ProjectOnlyForWindows1, OnlyForWindows2...
ProjectNotLinux1, ProjectNotLinux2...
I want to exclude "OnlyForWindows" and "NotLinux", but how?
I want to use xbuild and be able to do it for all targets.
You can't do it with one sln. Usually people create multiple solutions, even in the same directory.
Everything.sln
WindowsCentric.sln
LinuxCentric.sln
something like that.
The "gotcha" is that......when you add a "reference by project", both projects need to be in the .sln file.
Have you tried using different Configurations to pair with your targets and omit the configurations from the specific projects? Example:
Solution configurations :
LinuxDebug
LinuxRelease
WindowsDebug
WindowsRelease
And then you tell the solution to omit the linux projects from the Windows* configurations and vice versa?
I'll admit, I haven't leveraged xbuild but this approach works in MSBuild if you are using solutions and not traversal proj files. In the case of Traversal proj files you can just add conditionals to the ItemGroup inclusions to omit projects based on a $() property.
I am using heat to generated wix files for multiple directories.
However, it seems like if Directory A and Directory B has the same folder name, even though the absolute path is different, heat still think that it is the same directory, therefore generates the same directory Id.
There seems to be a way of fixing that, is to override the generated Directory Id by using -directoryid, but there are no examples given in the manual, how are we suppose to pass in the arguments. Obviously, somehow it needs to know which Directory Id I wanted to change, I will very much appreciate it if someone could help.
Thanks.
http://wix.sourceforge.net/manual-wix3/heat.htm
Overriding the output from heat pretty much always falls back to applying an XSLT to get the output the way you want.
Say I have a game.exe that depends on engine.dll. When I build the game.csproj I want the engine.csproj to copy some stuff to the OutputPath of the project that is referencing it.
So in this example case, I want engine.csproj to copy something to the OutputPath of game.csproj
How do I get the $(OutputPath) of game.csproj in engine.csproj?
The reason I want to do this is because I'm building a content project in game and engine like this:
<Target Name="BuildContent">
<MSBuild Projects="Content\Content.contentproj"
Properties="OutputPath=MAINPROJECTPATH" />
</Target>
So I need to specify the OutputPath to the 'main project' which is the game.
With a bit nosing around in some of the msbuild targets I found the solution.
I should pass through the Parent properties like this
<Target Name="BuildContent">
<MSBuild Projects="Content\Content.contentproj"
Properties="ParentOutputDir=$(ParentOutputDir);
ParentIntermediateDir=$(ParentIntermediateDir);
ParentProjectDir=$(ProjectDir);" />
</Target>
First off, it is not clear from the question exactly what extra files you need to be copied that will not happen automatically using inter-project references.
If the Game project includes a project reference (rather then just a DLL file reference) to the Engine project, msbuild should copy all the output from Engine into the Game output directory, doesn't it?
If you really do need to manually copy files between projects, then I do not believe there is any easy way to find out which projects reference the current project, so it would probably be simpler to create a level of indirection with Engine pushing files half way and Game (or any other projects that need to include those files) pulling the files the rest of the way:
Some post-build event code in Engine.csproj created a "References" directory under SolutionDir and copies the files it wants to share into there.
Then Game.csproj can include the files from the "References" directory - either as direct file references, or by copying with some pre-build event code in Game.csproj