Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The best way to delegate the generation job to Eclipse is through the Ant builder. <a href="https://stackoverflow.com/questions/4620145/hook-into-the-eclipse-build-process/4620263#4620263">Look here</a> on how to setup a builder.</p> <p>In your <code>build.xml</code> file create 2 targets: <code>generate-code</code> and <code>cleanup-generated-code</code>.</p> <p>Then hook them up this way in builder's <code>Targets</code> tab:</p> <p><img src="https://i.stack.imgur.com/VMyaO.jpg" alt="Ant Builder Targets configuration"></p> <p>This will allow your project to respond nicely to build events.</p> <p>The next step is to make Eclipse to compile your generated sources automatically.</p> <p>For this, in the root of your project create a directory called <code>generated-src</code>. This directory should be empty and you should put it under management of you source control system. Because there will be some generated code, put .xxxignore file into this directory.</p> <p>Once <code>generated-src</code> directory is in-place, make it your project's source directory ( Source tab in Java Build Path )</p> <p><img src="https://i.stack.imgur.com/8iWZ7.jpg" alt="Source directory"></p> <p>Last, but not least, you want to kick Eclipse's java compiler, once you've generated your sources. To do that you need to modify the <code>Refresh</code> tab of you Ant builder.</p> <p>Here is the setting that does it:</p> <p><img src="https://i.stack.imgur.com/8ANQe.jpg" alt="Refresh Tab"></p> <p>When you click <code>Specify Resources</code> button, make sure that your whole project directory is selected, like here:</p> <p><img src="https://i.stack.imgur.com/94mF8.jpg" alt="Selected Resources"></p> <p>This way, when anything in your project changes it kicks off the ant builder, which may, or may not, regenerate sources, which would lead to java recompilation.</p> <p>One last screenshot. Make sure that both <code>build.xml</code> and base directory are relative to your ${workspace_loc} in Builder's <code>Main</code> tab, like here ( basically only use <code>Browse Workspace</code> button ):</p> <p><img src="https://i.stack.imgur.com/tDrn0.jpg" alt="Builder&#39;s Main Tab"></p> <p>Once this is done, hookup <code>generate-code</code> and <code>cleanup-generated-code</code> to your regular targets in your <code>build.xml</code> that you would call for command-line builds. This way Eclipse and your command line build are doing exactly the same steps for code generation. Moreover your Eclipse build will be fully sensitive to the <strong>real</strong> sources of your project.</p>
    singulars
    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. 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