profiler-build-impl.xml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. *** GENERATED FROM project.xml - DO NOT EDIT ***
  4. *** EDIT ../build.xml INSTEAD ***
  5. For the purpose of easier reading the script
  6. is divided into following sections:
  7. - initialization
  8. - profiling
  9. - applet profiling
  10. -->
  11. <project name="-profiler-impl" default="profile" basedir="..">
  12. <target name="default" depends="profile" description="Build and profile the project."/>
  13. <!--
  14. ======================
  15. INITIALIZATION SECTION
  16. ======================
  17. -->
  18. <target name="profile-init" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check"/>
  19. <target name="-profile-pre-init">
  20. <!-- Empty placeholder for easier customization. -->
  21. <!-- You can override this target in the ../build.xml file. -->
  22. </target>
  23. <target name="-profile-post-init">
  24. <!-- Empty placeholder for easier customization. -->
  25. <!-- You can override this target in the ../build.xml file. -->
  26. </target>
  27. <target name="-profile-init-macrodef-profile">
  28. <macrodef name="resolve">
  29. <attribute name="name"/>
  30. <attribute name="value"/>
  31. <sequential>
  32. <property name="@{name}" value="${env.@{value}}"/>
  33. </sequential>
  34. </macrodef>
  35. <macrodef name="profile">
  36. <attribute name="classname" default="${main.class}"/>
  37. <element name="customize" optional="true"/>
  38. <sequential>
  39. <property environment="env"/>
  40. <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
  41. <java fork="true" classname="@{classname}" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}">
  42. <jvmarg value="${profiler.info.jvmargs.agent}"/>
  43. <jvmarg line="${profiler.info.jvmargs}"/>
  44. <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  45. <arg line="${application.args}"/>
  46. <classpath>
  47. <path path="${run.classpath}"/>
  48. </classpath>
  49. <syspropertyset>
  50. <propertyref prefix="run-sys-prop."/>
  51. <mapper type="glob" from="run-sys-prop.*" to="*"/>
  52. </syspropertyset>
  53. <customize/>
  54. </java>
  55. </sequential>
  56. </macrodef>
  57. </target>
  58. <target name="-profile-init-check" depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile">
  59. <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
  60. <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
  61. </target>
  62. <!--
  63. =================
  64. PROFILING SECTION
  65. =================
  66. -->
  67. <target name="profile" if="netbeans.home" depends="profile-init,compile" description="Profile a project in the IDE.">
  68. <nbprofiledirect>
  69. <classpath>
  70. <path path="${run.classpath}"/>
  71. </classpath>
  72. </nbprofiledirect>
  73. <profile/>
  74. </target>
  75. <target name="profile-single" if="netbeans.home" depends="profile-init,compile-single" description="Profile a selected class in the IDE.">
  76. <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  77. <nbprofiledirect>
  78. <classpath>
  79. <path path="${run.classpath}"/>
  80. </classpath>
  81. </nbprofiledirect>
  82. <profile classname="${profile.class}"/>
  83. </target>
  84. <!--
  85. =========================
  86. APPLET PROFILING SECTION
  87. =========================
  88. -->
  89. <target name="profile-applet" if="netbeans.home" depends="profile-init,compile-single">
  90. <nbprofiledirect>
  91. <classpath>
  92. <path path="${run.classpath}"/>
  93. </classpath>
  94. </nbprofiledirect>
  95. <profile classname="sun.applet.AppletViewer">
  96. <customize>
  97. <arg value="${applet.url}"/>
  98. </customize>
  99. </profile>
  100. </target>
  101. <!--
  102. =========================
  103. TESTS PROFILING SECTION
  104. =========================
  105. -->
  106. <target name="profile-test-single" if="netbeans.home" depends="profile-init,compile-test-single">
  107. <nbprofiledirect>
  108. <classpath>
  109. <path path="${run.test.classpath}"/>
  110. </classpath>
  111. </nbprofiledirect>
  112. <junit showoutput="true" fork="true" dir="${profiler.info.dir}" jvm="${profiler.info.jvm}" failureproperty="tests.failed" errorproperty="tests.failed">
  113. <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  114. <jvmarg value="${profiler.info.jvmargs.agent}"/>
  115. <jvmarg line="${profiler.info.jvmargs}"/>
  116. <test name="${profile.class}"/>
  117. <classpath>
  118. <path path="${run.test.classpath}"/>
  119. </classpath>
  120. <syspropertyset>
  121. <propertyref prefix="test-sys-prop."/>
  122. <mapper type="glob" from="test-sys-prop.*" to="*"/>
  123. </syspropertyset>
  124. <formatter type="brief" usefile="false"/>
  125. <formatter type="xml"/>
  126. </junit>
  127. </target>
  128. </project>