1 package org.codehaus.mojo.natives.compiler;
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 import java.io.File;
28
29 import org.codehaus.mojo.natives.ConfigurationBase;
30 import org.codehaus.plexus.util.FileUtils;
31
32 public class ResourceCompilerConfiguration
33 extends ConfigurationBase
34 {
35 private static final File[] EMPTY_FILE_ARRAY = new File[0];
36
37 private static final String[] EMPTY_STRING_ARRAY = new String[0];
38
39
40
41
42 private String executable = "";
43
44 private File workingDirectory;
45
46 private File outputDirectory;
47
48 private File debugOutputDirectory;
49
50 private String[] options = EMPTY_STRING_ARRAY;
51
52 private File[] includePaths = EMPTY_FILE_ARRAY;
53
54 private File[] systemIncludePaths = EMPTY_FILE_ARRAY;
55
56 public ResourceCompilerConfiguration()
57 {
58 }
59
60 public String getExecutable()
61 {
62 return this.executable;
63 }
64
65 public void setExecutable( String executable )
66 {
67 this.executable = executable;
68 }
69
70 public File getWorkingDirectory()
71 {
72 return this.workingDirectory;
73 }
74
75 public void setWorkingDirectory( File dir )
76 {
77 this.workingDirectory = dir;
78 }
79
80 public String[] getOptions()
81 {
82 return this.options;
83 }
84
85 public void setOptions( String[] options )
86 {
87 this.options = options;
88
89 if ( this.options == null )
90 {
91 this.options = EMPTY_STRING_ARRAY;
92 }
93 }
94
95 public File getOutputDirectory()
96 {
97 return this.outputDirectory;
98 }
99
100 public void setOutputDirectory( File dir )
101 {
102 this.outputDirectory = dir;
103 }
104
105 public File getDebugOutputDirectory()
106 {
107 return this.debugOutputDirectory;
108 }
109
110 public void setDebugOutputDirectory( File dir )
111 {
112 this.debugOutputDirectory = dir;
113 }
114
115 public File[] getIncludePaths()
116 {
117 return this.includePaths;
118 }
119
120 public void setIncludePaths( File[] paths )
121 {
122 this.includePaths = paths;
123
124 if ( this.includePaths == null )
125 {
126 this.includePaths = EMPTY_FILE_ARRAY;
127 }
128 }
129
130 public File[] getSystemIncludePaths()
131 {
132 return this.systemIncludePaths;
133 }
134
135 public void setSystemIncludePaths( File[] paths )
136 {
137 this.systemIncludePaths = paths;
138
139 if ( this.systemIncludePaths == null )
140 {
141 this.systemIncludePaths = EMPTY_FILE_ARRAY;
142 }
143 }
144
145
146
147
148 public File getOutputFile( File src )
149 {
150 String srcPath = src.getPath();
151
152 String destPath = this.getOutputDirectory().getPath() + "/" + FileUtils.basename( srcPath ) + "res";
153
154 return new File( destPath );
155 }
156
157 }