hotspot/make/src/classes/build/tools/projectcreator/WinGammaPlatform.java
author sspitsyn
Wed, 03 May 2017 02:32:02 +0000
changeset 46426 02a1fc064144
parent 38247 6ff550a6307e
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
38247
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
     2
 * Copyright (c) 1999, 2016, 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
38247
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
    25
package build.tools.projectcreator;
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
    26
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    27
import java.io.File;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    28
import java.io.IOException;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    29
import java.io.PrintWriter;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    30
import java.util.Hashtable;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    31
import java.util.Iterator;
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
    32
import java.util.Stack;
7452
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.");
19270
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   142
        System.err.println("  Note: if '-altRelativeInclude' option below " +
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   143
                           "is used, then the '-relativeAltSrcInclude' " +
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   144
                           "option must be used to specify the alternate " +
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   145
                           "source dir, e.g., 'src\\closed'");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
        System.err.println("  Additional, optional arguments, which can be " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
                           "specified multiple times:");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
        System.err.println("    -absoluteInclude <string containing absolute " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
                           "path to include directory>");
19270
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   150
        System.err.println("    -altRelativeInclude <string containing " +
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   151
                           "alternate include directory relative to " +
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   152
                           "-sourceBase>");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
        System.err.println("    -relativeInclude <string containing include " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
                           "directory relative to -sourceBase>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
        System.err.println("    -define <preprocessor flag to be #defined " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
                           "(note: doesn't yet support " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
                           "#define (flag) (value))>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
        System.err.println("    -startAt <subdir of sourceBase>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
        System.err.println("    -additionalFile <file not in database but " +
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   160
                           "which should show up in project file>");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
        System.err.println("    -additionalGeneratedFile <absolute path to " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
                           "directory containing file; no trailing slash> " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
                           "<name of file generated later in the build process>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
        throw new IllegalArgumentException();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    public void addPerFileLine(Hashtable table,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
                               String fileName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
                               String line) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
        Vector v = (Vector) table.get(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
        if (v != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
            v.add(line);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
            v = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
            v.add(line);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
            table.put(fileName, v);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
    protected static class PerFileCondData {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
        public String releaseString;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
        public String debugString;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
    protected void addConditionalPerFileLine(Hashtable table,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
                                           String fileName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
                                           String releaseLine,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
                                           String debugLine) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
        PerFileCondData data = new PerFileCondData();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
        data.releaseString = releaseLine;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
        data.debugString = debugLine;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
        Vector v = (Vector) table.get(fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
        if (v != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
            v.add(data);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
            v = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
            v.add(data);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
            table.put(fileName, v);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
    protected static class PrelinkCommandData {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
      String description;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
      String commands;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
    protected void addPrelinkCommand(Hashtable table,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
                                     String build,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
                                     String description,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
                                     String commands) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
      PrelinkCommandData data = new PrelinkCommandData();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
      data.description = description;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
      data.commands = commands;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
      table.put(build, data);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
    public boolean findString(Vector v, String s) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
        for (Iterator iter = v.iterator(); iter.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
            if (((String) iter.next()).equals(s)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
                return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
        return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
     String getProjectName(String fullPath, String extension)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
        throws IllegalArgumentException, IOException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
        File file = new File(fullPath).getCanonicalFile();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
        fullPath = file.getCanonicalPath();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
        String parent = file.getParent();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
        if (!fullPath.endsWith(extension)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
            throw new IllegalArgumentException("project file name \"" +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
                                               fullPath +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
                                               "\" does not end in "+extension);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
        if ((parent != null) &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
            (!fullPath.startsWith(parent))) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
            throw new RuntimeException(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
                "Internal error: parent of file name \"" + parent +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
                "\" does not match file name \"" + fullPath + "\""
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
        int len = parent.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
        if (!parent.endsWith(Util.sep)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
            len += Util.sep.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
        int end = fullPath.length() - extension.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
        if (len == end) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
            throw new RuntimeException(
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
                "Internal error: file name was empty"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
        return fullPath.substring(len, end);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
    protected abstract String getProjectExt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   266
    public void createVcproj(String[] args)
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
        throws IllegalArgumentException, IOException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
        parseArguments(args);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
        String projectFileName = BuildConfig.getFieldString(null, "ProjectFileName");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
        String ext = getProjectExt();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
        String projectName = getProjectName(projectFileName, ext);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   276
        writeProjectFile(projectFileName, projectName, createAllConfigs(BuildConfig.getFieldString(null, "PlatformName")));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
    protected void writePrologue(String[] args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
        System.err.println("WinGammaPlatform platform-specific arguments:");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
        for (int i = 0; i < args.length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
            System.err.print(args[i] + " ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
        System.err.println();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
    void parseArguments(String[] args) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
        new ArgsParser(args,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
                       new ArgRule[]
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
            {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   292
                new ArgRule("-sourceBase",
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   293
                            new HsArgHandler() {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   294
                                public void handle(ArgIterator it) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   295
                                   String cfg = getCfg(it.get());
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   296
                                   if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   297
                                      String sb = (String) it.get();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   298
                                      if (sb.endsWith(Util.sep)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   299
                                         sb = sb.substring(0, sb.length() - 1);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   300
                                      }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   301
                                      BuildConfig.putField(cfg, "SourceBase", sb);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   302
                                      it.next();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   303
                                   } else {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   304
                                      empty("-sourceBase", null);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   305
                                   }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   306
                                }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   307
                            }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   308
                            ),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
                new HsArgRule("-buildBase",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
                              "BuildBase",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
                              "   (Did you set the HotSpotBuildSpace environment variable?)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   316
               new HsArgRule("-buildSpace",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   317
                              "BuildSpace",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   318
                              null,
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   319
                              HsArgHandler.STRING
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   320
                              ),
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   321
38247
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   322
               new HsArgRule("-makeBinary",
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   323
                              "MakeBinary",
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   324
                              null,
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   325
                              HsArgHandler.STRING
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   326
                              ),
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   327
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   328
               new HsArgRule("-makeOutput",
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   329
                              "MakeOutput",
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   330
                              null,
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   331
                              HsArgHandler.STRING
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   332
                              ),
6ff550a6307e 8156018: Hotspot visual studio project generation broken
erikj
parents: 35183
diff changeset
   333
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   334
              new HsArgRule("-platformName",
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   335
                              "PlatformName",
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   336
                              null,
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   337
                              HsArgHandler.STRING
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   338
                              ),
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   339
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   340
              new HsArgRule("-projectFileName",
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
                              "ProjectFileName",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
                new HsArgRule("-jdkTargetRoot",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
                              "JdkTargetRoot",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
                              "   (Did you set the HotSpotJDKDist environment variable?)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
                new HsArgRule("-compiler",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
                              "CompilerVersion",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
                              "   (Did you set the VcVersion correctly?)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
                new HsArgRule("-absoluteInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
                              "AbsoluteInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
19270
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   364
                new HsArgRule("-altRelativeInclude",
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   365
                              "AltRelativeInclude",
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   366
                              null,
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   367
                              HsArgHandler.VECTOR
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   368
                              ),
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   369
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
                new HsArgRule("-relativeInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
                              "RelativeInclude",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   376
                new HsArgRule("-absoluteSrcInclude",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   377
                              "AbsoluteSrcInclude",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   378
                              null,
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   379
                              HsArgHandler.VECTOR
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   380
                              ),
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   381
19270
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   382
                new HsArgRule("-relativeAltSrcInclude",
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   383
                              "RelativeAltSrcInclude",
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   384
                              null,
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   385
                              HsArgHandler.STRING
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   386
                              ),
607d97508c60 8016601: Unable to build hsx24 on Windows using project creator and Visual Studio
dcubed
parents: 16447
diff changeset
   387
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   388
                new HsArgRule("-relativeSrcInclude",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   389
                              "RelativeSrcInclude",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   390
                              null,
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   391
                              HsArgHandler.VECTOR
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   392
                              ),
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   393
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
                new HsArgRule("-define",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
                              "Define",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
                new HsArgRule("-useToGeneratePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
                              "UseToGeneratePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
                              HsArgHandler.STRING
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
                new ArgRuleSpecific("-perFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
                                    String cfg = getCfg(it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
                                        String fileName = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
                                            String line = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
                                            BuildConfig.putFieldHash(cfg, "PerFileLine", fileName, line);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
                                            it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
                                            return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
                                    empty(null, "** Error: wrong number of args to -perFileLine");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
                new ArgRuleSpecific("-conditionalPerFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
                                    String cfg = getCfg(it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
                                        String fileName = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
                                            String productLine = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
                                            if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
                                                String debugLine = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
                                                BuildConfig.putFieldHash(cfg+"_debug", "CondPerFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
                                                                         fileName, debugLine);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
                                                BuildConfig.putFieldHash(cfg+"_product", "CondPerFileLine",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
                                                                         fileName, productLine);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
                                                it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
                                                return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
                                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
                                    empty(null, "** Error: wrong number of args to -conditionalPerFileLine");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
                new HsArgRule("-disablePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
                              "DisablePch",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
                              HsArgHandler.HASH
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
                new ArgRule("-startAt",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
                                    if (BuildConfig.getField(null, "StartAt") != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
                                        empty(null, "** Error: multiple -startAt");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
                                        BuildConfig.putField(null, "StartAt", it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
                                        it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
                                    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
                                        empty("-startAt", null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
                new HsArgRule("-ignoreFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
                                      "IgnoreFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
                                      null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
                                      HsArgHandler.HASH
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
                                      ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   477
                new HsArgRule("-ignorePath",
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   478
                              "IgnorePath",
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   479
                              null,
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   480
                              HsArgHandler.VECTOR
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   481
                              ),
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   482
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   483
                new HsArgRule("-hidePath",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   484
                      "HidePath",
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   485
                      null,
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   486
                      HsArgHandler.VECTOR
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   487
                      ),
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   488
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
                new HsArgRule("-additionalFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
                              "AdditionalFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
                              null,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
                              HsArgHandler.VECTOR
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
                              ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
                new ArgRuleSpecific("-additionalGeneratedFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
                                    String cfg = getCfg(it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
                                        String dir = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
                                            String fileName = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
                                            BuildConfig.putFieldHash(cfg, "AdditionalGeneratedFile",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
                                                                     Util.normalize(dir + Util.sep + fileName),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
                                                                     fileName);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
                                            it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
                                            return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
                                    empty(null, "** Error: wrong number of args to -additionalGeneratedFile");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
                            ),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
                new ArgRule("-prelink",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
                            new HsArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
                                public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
                                    if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
                                        if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
                                            String description = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
                                            if (nextNotKey(it)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
                                                String command = it.get();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
                                                BuildConfig.putField(null, "PrelinkDescription", description);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
                                                BuildConfig.putField(null, "PrelinkCommand", command);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
                                                it.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
                                                return;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
                                            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
                                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
                                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
                                    empty(null,  "** Error: wrong number of args to -prelink");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
                                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
                            }
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   534
                            ),
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   535
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   536
                new ArgRule("-postbuild",
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   537
                            new HsArgHandler() {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   538
                                public void handle(ArgIterator it) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   539
                                    if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   540
                                        if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   541
                                            String description = it.get();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   542
                                            if (nextNotKey(it)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   543
                                                String command = it.get();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   544
                                                BuildConfig.putField(null, "PostbuildDescription", description);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   545
                                                BuildConfig.putField(null, "PostbuildCommand", command);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   546
                                                it.next();
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   547
                                                return;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   548
                                            }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   549
                                        }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   550
                                    }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   551
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   552
                                    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
   553
                                }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   554
                            }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   555
                            ),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
            },
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
                                       new ArgHandler() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
                                           public void handle(ArgIterator it) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
                                               throw new RuntimeException("Arg Parser: unrecognized option "+it.get());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
                                           }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
                                       }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
                                       );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
        if (BuildConfig.getField(null, "SourceBase") == null      ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
            BuildConfig.getField(null, "BuildBase") == null       ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
            BuildConfig.getField(null, "ProjectFileName") == null ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
            BuildConfig.getField(null, "CompilerVersion") == null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
            usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
        BuildConfig.putField(null, "PlatformObject", this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   574
    Vector createAllConfigs(String platform) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
        Vector allConfigs = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
        allConfigs.add(new C1DebugConfig());
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   578
        allConfigs.add(new C1FastDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   579
        allConfigs.add(new C1ProductConfig());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
8303
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   581
        allConfigs.add(new TieredDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   582
        allConfigs.add(new TieredFastDebugConfig());
81a0b8663748 7017824: Add support for creating 64-bit Visual Studio projects
sla
parents: 7452
diff changeset
   583
        allConfigs.add(new TieredProductConfig());
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
        return allConfigs;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
    PrintWriter printWriter;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
    public void writeProjectFile(String projectFileName, String projectName,
8860
98a7ff20acf0 7031571: Generate native VS2010 project files
sla
parents: 8303
diff changeset
   591
                                 Vector<BuildConfig> allConfigs) throws IOException {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
        throw new RuntimeException("use compiler version specific version");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   593
    }
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   594
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   595
    int indent;
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   596
    private Stack<String> tagStack = new Stack<String>();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   597
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   598
    private void startTagPrim(String name, String[] attrs, boolean close) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   599
       startTagPrim(name, attrs, close, true);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   600
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   601
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   602
    private void startTagPrim(String name, String[] attrs, boolean close,
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   603
          boolean newline) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   604
       doIndent();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   605
       printWriter.print("<" + name);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   606
       indent++;
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   607
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   608
       if (attrs != null && attrs.length > 0) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   609
          for (int i = 0; i < attrs.length; i += 2) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   610
             printWriter.print(" " + attrs[i] + "=\"" + attrs[i + 1] + "\"");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   611
             if (i < attrs.length - 2) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   612
             }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   613
          }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   614
       }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   615
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   616
       if (close) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   617
          indent--;
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   618
          printWriter.print(" />");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   619
       } else {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   620
          // TODO push tag name, and change endTag to pop and print.
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   621
          tagStack.push(name);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   622
          printWriter.print(">");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   623
       }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   624
       if (newline) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   625
          printWriter.println();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   626
       }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   627
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   628
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   629
    void startTag(String name, String... attrs) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   630
       startTagPrim(name, attrs, false);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   631
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   632
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   633
    void startTagV(String name, Vector attrs) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   634
       String s[] = new String[attrs.size()];
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   635
       for (int i = 0; i < attrs.size(); i++) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   636
          s[i] = (String) attrs.elementAt(i);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   637
       }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   638
       startTagPrim(name, s, false);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   639
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   640
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   641
    void endTag() {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   642
       String name = tagStack.pop();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   643
       indent--;
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   644
       doIndent();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   645
       printWriter.println("</" + name + ">");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   646
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   647
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   648
    private void endTagNoIndent() {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   649
       String name = tagStack.pop();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   650
       indent--;
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   651
       printWriter.println("</" + name + ">");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   652
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   653
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   654
    void tag(String name, String... attrs) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   655
       startTagPrim(name, attrs, true);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   656
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   657
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   658
    void tagData(String name, String data) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   659
       startTagPrim(name, null, false, false);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   660
       printWriter.print(data);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   661
       endTagNoIndent();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   662
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   663
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   664
    void tagData(String name, String data, String... attrs) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   665
       startTagPrim(name, attrs, false, false);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   666
       printWriter.print(data);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   667
       endTagNoIndent();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   668
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   669
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   670
    void tagV(String name, Vector attrs) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   671
       String s[] = new String[attrs.size()];
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   672
       for (int i = 0; i < attrs.size(); i++) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   673
          s[i] = (String) attrs.elementAt(i);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   674
       }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   675
       startTagPrim(name, s, true);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   676
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   677
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   678
    void doIndent() {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   679
       for (int i = 0; i < indent; i++) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   680
          printWriter.print("  ");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   681
       }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   682
    }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   683
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 8860
diff changeset
   684
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   685
}