Ejemplo n.º 1
0
        internal VcProjectConfiguration(XmlElement elem, VcProject parentProject, DirectoryInfo outputDir) : base(elem, parentProject, outputDir)
        {
            // determine relative output directory (outdir)
            XmlAttribute outputDirAttribute = elem.Attributes["OutputDirectory"];

            if (outputDirAttribute != null)
            {
                _rawRelativeOutputDir = outputDirAttribute.Value;
            }

            // get intermediate directory and expand macros
            XmlAttribute intermidiateDirAttribute = elem.Attributes["IntermediateDirectory"];

            if (intermidiateDirAttribute != null)
            {
                _rawIntermediateDir = intermidiateDirAttribute.Value;
            }

            // get referencespath directory and expand macros
            XmlAttribute referencesPathAttribute = elem.Attributes["ReferencesPath"];

            if (referencesPathAttribute != null)
            {
                _rawReferencesPath = StringUtils.ConvertEmptyToNull(referencesPathAttribute.Value);
            }

            string managedExtentions = GetXmlAttributeValue(elem, "ManagedExtensions");

            if (managedExtentions != null)
            {
                switch (managedExtentions.ToLower())
                {
                case "false":
                case "0":
                    _managedExtensions = false;
                    break;

                case "true":
                case "1":
                    _managedExtensions = true;
                    break;

                default:
                    throw new BuildException(String.Format("ManagedExtensions '{0}' is not supported yet.", managedExtentions));
                }
            }

            // get configuration type
            string type = GetXmlAttributeValue(elem, "ConfigurationType");

            if (type != null)
            {
                _type = (ConfigurationType)Enum.ToObject(typeof(ConfigurationType),
                                                         int.Parse(type, CultureInfo.InvariantCulture));
            }

            string wholeProgramOptimization = GetXmlAttributeValue(elem, "WholeProgramOptimization");

            if (wholeProgramOptimization != null)
            {
                _wholeProgramOptimization = string.Compare(wholeProgramOptimization.Trim(), "true", true, CultureInfo.InvariantCulture) == 0;
            }

            string characterSet = GetXmlAttributeValue(elem, "CharacterSet");

            if (characterSet != null)
            {
                _characterSet = (CharacterSet)Enum.ToObject(typeof(CharacterSet),
                                                            int.Parse(characterSet, CultureInfo.InvariantCulture));
            }

            // get MFC settings
            string useOfMFC = GetXmlAttributeValue(elem, "UseOfMFC");

            if (useOfMFC != null)
            {
                _useOfMFC = (UseOfMFC)Enum.ToObject(typeof(UseOfMFC),
                                                    int.Parse(useOfMFC, CultureInfo.InvariantCulture));
            }

            // get ATL settings
            string useOfATL = GetXmlAttributeValue(elem, "UseOfATL");

            if (useOfATL != null)
            {
                _useOfATL = (UseOfATL)Enum.ToObject(typeof(UseOfATL),
                                                    int.Parse(useOfATL, CultureInfo.InvariantCulture));
            }

            _linkerConfiguration = new LinkerConfig(this);
        }
Ejemplo n.º 2
0
        internal VcProjectConfiguration(XmlElement elem, VcProject parentProject, DirectoryInfo outputDir)
            : base(elem, parentProject, outputDir)
        {
            // determine relative output directory (outdir)
            XmlAttribute outputDirAttribute = elem.Attributes["OutputDirectory"];
            if (outputDirAttribute != null) {
                _rawRelativeOutputDir = outputDirAttribute.Value;
            }

            // get intermediate directory and expand macros
            XmlAttribute intermidiateDirAttribute = elem.Attributes["IntermediateDirectory"];
            if (intermidiateDirAttribute != null) {
                _rawIntermediateDir = intermidiateDirAttribute.Value;
            }

            // get referencespath directory and expand macros
            XmlAttribute referencesPathAttribute = elem.Attributes["ReferencesPath"];
            if (referencesPathAttribute != null) {
                _rawReferencesPath = StringUtils.ConvertEmptyToNull(referencesPathAttribute.Value);
            }

            string managedExtentions = GetXmlAttributeValue(elem, "ManagedExtensions");
            if (managedExtentions != null) {
                switch(managedExtentions.ToLower()) {
                    case "false":
                    case "0":
                        _managedExtensions = false;
                        break;
                    case "true":
                    case "1":
                        _managedExtensions = true;
                        break;
                    default:
                        throw new BuildException(String.Format("ManagedExtensions '{0}' is not supported yet.",managedExtentions));
                }
            }

            // get configuration type
            string type = GetXmlAttributeValue(elem, "ConfigurationType");
            if (type != null) {
                _type = (ConfigurationType) Enum.ToObject(typeof(ConfigurationType),
                    int.Parse(type, CultureInfo.InvariantCulture));
            }

            string wholeProgramOptimization = GetXmlAttributeValue(elem, "WholeProgramOptimization");
            if (wholeProgramOptimization != null) {
                _wholeProgramOptimization = string.Compare(wholeProgramOptimization.Trim(), "true", true, CultureInfo.InvariantCulture) == 0;
            }

            string characterSet = GetXmlAttributeValue(elem, "CharacterSet");
            if (characterSet != null) {
                _characterSet = (CharacterSet) Enum.ToObject(typeof(CharacterSet),
                    int.Parse(characterSet, CultureInfo.InvariantCulture));
            }

            // get MFC settings
            string useOfMFC = GetXmlAttributeValue(elem, "UseOfMFC");
            if (useOfMFC != null) {
                _useOfMFC = (UseOfMFC) Enum.ToObject(typeof(UseOfMFC),
                    int.Parse(useOfMFC, CultureInfo.InvariantCulture));
            }

            // get ATL settings
            string useOfATL = GetXmlAttributeValue(elem, "UseOfATL");
            if (useOfATL != null) {
                _useOfATL = (UseOfATL) Enum.ToObject(typeof(UseOfATL),
                    int.Parse(useOfATL, CultureInfo.InvariantCulture));
            }

            _linkerConfiguration = new LinkerConfig(this);
        }