source: rtems-eclipse-plug-in/org.rtems.cdt.toolchain2/org/rtems/cdt/build/CygwinScannerInfoCollector.java @ f4f1f44

Last change on this file since f4f1f44 was f4f1f44, checked in by Sebastian Huber <sebastian.huber@…>, on 12/04/08 at 11:26:34

Added preferences for Cygwin, MinGW and MSYS paths on windows.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2 * Copyright (c) 2008
3 * Embedded Brains GmbH
4 * Obere Lagerstr. 30
5 * D-82178 Puchheim
6 * Germany
7 * rtems@embedded-brains.de
8 *
9 * The license and distribution terms for this file may be found in the file
10 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
11 */
12
13package org.rtems.cdt.build;
14
15import java.util.Iterator;
16import java.util.List;
17import java.util.Map;
18
19import org.eclipse.cdt.make.core.scannerconfig.InfoContext;
20import org.eclipse.cdt.make.core.scannerconfig.IScannerInfoCollector3;
21import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
22import org.eclipse.cdt.make.internal.core.scannerconfig2.PerProjectSICollector;
23import org.eclipse.cdt.make.internal.core.scannerconfig.util.CygpathTranslator;
24import org.eclipse.cdt.managedbuilder.scannerconfig.IManagedScannerInfoCollector;
25import org.eclipse.core.resources.IProject;
26
27/**
28 * This class exists only to disable the specialized UI elements of the scanner configuration.
29 *
30 * See also 'org.eclipse.cdt.managedbuilder.internal.scannerconfig.DefaultGnuWinScannerInfoCollector'.
31 */
32public class CygwinScannerInfoCollector extends PerProjectSICollector implements IScannerInfoCollector3, IManagedScannerInfoCollector {
33        private IProject mProject;
34
35        public void contributeToScannerConfig( Object resource, Map scannerInfo) {
36                List<String> includes = (List<String>) scannerInfo.get( ScannerInfoTypes.INCLUDE_PATHS);
37                List<String> translatedIncludes = CygpathTranslator.translateIncludePaths( mProject, includes);
38
39                Iterator<String> iter = translatedIncludes.listIterator();
40                while (iter.hasNext()) {
41                        String convertedPath = iter.next();
42                        if (convertedPath.startsWith( "/")) {
43                                iter.remove();
44                        }
45                }
46                scannerInfo.put( ScannerInfoTypes.INCLUDE_PATHS, translatedIncludes);
47               
48                super.contributeToScannerConfig( resource, scannerInfo);
49}
50
51        public void setProject( IProject project) {
52                mProject = project;
53                super.setProject( project);
54        }
55
56        public void setInfoContext( InfoContext context) {
57                mProject = context.getProject();
58                super.setInfoContext( context);
59        }
60}
Note: See TracBrowser for help on using the repository browser.