Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Introduction</strong></p> <p>Formatter, Code Templates, etc. can be stored as <em>project specific settings</em> in the folder <code>.settings/</code>. You don't necessarily need to re-import the Formatter in your <em>workspace</em>.</p> <p>You can use project specific settings in combination with <code>svn:externals</code> to "inject" the formatter, code templates, etc. in your projects.</p> <blockquote> <p><strong><a href="http://svnbook.red-bean.com/en/1.0/ch07s03.html" rel="noreferrer">svn:externals:</a></strong></p> <p>Sometimes it is useful to construct a working copy that is made out of a number of different checkouts. For example, you may want different subdirectories to come from different locations in a repository, or perhaps from different repositories altogether.</p> </blockquote> <p><strong>Projects</strong></p> <ol> <li>We have a java project named <code>com.xyz.codeconventions</code> where we added a project specific formatter and code templates. This project is under version control.</li> <li>For all the other projects we define a <code>svn:externals</code> property to "inject" the <code>.settings/</code> folder from the project <code>com.xyz.codeconventions</code> (This is the folder where the project specific data is stored)</li> <li>If you now want to change the formatter you can edit the project <code>com.xyz.codeconventions</code> and use <code>svn commit</code> to submit the changes. The team will have to <code>svn update</code> on all projects to get the latest version of the code formatter.</li> </ol> <p><strong>Configuration</strong></p> <p>For all projects which should use this formatter you have to define a svn:externals property.</p> <p>Example for com.xyz.project1:</p> <pre> key value ---- ------ svn:externals http://path/to/com.xyz.codeconventions/.settings .settings </pre> <p>In Eclipse (in my case Subversive) you can add svn specific properties with <code>Team -&gt; Set property...</code>.</p> <p><img src="https://i.stack.imgur.com/kNq2F.png" width="450" height="520"></p> <p><strong>Repository Layout</strong></p> <p>The repository structure in our case looks like this:</p> <pre> &lt;root&gt; | +-- com.xyz.project1 # (svn:externals -> &lt;root&gt;/codeconventions/.settings .settings) | | | +-- src | +-- &lt;...&gt; +-- com.xyz.project2 # (svn:externals -> &lt;root&gt;/codeconventions/.settings .settings) | | | +-- src | +-- &lt;...&gt; +-- com.xyz.codeconventions | +-- .settings # (this folder will get "injected" in project1 and project2) | +-- org.eclipse.jdt.core.prefs +-- org.eclipse.jdt.ui.prefs </pre> <p><strong>Additional comments / Limitations</strong></p> <ul> <li>This approach is for <code>svn</code> users only but if you use <code>git</code> there is something similar to svn:externals named <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="noreferrer">Submodules</a>.</li> <li>Make sure that in project1 and project2 are no <code>.settings/</code>-folder because with <code>svn:externals</code> it is not possible to overwrite existing files.</li> <li>If you have java projects which need completely different formatters or different files in the <code>.settings/</code> folder this approach is probably not what you are looking for. Our projects always have the same <code>.settings</code> files.</li> </ul> <p><strong>Sources</strong></p> <ul> <li><a href="http://svnbook.red-bean.com/en/1.5/svn.advanced.externals.html" rel="noreferrer">SVN: Externals Definitions</a></li> <li><a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-externals.html" rel="noreferrer">SVN: TortoiseSVN - External Items</a></li> <li><a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="noreferrer">Git: Tools - Submodules</a></li> <li><a href="https://help.github.com/articles/working-with-subtree-merge" rel="noreferrer">Git: Working with subtree merge</a></li> <li><a href="http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.jdt.doc.user/reference/preferences/java/codestyle/ref-preferences-formatter.htm" rel="noreferrer">Eclipse Help: Code Formatter Preferences</a> </li> <li><a href="http://www.vasanth.in/2005/07/13/eclipse-tip-sharing-java-project-settings/" rel="noreferrer">Eclipse Tip: Sharing Java project settings</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload