Hello,
I am currently trying to write a macro which will be able to detect
which projects and configurations are being built within a solution in
order to produce an estimation of the time left.
At present, the only method I am aware of is to us the
DTE.Solution.Count to detect the number of projects within the
solution, and then use
DTE.Solution.Item(...).ConfigurationManager.Count to detect the number
of configurations for each project. (See below)
By using this method I am able to retrieve the total number of builds
required for the complete solution. However, it would be preferable to
detect the number of projects and configurations which have been
selected to be built.
Is there a way to detect the number of build/rebuild/clean events which
are going to be performed by looking at which projects and
configurations have been selected? Also, is it possible to
differentiate between a build event and a batch build event?
Thanks in advance for any help I receive! J
sol = DTE.Solution
For i = 1 To sol.Count
'Look for a valid project
If sol.Item(i).FullName <> "" Then
counter = counter + sol.Item(i).ConfigurationManager.Count()
(counter is the number of builds which are going to be performed)
Paul Skelton - 19 Aug 2005 21:12 GMT
Try
DTE.ActiveSolutionProjects
> Hello,
>
[quoted text clipped - 27 lines]
>
> (counter is the number of builds which are going to be performed)
peterdavidcampbell@hotmail.com - 24 Aug 2005 10:18 GMT
DTE.ActiveSoltuionProjects returns the number of projects currently
selected in the solution explorer, but what I would like to detect is
how many projects and configurations are selected from within the batch
build dialog box.
For example, if I have a solution with 4 projects (A, B, C and D), each
with five configurations, I would like to be able to detect what is
selected to be built/rebuilt/cleaned. Eg, 2 configurations from
project A, all 5 config from project B and 3 from project C.
Thanks in advance for any advice.
Pete