7 Replies Latest reply on Oct 20, 2005 4:19 PM by khaleel p

    new build system and Eclipse

    mazz Master

      Anyone using the new build scripts with Eclipse?

      I figured things might go screwy since the new build system creates targets on the fly in memory. So, I opened the Ant View and loaded microkernel's jbossbuild.xml and got "Default target build does not exist in this project".

      I put jbossbuild.jar in my Eclipse's ANT classpath (part of the Ant preferences) but still no go. I'm assuming the Ant view only parses the file and thus can't see any of the dynamic targets.

      If true, this kinda sucks - we won't be able to create any External Tool definitions to run Ant targets in projects that happen to use the new build system. :-(

      Am I just not configured properly or is this going to be a restriction of the new build system (i.e. must use command line to build)

        • 1. Re: new build system and Eclipse
          Adrian Brock Master

          This is a know issue.

          Eclipse shouldn't be generating the list by parsing the ant file directly,
          it should be parsing then asking the ant project "what are the targets?"

          If it really is an issue, maybe you could look at providing a patch to
          the eclipse project?

          • 2. Re: new build system and Eclipse
            ryan.campbell Expert

            Weren't you complaining a few months ago that you couldn't use eclipse with buildmagic? At least we're not moving backwards :-)

            One possibility is that we have a few regular s in tasks.xml for Eclipse to read. Then the dynamic ones can use Project.addOrReplaceTarget() instead of just addTarget().

            Duplicate targetdefs are a good indication you have something wrong with your build definition, so we could check to see if the existing target is instanceof DynamicTarget before overriding it...

            • 3. Re: new build system and Eclipse
              ryan.campbell Expert

              I meant to say "we could have a few regular targets in tasks.xml for Eclipse to read". Basicaly, no-op targets to work around Eclipse's desire to parse the ant file.

              • 4. Re: new build system and Eclipse
                mazz Master

                Good point about the buildmagic issue :-)

                no-arg targets is a good idea - build, compile, etc. Something for Eclipse to see.

                I was thinking we can have a static target that builds a static script that Eclipse can read in. instead of pointing Eclipse to jbossbuild.xml, we point it to output/build.xml - it would basically be the full set of dynamic targets written to it (something like the "show" output, but with everyting in there). But no-arg targets might not be a bad idea and might be simpler to do.

                • 5. Re: new build system and Eclipse
                  Adrian Brock Master

                  You can almost get that now except it includes the ant cruft:

                  [ejort@htimes2 kernel]$ ant -emacs -f jbossbuild.xml show > test
                  

                  produces:
                  Buildfile: jbossbuild.xml
                  
                  show:
                  <!-- Build All -->
                  <target name="all" depends="build, doc, test">
                  </target>
                  
                  <!-- Javadoc -->
                  <target name="api">
                  </target>
                  
                  <!-- Build -->
                  <target name="build" depends="build.etc, build.main, build.tests, build.xml-test, build.jboss-microcontainer.jar">
                  <mkdir dir="/home/ejort/jboss-head/workspace/kernel/output/etc"/>
                  <copy todir="/home/ejort/jboss-head/workspace/kernel/output/etc" filtering="yes">
                   <fileset dir="/home/ejort/jboss-head/workspace/kernel/src/etc/" includes="**"/>
                  </copy>
                  </target>
                  
                  <target name="build.etc">
                  <mkdir dir="/home/ejort/jboss-head/workspace/kernel/output/etc"/>
                  <copy todir="/home/ejort/jboss-head/workspace/kernel/output/etc" filtering="yes">
                   <fileset dir="/home/ejort/jboss-head/workspace/kernel/src/etc/" includes="**"/>
                   <filterset>
                   <filter token="java.vm.version" value="1.4.2_04-b05"/>
                   <filter token="java.vm.vendor" value="Sun Microsystems Inc."/>
                   <filter token="specification.title" value="JBossAS"/>
                   <filter token="specification.version" value="5.0.0alpha"/>
                   <filter token="specification.vendor" value="JBoss Inc."/>
                   <filter token="implementation.title" value="JBossAS"/>
                   <filter token="implementation.url" value="http://www.jboss.org"/>
                   <filter token="implementation.version" value="5.0.0alpha"/>
                   <filter token="implementation.vendor" value="JBoss Inc."/>
                   <filter token="implementation.vendor.id" value="http://www.jboss.org"/>
                   </filterset>
                  </copy>
                  </target>
                  
                  <!-- Build for the artifact jboss-microcontainer.jar -->
                  <target name="build.jboss-microcontainer.jar">
                  <mkdir dir="/home/ejort/jboss-head/workspace/kernel/output/lib"/>
                  <jar destfile="/home/ejort/jboss-head/workspace/kernel/output/lib/jboss-microcontainer.jar">
                   <manifest>
                   <attribute name="Created-by" value="1.4.2_04-b05 Sun Microsystems Inc."/>
                   <attribute name="Specification-Title" value="JBossAS"/>
                   <attribute name="Specification-Version" value="5.0.0alpha"/>
                   <attribute name="Specification-Vendor" value="JBoss Inc."/>
                   <attribute name="Implementation-Title" value="JBossAS"/>
                   <attribute name="Implementation-URL" value="http://www.jboss.org"/>
                   <attribute name="Implementation-Version" value="5.0.0alpha"/>
                   <attribute name="Implementation-Vendor" value="JBoss Inc."/>
                   <attribute name="Implementation-Vendor-Id" value="http://www.jboss.org"/>
                   <attribute name="Class-Path" value="jboss-common.jar namespace.jar jboss-container.jar concurrent.jar"/>
                   </manifest>
                   <zipfileset file="/home/ejort/jboss-head/workspace/kernel/output/classes/main"/>
                  </jar>
                  </target>
                  
                  <!-- Build for the source src/main -->
                  <target name="build.main">
                  <property name="javac.excludes" value=""/>
                  Unable to locate '../conf/' in Class-Path of jboss-container.jar
                  <mkdir dir="/home/ejort/jboss-head/workspace/kernel/output/classes/main"/>
                  <depend destdir="/home/ejort/jboss-head/workspace/kernel/output/classes/main" srcdir="src/main">
                   <classpath>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/namespace.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-xerces/lib/xercesImpl.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-log4j/lib/log4j.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/jboss-common.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/main"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/container/output/lib/jboss-container.jar"/>
                   </classpath>
                  Unable to locate '../conf/' in Class-Path of jboss-container.jar
                  </depend>
                  <javac destdir="/home/ejort/jboss-head/workspace/kernel/output/classes/main" deprecation="true" srcdir="src/main" debug="true" excludes="${javac.excludes}">
                   <classpath>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/namespace.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-xerces/lib/xercesImpl.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-log4j/lib/log4j.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/jboss-common.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/main"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/container/output/lib/jboss-container.jar"/>
                   </classpath>
                  </javac>
                  <copy todir="/home/ejort/jboss-head/workspace/kernel/output/classes/main">
                   <fileset dir="src/main">
                   <include name="**/*.properties"/>
                   </fileset>
                  </copy>
                  </target>
                  
                  <target name="build.resources">
                  <mkdir dir="/home/ejort/jboss-head/workspace/kernel/output/resources"/>
                  <copy todir="/home/ejort/jboss-head/workspace/kernel/output" filtering="no">
                   <fileset dir="/home/ejort/jboss-head/workspace/kernel/src" includes="resources/**"/>
                  </copy>
                  </target>
                  
                  <!-- Build for the source src/tests -->
                  <target name="build.tests">
                  <property name="javac.excludes" value=""/>
                  Unable to locate '../conf/' in Class-Path of jboss-container.jar
                  <mkdir dir="/home/ejort/jboss-head/workspace/kernel/output/classes/tests"/>
                  <depend destdir="/home/ejort/jboss-head/workspace/kernel/output/classes/tests" srcdir="src/tests">
                   <classpath>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/namespace.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/resources/xml-test"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/tests"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-xerces/lib/xercesImpl.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-log4j/lib/log4j.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/jboss-common.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/test/output/lib/jboss-test.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/main"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/container/output/lib/jboss-container.jar"/>
                   </classpath>
                  Unable to locate '../conf/' in Class-Path of jboss-container.jar
                  </depend>
                  <javac destdir="/home/ejort/jboss-head/workspace/kernel/output/classes/tests" deprecation="true" srcdir="src/tests" debug="true" excludes="${javac.excludes}">
                   <classpath>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/namespace.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/resources/xml-test"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/tests"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-xerces/lib/xercesImpl.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-log4j/lib/log4j.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/jboss-common.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/test/output/lib/jboss-test.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/main"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/container/output/lib/jboss-container.jar"/>
                   </classpath>
                  </javac>
                  <copy todir="/home/ejort/jboss-head/workspace/kernel/output/classes/tests">
                   <fileset dir="src/tests">
                   <include name="**/*.properties"/>
                   </fileset>
                  </copy>
                  </target>
                  
                  <!-- Build for the resource resources/xml-test -->
                  <target name="build.xml-test" depends="build.resources">
                  </target>
                  
                  <!-- Clean -->
                  <target name="clean">
                  <delete dir="/home/ejort/jboss-head/workspace/kernel/output"/>
                  </target>
                  
                  <!-- Commit -->
                  <target name="commit">
                  <fail message="Use -Dm="xxx" to specify the commit message" unless="m"/>
                  <cvs failonerror="true">
                   <commandline>
                   <argument value="commit"/>
                   <argument value="-m"/>
                   <argument value="${m}"/>
                   </commandline>
                  </cvs>
                  </target>
                  
                  <!-- Documentation -->
                  <target name="doc" depends="api">
                  </target>
                  
                  <!-- Synchronize then build -->
                  <target name="rebuild" depends="synchronize">
                  <execant target="build"/>
                  </target>
                  
                  <!-- Synchronize then build all -->
                  <target name="rebuildall" depends="synchronize">
                  <execant target="all"/>
                  </target>
                  
                  <!-- Run tests -->
                  <target name="runtest" depends="runtest.tests">
                  </target>
                  
                  <!-- Run tests for the source src/tests -->
                  <target name="runtest.tests">
                  <mkdir dir="/home/ejort/jboss-head/workspace/kernel/output/reports/tests"/>
                  Unable to locate '../conf/' in Class-Path of jboss-container.jar
                  <delete file="/home/ejort/jboss-head/workspace/kernel/output/reports/tests/test.log"/>
                  <junit printsummary="true" fork="true">
                   <sysproperty key="org.jboss.test.logfile" value="/home/ejort/jboss-head/workspace/kernel/output/reports/tests/test.log"/>
                   <formatter type="plain"/>
                   <classpath>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/namespace.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/resources/xml-test"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/tests"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-xerces/lib/xercesImpl.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/apache-log4j/lib/log4j.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/common/output/lib/jboss-common.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/test/output/lib/jboss-test.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/kernel/output/classes/main"/>
                   <pathelement location="/home/ejort/jboss-head/workspace/container/output/lib/jboss-container.jar"/>
                   </classpath>
                   <batchtest todir="/home/ejort/jboss-head/workspace/kernel/output/reports/tests">
                   <fileset dir="/home/ejort/jboss-head/workspace/kernel/src/tests" includes="org/jboss/test/**/*TestCase.java"/>
                   </batchtest>
                  </junit>
                  </target>
                  
                  <!-- Show the targets -->
                  <target name="show">
                  <!-- Dynamic Target -->
                  </target>
                  
                  <!-- Synchronize -->
                  <target name="synchronize">
                  <cvs failonerror="true" command="update -dP"/>
                  </target>
                  
                  <!-- After synchronization processing -->
                  <target name="synchronize.after">
                  <idecomponent/>
                  </target>
                  
                  <!-- Build and run the tests -->
                  <target name="test" depends="build, runtest">
                  </target>
                  
                  
                  BUILD SUCCESSFUL
                  Total time: 1 second
                  


                  • 6. Re: new build system and Eclipse
                    Adrian Brock Master

                    One of the big problems with buildmagic/eclipse is gone in jboss-head.

                    It no longer uses xdoclet, so you don't have xjavadoc eating all your memory.

                    • 7. Re: new build system and Eclipse
                      khaleel p Newbie

                      Does any one know whether this issue has been solved ? I am using
                      Version: 3.1.1 Build id: M20050929-0840

                      This is a know issue.

                      Eclipse shouldn't be generating the list by parsing the ant file directly,
                      it should be parsing then asking the ant project "what are the targets?"

                      Thanks
                      Khaleel