hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
author sla
Wed, 15 Dec 2010 07:11:31 -0800
changeset 7452 b3fa838286de
parent 7397 5b173b4ca846
child 8303 81a0b8663748
permissions -rw-r--r--
7006354: Updates to Visual Studio project creation and development launcher Summary: Updates to Visual Studio project creation and development launcher Reviewed-by: stefank, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
     2
 * Copyright (c) 2005, 2010, 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: 3261
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3261
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: 3261
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.FileWriter;
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.Hashtable;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    29
import java.util.Iterator;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    30
import java.util.TreeSet;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
    31
import java.util.Vector;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
public class WinGammaPlatformVC7 extends WinGammaPlatform {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
    35
    String projectVersion() {return "7.10";};
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
    36
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
    public void writeProjectFile(String projectFileName, String projectName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
                                 Vector allConfigs) throws IOException {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
        System.out.println();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
        System.out.println("    Writing .vcproj file...");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
        // If we got this far without an error, we're safe to actually
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
        // write the .vcproj file
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
        printWriter = new PrintWriter(new FileWriter(projectFileName));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
        printWriter.println("<?xml version=\"1.0\" encoding=\"windows-1251\"?>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
        startTag(
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
            "VisualStudioProject",
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
            new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
                "ProjectType", "Visual C++",
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
    50
                "Version", projectVersion(),
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
                "Name", projectName,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
                "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}",
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
                "SccProjectName", "",
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
                "SccLocalPath", ""
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
        startTag("Platforms", null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
        tag("Platform", new String[] {"Name", Util.os});
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
        endTag("Platforms");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
        startTag("Configurations", null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
            writeConfiguration((BuildConfig)i.next());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
        endTag("Configurations");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
        tag("References", null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
        writeFiles(allConfigs);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
        tag("Globals", null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
        endTag("VisualStudioProject");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
        printWriter.close();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
        System.out.println("    Done.");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
    abstract class NameFilter {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
        protected String fname;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
        abstract boolean match(FileInfo fi);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
        String  filterString() { return ""; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
        String name() { return this.fname;}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
    class DirectoryFilter extends NameFilter {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
        String dir;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
        int baseLen, dirLen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
        DirectoryFilter(String dir, String sbase) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
            this.dir = dir;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
            this.baseLen = sbase.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
            this.dirLen = dir.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
            this.fname = dir;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
        DirectoryFilter(String fname, String dir, String sbase) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
            this.dir = dir;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
            this.baseLen = sbase.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
            this.dirLen = dir.length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
            this.fname = fname;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
        boolean match(FileInfo fi) {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   112
           int lastSlashIndex = fi.full.lastIndexOf('/');
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   113
           String fullDir = fi.full.substring(0, lastSlashIndex);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   114
           return fullDir.endsWith(dir);
1
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
    class TypeFilter extends NameFilter {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
        String[] exts;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
        TypeFilter(String fname, String[] exts) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
            this.fname = fname;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
            this.exts = exts;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
        boolean match(FileInfo fi) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
            for (int i=0; i<exts.length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
                if (fi.full.endsWith(exts[i])) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
                    return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
            return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
        String  filterString() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
            return Util.join(";", exts);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    class TerminatorFilter extends NameFilter {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
        TerminatorFilter(String fname) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
            this.fname = fname;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
        boolean match(FileInfo fi) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
            return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    class SpecificNameFilter extends NameFilter {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
        String pats[];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
        SpecificNameFilter(String fname, String[] pats) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
            this.fname = fname;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
            this.pats = pats;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
        boolean match(FileInfo fi) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
            for (int i=0; i<pats.length; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
                if (fi.attr.shortName.matches(pats[i])) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
                    return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
            return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   170
    class SpecificPathFilter extends NameFilter {
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   171
        String pats[];
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   172
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   173
        SpecificPathFilter(String fname, String[] pats) {
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   174
            this.fname = fname;
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   175
            this.pats = pats;
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   176
        }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   177
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   178
        boolean match(FileInfo fi) {
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   179
            for (int i=0; i<pats.length; i++) {
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   180
                if (fi.full.matches(pats[i])) {
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   181
                    return true;
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   182
                }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   183
            }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   184
            return false;
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   185
        }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   186
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   187
    }
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   188
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
    class ContainerFilter extends NameFilter {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
        Vector children;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
        ContainerFilter(String fname) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
            this.fname = fname;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
            children = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
        boolean match(FileInfo fi) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
            return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
        Iterator babies() { return children.iterator(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
        void add(NameFilter f) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
            children.add(f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
    void writeCustomToolConfig(Vector configs, String[] customToolAttrs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
        for (Iterator i = configs.iterator(); i.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
            startTag("FileConfiguration",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
                     new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
                         "Name",  (String)i.next()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
                     }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
                     );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
            tag("Tool", customToolAttrs);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
            endTag("FileConfiguration");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
    // here we define filters, which define layout of what can be seen in 'Solution View' of MSVC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
    // Basically there are two types of entities - container filters and real filters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
    //   - container filter just provides a container to group together real filters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
    //   - real filter can select elements from the set according to some rule, put it into XML
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
    //     and remove from the list
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   227
    Vector makeFilters(TreeSet<FileInfo> files) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
        String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   231
        String currentDir = "";
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   232
        DirectoryFilter container = null;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   233
        for(FileInfo fileInfo : files) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   235
           if (!fileInfo.full.startsWith(sbase)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   236
              continue;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   237
           }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   239
           int lastSlash = fileInfo.full.lastIndexOf('/');
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   240
           String dir = fileInfo.full.substring(sbase.length(), lastSlash);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   241
           if(dir.equals("share/vm")) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   242
              // skip files directly in share/vm - should only be precompiled.hpp which is handled below
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   243
              continue;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   244
           }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   245
           if (!dir.equals(currentDir)) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   246
              currentDir = dir;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   247
              if (container != null) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   248
                 rv.add(container);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   249
              }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   251
              // remove "share/vm/" from names
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   252
              String name = dir;
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   253
              if (dir.startsWith("share/vm/")) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   254
                 name = dir.substring("share/vm/".length(), dir.length());
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   255
              }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   256
              container = new DirectoryFilter(name, dir, sbase);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   257
           }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   258
        }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   259
        if (container != null) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   260
           rv.add(container);
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   261
        }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   263
        ContainerFilter generated = new ContainerFilter("Generated");
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   264
        ContainerFilter c1Generated = new ContainerFilter("C1");
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   265
        c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   266
        c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   267
        generated.add(c1Generated);
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   268
        ContainerFilter c2Generated = new ContainerFilter("C2");
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   269
        c2Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler2/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   270
        c2Generated.add(new SpecificPathFilter("adfiles", new String[] {".*compiler2/generated/adfiles/.*"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   271
        c2Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler2/generated/jvmtifiles/.*"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   272
        generated.add(c2Generated);
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   273
        ContainerFilter coreGenerated = new ContainerFilter("Core");
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   274
        coreGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*core/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   275
        coreGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*core/generated/jvmtifiles/.*"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   276
        generated.add(coreGenerated);
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   277
        ContainerFilter tieredGenerated = new ContainerFilter("Tiered");
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   278
        tieredGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*tiered/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   279
        tieredGenerated.add(new SpecificPathFilter("adfiles", new String[] {".*tiered/generated/adfiles/.*"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   280
        tieredGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*tiered/generated/jvmtifiles/.*"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   281
        generated.add(tieredGenerated);
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   282
        ContainerFilter kernelGenerated = new ContainerFilter("Kernel");
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   283
        kernelGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*kernel/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   284
        kernelGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*kernel/generated/jvmtifiles/.*"}));
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   285
        generated.add(kernelGenerated);
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   286
        rv.add(generated);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   288
        rv.add(new SpecificNameFilter("Precompiled Header", new String[] {"precompiled.hpp"}));
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
        // this one is to catch files not caught by other filters
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
        //rv.add(new TypeFilter("Header Files", new String[] {"h", "hpp", "hxx", "hm", "inl", "fi", "fd"}));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
        rv.add(new TerminatorFilter("Source Files"));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
    void writeFiles(Vector allConfigs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
        Hashtable allFiles = computeAttributedFiles(allConfigs);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
        Vector allConfigNames = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
        for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
            allConfigNames.add(((BuildConfig)i.next()).get("Name"));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
        TreeSet sortedFiles = sortFiles(allFiles);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
        startTag("Files", null);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
        for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
            doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
        startTag("Filter",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
                 new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
                     "Name", "Resource Files",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
                     "Filter", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
                 }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
                 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
        endTag("Filter");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
        endTag("Files");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
    void doWriteFiles(TreeSet allFiles, Vector allConfigNames, NameFilter filter) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
        startTag("Filter",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
                 new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
                     "Name",   filter.name(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
                     "Filter", filter.filterString()
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
                 }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
                 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
        if (filter instanceof ContainerFilter) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
            Iterator i = ((ContainerFilter)filter).babies();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
            while (i.hasNext()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
                doWriteFiles(allFiles, allConfigNames, (NameFilter)i.next());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
            Iterator i = allFiles.iterator();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
            while (i.hasNext()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
                FileInfo fi = (FileInfo)i.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
                if (!filter.match(fi)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
                    continue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
                startTag("File",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
                         new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
                             "RelativePath", fi.full.replace('/', '\\')
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
                         }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
                         );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
                FileAttribute a = fi.attr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
                if (a.pchRoot) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
                    writeCustomToolConfig(allConfigNames,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
                                          new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
                                              "Name", "VCCLCompilerTool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
                                              "UsePrecompiledHeader", "1"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
                                          });
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
                if (a.noPch) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
                    writeCustomToolConfig(allConfigNames,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
                                          new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
                                              "Name", "VCCLCompilerTool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
                                              "UsePrecompiledHeader", "0"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
                                          });
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
                if (a.configs != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
                    for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
                        String cfg = (String)j.next();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
                        if (!a.configs.contains(cfg)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
                            startTag("FileConfiguration",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
                                     new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
                                         "Name", cfg,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
                                         "ExcludedFromBuild", "TRUE"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
                                     });
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
                            endTag("FileConfiguration");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
                        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
                    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
                }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
                endTag("File");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
                // we not gonna look at this file anymore
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
                i.remove();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
        endTag("Filter");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
    void writeConfiguration(BuildConfig cfg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
        startTag("Configuration",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
                 new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
                     "Name", cfg.get("Name"),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
                     "OutputDirectory",  cfg.get("OutputDir"),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
                     "IntermediateDirectory",  cfg.get("OutputDir"),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
                     "ConfigurationType", "2",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
                     "UseOfMFC", "0",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
                     "ATLMinimizesCRunTimeLibraryUsage", "FALSE"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
                 }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
                 );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
        tagV("Tool", cfg.getV("CompilerFlags"));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
        tag("Tool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
            new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
                "Name", "VCCustomBuildTool"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
        tagV("Tool", cfg.getV("LinkerFlags"));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
        tag("Tool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
            new String[] {
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   426
               "Name", "VCPostBuildEventTool",
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   427
                "Description", BuildConfig.getFieldString(null, "PostbuildDescription"),
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   428
                //Caution: String.replace(String,String) is available from JDK5 onwards only
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   429
                "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   430
                   ("\t", "&#x0D;&#x0A;"))
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
        tag("Tool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
            new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
                "Name", "VCPreBuildEventTool"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
        tag("Tool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
            new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
                "Name", "VCPreLinkEventTool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
                "Description", BuildConfig.getFieldString(null, "PrelinkDescription"),
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   444
                //Caution: String.replace(String,String) is available from JDK5 onwards only
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   445
                "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   446
                   ("\t", "&#x0D;&#x0A;"))
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
        tag("Tool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
            new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
                "Name", "VCResourceCompilerTool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
                // XXX???
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
                "PreprocessorDefinitions", "NDEBUG",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
                "Culture", "1033"
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
            );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
        tag("Tool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
            new String[] {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
                "Name", "VCMIDLTool",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
                "PreprocessorDefinitions", "NDEBUG",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
                "MkTypLibCompatible", "TRUE",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
                "SuppressStartupBanner", "TRUE",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
                "TargetEnvironment", "1",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
                "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
                "HeaderFileName", ""
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
        endTag("Configuration");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
    int indent;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
    private void startTagPrim(String name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
                              String[] attrs,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
                              boolean close) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
        doIndent();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
        printWriter.print("<"+name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
        indent++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
        if (attrs != null) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
            printWriter.println();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
            for (int i=0; i<attrs.length; i+=2) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
                doIndent();
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   487
                printWriter.print(" " + attrs[i]+"=\""+attrs[i+1]+"\"");
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   488
                if (i < attrs.length - 2) {
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   489
                    printWriter.println();
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   490
                }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
            }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
        if (close) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
            indent--;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
            //doIndent();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
            printWriter.println("/>");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
            //doIndent();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
            printWriter.println(">");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
    void startTag(String name, String[] attrs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
        startTagPrim(name, attrs, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
    void startTagV(String name, Vector attrs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
        String s[] = new String [attrs.size()];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
         for (int i=0; i<attrs.size(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
             s[i] = (String)attrs.elementAt(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
         }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
        startTagPrim(name, s, false);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
    void endTag(String name) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
        indent--;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
        doIndent();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
        printWriter.println("</"+name+">");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
    void tag(String name, String[] attrs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
        startTagPrim(name, attrs, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
     void tagV(String name, Vector attrs) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
         String s[] = new String [attrs.size()];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
         for (int i=0; i<attrs.size(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
             s[i] = (String)attrs.elementAt(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
         }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
         startTagPrim(name, s, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
    void doIndent() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
        for (int i=0; i<indent; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
            printWriter.print("    ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
    protected String getProjectExt() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
        return ".vcproj";
489c9b5090e2 Initial load
duke
parents:
diff changeset
   543
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   545
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
class CompilerInterfaceVC7 extends CompilerInterface {
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   547
    void getBaseCompilerFlags_common(Vector defines, Vector includes, String outDir,Vector rv) {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   548
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
        // advanced M$ IDE (2003) can only recognize name if it's first or
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
        // second attribute in the tag - go guess
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
        addAttr(rv, "Name", "VCCLCompilerTool");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
        addAttr(rv, "AdditionalIncludeDirectories", Util.join(",", includes));
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   553
        addAttr(rv, "PreprocessorDefinitions",
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   554
                                Util.join(";", defines).replace("\"","&quot;"));
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   555
        addAttr(rv, "PrecompiledHeaderThrough", "precompiled.hpp");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
        addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
        addAttr(rv, "AssemblerListingLocation", outDir);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
        addAttr(rv, "ObjectFile", outDir+Util.sep);
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   559
        addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   560
        // Set /nologo optin
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
        addAttr(rv, "SuppressStartupBanner", "TRUE");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   562
        // Surpass the default /Tc or /Tp. 0 is compileAsDefault
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
        addAttr(rv, "CompileAs", "0");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   564
        // Set /W3 option. 3 is warningLevel_3
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
        addAttr(rv, "WarningLevel", "3");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   566
        // Set /WX option,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
        addAttr(rv, "WarnAsError", "TRUE");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   568
        // Set /GS option
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
        addAttr(rv, "BufferSecurityCheck", "FALSE");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   570
        // Set /Zi option. 3 is debugEnabled
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   571
        addAttr(rv, "DebugInformationFormat", "3");
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   572
    }
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   573
    Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   574
        Vector rv = new Vector();
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   575
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   576
        getBaseCompilerFlags_common(defines,includes, outDir, rv);
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   577
        // Set /Yu option. 3 is pchUseUsingSpecific
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   578
        // Note: Starting VC8 pchUseUsingSpecific is 2 !!!
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   579
        addAttr(rv, "UsePrecompiledHeader", "3");
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   580
        // Set /EHsc- option
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
        addAttr(rv, "ExceptionHandling", "FALSE");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
    Vector getBaseLinkerFlags(String outDir, String outDll) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
        addAttr(rv, "Name", "VCLinkerTool");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
        addAttr(rv, "AdditionalOptions",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   591
                "/export:JNI_GetDefaultJavaVMInitArgs " +
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
                "/export:JNI_CreateJavaVM " +
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   593
                "/export:JVM_FindClassFromBootLoader "+
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   594
                "/export:JNI_GetCreatedJavaVMs "+
489c9b5090e2 Initial load
duke
parents:
diff changeset
   595
                "/export:jio_snprintf /export:jio_printf "+
489c9b5090e2 Initial load
duke
parents:
diff changeset
   596
                "/export:jio_fprintf /export:jio_vfprintf "+
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   597
                "/export:jio_vsnprintf "+
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   598
                "/export:JVM_GetVersionInfo "+
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   599
                "/export:JVM_GetThreadStateNames "+
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   600
                "/export:JVM_GetThreadStateValues "+
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   601
                "/export:JVM_InitAgentProperties ");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   602
        addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   603
        addAttr(rv, "OutputFile", outDll);
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   604
        // Set /INCREMENTAL option. 1 is linkIncrementalNo
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   605
        addAttr(rv, "LinkIncremental", "1");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   606
        addAttr(rv, "SuppressStartupBanner", "TRUE");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   607
        addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   608
        addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   609
        // Set /SUBSYSTEM option. 2 is subSystemWindows
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   610
        addAttr(rv, "SubSystem", "2");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   611
        addAttr(rv, "BaseAddress", "0x8000000");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   612
        addAttr(rv, "ImportLibrary", outDir+Util.sep+"jvm.lib");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   613
        // Set /MACHINE option. 1 is machineX86
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   614
        addAttr(rv, "TargetMachine", "1");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   615
489c9b5090e2 Initial load
duke
parents:
diff changeset
   616
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   617
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   618
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   619
    void  getDebugCompilerFlags_common(String opt,Vector rv) {
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   620
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   621
        // Set /On option
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   622
        addAttr(rv, "Optimization", opt);
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   623
        // Set /FR option. 1 is brAllInfo
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   624
        addAttr(rv, "BrowseInformation", "1");
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   625
        addAttr(rv, "BrowseInformationFile", "$(IntDir)" + Util.sep);
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   626
        // Set /MD option. 2 is rtMultiThreadedDLL
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   627
        addAttr(rv, "RuntimeLibrary", "2");
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   628
        // Set /Oy- option
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   629
        addAttr(rv, "OmitFramePointers", "FALSE");
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   630
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   631
    }
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   632
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   633
    Vector getDebugCompilerFlags(String opt) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   634
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   635
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   636
        getDebugCompilerFlags_common(opt,rv);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   637
489c9b5090e2 Initial load
duke
parents:
diff changeset
   638
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   639
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   640
489c9b5090e2 Initial load
duke
parents:
diff changeset
   641
    Vector getDebugLinkerFlags() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   642
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   643
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   644
        addAttr(rv, "GenerateDebugInformation", "TRUE"); // == /DEBUG option
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   645
489c9b5090e2 Initial load
duke
parents:
diff changeset
   646
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   647
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   648
7452
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   649
    void getAdditionalNonKernelLinkerFlags(Vector rv) {
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   650
        extAttr(rv, "AdditionalOptions",
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   651
                "/export:AsyncGetCallTrace ");
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   652
    }
b3fa838286de 7006354: Updates to Visual Studio project creation and development launcher
sla
parents: 7397
diff changeset
   653
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   654
    void getProductCompilerFlags_common(Vector rv) {
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   655
        // Set /O2 option. 2 is optimizeMaxSpeed
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   656
        addAttr(rv, "Optimization", "2");
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   657
        // Set /Oy- option
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   658
        addAttr(rv, "OmitFramePointers", "FALSE");
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   659
    }
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   660
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   661
    Vector getProductCompilerFlags() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   662
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   663
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   664
        getProductCompilerFlags_common(rv);
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   665
        // Set /Ob option.  1 is expandOnlyInline
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   666
        addAttr(rv, "InlineFunctionExpansion", "1");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   667
        // Set /GF option.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   668
        addAttr(rv, "StringPooling", "TRUE");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   669
        // Set /MD option. 2 is rtMultiThreadedDLL
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   670
        addAttr(rv, "RuntimeLibrary", "2");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   671
        // Set /Gy option
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   672
        addAttr(rv, "EnableFunctionLevelLinking", "TRUE");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   673
489c9b5090e2 Initial load
duke
parents:
diff changeset
   674
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   675
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   676
489c9b5090e2 Initial load
duke
parents:
diff changeset
   677
    Vector getProductLinkerFlags() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   678
        Vector rv = new Vector();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   679
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   680
        // Set /OPT:REF option. 2 is optReferences
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   681
        addAttr(rv, "OptimizeReferences", "2");
2271
ff6d122287cb 6812297: update project creation for Visual Studio 2005-2008
ikrylov
parents: 1
diff changeset
   682
        // Set /OPT:optFolding option. 2 is optFolding
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   683
        addAttr(rv, "EnableCOMDATFolding", "2");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   684
489c9b5090e2 Initial load
duke
parents:
diff changeset
   685
        return rv;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   686
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   687
489c9b5090e2 Initial load
duke
parents:
diff changeset
   688
    String getOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   689
        return "2";
489c9b5090e2 Initial load
duke
parents:
diff changeset
   690
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   691
489c9b5090e2 Initial load
duke
parents:
diff changeset
   692
    String getNoOptFlag() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   693
        return "0";
489c9b5090e2 Initial load
duke
parents:
diff changeset
   694
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   695
489c9b5090e2 Initial load
duke
parents:
diff changeset
   696
    String makeCfgName(String flavourBuild) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   697
        return  flavourBuild + "|" + Util.os;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   698
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   699
}