View Javadoc

1   /*
2    * #%L
3    * Native ARchive plugin for Maven
4    * %%
5    * Copyright (C) 2002 - 2014 NAR Maven Plugin developers.
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   * 
11   * http://www.apache.org/licenses/LICENSE-2.0
12   * 
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package com.github.maven_nar.cpptasks.compiler;
21  
22  import java.io.File;
23  
24  import org.apache.tools.ant.BuildException;
25  
26  import com.github.maven_nar.cpptasks.CCTask;
27  import com.github.maven_nar.cpptasks.CompilerParam;
28  import com.github.maven_nar.cpptasks.DependencyInfo;
29  
30  /**
31   * A configuration for a compiler
32   *
33   * @author Curt Arnold
34   */
35  public interface CompilerConfiguration extends ProcessorConfiguration {
36    void compile(CCTask task, File outputDir, String[] sourceFiles, boolean relentless, ProgressMonitor monitor)
37        throws BuildException;
38  
39    /**
40     * 
41     * This method may be used to get two distinct compiler configurations, one
42     * for compiling the specified file and producing a precompiled header
43     * file, and a second for compiling other files using the precompiled
44     * header file.
45     * 
46     * The last (preferrably only) include directive in the prototype file will
47     * be used to mark the boundary between pre-compiled and normally compiled
48     * headers.
49     * 
50     * @param prototype
51     *          A source file (for example, stdafx.cpp) that is used to build
52     *          the precompiled header file. @returns null if precompiled
53     *          headers are not supported or a two element array containing
54     *          the precompiled header generation configuration and the
55     *          consuming configuration
56     * 
57     */
58    CompilerConfiguration[] createPrecompileConfigurations(File prototype, String[] nonPrecompiledFiles);
59  
60    /**
61     * Returns an digest for the include path for the configuration.
62     * 
63     * This is used to determine if cached dependency information is invalid
64     * because the include paths have changed
65     */
66    String getIncludePathIdentifier();
67  
68    CompilerParam getParam(String name);
69  
70    boolean isPrecompileGeneration();
71  
72    DependencyInfo parseIncludes(CCTask task, File baseDir, File source);
73  }