]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /*\r |
2 | * \r | |
3 | * Copyright 2002-2004 The Ant-Contrib project\r | |
4 | *\r | |
5 | * Licensed under the Apache License, Version 2.0 (the "License");\r | |
6 | * you may not use this file except in compliance with the License.\r | |
7 | * You may obtain a copy of the License at\r | |
8 | *\r | |
9 | * http://www.apache.org/licenses/LICENSE-2.0\r | |
10 | *\r | |
11 | * Unless required by applicable law or agreed to in writing, software\r | |
12 | * distributed under the License is distributed on an "AS IS" BASIS,\r | |
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r | |
14 | * See the License for the specific language governing permissions and\r | |
15 | * limitations under the License.\r | |
16 | */\r | |
17 | package net.sf.antcontrib.cpptasks;\r | |
18 | import java.io.File;\r | |
19 | \r | |
20 | import net.sf.antcontrib.cpptasks.types.ConditionalFileSet;\r | |
21 | \r | |
22 | import org.apache.tools.ant.BuildException;\r | |
23 | /**\r | |
24 | * Specifies files that should not be compiled using precompiled headers.\r | |
25 | * \r | |
26 | * @author Curt Arnold\r | |
27 | */\r | |
28 | public final class PrecompileExceptDef {\r | |
29 | private ConditionalFileSet localSet = null;\r | |
30 | /**\r | |
31 | * Collection of <fileset>contained by definition\r | |
32 | */\r | |
33 | private PrecompileDef owner;\r | |
34 | /**\r | |
35 | * Constructor\r | |
36 | * \r | |
37 | */\r | |
38 | public PrecompileExceptDef(PrecompileDef owner) {\r | |
39 | this.owner = owner;\r | |
40 | }\r | |
41 | /**\r | |
42 | * Adds filesets that specify files that should not be processed using\r | |
43 | * precompiled headers.\r | |
44 | * \r | |
45 | * @param exceptSet\r | |
46 | * FileSet specify files that should not be processed with\r | |
47 | * precompiled headers enabled.\r | |
48 | */\r | |
49 | public void addFileset(ConditionalFileSet exceptSet) {\r | |
50 | owner.appendExceptFileSet(exceptSet);\r | |
51 | }\r | |
52 | public void execute() throws org.apache.tools.ant.BuildException {\r | |
53 | throw new org.apache.tools.ant.BuildException(\r | |
54 | "Not an actual task, but looks like one for documentation purposes");\r | |
55 | }\r | |
56 | /**\r | |
57 | * Sets the base-directory\r | |
58 | */\r | |
59 | public void setDir(File dir) throws BuildException {\r | |
60 | if (localSet == null) {\r | |
61 | localSet = new ConditionalFileSet();\r | |
62 | owner.appendExceptFileSet(localSet);\r | |
63 | }\r | |
64 | localSet.setDir(dir);\r | |
65 | }\r | |
66 | /**\r | |
67 | * Comma or space separated list of file patterns that should not be\r | |
68 | * compiled using precompiled headers.\r | |
69 | * \r | |
70 | * @param includes\r | |
71 | * the string containing the include patterns\r | |
72 | */\r | |
73 | public void setIncludes(String includes) {\r | |
74 | if (localSet == null) {\r | |
75 | localSet = new ConditionalFileSet();\r | |
76 | owner.appendExceptFileSet(localSet);\r | |
77 | }\r | |
78 | localSet.setIncludes(includes);\r | |
79 | }\r | |
80 | }\r |