Skip to main content
Jump to: navigation, search

Difference between revisions of "Eclipse copyright tool"

m
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The Eclipse repository contains a tool that will fix copyrights in your code.  It will insert copyrights into any files that are missing them, and will also attempt to insert the additional year for modified files (e.g. "2007, 2008").  In practice, it does the former perfectly, but it's not extremely accurate in performing the latter taskBut since it's most important that all relevant files have a copyright, it is expected you to run this tool periodically against your own code.  
+
[[COSMOS|COSMOS Wiki]] > [[COSMOS_dev_process|COSMOS Development Process]]
 +
 
 +
We are legally required (and also required by Eclipse guidelines) to maintain our copyrights as accurately as possible.  The Eclipse repository contains a tool that will fix copyrights in your code.  It will insert copyrights into any files that are missing them, and will also attempt to insert the additional year for modified files (e.g. "2007, 2009").  To do the latter, the tool compares all files against the last revision from the previous year to see if there were any changesSo even if you didn't change the file for this checkin, it might be fixing the copyright for a previous change in the current year.  
  
 
Here are the steps to load and run the fix copyrights tool.  
 
Here are the steps to load and run the fix copyrights tool.  
  
# Load module <code>org.eclipse.releng.tools</code> from repository <code>/cvsroot/eclipse</code> on dev.eclipse.org.  
+
<ol>
# Export the plugin to your plugins directory by selecting '''Export...''' from the popup menu and then Deployable plugins and fragments  
+
<li>Load module <code>org.eclipse.releng.tools</code> from repository <code>/cvsroot/eclipse</code> on dev.eclipse.org.</li>
# Restart Eclipse to pick up the new plugin (shortcut is to choose '''File''' > '''Switch Workspace''' and incidate the same workspace).  
+
<li>Export the plugin to your plugins directory by selecting '''Export...''' from the popup menu and then Deployable plugins and fragments</li>
# Go to '''Window''' > '''Preferences''' > '''Copyright Tool''' to set your copyright preferences.  For IBM committers, the template should appear as follows:  
+
<li>Restart Eclipse to pick up the new plugin (shortcut is to choose '''File''' > '''Switch Workspace''' and incidate the same workspace).</li>
 +
<li>Go to '''Window''' > '''Preferences''' > '''Copyright Tool''' to set your copyright preferences.  For IBM committers, the template should appear as follows:  
 
<pre>Copyright (c) ${date} IBM Corporation.  
 
<pre>Copyright (c) ${date} IBM Corporation.  
 
All rights reserved. This program and the accompanying materials  
 
All rights reserved. This program and the accompanying materials  
Line 14: Line 17:
  
 
Contributors:  
 
Contributors:  
   IBM Corporation - initial API and implementation</pre>
+
   IBM Corporation - initial API and implementation</pre></li>
# Set default creation year in the preferences to 2008 and default revision year to 2008.  Click OK to save the preferences.  
+
<li>Set default creation year and default revision year in the preferences to the current year.  Click OK to save the preferences.</li>
# Switch to the Resource perspective.  
+
<li>Switch to the Resource perspective.</li>
# Select all projects for which you want to run the tool and select Advanced Fix Copyrights from the context menu.  
+
<li>Select all projects for which you want to run the tool and select Fix Copyrights from the context menu.</li>
# If the tool has changed any files (and it probably will), you will want to inspect its work during synchronization with the repo, since as previously mentioned, it's not entirely accurate with modified files, even though it works well for files that didn't already have a copyright.
+
<li>Perform a team synchronization on the changed projects and commit the changes.</li>
 +
</ol>

Latest revision as of 15:08, 9 May 2011

COSMOS Wiki > COSMOS Development Process

We are legally required (and also required by Eclipse guidelines) to maintain our copyrights as accurately as possible. The Eclipse repository contains a tool that will fix copyrights in your code. It will insert copyrights into any files that are missing them, and will also attempt to insert the additional year for modified files (e.g. "2007, 2009"). To do the latter, the tool compares all files against the last revision from the previous year to see if there were any changes. So even if you didn't change the file for this checkin, it might be fixing the copyright for a previous change in the current year.

Here are the steps to load and run the fix copyrights tool.

  1. Load module org.eclipse.releng.tools from repository /cvsroot/eclipse on dev.eclipse.org.
  2. Export the plugin to your plugins directory by selecting Export... from the popup menu and then Deployable plugins and fragments
  3. Restart Eclipse to pick up the new plugin (shortcut is to choose File > Switch Workspace and incidate the same workspace).
  4. Go to Window > Preferences > Copyright Tool to set your copyright preferences. For IBM committers, the template should appear as follows:
    Copyright (c) ${date} IBM Corporation. 
    All rights reserved. This program and the accompanying materials 
    are made available under the terms of the Eclipse Public License v1.0 
    which accompanies this distribution, and is available at 
    http://www.eclipse.org/legal/epl-v10.html  
    
    Contributors: 
       IBM Corporation - initial API and implementation
  5. Set default creation year and default revision year in the preferences to the current year. Click OK to save the preferences.
  6. Switch to the Resource perspective.
  7. Select all projects for which you want to run the tool and select Fix Copyrights from the context menu.
  8. Perform a team synchronization on the changed projects and commit the changes.

Back to the top