1 package net.sf.logdistiller.ant;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 import org.apache.tools.ant.Project;
18 import org.apache.tools.ant.types.Path;
19 import org.apache.tools.ant.types.Reference;
20
21
22
23
24
25
26
27
28 public class AntLogEvent
29 {
30 private final Project project;
31
32 private String logtype;
33
34 private Path classpath;
35
36 public AntLogEvent( Project project )
37 {
38 this.project = project;
39 }
40
41 public void setClasspath( Path classpath )
42 {
43 if ( this.classpath == null )
44 {
45 this.classpath = classpath;
46 }
47 else
48 {
49 this.classpath.append( classpath );
50 }
51 }
52
53 public Path createClasspath()
54 {
55 if ( classpath == null )
56 {
57 classpath = new Path( project );
58 }
59 return classpath.createPath();
60 }
61
62 public void setClasspathRef( Reference r )
63 {
64 createClasspath().setRefid( r );
65 }
66
67 public void setLoaderRef( Reference r )
68 {
69 }
70
71
72
73
74 public void setFactory( String factory )
75 {
76 setLogtype( factory );
77 project.log( "WARNING: attribute 'factory' is deprecated, please use attribute 'logtype' instead",
78 Project.MSG_WARN );
79 }
80
81 public void setLogtype( String logtype )
82 {
83 this.logtype = logtype;
84 }
85
86 public String getLogtype()
87 {
88 return logtype;
89 }
90 }