Permalink
Browse files

Add NB support for debugging a single file.

  • Loading branch information...
1 parent 80603cf commit 0c0ce5ea1811d53799f35ecf594b0ae00bf0185e @headius headius committed Nov 3, 2011
Showing with 37 additions and 0 deletions.
  1. +24 −0 nbproject/ide-file-targets.xml
  2. +13 −0 nbproject/project.xml
@@ -44,4 +44,28 @@
<test name="${classname}"/>
</junit>
</target>
+ <property file="nbproject/nbjdk.properties"/>
+ <property location="${netbeans.user}/build.properties" name="user.properties.file"/>
+ <property file="${user.properties.file}"/>
+ <import file="jdk.xml"/>
+ <!-- TODO: edit the following target according to your needs -->
+ <!-- (more info: http://www.netbeans.org/kb/articles/freeform-config.html#runsingle) -->
+ <target depends="-jdk-init" name="debug-selected-file-in-src">
+ <fail unless="debug.class">Must set property 'debug.class'</fail>
+ <path id="cp">
+ <pathelement path="build_lib/junit.jar:build_lib/jline-1.0.jar:build_lib/jna.jar:build_lib/nailgun-0.7.1.jar:build_lib/joni.jar:build_lib/dynalang-0.3.jar:build_lib/invokedynamic.jar:build_lib/jcodings.jar:build_lib/bytelist.jar:build_lib/jffi.jar:build_lib/yydebug.jar:build_lib/bsf.jar:build_lib/jaffl.jar:build_lib/jsr292-mock.jar:build_lib/jgrapht-jdk1.5.jar:build_lib/jnr-netdb.jar:build_lib/jnr-posix.jar:build_lib/joda-time-1.6.2.jar:build_lib/livetribe-jsr223-2.0.6.jar:build_lib/ant.jar:build_lib/org.osgi.core-4.2.0.jar:build_lib/jnr-constants.jar:build_lib/slf4j-api-1.6.1.jar:build_lib/asm-4.0_RC2.jar:build_lib/asm-analysis-4.0_RC2.jar:build_lib/asm-commons-4.0_RC2.jar:build_lib/asm-tree-4.0_RC2.jar:build_lib/asm-util-4.0_RC2.jar:build_lib/jzlib-gzip.jar:build_lib/snakeyaml-1.9.jar:build_lib/coro-mock-1.0-SNAPSHOT.jar:build_lib/jzlib-1.1.0.jar"/>
+ <pathelement location="${jruby.classes.dir}"/>
+ <pathelement location="${lib.dir}/jruby.jar"/>
+ </path>
+ <nbjpdastart addressproperty="jpda.address" name="JRuby trunk" transport="dt_socket">
+ <classpath refid="cp"/>
+ </nbjpdastart>
+ <input message="Enter command-line args" addproperty="command.line.args"/>
+ <java classname="${debug.class}" fork="true">
+ <classpath refid="cp"/>
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+ <arg line="${command.line.args}"/>
+ </java>
+ </target>
</project>
View
@@ -155,6 +155,19 @@
</arity>
</context>
</action>
+ <action name="debug.single">
+ <script>nbproject/ide-file-targets.xml</script>
+ <target>debug-selected-file-in-src</target>
+ <context>
+ <property>debug.class</property>
+ <folder>${src.dir}</folder>
+ <pattern>\.java$</pattern>
+ <format>java-name</format>
+ <arity>
+ <one-file-only/>
+ </arity>
+ </context>
+ </action>
</ide-actions>
<export>
<type>folder</type>

0 comments on commit 0c0ce5e

Please sign in to comment.