Thu, 08 Aug 2013 09:21:30 -0700
8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
Summary: ProjectCreator tool is modified to support two new options: '-relativeAltSrcInclude' and '-altRelativeInclude' which prevents IDE linker errors. Also fixed some cmd line build linker warnings. Misc cleanups.
Reviewed-by: rdurbin, coleenp
neliasso@4112 | 1 | import java.nio.file.FileSystems; |
neliasso@4112 | 2 | import java.nio.file.Path; |
neliasso@4112 | 3 | import java.nio.file.SimpleFileVisitor; |
neliasso@4112 | 4 | import java.util.HashSet; |
neliasso@4112 | 5 | import java.util.Stack; |
neliasso@4112 | 6 | import java.util.Vector; |
neliasso@4112 | 7 | |
neliasso@4112 | 8 | public class FileTreeCreator extends SimpleFileVisitor<Path> |
neliasso@4112 | 9 | { |
neliasso@4112 | 10 | Path vcProjLocation; |
neliasso@4112 | 11 | Path startDir; |
neliasso@4112 | 12 | final int startDirLength; |
neliasso@4112 | 13 | Stack<DirAttributes> attributes = new Stack<DirAttributes>(); |
neliasso@4112 | 14 | Vector<BuildConfig> allConfigs; |
neliasso@4112 | 15 | WinGammaPlatformVC10 wg; |
neliasso@4112 | 16 | |
neliasso@4112 | 17 | public FileTreeCreator(Path startDir, Vector<BuildConfig> allConfigs, WinGammaPlatformVC10 wg) { |
neliasso@4112 | 18 | super(); |
neliasso@4112 | 19 | this.wg = wg; |
neliasso@4112 | 20 | this.allConfigs = allConfigs; |
neliasso@4112 | 21 | this.startDir = startDir; |
neliasso@4112 | 22 | startDirLength = startDir.toAbsolutePath().toString().length(); |
neliasso@4112 | 23 | vcProjLocation = FileSystems.getDefault().getPath(allConfigs.firstElement().get("BuildSpace")); |
neliasso@4112 | 24 | attributes.push(new DirAttributes()); |
neliasso@4112 | 25 | } |
neliasso@4112 | 26 | |
neliasso@4112 | 27 | public class DirAttributes { |
neliasso@4112 | 28 | |
neliasso@4112 | 29 | private HashSet<BuildConfig> ignores; |
neliasso@4112 | 30 | private HashSet<BuildConfig> disablePch; |
neliasso@4112 | 31 | |
neliasso@4112 | 32 | public DirAttributes() { |
neliasso@4112 | 33 | ignores = new HashSet<BuildConfig>(); |
neliasso@4112 | 34 | disablePch = new HashSet<BuildConfig>(); |
neliasso@4112 | 35 | } |
neliasso@4112 | 36 | |
neliasso@4112 | 37 | public DirAttributes(HashSet<BuildConfig> excludes2, HashSet<BuildConfig> disablePch2) { |
neliasso@4112 | 38 | ignores = excludes2; |
neliasso@4112 | 39 | disablePch = disablePch2; |
neliasso@4112 | 40 | } |
neliasso@4112 | 41 | |
neliasso@4112 | 42 | @SuppressWarnings("unchecked") |
neliasso@4112 | 43 | public DirAttributes clone() { |
neliasso@4112 | 44 | return new DirAttributes((HashSet<BuildConfig>)this.ignores.clone(), (HashSet<BuildConfig>)this.disablePch.clone()); |
neliasso@4112 | 45 | } |
neliasso@4112 | 46 | |
neliasso@4112 | 47 | public void setIgnore(BuildConfig conf) { |
neliasso@4112 | 48 | ignores.add(conf); |
neliasso@4112 | 49 | } |
neliasso@4112 | 50 | |
neliasso@4112 | 51 | public boolean hasIgnore(BuildConfig cfg) { |
neliasso@4112 | 52 | return ignores.contains(cfg); |
neliasso@4112 | 53 | } |
neliasso@4112 | 54 | |
neliasso@4112 | 55 | public void removeFromIgnored(BuildConfig cfg) { |
neliasso@4112 | 56 | ignores.remove(cfg); |
neliasso@4112 | 57 | } |
neliasso@4112 | 58 | |
neliasso@4112 | 59 | public void setDisablePch(BuildConfig conf) { |
neliasso@4112 | 60 | disablePch.add(conf); |
neliasso@4112 | 61 | } |
neliasso@4112 | 62 | |
neliasso@4112 | 63 | public boolean hasDisablePch(BuildConfig cfg) { |
neliasso@4112 | 64 | return disablePch.contains(cfg); |
neliasso@4112 | 65 | } |
neliasso@4112 | 66 | |
neliasso@4112 | 67 | public void removeFromDisablePch(BuildConfig cfg) { |
neliasso@4112 | 68 | disablePch.remove(cfg); |
neliasso@4112 | 69 | } |
neliasso@4112 | 70 | |
neliasso@4112 | 71 | } |
neliasso@4112 | 72 | } |