Esempio n. 1
0
        EnsureTargetConfigurationExists(
            Bam.Core.Module module,
            Target target)
        {
            var configList = target.ConfigurationList;

            lock (configList)
            {
                var config         = module.BuildEnvironment.Configuration;
                var existingConfig = configList.FirstOrDefault(item => item.Config == config);
                if (null != existingConfig)
                {
                    return(existingConfig);
                }

                // if a new target config is needed, then a new project config is needed too
                this.EnsureProjectConfigurationExists(module);

                var newConfig = new Configuration(module.BuildEnvironment.Configuration, this, target);
                this.AllConfigurations.Add(newConfig);
                configList.AddConfiguration(newConfig);

                var clangMeta = Bam.Core.Graph.Instance.PackageMetaData <Clang.MetaData>("Clang");

                // set which SDK to build against
                newConfig["SDKROOT"] = new UniqueConfigurationValue(clangMeta.SDK);

                // set the minimum version of OSX/iPhone to run against
                var minVersionRegEx = new System.Text.RegularExpressions.Regex("^(?<Type>[a-z]+)(?<Version>[0-9.]+)$");
                var match           = minVersionRegEx.Match(clangMeta.MinimumVersionSupported);
                if (!match.Groups["Type"].Success)
                {
                    throw new Bam.Core.Exception("Unable to extract SDK type from: '{0}'", clangMeta.MinimumVersionSupported);
                }
                if (!match.Groups["Version"].Success)
                {
                    throw new Bam.Core.Exception("Unable to extract SDK version from: '{0}'", clangMeta.MinimumVersionSupported);
                }

                var optionName = System.String.Format("{0}_DEPLOYMENT_TARGET", match.Groups["Type"].Value.ToUpper());
                newConfig[optionName] = new UniqueConfigurationValue(match.Groups["Version"].Value);

                return(newConfig);
            }
        }
Esempio n. 2
0
        EnsureProjectConfigurationExists(
            Bam.Core.Module module)
        {
            lock (this.ProjectConfigurations)
            {
                var config = module.BuildEnvironment.Configuration;
                if (this.ProjectConfigurations.ContainsKey(config))
                {
                    return;
                }

                // add configuration to project
                var projectConfig = new Configuration(config, this, null);
                projectConfig["USE_HEADERMAP"]        = new UniqueConfigurationValue("NO");
                projectConfig["COMBINE_HIDPI_IMAGES"] = new UniqueConfigurationValue("NO"); // TODO: needed to quieten Xcode 4 verification

                // reset SRCROOT, or it is taken to be where the workspace is
                var pkgdir             = this.Module.Macros["packagedir"].ToString() + "/";
                var relativeSourcePath = Bam.Core.RelativePathUtilities.GetPath(pkgdir, this.ProjectDir.ToString());
                projectConfig["SRCROOT"] = new UniqueConfigurationValue(relativeSourcePath);

                // all 'products' are relative to SYMROOT in the IDE, regardless of the project settings
                // needed so that built products are no longer 'red' in the IDE
                var relativeSymRoot = Bam.Core.RelativePathUtilities.GetPath(this.BuiltProductsDir, this.SourceRoot);
                projectConfig["SYMROOT"] = new UniqueConfigurationValue("$(SRCROOT)/" + relativeSymRoot.TrimEnd('/'));

                // all intermediate files generated are relative to this
                projectConfig["OBJROOT"] = new UniqueConfigurationValue("$(SYMROOT)/intermediates");

                // would like to be able to set this to '$(SYMROOT)/$(TARGET_NAME)/$(CONFIGURATION)'
                // but TARGET_NAME is not defined in the Project configuration settings, and will end up collapsing
                // to an empty value
                // 'products' use the Project configuration value of CONFIGURATION_BUILD_DIR for their path, while
                // written target files use the Target configuration value of CONFIGURATION_BUILD_DIR
                // if these are inconsistent the IDE shows the product in red
                projectConfig["CONFIGURATION_BUILD_DIR"] = new UniqueConfigurationValue("$(SYMROOT)/$(CONFIGURATION)");

                this.getProjectConfiguratonList().AddConfiguration(projectConfig);
                this.appendAllConfigurations(projectConfig);
                this.ProjectConfigurations.Add(config, projectConfig);
            }
        }
Esempio n. 3
0
        public Configuration EnsureTargetConfigurationExists(
            Bam.Core.Module module,
            ConfigurationList configList)
        {
            lock (configList)
            {
                var config = module.BuildEnvironment.Configuration;
                var existingConfig = configList.Where(item => item.Config == config).FirstOrDefault();
                if (null != existingConfig)
                {
                    return existingConfig;
                }

                // if a new target config is needed, then a new project config is needed too
                this.EnsureProjectConfigurationExists(module);

                var newConfig = new Configuration(module.BuildEnvironment.Configuration);
                this.AllConfigurations.Add(newConfig);
                configList.AddConfiguration(newConfig);

                var clangMeta = Bam.Core.Graph.Instance.PackageMetaData<Clang.MetaData>("Clang");

                // set which SDK to build against
                newConfig["SDKROOT"] = new UniqueConfigurationValue(clangMeta.SDK);

                // set the minimum version of OSX/iPhone to run against
                var minVersionRegEx = new System.Text.RegularExpressions.Regex("^(?<Type>[a-z]+)(?<Version>[0-9.]+)$");
                var match = minVersionRegEx.Match(clangMeta.MinimumVersionSupported);
                if (!match.Groups["Type"].Success)
                {
                    throw new Bam.Core.Exception("Unable to extract SDK type from: '{0}'", clangMeta.MinimumVersionSupported);
                }
                if (!match.Groups["Version"].Success)
                {
                    throw new Bam.Core.Exception("Unable to extract SDK version from: '{0}'", clangMeta.MinimumVersionSupported);
                }

                var optionName = System.String.Format("{0}_DEPLOYMENT_TARGET", match.Groups["Type"].Value.ToUpper());
                newConfig[optionName] = new UniqueConfigurationValue(match.Groups["Version"].Value);

                return newConfig;
            }
        }
Esempio n. 4
0
        public void EnsureProjectConfigurationExists(
            Bam.Core.Module module)
        {
            lock (this.ProjectConfigurations)
            {
                var config = module.BuildEnvironment.Configuration;
                if (this.ProjectConfigurations.ContainsKey(config))
                {
                    return;
                }

                // add configuration to project
                var projectConfig = new Configuration(config);
                projectConfig["USE_HEADERMAP"] = new UniqueConfigurationValue("NO");
                projectConfig["COMBINE_HIDPI_IMAGES"] = new UniqueConfigurationValue("NO"); // TODO: needed to quieten Xcode 4 verification

                // reset SRCROOT, or it is taken to be where the workspace is
                projectConfig["SRCROOT"] = new UniqueConfigurationValue(this.SourceRoot);

                // all 'products' are relative to SYMROOT in the IDE, regardless of the project settings
                // needed so that built products are no longer 'red' in the IDE
                projectConfig["SYMROOT"] = new UniqueConfigurationValue(this.BuiltProductsDir);

                // all intermediate files generated are relative to this
                projectConfig["OBJROOT"] = new UniqueConfigurationValue("$(SYMROOT)/intermediates");

                // would like to be able to set this to '$(SYMROOT)/$(TARGET_NAME)/$(CONFIGURATION)'
                // but TARGET_NAME is not defined in the Project configuration settings, and will end up collapsing
                // to an empty value
                // 'products' use the Project configuration value of CONFIGURATION_BUILD_DIR for their path, while
                // written target files use the Target configuration value of CONFIGURATION_BUILD_DIR
                // if these are inconsistent the IDE shows the product in red
                projectConfig["CONFIGURATION_BUILD_DIR"] = new UniqueConfigurationValue("$(SYMROOT)/$(CONFIGURATION)");

                this.ConfigurationLists[0].AddConfiguration(projectConfig);
                this.AllConfigurations.Add(projectConfig);
                this.ProjectConfigurations.Add(config, projectConfig);
            }
        }
Esempio n. 5
0
 SetProductName(
     Bam.Core.TokenizedString productName)
 {
     this["PRODUCT_NAME"] = new UniqueConfigurationValue(productName.Parse());
 }
Esempio n. 6
0
 public void SetProductName(
     Bam.Core.TokenizedString productName)
 {
     this["PRODUCT_NAME"] = new UniqueConfigurationValue(productName.Parse());
 }