hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java
author sla
Thu, 10 Feb 2011 13:03:22 +0100
changeset 8303 81a0b8663748
parent 7452 b3fa838286de
child 8860 98a7ff20acf0
permissions -rw-r--r--
7017824: Add support for creating 64-bit Visual Studio projects Summary: Updated create.bat and ProjectCreator Reviewed-by: brutisso, stefank, ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
     2
 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    25
import java.io.File;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    26
import java.io.IOException;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    27
import java.io.PrintWriter;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    28
import java.util.Enumeration;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    29
import java.util.Hashtable;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    30
import java.util.Iterator;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    31
import java.util.List;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    32
import java.util.TreeSet;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    33
import java.util.Vector;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
abstract class HsArgHandler extends ArgHandler {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
    static final int STRING = 1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    static final int VECTOR = 2;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
    static final int HASH   = 3;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
    boolean nextNotKey(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
        if (it.next()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
            String s = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
            return (s.length() == 0) || (s.charAt(0) != '-');
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
            return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
    void empty(String key, String message) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
        if (key != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
            System.err.println("** Error: empty " + key);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
        if (message != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
            System.err.println(message);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
        WinGammaPlatform.usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    static String getCfg(String val) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
        int under = val.indexOf('_');
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
        int len = val.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
        if (under != -1 && under < len - 1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
            return val.substring(under+1, len);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
            return null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
class ArgRuleSpecific extends ArgRule {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
    ArgRuleSpecific(String arg, ArgHandler handler) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
        super(arg, handler);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
    boolean match(String rulePattern, String arg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
        return rulePattern.startsWith(arg);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
class SpecificHsArgHandler extends HsArgHandler {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
    String message, argKey, valKey;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
    int type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
    public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
        String cfg = getCfg(it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
            String val = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
            switch (type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
            case VECTOR:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
                BuildConfig.addFieldVector(cfg, valKey, val);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
                break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
            case HASH:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
                BuildConfig.putFieldHash(cfg, valKey, val, "1");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
                break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
            case STRING:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
                BuildConfig.putField(cfg, valKey, val);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
                break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
            default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
                empty(valKey, "Unknown type: "+type);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
            it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
            empty(argKey, message);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    SpecificHsArgHandler(String argKey, String valKey, String message, int type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
        this.argKey = argKey;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
        this.valKey = valKey;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
        this.message = message;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
        this.type = type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
class HsArgRule extends ArgRuleSpecific {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
    HsArgRule(String argKey, String valKey, String message, int type) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
        super(argKey, new SpecificHsArgHandler(argKey, valKey, message, type));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   127
public abstract class WinGammaPlatform {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
    public boolean fileNameStringEquality(String s1, String s2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
        return s1.equalsIgnoreCase(s2);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    static void usage() throws IllegalArgumentException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
        System.err.println("WinGammaPlatform platform-specific options:");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
        System.err.println("  -sourceBase <path to directory (workspace) " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
                           "containing source files; no trailing slash>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
        System.err.println("  -projectFileName <full pathname to which project file " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
                           "will be written; all parent directories must " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
                           "already exist>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
        System.err.println("  If any of the above are specified, "+
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
                           "they must all be.");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
        System.err.println("  Additional, optional arguments, which can be " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
                           "specified multiple times:");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
        System.err.println("    -absoluteInclude <string containing absolute " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
                           "path to include directory>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
        System.err.println("    -relativeInclude <string containing include " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
                           "directory relative to -sourceBase>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
        System.err.println("    -define <preprocessor flag to be #defined " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
                           "(note: doesn't yet support " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
                           "#define (flag) (value))>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
        System.err.println("    -startAt <subdir of sourceBase>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
        System.err.println("    -additionalFile <file not in database but " +
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   153
                           "which should show up in project file>");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
        System.err.println("    -additionalGeneratedFile <absolute path to " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
                           "directory containing file; no trailing slash> " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
                           "<name of file generated later in the build process>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
        throw new IllegalArgumentException();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
    public void addPerFileLine(Hashtable table,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
                               String fileName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
                               String line) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
        Vector v = (Vector) table.get(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
        if (v != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
            v.add(line);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
            v = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
            v.add(line);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
            table.put(fileName, v);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
    protected static class PerFileCondData {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
        public String releaseString;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
        public String debugString;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
    protected void addConditionalPerFileLine(Hashtable table,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
                                           String fileName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
                                           String releaseLine,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
                                           String debugLine) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
        PerFileCondData data = new PerFileCondData();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
        data.releaseString = releaseLine;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
        data.debugString = debugLine;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
        Vector v = (Vector) table.get(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
        if (v != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
            v.add(data);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
            v = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
            v.add(data);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
            table.put(fileName, v);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
    protected static class PrelinkCommandData {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
      String description;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
      String commands;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
    protected void addPrelinkCommand(Hashtable table,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
                                     String build,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
                                     String description,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
                                     String commands) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
      PrelinkCommandData data = new PrelinkCommandData();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
      data.description = description;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
      data.commands = commands;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
      table.put(build, data);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
    public boolean findString(Vector v, String s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
            if (((String) iter.next()).equals(s)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
                return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
        return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
    /* This returns a String containing the full path to the passed
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
       file name, or null if an error occurred. If the file was not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
       found or was a duplicate and couldn't be resolved using the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
       preferred paths, the file name is added to the appropriate
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
       Vector of Strings. */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
    private String findFileInDirectory(String fileName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
                                       DirectoryTree directory,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
                                       Vector preferredPaths,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
                                       Vector filesNotFound,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
                                       Vector filesDuplicate) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
        List locationsInTree = directory.findFile(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
        int  rootNameLength = directory.getRootNodeName().length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
        String name = null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
        if ((locationsInTree == null) ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
            (locationsInTree.size() == 0)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
            filesNotFound.add(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
        } else if (locationsInTree.size() > 1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
            // Iterate through them, trying to find one with a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
            // preferred path
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
        search:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
            {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
                for (Iterator locIter = locationsInTree.iterator();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
                     locIter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
                    DirectoryTreeNode node =
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
                        (DirectoryTreeNode) locIter.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
                    String tmpName = node.getName();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
                    for (Iterator prefIter = preferredPaths.iterator();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
                         prefIter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
                        // We need to make sure the preferred path is
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
                        // found from the file path not including the root node name.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
                        if (tmpName.indexOf((String)prefIter.next(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
                                            rootNameLength) != -1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
                            name = tmpName;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
                            break search;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
            if (name == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
                filesDuplicate.add(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
            name = ((DirectoryTreeNode) locationsInTree.get(0)).getName();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
        return name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
    protected String envVarPrefixedFileName(String fileName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
                                            int sourceBaseLen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
                                            DirectoryTree tree,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
                                            Vector preferredPaths,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
                                            Vector filesNotFound,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
                                            Vector filesDuplicate) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
        String fullName = findFileInDirectory(fileName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
                                              tree,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
                                              preferredPaths,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
                                              filesNotFound,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
                                              filesDuplicate);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
        return fullName;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
     String getProjectName(String fullPath, String extension)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
        throws IllegalArgumentException, IOException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
        File file = new File(fullPath).getCanonicalFile();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
        fullPath = file.getCanonicalPath();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
        String parent = file.getParent();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
        if (!fullPath.endsWith(extension)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
            throw new IllegalArgumentException("project file name \"" +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
                                               fullPath +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
                                               "\" does not end in "+extension);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
        if ((parent != null) &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
            (!fullPath.startsWith(parent))) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
            throw new RuntimeException(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
                "Internal error: parent of file name \"" + parent +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
                "\" does not match file name \"" + fullPath + "\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
        int len = parent.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
        if (!parent.endsWith(Util.sep)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
            len += Util.sep.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
        int end = fullPath.length() - extension.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
        if (len == end) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
            throw new RuntimeException(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
                "Internal error: file name was empty"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
        return fullPath.substring(len, end);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
    protected abstract String getProjectExt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   322
    public void createVcproj(String[] args)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
        throws IllegalArgumentException, IOException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
        parseArguments(args);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
        String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
        String ext = getProjectExt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
        String projectName = getProjectName(projectFileName, ext);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   332
        writeProjectFile(projectFileName, projectName, createAllConfigs(BuildConfig.getFieldString(null, "PlatformName")));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
    protected void writePrologue(String[] args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
        System.err.println("WinGammaPlatform platform-specific arguments:");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
        for (int i = 0; i < args.length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
            System.err.print(args[i] + " ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
        System.err.println();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
    void parseArguments(String[] args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
        new ArgsParser(args,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
                       new ArgRule[]
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
            {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   348
                new ArgRule("-sourceBase",
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   349
                            new HsArgHandler() {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   350
                                public void handle(ArgIterator it) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   351
                                   String cfg = getCfg(it.get());
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   352
                                   if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   353
                                      String sb = (String) it.get();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   354
                                      if (sb.endsWith(Util.sep)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   355
                                         sb = sb.substring(0, sb.length() - 1);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   356
                                      }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   357
                                      BuildConfig.putField(cfg, "SourceBase", sb);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   358
                                      it.next();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   359
                                   } else {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   360
                                      empty("-sourceBase", null);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   361
                                   }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   362
                                }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   363
                            }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   364
                            ),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
                new HsArgRule("-buildBase",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
                              "BuildBase",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
                              "   (Did you set the HotSpotBuildSpace environment variable?)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   372
              new HsArgRule("-platformName",
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   373
                              "PlatformName",
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   374
                              null,
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   375
                              HsArgHandler.STRING
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   376
                              ),
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   377
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   378
              new HsArgRule("-projectFileName",
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
                              "ProjectFileName",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
                new HsArgRule("-jdkTargetRoot",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
                              "JdkTargetRoot",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
                              "   (Did you set the HotSpotJDKDist environment variable?)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
                new HsArgRule("-compiler",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
                              "CompilerVersion",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
                              "   (Did you set the VcVersion correctly?)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
                new HsArgRule("-absoluteInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
                              "AbsoluteInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
                new HsArgRule("-relativeInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
                              "RelativeInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
                new HsArgRule("-define",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
                              "Define",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
                new HsArgRule("-useToGeneratePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
                              "UseToGeneratePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
                new ArgRuleSpecific("-perFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
                                    String cfg = getCfg(it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
                                        String fileName = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
                                            String line = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
                                            BuildConfig.putFieldHash(cfg, "PerFileLine", fileName, line);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
                                            it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
                                            return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
                                    empty(null, "** Error: wrong number of args to -perFileLine");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
                new ArgRuleSpecific("-conditionalPerFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
                                    String cfg = getCfg(it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
                                        String fileName = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
                                            String productLine = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
                                            if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
                                                String debugLine = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
                                                BuildConfig.putFieldHash(cfg+"_debug", "CondPerFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
                                                                         fileName, debugLine);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
                                                BuildConfig.putFieldHash(cfg+"_product", "CondPerFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
                                                                         fileName, productLine);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
                                                it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
                                                return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
                                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
                                    empty(null, "** Error: wrong number of args to -conditionalPerFileLine");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
                new HsArgRule("-disablePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
                              "DisablePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
                              HsArgHandler.HASH
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
                new ArgRule("-startAt",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
                                    if (BuildConfig.getField(null, "StartAt") != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
                                        empty(null, "** Error: multiple -startAt");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
                                        BuildConfig.putField(null, "StartAt", it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
                                        it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
                                    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
                                        empty("-startAt", null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
                new HsArgRule("-ignoreFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
                                      "IgnoreFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
                                      null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
                                      HsArgHandler.HASH
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
                                      ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   491
                new HsArgRule("-ignorePath",
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   492
                              "IgnorePath",
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   493
                              null,
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   494
                              HsArgHandler.VECTOR
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   495
                              ),
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   496
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
                new HsArgRule("-additionalFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
                              "AdditionalFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
                new ArgRuleSpecific("-additionalGeneratedFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
                                    String cfg = getCfg(it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
                                        String dir = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
                                            String fileName = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
                                            BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
                                                                     Util.normalize(dir + Util.sep + fileName),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
                                                                     fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
                                            it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
                                            return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
                                    empty(null, "** Error: wrong number of args to -additionalGeneratedFile");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
                new ArgRule("-prelink",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
                                            String description = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
                                            if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
                                                String command = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
                                                BuildConfig.putField(null, "PrelinkDescription", description);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
                                                BuildConfig.putField(null, "PrelinkCommand", command);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
                                                it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
                                                return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
                                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
                                    empty(null,  "** Error: wrong number of args to -prelink");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
                            }
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   542
                            ),
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   543
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   544
                new ArgRule("-postbuild",
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   545
                            new HsArgHandler() {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   546
                                public void handle(ArgIterator it) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   547
                                    if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   548
                                        if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   549
                                            String description = it.get();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   550
                                            if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   551
                                                String command = it.get();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   552
                                                BuildConfig.putField(null, "PostbuildDescription", description);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   553
                                                BuildConfig.putField(null, "PostbuildCommand", command);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   554
                                                it.next();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   555
                                                return;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   556
                                            }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   557
                                        }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   558
                                    }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   559
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   560
                                    empty(null,  "** Error: wrong number of args to -postbuild");
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   561
                                }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   562
                            }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   563
                            ),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
            },
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
                                       new ArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
                                           public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
                                               throw new RuntimeException("Arg Parser: unrecognized option "+it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
                                           }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
                                       }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
                                       );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
        if (BuildConfig.getField(null, "SourceBase") == null      ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
            BuildConfig.getField(null, "BuildBase") == null       ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   574
            BuildConfig.getField(null, "ProjectFileName") == null ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
            BuildConfig.getField(null, "CompilerVersion") == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
            usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   578
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
        if (BuildConfig.getField(null, "UseToGeneratePch") == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
            throw new RuntimeException("ERROR: need to specify one file to compute PCH, with -useToGeneratePch flag");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
        BuildConfig.putField(null, "PlatformObject", this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   586
    Vector createAllConfigs(String platform) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
        Vector allConfigs = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
        allConfigs.add(new C1DebugConfig());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   591
        allConfigs.add(new C1FastDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   592
        allConfigs.add(new C1ProductConfig());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   593
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   594
        allConfigs.add(new C2DebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   595
        allConfigs.add(new C2FastDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   596
        allConfigs.add(new C2ProductConfig());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   597
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   598
        allConfigs.add(new TieredDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   599
        allConfigs.add(new TieredFastDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   600
        allConfigs.add(new TieredProductConfig());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   601
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   602
        allConfigs.add(new CoreDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   603
        allConfigs.add(new CoreFastDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   604
        allConfigs.add(new CoreProductConfig());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   605
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   606
        if (platform.equals("Win32")) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   607
            allConfigs.add(new KernelDebugConfig());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   608
            allConfigs.add(new KernelFastDebugConfig());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   609
            allConfigs.add(new KernelProductConfig());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   610
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   611
489c9b5090e2 Initial load
duke
parents:
diff changeset
   612
        return allConfigs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   613
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   614
489c9b5090e2 Initial load
duke
parents:
diff changeset
   615
    class FileAttribute {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   616
        int     numConfigs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   617
        Vector  configs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   618
        String  shortName;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   619
        boolean noPch, pchRoot;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   620
489c9b5090e2 Initial load
duke
parents:
diff changeset
   621
        FileAttribute(String shortName, BuildConfig cfg, int numConfigs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   622
            this.shortName = shortName;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   623
            this.noPch =  (cfg.lookupHashFieldInContext("DisablePch", shortName) != null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   624
            this.pchRoot = shortName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   625
            this.numConfigs = numConfigs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   626
489c9b5090e2 Initial load
duke
parents:
diff changeset
   627
            configs = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   628
            add(cfg.get("Name"));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   629
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   630
489c9b5090e2 Initial load
duke
parents:
diff changeset
   631
        void add(String confName) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   632
            configs.add(confName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   633
489c9b5090e2 Initial load
duke
parents:
diff changeset
   634
            // if presented in all configs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   635
            if (configs.size() == numConfigs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   636
                configs = null;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   637
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   638
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   639
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   640
489c9b5090e2 Initial load
duke
parents:
diff changeset
   641
    class FileInfo implements Comparable {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   642
        String        full;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   643
        FileAttribute attr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   644
489c9b5090e2 Initial load
duke
parents:
diff changeset
   645
        FileInfo(String full, FileAttribute  attr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   646
            this.full = full;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   647
            this.attr = attr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   648
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   649
489c9b5090e2 Initial load
duke
parents:
diff changeset
   650
        public int compareTo(Object o) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   651
            FileInfo oo = (FileInfo)o;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   652
            return full.compareTo(oo.full);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   653
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   654
489c9b5090e2 Initial load
duke
parents:
diff changeset
   655
        boolean isHeader() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   656
            return attr.shortName.endsWith(".h") || attr.shortName.endsWith(".hpp");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   657
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   658
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   659
489c9b5090e2 Initial load
duke
parents:
diff changeset
   660
489c9b5090e2 Initial load
duke
parents:
diff changeset
   661
    TreeSet sortFiles(Hashtable allFiles) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   662
        TreeSet rv = new TreeSet();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   663
        Enumeration e = allFiles.keys();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   664
        while (e.hasMoreElements()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   665
            String fullPath = (String)e.nextElement();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   666
            rv.add(new FileInfo(fullPath, (FileAttribute)allFiles.get(fullPath)));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   667
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   668
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   669
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   670
489c9b5090e2 Initial load
duke
parents:
diff changeset
   671
    Hashtable computeAttributedFiles(Vector allConfigs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   672
        Hashtable ht = new Hashtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   673
        int numConfigs = allConfigs.size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   674
489c9b5090e2 Initial load
duke
parents:
diff changeset
   675
        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   676
            BuildConfig bc = (BuildConfig)i.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   677
            Hashtable  confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   678
            String confName = bc.get("Name");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   679
489c9b5090e2 Initial load
duke
parents:
diff changeset
   680
            for (Enumeration e=confFiles.keys(); e.hasMoreElements(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   681
                String filePath = (String)e.nextElement();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   682
                FileAttribute fa = (FileAttribute)ht.get(filePath);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   683
489c9b5090e2 Initial load
duke
parents:
diff changeset
   684
                if (fa == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   685
                    fa = new FileAttribute((String)confFiles.get(filePath), bc, numConfigs);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   686
                    ht.put(filePath, fa);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   687
                } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   688
                    fa.add(confName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   689
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   690
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   691
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   692
489c9b5090e2 Initial load
duke
parents:
diff changeset
   693
        return ht;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   694
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   695
489c9b5090e2 Initial load
duke
parents:
diff changeset
   696
     Hashtable computeAttributedFiles(BuildConfig bc) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   697
        Hashtable ht = new Hashtable();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   698
        Hashtable confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   699
489c9b5090e2 Initial load
duke
parents:
diff changeset
   700
        for (Enumeration e = confFiles.keys(); e.hasMoreElements(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   701
            String filePath = (String)e.nextElement();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   702
            ht.put(filePath,  new FileAttribute((String)confFiles.get(filePath), bc, 1));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   703
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   704
489c9b5090e2 Initial load
duke
parents:
diff changeset
   705
        return ht;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   706
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   707
489c9b5090e2 Initial load
duke
parents:
diff changeset
   708
    PrintWriter printWriter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   709
489c9b5090e2 Initial load
duke
parents:
diff changeset
   710
    public void writeProjectFile(String projectFileName, String projectName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   711
                                 Vector allConfigs) throws IOException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   712
        throw new RuntimeException("use compiler version specific version");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   713
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   714
}