|
Java example source code file (FileTreeCreatorVC10.java)
The FileTreeCreatorVC10.java Java example source code/* * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. * */ import static java.nio.file.FileVisitResult.CONTINUE; import java.io.IOException; import java.nio.file.FileSystems; import java.nio.file.FileVisitResult; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.BasicFileAttributes; import java.util.Stack; import java.util.Vector; public class FileTreeCreatorVC10 extends FileTreeCreator { public FileTreeCreatorVC10(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatformVC10 wg) { super(startDir, allConfigs, wg); } @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attr) { DirAttributes currentFileAttr = attributes.peek().clone(); boolean usePch = false; boolean disablePch = false; boolean useIgnore = false; boolean isAltSrc = false; // only needed as a debugging crumb boolean isReplacedByAltSrc = false; String fileName = file.getFileName().toString(); // TODO hideFile // usePch applies to all configs for a file. if (fileName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"))) { usePch = true; } String fileLoc = vcProjLocation.relativize(file).toString(); // isAltSrc and isReplacedByAltSrc applies to all configs for a file if (BuildConfig.matchesRelativeAltSrcInclude( file.toAbsolutePath().toString())) { // current file is an alternate source file so track it isAltSrc = true; BuildConfig.trackRelativeAltSrcFile( file.toAbsolutePath().toString()); } else if (BuildConfig.matchesRelativeAltSrcFile( file.toAbsolutePath().toString())) { // current file is a regular file that matches an alternate // source file so yack about replacing the regular file isReplacedByAltSrc = true; System.out.println("INFO: alternate source file '" + BuildConfig.getMatchingRelativeAltSrcFile( file.toAbsolutePath().toString()) + "' replaces '" + fileLoc + "'"); } for (BuildConfig cfg : allConfigs) { if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) { useIgnore = true; currentFileAttr.setIgnore(cfg); } else if (cfg.matchesIgnoredPath(file.toAbsolutePath().toString())) { useIgnore = true; currentFileAttr.setIgnore(cfg); } if (cfg.lookupHashFieldInContext("DisablePch", fileName) != null) { disablePch = true; currentFileAttr.setDisablePch(cfg); } Vector<String> rv = new Vector Other Java examples (source code examples)Here is a short list of links related to this Java FileTreeCreatorVC10.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.