src/share/tools/ProjectCreator/Util.java

Thu, 08 Aug 2013 09:21:30 -0700

author
dcubed
date
Thu, 08 Aug 2013 09:21:30 -0700
changeset 5500
31f3b1e1c5e5
parent 4153
b9a9ed0f8eeb
child 6876
710a3c8b516e
permissions
-rw-r--r--

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

duke@435 1 /*
mikael@4153 2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
duke@435 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@435 4 *
duke@435 5 * This code is free software; you can redistribute it and/or modify it
duke@435 6 * under the terms of the GNU General Public License version 2 only, as
duke@435 7 * published by the Free Software Foundation.
duke@435 8 *
duke@435 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@435 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@435 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@435 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@435 13 * accompanied this code).
duke@435 14 *
duke@435 15 * You should have received a copy of the GNU General Public License version
duke@435 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@435 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@435 18 *
trims@1907 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
trims@1907 20 * or visit www.oracle.com if you need additional information or have any
trims@1907 21 * questions.
duke@435 22 *
duke@435 23 */
duke@435 24
duke@435 25 import java.util.*;
duke@435 26 import java.io.File;
duke@435 27
duke@435 28 public class Util {
neliasso@4112 29
neliasso@4112 30 static String join(String padder, Vector<String> v) {
duke@435 31 return join(padder, v, false);
duke@435 32 }
duke@435 33
neliasso@4112 34 static String join(String padder, Vector<String> v, boolean quoted) {
duke@435 35 StringBuffer sb = new StringBuffer();
duke@435 36
neliasso@4112 37 for (Iterator<String> iter = v.iterator(); iter.hasNext(); ) {
duke@435 38 if (quoted) {
duke@435 39 sb.append('"');
duke@435 40 }
neliasso@4112 41 sb.append(iter.next());
duke@435 42 if (quoted) {
duke@435 43 sb.append('"');
duke@435 44 }
duke@435 45 if (iter.hasNext()) sb.append(padder);
duke@435 46 }
duke@435 47
duke@435 48 return sb.toString();
duke@435 49 }
duke@435 50
duke@435 51
neliasso@4112 52 static String prefixed_join(String padder, Vector<String> v, boolean quoted) {
duke@435 53 StringBuffer sb = new StringBuffer();
duke@435 54
neliasso@4112 55 for (Iterator<String> iter = v.iterator(); iter.hasNext(); ) {
duke@435 56 sb.append(padder);
duke@435 57
duke@435 58 if (quoted) {
duke@435 59 sb.append('"');
duke@435 60 }
duke@435 61 sb.append((String)iter.next());
duke@435 62 if (quoted) {
duke@435 63 sb.append('"');
duke@435 64 }
duke@435 65 }
duke@435 66
duke@435 67 return sb.toString();
duke@435 68 }
duke@435 69
duke@435 70
duke@435 71 static String normalize(String file) {
sla@2540 72 file = file.replace('\\', '/');
sla@2540 73 if (file.length() > 2) {
sla@2540 74 if (file.charAt(1) == ':' && file.charAt(2) == '/') {
sla@2540 75 // convert drive letter to uppercase
sla@2540 76 String drive = file.substring(0, 1).toUpperCase();
sla@2540 77 return drive + file.substring(1);
sla@2540 78 }
sla@2540 79 }
sla@2540 80 return file;
duke@435 81 }
duke@435 82
duke@435 83 static String sep = File.separator;
duke@435 84 }

mercurial