/usr/share/doc/libcobertura-java/api/src-html/net/sourceforge/cobertura/ant/AntUtil.html is in libcobertura-java-doc 1.9.4.1+dfsg-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<div class="sourceContainer">
<pre><span class="sourceLineNo">001</span>/*<a name="line.1"></a>
<span class="sourceLineNo">002</span> * The Apache Software License, Version 1.1<a name="line.2"></a>
<span class="sourceLineNo">003</span> *<a name="line.3"></a>
<span class="sourceLineNo">004</span> * Copyright (C) 2006 Mark Doliner<a name="line.4"></a>
<span class="sourceLineNo">005</span> * Copyright (C) 2006 John Lewis<a name="line.5"></a>
<span class="sourceLineNo">006</span> *<a name="line.6"></a>
<span class="sourceLineNo">007</span> * Redistribution and use in source and binary forms, with or without<a name="line.7"></a>
<span class="sourceLineNo">008</span> * modification, are permitted provided that the following conditions<a name="line.8"></a>
<span class="sourceLineNo">009</span> * are met:<a name="line.9"></a>
<span class="sourceLineNo">010</span> *<a name="line.10"></a>
<span class="sourceLineNo">011</span> * 1. Redistributions of source code must retain the above copyright<a name="line.11"></a>
<span class="sourceLineNo">012</span> * notice, this list of conditions and the following disclaimer.<a name="line.12"></a>
<span class="sourceLineNo">013</span> *<a name="line.13"></a>
<span class="sourceLineNo">014</span> * 2. Redistributions in binary form must reproduce the above copyright<a name="line.14"></a>
<span class="sourceLineNo">015</span> * notice, this list of conditions and the following disclaimer in<a name="line.15"></a>
<span class="sourceLineNo">016</span> * the documentation and/or other materials provided with the<a name="line.16"></a>
<span class="sourceLineNo">017</span> * distribution.<a name="line.17"></a>
<span class="sourceLineNo">018</span> *<a name="line.18"></a>
<span class="sourceLineNo">019</span> * 3. The end-user documentation included with the redistribution, if<a name="line.19"></a>
<span class="sourceLineNo">020</span> * any, must include the following acknowlegement:<a name="line.20"></a>
<span class="sourceLineNo">021</span> * "This product includes software developed by the<a name="line.21"></a>
<span class="sourceLineNo">022</span> * Apache Software Foundation (http://www.apache.org/)."<a name="line.22"></a>
<span class="sourceLineNo">023</span> * Alternately, this acknowlegement may appear in the software itself,<a name="line.23"></a>
<span class="sourceLineNo">024</span> * if and wherever such third-party acknowlegements normally appear.<a name="line.24"></a>
<span class="sourceLineNo">025</span> *<a name="line.25"></a>
<span class="sourceLineNo">026</span> * 4. The names "Ant" and "Apache Software<a name="line.26"></a>
<span class="sourceLineNo">027</span> * Foundation" must not be used to endorse or promote products derived<a name="line.27"></a>
<span class="sourceLineNo">028</span> * from this software without prior written permission. For written<a name="line.28"></a>
<span class="sourceLineNo">029</span> * permission, please contact apache@apache.org.<a name="line.29"></a>
<span class="sourceLineNo">030</span> *<a name="line.30"></a>
<span class="sourceLineNo">031</span> * 5. Products derived from this software may not be called "Apache"<a name="line.31"></a>
<span class="sourceLineNo">032</span> * nor may "Apache" appear in their names without prior written<a name="line.32"></a>
<span class="sourceLineNo">033</span> * permission of the Apache Group.<a name="line.33"></a>
<span class="sourceLineNo">034</span> *<a name="line.34"></a>
<span class="sourceLineNo">035</span> * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED<a name="line.35"></a>
<span class="sourceLineNo">036</span> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES<a name="line.36"></a>
<span class="sourceLineNo">037</span> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE<a name="line.37"></a>
<span class="sourceLineNo">038</span> * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR<a name="line.38"></a>
<span class="sourceLineNo">039</span> * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,<a name="line.39"></a>
<span class="sourceLineNo">040</span> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT<a name="line.40"></a>
<span class="sourceLineNo">041</span> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF<a name="line.41"></a>
<span class="sourceLineNo">042</span> * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND<a name="line.42"></a>
<span class="sourceLineNo">043</span> * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,<a name="line.43"></a>
<span class="sourceLineNo">044</span> * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT<a name="line.44"></a>
<span class="sourceLineNo">045</span> * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF<a name="line.45"></a>
<span class="sourceLineNo">046</span> * SUCH DAMAGE.<a name="line.46"></a>
<span class="sourceLineNo">047</span> * ====================================================================<a name="line.47"></a>
<span class="sourceLineNo">048</span> *<a name="line.48"></a>
<span class="sourceLineNo">049</span> * This software consists of voluntary contributions made by many<a name="line.49"></a>
<span class="sourceLineNo">050</span> * individuals on behalf of the Apache Software Foundation. For more<a name="line.50"></a>
<span class="sourceLineNo">051</span> * information on the Apache Software Foundation, please see<a name="line.51"></a>
<span class="sourceLineNo">052</span> * <http://www.apache.org/>.<a name="line.52"></a>
<span class="sourceLineNo">053</span> */<a name="line.53"></a>
<span class="sourceLineNo">054</span><a name="line.54"></a>
<span class="sourceLineNo">055</span>package net.sourceforge.cobertura.ant;<a name="line.55"></a>
<span class="sourceLineNo">056</span><a name="line.56"></a>
<span class="sourceLineNo">057</span>import org.apache.tools.ant.taskdefs.Java;<a name="line.57"></a>
<span class="sourceLineNo">058</span>import org.apache.tools.ant.types.Environment.Variable;<a name="line.58"></a>
<span class="sourceLineNo">059</span><a name="line.59"></a>
<span class="sourceLineNo">060</span>abstract class AntUtil<a name="line.60"></a>
<span class="sourceLineNo">061</span>{<a name="line.61"></a>
<span class="sourceLineNo">062</span><a name="line.62"></a>
<span class="sourceLineNo">063</span> /**<a name="line.63"></a>
<span class="sourceLineNo">064</span> * Used to transfer the net.sourceforge.cobertura.datafile property to a JVM<a name="line.64"></a>
<span class="sourceLineNo">065</span> * that is about to be forked.<a name="line.65"></a>
<span class="sourceLineNo">066</span> * <a name="line.66"></a>
<span class="sourceLineNo">067</span> * This is confusing, but it's required by our functional test.<a name="line.67"></a>
<span class="sourceLineNo">068</span> * What happens is, we have a JUnit test that runs ant to<a name="line.68"></a>
<span class="sourceLineNo">069</span> * instrument some classes. When the instrumentation is running,<a name="line.69"></a>
<span class="sourceLineNo">070</span> * we want to get the coverage info that is created by exercising<a name="line.70"></a>
<span class="sourceLineNo">071</span> * our instrumentation classes.<a name="line.71"></a>
<span class="sourceLineNo">072</span> *<a name="line.72"></a>
<span class="sourceLineNo">073</span> * So we pass in two different coverage files:<a name="line.73"></a>
<span class="sourceLineNo">074</span> * 1. The coverage data file command line parameter. This tells<a name="line.74"></a>
<span class="sourceLineNo">075</span> * the instrument task where to write the new coverage data.<a name="line.75"></a>
<span class="sourceLineNo">076</span> * 2. The coverage data system property. This tells the<a name="line.76"></a>
<span class="sourceLineNo">077</span> * instrumentation inside the instrumented classes where to<a name="line.77"></a>
<span class="sourceLineNo">078</span> * keep track of the line hit counts, etc.<a name="line.78"></a>
<span class="sourceLineNo">079</span> *<a name="line.79"></a>
<span class="sourceLineNo">080</span> * @param task The Java task that will do the forking.<a name="line.80"></a>
<span class="sourceLineNo">081</span> */<a name="line.81"></a>
<span class="sourceLineNo">082</span> static void transferCoberturaDataFileProperty(Java task)<a name="line.82"></a>
<span class="sourceLineNo">083</span> {<a name="line.83"></a>
<span class="sourceLineNo">084</span> String coberturaProperty = System.getProperty("net.sourceforge.cobertura.datafile");<a name="line.84"></a>
<span class="sourceLineNo">085</span> if (coberturaProperty != null)<a name="line.85"></a>
<span class="sourceLineNo">086</span> {<a name="line.86"></a>
<span class="sourceLineNo">087</span> Variable sysproperty = new Variable();<a name="line.87"></a>
<span class="sourceLineNo">088</span> sysproperty.setKey("net.sourceforge.cobertura.datafile");<a name="line.88"></a>
<span class="sourceLineNo">089</span> sysproperty.setValue(coberturaProperty);<a name="line.89"></a>
<span class="sourceLineNo">090</span> task.addSysproperty(sysproperty);<a name="line.90"></a>
<span class="sourceLineNo">091</span> }<a name="line.91"></a>
<span class="sourceLineNo">092</span> }<a name="line.92"></a>
<span class="sourceLineNo">093</span><a name="line.93"></a>
<span class="sourceLineNo">094</span>}<a name="line.94"></a>
</pre>
</div>
</body>
</html>
|