How to differentiate tasks from master project and subprojects - vsto

Using the Microsoft Project VSTO, I am able to iterate through all the Tasks in a project.
The problem with this approach is that if a file has one master project and multiple subprojects, the Tasks collection for the master project will contain tasks from ALL the projects (master as well as subprojects).
Is there someway to differentiate whether the Task is from a master project or a subproject?

The easies way is Task.Project that will return you name of a project your task belongs to link also you can get name of a subproject from it's "ancor" task in your master through Task.Subproject link. There is also a field which tells you if the subproject is Read-Only or you can update it: Task.SubProjectReadOnly link

If you want to access only the main project, it might be quicker to start with the summary task and recursively deal with each task's children, stopping the recursion on tasks which represent external subprojects. That way, you will not have to touch every task.

Related

How to run the same job against multiple repositories with multiple triggers?

So I'm actively trying to circumvent the job limit bamboo has in place because I have many inactive repositories that get fixed occasionally when new platform updates come out or a one-off new feature is added.
What I would like to happen is for my repository polling to pick up that there's been a change on one of my repository branches, run the job, and presto-change-o we're back to square 1 where I'm listening again for another repository polling update from another change.
Example:
Repo 1 has a commit pushed
Bamboo "hears" the change and starts the job
Repo 2 has a commit pushed
Bamboo hears this change as well, but doesn't continue due to 1 agent being available, this change is queued for later
Repo 1's triggered update finishes and publishes an artifact that can be shared
Bamboo resolves and starts Repo 2's job
Is doing something like this even possible? The best solution (meh) that I've found thus far is to just create one job with a sequential build where it's basically checkout/build/checkout/build/checkout/build but that would result in having to run through many unnecessary steps should I poll only one update from one repository. It's not like these things are changing frequently.
You can add multiple repositories to your build plan, and in your repository polling trigger put checkboxes on all repositories added into the plan.
To add multiple repositories,
Open Plan Configuration Editing
Select third tab "Repositories"
Press "Add repository" button.
Configure your repository and save.
Select fourth tab "Triggers".
Open your Repository Polling trigger and select all repositories you've added on steps 3-4.
Save the trigger.
Then repository polling has to check all configured repos, according to documentation:
https://confluence.atlassian.com/display/BAMBOO058/Triggering+builds
You can also add additional repositories into Source code checkout task, and checkout every repository in different subdirectory.
E.g. for repos R1, R2, R3 you will have working copy directories ./W1, ./W2, ./W3.
And Then it's up to you - either you clone your assembler task T to T1, T2, T3 to make builds from each working copy correspondingly, then it will be done for all jobs on every commit, they will all produce artifacts with the same build number, or you can add a shell script task and write a shell script which discovers the latest commit among all working copies (let's assume it is ./W2), creates symbolic link to that working copy subdirectory as ./MySymbolicLink, and your job that assembles the build will do that from ./MySymbolicLink folder.

IntelliJ: See all changes for a specific "task"

IntelliJ has the "task" feature where you can track the context for a Jira task, for example.
Now, I changed several files within this task und committed a few times. After a week, I returned to this project and I'd like to see all changed files for this task, from the start of the task until where I left of. I cannot find an option to do this, is this somehow possible?
By default creating a new task offers you to create a separate branch for this task. If you did so, all your commits are in that branch.
If you used another branch, I don;t think there is an easy way to do what you want. You could try checking the saved contexts under Tools - Tasks and Context - Load context

TFS Build XAML Template at “AssociateChanges” step get all the Work Items since begging of the source code branch created

I have asked a similar question
TFS Build Configuration: get all the Work Items Details for a particular build
And based on the answer of above question I have the below query. I decided to start a new thread for new question rather than confusing people in same thread.
I am using a default XAML template for workflow of TFS build configuration. Now my requirement is that I need all the Work Items since beginning whenever I trigger a build event for any build definition regardless of last successful build.
Let say I have triggered first TFS build and it is succeeded then I triggered 2nd build and that is also succeeded.
Then I have opened the log file of 2nd successful build and goes to Diagnostics Tab of last build. Inside Diagnostics tab there is a section as “Associate the changesets that occurred since the last good build”
Inside this it will display a message like
"No change sets are submitted to build 'ABC…..'"
Whereas I require list of all the work items since beginning.
Please suggest me the changes which need to be done in XAML template so that I can get all the work items since the beginning of source code.
As we know, associate the changesets and work items only occurs since the last good build.
There is a simple workaround to achieve what you want, you can specify a previous changeset to queue a build, then build the latest changeset again, then you'll get the associated changesets and work items again. Refer to this blog: http://chamindac.blogspot.sg/2013/09/tfs-2012-get-release-build-with.html
Otherwise, you need to create a MSBuild custom task that makes a call to TFS for the items. Check the links below:
https://volatilecoding.com/2013/06/11/tfs-build-how-to-customize-work-item-association/
(this solution is for TFS2010/TF2012 build process template, you'll
need to work on TFS 2013 build process template).
http://devgorilla.net/?p=104

Using multiple Source control folders in a single build definition TFS 2010

In the Workspace tab
Source Control Folder: I am picking only two locations from my entire team project. I do not want to pick the entire team project because it has 20 projects.
I only need two project locations for the build.
$/TeamProject/ABCProj.SVC
$/TeamProject/ABCProj.UI
Build Agent Folder, If i specify the same $(SourceDir) for both the Source control folder locations($/TeamProject/ABCProj.SVC, $/TeamProject/ABCProj.UI)
above, I am unable to save the build definition.
I am getting an error when saving the Build definition
"$(SourceDir) can only be mapped one time in a given workspace"
Can any one please suggest a solution.
You'll have to map your version control folders to different source directories, for example:
$/TeamProject/ABCProj.SVC -> $(SourceDir)/ABCProj.SVC
$/TeamProject/ABCProj.UI -> $(SourceDir)/ABCProj.UI
Alternatively, you can just map $/TeamProject to $(SourceDir) and cloak all subprojects you don't want to get the sources for.

Create MSBuild task that recursively copies a folder to several projects in my solution

I'm new to MSBuild and I tried reading up on several sources on the net but I'm missing somet things..
Here's what I want:
A build task that on execution recursively copies a directory structure from a (hardcoded/configured) path on my machine to a set of projects in the solution
Then compiles (release/debug, I guess I can make two sets of them)
Preferably this process would be called when I press f5 in VS and is selectable from the release/debug dropdown (with a different name off course).
What I don't get yet:
Where do I place my .proj file? In my root (where my sln file is)?
How can I make VS pick it up (bind it to f5).
Look at the Copy Task examples on how to copy a file structure recursively.