title: Shared content root in IntelliJ (share source across modules)
body: <p>Maybe my approach is wrong, but here is what I want:</p>
  
  <ul>
  <li>A logging library, written in pure JAVA</li>
  <li>It should work on Android as well</li>
  <li>I want to use it in Android and desktop apps</li>
  </ul>
  
  <p>The approach I tried is taken from VS and C#, there it is called "multi targeting" - it basically means a module shares source code with another module.</p>
  
  <p>So my idea was to create 4 modules:</p>
  
  <ul>
  <li>AndroidApp</li>
  <li>AndroidLog</li>
  <li>DesktopApp</li>
  <li>DesktopLog</li>
  </ul>
  
  <p>The "real work" on the logging stuff (most of the classes which are pure Android compatible JAVA) would go into AndroidLog (to prevent me from accidently using classes not in the Android SDK).</p>
  
  <p>The Android App can use the log library without any problem, thats the way I do it at the moment. Now the DesktopLog should have <strong>some</strong> of the folders the AndroidLog has, basically reusing the same JAVA code.</p>
  
  <p>I tried to add a source folder from AndroidLog to the DesktopLog, but I get an error telling me "the root already belongs to...". I am working with an SVN, but I think thats not the issue here (actually, I tried the above without SVN, but it might provide some workaround if there is no simpler solution).</p>
  
  <p>So how do I get IntelliJ to:<br>
  <strong>Share JAVA files across different modules with different target platforms.</strong></p>
  
  <p>Thanks for tips,
  Chris</p>
  
  <p>PS: Search tearms are also welcome "sharing source JAVA" is not very google friendly.</p>