TwineCompile with MSbuild, but not with IDE
TwineCompile with MSbuild, but not with IDE
I would like to (always) use TwineCompile when building my project group using msbuild. For that I import the 'TCTargets104.targets' project, and this works very well.
Simultaneously, I'd like to be able to disable TC from the IDE as necessary. Debugging sessions typically start faster when TC is disabled, and some error messages show up in a relevant part of the .targets file if builds fail, which is tougher to debug.
What I've noticed is that when the 'TCTargets104.targets' is imported, even when TwineCompile from the IDE is disabled, builds still use TC but the GUI process doesn't show. I think what is needed is to conditionally import the project task, only when run from msbuild. Is this possible?
Simultaneously, I'd like to be able to disable TC from the IDE as necessary. Debugging sessions typically start faster when TC is disabled, and some error messages show up in a relevant part of the .targets file if builds fail, which is tougher to debug.
What I've noticed is that when the 'TCTargets104.targets' is imported, even when TwineCompile from the IDE is disabled, builds still use TC but the GUI process doesn't show. I think what is needed is to conditionally import the project task, only when run from msbuild. Is this possible?
Re: TwineCompile with MSbuild, but not with IDE
Yes, it is definitely possible. You need to add a condition to the <Import> statement, for example:
Then you can invoke MSBuild like this and it will invoke TwineCompile. The IDE will not pass in that variable, so TwineCompile won't be used.
MSBuild /t:Build /p:TwineCompile=true Project1.cbproj
Code: Select all
<Import Project="C:\Program Files (x86)\JomiTech\TwineCompile\TCTargets104.targets" Condition="'$(TwineCompile)'=='true'" />
MSBuild /t:Build /p:TwineCompile=true Project1.cbproj
Jon
Re: TwineCompile with MSbuild, but not with IDE
Excellent, thank you. I slightly prefer using msbuild in this way over jtmake, due to the cleaner logfile and '/ds' overview at the end.
Re: TwineCompile with MSbuild, but not with IDE
Followup question: can we pass arguments like -prog- through msbuild?
Re: TwineCompile with MSbuild, but not with IDE
Most of the TwineCompile options are available via MSBuild properties, but unfortunately, -prog- is not one of the available options. The available options are:
- -threads: TC_Threads
- -disablecaching: TC_DisableCaching
- -afiles: TC_AllocateFiles
- -jb-: TC_StopOnErrors
- -dep: TC_Make
- -priority: TC_Priority
- -maxcache: TC_MaxCache
Code: Select all
MSBuild /t:Build /p:TC_Threads=4 Project1.cbproj
Jon
Re: TwineCompile with MSbuild, but not with IDE
Clear, thank you. If feasible, I'd like to request this feature be extended to include -prog- for a future release. Thanks you for your consideration!
Re: TwineCompile with MSbuild, but not with IDE
Yes, we'll definitely include this in the next release. It looks like the only missing option.
Jon
Re: TwineCompile with MSbuild, but not with IDE
Awesome, I'll keep my eyes peeled. Thank you!
Re: TwineCompile with MSbuild, but not with IDE
Hi Jon,
Did this make it into 5.2.3?
Did this make it into 5.2.3?