Wed, 22 May 2013 16:39:48 +0530
8008947: ScriptEnvironment ctor should be public
Reviewed-by: lagergren, attila
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 This code is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License version 2 only, as
8 published by the Free Software Foundation.
10 This code is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 version 2 for more details (a copy is included in the LICENSE file that
14 accompanied this code).
16 You should have received a copy of the GNU General Public License version
17 2 along with this work; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 or visit www.oracle.com if you need additional information or have any
22 questions.
23 -->
24 <project name="code-coverage" default="generate-code-coverage-report" basedir="..">
26 <!-- CODE COVERAGE -->
27 <target name="init-cc-enabled" if="${cc.enabled}">
29 <echo message="initialize [${jcov}] java coverage"/>
32 <property name="cc.report.dir" value="${cc.dir}/CC_${jcov}_report"/>
33 <property name="cc.merged.xml" value="${cc.dir}/CC_${jcov}_result-merged.xml"/>
35 <condition property="run.test.cc.jvmargs" value="${cc.dynamic.args}">
36 <equals arg1="${jcov}" arg2="dynamic" trim="true"/>
37 </condition>
39 <condition property="cc.generate.template" value="true">
40 <equals arg1="${cc.dynamic.genereate.template}" arg2="true" trim="true"/>
41 </condition>
43 <mkdir dir="${cc.dir}"/>
44 <mkdir dir="${build.dir}/to_be_instrumented"/>
46 <!-- info -->
47 <echo message="jcov=${jcov}"/>
48 <echo message="cc.generate.template=${cc.generate.template}"/>
49 <echo message="cc.instrument=${cc.instrument}"/>
50 <echo message="run.test.cc.jvmargs=${run.test.cc.jvmargs}"/>
51 <echo message="cc.report.dir=${cc.report.dir}"/>
52 <echo message="cc.merged.xml=${cc.merged.xml}"/>
53 </target>
55 <target name="init-cc-disabled" unless="${cc.enabled}">
56 <property name="run.test.cc.jvmargs" value=""/>
57 </target>
59 <target name="prepare-to-be-instrumented" depends="compile" description="Prepares to_be_instrumented dir">
60 <copy todir="${build.dir}/to_be_instrumented">
61 <fileset dir="${build.classes.dir}">
62 <include name="**/*.class"/>
63 <include name="**/*.clazz"/>
64 </fileset>
65 </copy>
67 <move todir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
68 <fileset dir="${build.dir}/to_be_instrumented/jdk/nashorn/internal/objects">
69 <include name="**/*.clazz"/>
70 </fileset>
71 <mapper type="glob" from="*.clazz" to="*.class"/>
72 </move>
73 </target>
75 <target name="generate-cc-template" depends="prepare-to-be-instrumented" description="Generates code coverage template for dynamic CC" if="cc.generate.template">
76 <property name="cc.instrumented.path" location="${build.dir}/to_be_instrumented"/>
77 <java classname="com.sun.tdk.jcov.TmplGen">
78 <arg value="-verbose"/>
79 <arg line="-include ${cc.include}"/>
80 <arg line="-type all"/>
81 <arg line="-template ${cc.template}"/>
82 <arg value="${cc.instrumented.path}"/>
83 <classpath>
84 <pathelement location="${jcov.jar}"/>
85 </classpath>
86 </java>
88 <java classname="com.sun.tdk.jcov.RepGen">
89 <arg value="-verbose"/>
90 <arg line="-output ${cc.dir}/CC_template_report"/>
91 <arg value="${cc.template}"/>
92 <classpath>
93 <pathelement location="${jcov.jar}"/>
94 </classpath>
95 </java>
96 </target>
98 <target name="init-cc" depends="init-cc-disabled, init-cc-enabled">
99 <property name="run.test.cc.jvmargs" value=""/>
100 </target>
102 <target name="init-cc-cleanup" if="${cc.enabled}">
103 <delete dir="${cc.dir}" failonerror="false" />
104 <delete dir="${build.dir}/to_be_instrumented" failonerror="false" />
105 </target>
107 <target name="check-merging-files" depends="init">
108 <echo message="checking avalibility of ${cc.template}"/>
109 <condition property="nothing-to-merge" value="true">
110 <not>
111 <available file="${cc.template}"/>
112 </not>
113 </condition>
114 <echo message="nothing-to-merge = ${nothing-to-merge}"/>
115 </target>
117 <target name="fix-merging-files" depends="check-merging-files" if="${nothing-to-merge}">
118 <echo message="making pre-merge workaround due to missed template"/>
119 <move todir="${cc.dir}" includeemptydirs="false">
120 <fileset dir="${cc.dir}">
121 <include name="*.xml"/>
122 </fileset>
123 <mapper type="glob" from="*.xml" to="CC_${jcov}_result-merged.xml"/>
124 </move>
125 </target>
127 <target name="merge-code-coverage" depends="fix-merging-files" unless="${nothing-to-merge}">
128 <echo message="merging files"/>
129 <fileset dir="${cc.dir}" id="cc.xmls">
130 <include name="**/*_${jcov}_*.xml"/>
131 <include name="**/CC_template.xml"/>
132 </fileset>
134 <pathconvert pathsep=" " property="cc.all.xmls" refid="cc.xmls"/>
135 <echo message="merging files - ${cc.all.xmls}" />
136 <java classname="com.sun.tdk.jcov.Merger">
137 <arg value="-verbose"/>
138 <arg value="-output"/>
139 <arg value="${cc.merged.xml}"/>
140 <arg value="-exclude"/>
141 <arg value="com\.oracle\.nashorn\.runtime\.ScriptRuntime*"/>
142 <arg value="-exclude"/>
143 <arg value="jdk\.nashorn\.internal\.javaadapters*"/>
144 <arg value="-exclude"/>
145 <arg value="jdk\.nashorn\.internal\.objects\.annotations*"/>
146 <arg value="-exclude"/>
147 <arg value="jdk\.nashorn\.internal\.scripts*"/>
148 <arg value="-exclude"/>
149 <arg value="jdk\.nashorn\.internal\.lookup\.MethodHandleFactory*"/>
150 <arg value="-exclude"/>
151 <arg value="jdk\.nashorn\.internal\.test\.framework*"/>
152 <arg value="-exclude"/>
153 <arg value="jdk\.nashorn\.test\.models*"/>
154 <arg value="-exclude"/>
155 <arg value="jdk\.nashorn\.internal\.ir\.debug*"/>
156 <arg value="-exclude"/>
157 <arg value="jdk\.nashorn\.internal\.runtime\.regexp\.joni\.bench*"/>
158 <arg value="-exclude"/>
159 <arg value="jdk\.nashorn\.internal\.runtime\.DebugLogger*"/>
160 <arg value="-exclude"/>
161 <arg value="jdk\.nashorn\.internal\.runtime\.Timing*"/>
162 <arg value="-exclude"/>
163 <arg value="jdk\.nashorn\.internal\.runtime\.Logging*"/>
164 <arg value="-exclude"/>
165 <arg value="jdk\.nashorn\.internal\.runtime\.Debug*"/>
166 <arg value="-exclude"/>
167 <arg value="jdk\.nashorn\.internal\.objects\.NativeDebug*"/>
168 <arg line="${cc.all.xmls}"/>
169 <classpath>
170 <pathelement location="${jcov.jar}"/>
171 </classpath>
172 </java>
174 </target>
176 <target name="generate-code-coverage-report" depends="merge-code-coverage">
177 <java classname="com.sun.tdk.jcov.RepGen">
178 <arg value="-verbose"/>
179 <!-- <arg line ="-exclude_list CC.report.exclude"/> -->
180 <arg line="-output ${cc.report.dir}"/>
181 <arg value="${cc.merged.xml}"/>
182 <classpath>
183 <pathelement location="${jcov.jar}"/>
184 </classpath>
185 </java>
186 </target>
189 </project>