View Javadoc
1   package org.codehaus.mojo.natives.compiler;
2   
3   /*
4    * The MIT License
5    *
6    * Copyright (c) 2004, The Codehaus
7    *
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of
9    * this software and associated documentation files (the "Software"), to deal in
10   * the Software without restriction, including without limitation the rights to
11   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12   * of the Software, and to permit persons to whom the Software is furnished to do
13   * so, subject to the following conditions:
14   * 
15   * The above copyright notice and this permission notice shall be included in all
16   * copies or substantial portions of the Software.
17   * 
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24   * SOFTWARE.
25   */
26  
27  import java.io.File;
28  
29  import org.codehaus.mojo.natives.ConfigurationBase;
30  
31  /**
32   * CompilerConfiguration contains inputs by the user + DependencyMangement for dependencies analysis
33   */
34  public class CompilerConfiguration
35      extends ConfigurationBase
36  {
37  
38      private File workingDirectory;
39  
40      /**
41       * Must be in your path
42       */
43      private String executable;
44  
45      private String objectFileExtension;
46  
47      /**
48       * Will be passed to compiler executable
49       */
50      private String[] startOptions;
51  
52      private String[] middleOptions;
53  
54      private String[] endOptions;
55  
56      private File[] includePaths;
57  
58      private File[] systemIncludePaths;
59  
60      /**
61       * Directory to place all object output files
62       */
63      private File outputDirectory;
64  
65      private int numberOfConcurrentCompilation = 4;
66  
67      public CompilerConfiguration()
68      {
69      }
70  
71      public File getWorkingDirectory()
72      {
73          return this.workingDirectory;
74      }
75  
76      public void setWorkingDirectory( File dir )
77      {
78          this.workingDirectory = dir;
79      }
80  
81      public String getExecutable()
82      {
83          return this.executable;
84      }
85  
86      public void setExecutable( String executable )
87      {
88          this.executable = executable;
89      }
90  
91      public String getObjectFileExtension()
92      {
93          return this.objectFileExtension;
94      }
95  
96      public void setObjectFileExtension( String ofe )
97      {
98          this.objectFileExtension = ofe;
99      }
100 
101     public void setSystemIncludePaths( File[] paths )
102     {
103         this.systemIncludePaths = paths;
104     }
105 
106     public File[] getSystemIncludePaths()
107     {
108         if ( this.systemIncludePaths == null )
109         {
110             return new File[0];
111         }
112 
113         return this.systemIncludePaths;
114     }
115 
116     public void setIncludePaths( File[] paths )
117     {
118         this.includePaths = paths;
119     }
120 
121     public File[] getIncludePaths()
122     {
123         if ( this.includePaths == null )
124         {
125             return new File[0];
126         }
127 
128         return this.includePaths;
129     }
130 
131     public File getOutputDirectory()
132     {
133         return this.outputDirectory;
134     }
135 
136     public void setOutputDirectory( File dir )
137     {
138         this.outputDirectory = dir;
139     }
140 
141     public String[] getStartOptions()
142     {
143         if ( this.startOptions == null )
144         {
145             return new String[0];
146         }
147         return this.startOptions;
148     }
149 
150     public void setStartOptions( String[] options )
151     {
152         this.startOptions = options;
153     }
154 
155     public String[] getMiddleOptions()
156     {
157         return this.middleOptions;
158     }
159 
160     public void setMiddleOptions( String[] options )
161     {
162         this.middleOptions = options;
163     }
164 
165     public String[] getEndOptions()
166     {
167         return this.endOptions;
168     }
169 
170     public void setEndOptions( String[] options )
171     {
172         this.endOptions = options;
173     }
174 
175     public int getNumberOfConcurrentCompilation()
176     {
177         return numberOfConcurrentCompilation;
178     }
179 
180     public void setNumberOfConcurrentCompilation( int numberOfConcurrentCompilation )
181     {
182         this.numberOfConcurrentCompilation = numberOfConcurrentCompilation;
183     }
184 
185 }