Verify source code during check-in or delivery
We migrated from SVN to Jazz source control early in 2010.
We have a requirement that all source code submissions made in a calendar year have a copyright that reflects the year. This is a 2 part question. 1) What would be the recommended way of determining all of the source files that have changed for a stream in 2010 so that we can ensure that the copyright headers are correct? 2) We would like to automate the above going forward by running a check of the source during check-in or delivery (whichever is simpler!) and either automatically fix the copyright or reject the change with sufficient information that the submitter knows to fix the copyright. What would be a recommended way of doing this? Thanks Jim |
2 answers
You can add a precondition for delivery operation. Detailed steps: 1. open your team area 2. click on "process customization source" tab 3. find <operation id="com.ibm.team.scm.client.deliver"> 4. insert following precondition and fill in the values similar to the sample values provided at below. <operation id="com.ibm.team.scm.client.deliver"> <preconditions> <precondition xmlns="http://com.ibm.team.process/requireContent" description="Remember to include the Copyright on all Java files that you create." id="com.ibm.team.process.deliver.requiredContent" name="XXX Copyright"> <filePattern pattern=".*java"/> <requiredText text="Copyright XXX Corporation"/> <insertText text="/******************************************************************************* * Property of XXX * (c) Copyright XXXXX *******************************************************************************/"/> </precondition> 5. do more editing at "Process Customization" tab page Comments
Mike Shkolnik
commented Dec 11 '13, 3:09 p.m.
Is it possible to have this text inserted after every 40 lines of code?
Mike Shkolnik
commented Dec 12 '13, 8:19 p.m.
I tried the method above and it does not AUTOMATICALLY insert the text. How do I do this automatically, transparent to the user, every time code is delivered?
|
This worked excellent!! We used a simple check which now verifies that the Copyright has been changed to reflect the current year.
Thank you for your idea. JimR Comments
Mike Shkolnik
commented Jan 10 '14, 2:56 p.m.
James, were you able to do this in an automated fashion, transparent to the developer? If so, how did you implement it?
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.