This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Adding groovy class to Java Project - bad ant file build-impl.xml | ||
---|---|---|---|
Product: | groovy | Reporter: | pzalews <pzalews> |
Component: | Code | Assignee: | Martin Janicek <mjanicek> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | orluke |
Priority: | P3 | ||
Version: | 7.0 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
pzalews
2010-05-07 11:21:45 UTC
May already be known, but in 6.9.1 this appears to stem from a discrepancy between the definition of the <j2seproject3:javac> macro in groovy-build.xml relative to that in build-impl.xml. A workaround is to copy the macro from groovy-build.xml to build.xml and add the two missing attribute definitions: <attribute default="${javac.processorpath}" name="processorpath"/> <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> (It doesn't look like these are actually used even in the "default" implementation, but they are used by the invocation points and therefore required.) The following may also be needed information for groovy users: http://charliesquires.wordpress.com/2009/08/30/running-groovy-tests-in-netbeans-6-7-1/ Are there any other workarounds besides those listed above? I'm having the same problem in Netbeans 7.0 and 6.9.1, and those workarounds listed to not work. I'm able to reproduce. This should be fixed - setting TM --> 7.2 For now the easiest way to workarround the problem: - Open groovy-build.xml - Put these two lines right behind javac macrodef: <attribute default="${javac.processorpath}" name="processorpath"/> <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/> - Try to test project again - problem shouldn't occurs anymore Btw: If you workarround the issue by steps I've just described, you could still have problem with running .groovy tests together with .java tests. In that case you need to change your build.xml file and put these lines right behind import line: <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run"> <j2seproject3:junit testincludes="**/*Test.class"/> </target> <target name="-init-macrodef-junit"> <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3"> <attribute default="${includes}" name="includes"/> <attribute default="${excludes}" name="excludes"/> <attribute default="**" name="testincludes"/> <sequential> <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true"> <batchtest todir="${build.test.results.dir}"> <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes}" includes="@{includes}"> <filename name="@{testincludes}"/> </fileset> </batchtest> <classpath> <path path="${run.test.classpath}"/> </classpath> <syspropertyset> <propertyref prefix="test-sys-prop."/> <mapper from="test-sys-prop.*" to="*" type="glob"/> </syspropertyset> <formatter type="brief" usefile="false"/> <formatter type="xml"/> <jvmarg line="${run.jvmargs}"/> </junit> </sequential> </macrodef> </target> Fixed in: web-main #ff9e29335bea Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/ff9e29335bea User: Martin Janicek <mjanicek@netbeans.org> Log: #185686 - Adding groovy class to Java Project - bad ant file build-impl.xml |