支持 Groovy 2.0的 Groovy-Eclipse 2.7.0 发布,

jopen 12年前
   <p><span id="desc">Groovy Eclipse Plugin(插件)是script语言Groovy的开发辅助工具,它提供编辑,编译,以及执行groovy脚本的功能。<br /> <br style="font-weight:bold;" /> </span><span style="font-weight:bold;">Groovy-Eclipse 2.7.0. 这是首个包含 Groovy 2.0 正式版,同时支持 Eclipse 4.2 的版本。</span><br style="font-weight:bold;" /> <span style="font-weight:bold;">详见:</span><br /> <span style="color:#000000;">The Groovy-Eclipse team is proud to announce the release of Groovy-Eclipse 2.7.0. This is the first release that includes Groovy 2.0 final and that is available on Eclipse 4.2 (Juno).  Now that Eclipse 4.2 is released, we will be dropping our Eclipse 3.6 support.<br /> </span></p>    <p><span style="color:#000000;">You can use the following update sites to install this release:</span></p>    <div class="panelMacro">     <table class="infoMacro ke-zeroborder">      <colgroup>       <col width="24" />       <col />     </colgroup>      <tbody>       <tr>        <td valign="top"><img border="0" alt="" align="absMiddle" src="http://docs.codehaus.org/images/icons/emoticons/information.png" width="16" height="16" /></td>        <td><b>Groovy-Eclipse update site for Eclipse 4.2 and 3.7</b><br /> <p><span style="color:#000000;">For Eclipse 4.2 (Juno):</span><br /> <span style="color:#000000;"><code><a class="external-link" href="/misc/goto?guid=4958192122370832872" rel="nofollow"><span style="color:#000000;">http://dist.springsource.org/release/GRECLIPSE/e4.2/</span></a></code></span></p> <p><span style="color:#000000;">For Eclipse 3.7 (Indigo):</span><br /> <span style="color:#000000;"><code><a class="external-link" href="/misc/goto?guid=4958192122370832872" rel="nofollow"><span style="color:#000000;">http://dist.springsource.org/release/GRECLIPSE/e3.7/</span></a></code></span></p> <span style="color:#000000;"> </span></td>       </tr>      </tbody>     </table>    </div>    <p><span style="color:#000000;">The Groovy 2.0 compiler is not installed by default.  If you want to install it, you can do so from the <em>Extra Compilers </em>category in the update site.<br /> </span></p>    <p><span style="color:#000000;">And a zipped version of the update site is available at:</span></p>    <div class="panelMacro">     <table class="infoMacro ke-zeroborder">      <colgroup>       <col width="24" />       <col />     </colgroup>      <tbody>       <tr>        <td valign="top"><img border="0" alt="" align="absMiddle" src="http://docs.codehaus.org/images/icons/emoticons/information.png" width="16" height="16" /></td>        <td><b>Zipped Groovy-Eclipse update site for Eclipse 4.2 and 3.7</b><br /> <p><span style="color:#000000;">For Eclipse 4.2 (Juno):</span><br /> <span style="color:#000000;"><code><a class="external-link" href="/misc/goto?guid=4958346930344963670" rel="nofollow"><span style="color:#000000;">http://dist.springsource.org/release/GRECLIPSE/e4.2/archive-2.7.0.xx-20120703-1400-e42-RELEASE.zip</span></a></code></span></p> <p><span style="color:#000000;">For Eclipse 3.7 (Indigo):</span><br /> <span style="color:#000000;"><code><a class="external-link" href="/misc/goto?guid=4958346931142335152" rel="nofollow"><span style="color:#000000;">http://dist.springsource.org/release/GRECLIPSE/e3.7/archive-2.7.0.xx-20120703-1400-e37-RELEASE.zip</span></a></code></span></p> <p><span style="color:#000000;">You can install from the zip by pointing your Eclipse update manager to the downloaded zip file and following the installation instructions.  <em>Do not unzip into your Eclipse dropins folder.</em><br /> </span></p> </td>       </tr>      </tbody>     </table>    </div>    <p></p>    <div class="rbtoc1341366653668">     <ul>      <li><a href="/misc/goto?guid=4958346931926021205"><span style="color:#000000;">Groovy 2.0<br /> </span></a></li>      <li><a href="/misc/goto?guid=4958346932725328624"><span style="color:#000000;">Maven integration with <code>groovy-eclipse-compiler</code></span></a></li>      <li><a href="/misc/goto?guid=4958346933512817729"><span style="color:#000000;">@TypeChecked and @CompileStatic Support</span></a></li>      <li><a href="/misc/goto?guid=4958346934302777474">Assign statement to new local variable quickfix</a></li>      <li><a href="/misc/goto?guid=4958346935270398546"><span style="color:#000000;"><span style="color:#000000;">Convert variable to field</span></span></a></li>      <li><a href="/misc/goto?guid=4958346936078099556">Doc hovers with @link and @see</a></li>      <li><a href="/misc/goto?guid=4958346936874820690"><span style="color:#000000;">Source code to github</span></a></li>      <li><a href="/misc/goto?guid=4958346937700142337"><span style="color:#000000;">Compatibility</span></a></li>      <li><a href="/misc/goto?guid=4958346938495365634"><span style="color:#000000;">Bug fixes</span></a></li>      <li><a href="/misc/goto?guid=4958346939300701900"><span style="color:#000000;">What's next?</span></a></li>     </ul>    </div>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Groovy20"><span style="color:#000000;">Groovy 2.0<br /> </span></h3>    <p><span style="color:#000000;"><span style="color:#000000;">Groovy 2.0 is now available in Groovy-Eclipse as an optional add-on</span>.  We have not yet made the compiler default because we make our default compiler compatible with the default compiler of the latest release of Grails.  At the time of this release, Grails is at version 2.0.4, which uses Groovy 1.8 as its compiler.  When Grails moves to being based on Groovy 2.x, Groovy-Eclipse will move its default compiler as well.</span></p>    <p><span style="color:#000000;">To install Groovy 2.0, go to Help --> Install new Software.  In the work with tab, choose the Groovy-Eclipse update site and select the <em>Extra Compilers</em> category:</span></p>    <p><span style="color:#000000;"><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/install20.png?version=1&modificationDate=1341338701315" width="319" height="252" data-image-src="/download/attachments/229739268/install20.png?version=1&modificationDate=1341338701315" /><br /> </span></p>    <p><span style="color:#000000;">Read <a href="/misc/goto?guid=4958346940094926409">Compiler Switching within Groovy-Eclipse</a> for more information on how to install Groovy 2.0 and how to switch compiler levels.</span></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Mavenintegrationwithgroovy-eclipse-compiler"><span style="color:#000000;">Maven integration with <code>groovy-eclipse-compiler</code></span></h3>    <p><span style="color:#000000;">The groovy-eclipse-compiler plugin for maven has just released the 2.7.0-01 version and now uses Groovy 2.0 to compile against by default.  You can specify other Groovy compiler levels if required.  See <a href="/misc/goto?guid=4958346940896757946">Groovy-Eclipse compiler plugin for Maven</a> for more information.<br /> </span></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-TypeCheckedandCompileStaticSupport"><span style="color:#000000;">@TypeChecked and @CompileStatic Support</span></h3>    <p><span style="color:#000000;">With the 2.0 compiler enabled, you can use the</span><span style="color:#000000;"><code> @TypeChecked</code> and <code>@CompileStatic</code> annotations and Groovy-Eclipse compiles with them appropriately.  Here is an example from the <a class="external-link" href="/misc/goto?guid=4958346941703338846" rel="nofollow">What's new in Groovy 2.0</a> article on <a class="external-link" href="/misc/goto?guid=4958346942498930387" rel="nofollow">InfoQ</a>:</span></p>    <div class="table-wrap">     <table class="confluenceTable ke-zeroborder">      <tbody>       <tr>        <th style="text-align:center;" class="confluenceTh"> <p>TypeChecked</p> </th>        <th style="text-align:center;" class="confluenceTh"> <p>CompileStatic</p> </th>       </tr>       <tr>        <td class="confluenceTd"> <p><span><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/typeChecked.png?version=1&modificationDate=1341339855615" width="300" height="135" data-image-src="/download/attachments/229739268/typeChecked.png?version=1&modificationDate=1341339855615" /></span></p> </td>        <td class="confluenceTd"> <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/compileStatic.png?version=1&modificationDate=1341339981183" width="307" height="140" data-image-src="/download/attachments/229739268/compileStatic.png?version=1&modificationDate=1341339981183" /></p> </td>       </tr>      </tbody>     </table>    </div>    <p><span style="color:#000000;">Also, reconciling (i.e., eager parsing as you type) handles these annotations properly.  So, you get proper affordance when changing <code>int object = new Date()</code> to <code>Date object = new Date():</code></span></p>    <p><span style="color:#000000;"><span style="color:#000000;"><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/compileStaticReconcile.png?version=1&modificationDate=1341340130586" width="235" height="25" data-image-src="/download/attachments/229739268/compileStaticReconcile.png?version=1&modificationDate=1341340130586" /></span></span></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Assignstatementtonewlocalvariablequickfix">Assign statement to new local variable quickfix</h3>    <p>The Groovy-Eclipse editor now provides a new quickfix for assigning a statement to a local variable.  To access the quickfixes, press CTRL/CMD+1.  Choose <em>Assign statement to new local variable</em>:</p>    <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/assignToLocal.png?version=1&modificationDate=1341343955557" width="555" height="81" data-image-src="/download/attachments/229739268/assignToLocal.png?version=1&modificationDate=1341343955557" /></p>    <p>And the results look something like this:</p>    <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/assignToLocal2.png?version=1&modificationDate=1341343975157" width="367" height="37" data-image-src="/download/attachments/229739268/assignToLocal2.png?version=1&modificationDate=1341343975157" /></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Convertvariabletofield"><span style="color:#000000;"><span style="color:#000000;">Convert variable to field</span></span></h3>    <p>Groovy-Eclipse now provides a refactoring to convert local variables to fields.  To access the refactoring, select a local variable:</p>    <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/convertToField1.png?version=1&modificationDate=1341341643714" width="321" height="80" data-image-src="/download/attachments/229739268/convertToField1.png?version=1&modificationDate=1341341643714" /></p>    <p>In the context menu, choose Refactoring --> Convert Local Variable to Field...</p>    <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/convertToField2.png?version=1&modificationDate=1341341656695" width="560" height="147" data-image-src="/download/attachments/229739268/convertToField2.png?version=1&modificationDate=1341341656695" /></p>    <p>A wizard pops up where you can tweak your options and preview the results:</p>    <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/convertToField3.png?version=1&modificationDate=1341341671300" width="481" height="362" data-image-src="/download/attachments/229739268/convertToField3.png?version=1&modificationDate=1341341671300" /></p>    <p>Note that not all options are implemented yet.  Unimplemented pieces of the refactoring wizard are grey.  After pressing OK, you will see something like this:</p>    <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/convertToField4.png?version=1&modificationDate=1341341756471" width="272" height="94" data-image-src="/download/attachments/229739268/convertToField4.png?version=1&modificationDate=1341341756471" /></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Dochoverswithlinkandsee">Doc hovers with @link and @see</h3>    <p><span style="color:#000000;">Doc hovers now respect the <code>@link</code> and<code> @se</code>e JavaDoc tags, so you can add them to your DSLDs and users will be able to follow proper links to other parts of the source code:<br /> </span></p>    <p><img class="confluence-embedded-image confluence-content-image-border" src="http://static.open-open.com/download/attachments/229739268/seeAndLink.png?version=1&modificationDate=1341340547260" width="341" height="308" data-image-src="/download/attachments/229739268/seeAndLink.png?version=1&modificationDate=1341340547260" /></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Sourcecodetogithub"><span style="color:#000000;">Source code to github</span></h3>    <p><span style="color:#000000;">Groovy-Eclipse is now on GitHub.  Forking and pull requests are appreciated!</span></p>    <div class="panelMacro">     <table class="infoMacro ke-zeroborder">      <colgroup>       <col width="24" />       <col />     </colgroup>      <tbody>       <tr>        <td valign="top"><img border="0" alt="" align="absMiddle" src="http://docs.codehaus.org/images/icons/emoticons/information.png" width="16" height="16" /></td>        <td><b>GitHub Project</b><br /> <p><span style="color:#000000;"><a class="external-link" href="/misc/goto?guid=4958346943291191583" rel="nofollow">https://github.com/groovy/groovy-eclipse</a></span></p> </td>       </tr>      </tbody>     </table>    </div>    <p><span style="color:#000000;">The old SVN repository is no longer valid.</span></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Compatibility"><span style="color:#000000;">Compatibility</span></h3>    <p><span style="color:#000000;">Groovy-Eclipse 2.7.0 includes Groovy 1.8.6 by default. <a href="/misc/goto?guid=4958346940094926409"><span style="color:#000000;">Groovy 1.7.10 can be enabled optionally</span></a>, and Groovy 2.0.0 can be installed through the extra compilers section on the update site.<br /> </span></p>    <p><span style="color:#000000;">This version of Groovy-Eclipse is recommended to be installed on STS 2.9.2, STS 3.0.0.M3, Eclipse 3.7.2, or Eclipse 4.2.  There is also a 4.2-based Groovy-Eclipse now available.  See above for the update site.</span></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Bugfixes"><span style="color:#000000;">Bug fixes</span></h3>    <p><span style="color:#000000;">See the details on our <a class="external-link" href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+GRECLIPSE+AND+fixVersion+%3D+18349+AND+status+in+%28Resolved%2C+Closed%29+ORDER+BY+priority+DESC" rel="nofollow"><span style="color:#000000;">issue tracker</span></a>.</span></p>    <h3 id="Groovy-Eclipse270NewandNoteworthy-Whatsnext"><span style="color:#000000;">What's next?</span></h3>    <p><span style="color:#000000;">We are planning a 2.8.0 release in October. You can take a look at all issues we are <a class="external-link" href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+GRECLIPSE+AND+fixVersion+in+%2818617%2C+18618%29+AND+status+in+%28Open%2C+%22In+Progress%22%2C+Reopened%29" rel="nofollow"><span style="color:#000000;">planning to fix for this release</span></a>.</span></p>