Exemplo n.º 1
0
 public VSProject(
     VSSolution solution,
     Bam.Core.Module module)
     : base(module.CreateTokenizedString("$(packagebuilddir)/$(modulename).vcxproj").Parse())
 {
     this.Solution = solution;
     this.ProjectPath = module.CreateTokenizedString("$(packagebuilddir)/$(modulename).vcxproj").Parse();
     this.Configurations = new System.Collections.Generic.Dictionary<Bam.Core.EConfiguration, VSProjectConfiguration>();
     this.ProjectSettings = new Bam.Core.Array<VSSettingsGroup>();
     this.Headers = new Bam.Core.Array<VSSettingsGroup>();
     this.Sources = new Bam.Core.Array<VSSettingsGroup>();
     this.Others = new Bam.Core.Array<VSSettingsGroup>();
     this.Resources = new Bam.Core.Array<VSSettingsGroup>();
     this.Filter = new VSProjectFilter();
     this.OrderOnlyDependentProjects = new Bam.Core.Array<VSProject>();
     this.LinkDependentProjects = new Bam.Core.Array<VSProject>();
 }
Exemplo n.º 2
0
        public Project(
            Bam.Core.Module module,
            string name)
        {
            this.IsA = "PBXProject";
            this.Name = name;
            this.ProjectDir = module.CreateTokenizedString("$(buildroot)/$(packagename).xcodeproj");
            module.Macros.Add("xcodeprojectdir", this.ProjectDir);

            var projectPath = module.CreateTokenizedString("$(xcodeprojectdir)/project.pbxproj");
            this.ProjectPath = projectPath.Parse();

            this.SourceRoot = module.CreateTokenizedString("$(packagedir)").Parse();
            this.BuildRoot = module.CreateTokenizedString("$(buildroot)").Parse();

            this.Module = module;
            this.Targets = new System.Collections.Generic.Dictionary<System.Type, Target>();
            this.FileReferences = new System.Collections.Generic.List<FileReference>();
            this.BuildFiles = new System.Collections.Generic.List<BuildFile>();
            this.Groups = new System.Collections.Generic.List<Group>();
            this.GroupMap = new System.Collections.Generic.Dictionary<string, Group>();
            this.AllConfigurations = new System.Collections.Generic.List<Configuration>();
            this.ProjectConfigurations = new System.Collections.Generic.Dictionary<Bam.Core.EConfiguration, Configuration>();
            this.ConfigurationLists = new System.Collections.Generic.List<ConfigurationList>();
            this.SourcesBuildPhases = new System.Collections.Generic.List<SourcesBuildPhase>();
            this.FrameworksBuildPhases = new System.Collections.Generic.List<FrameworksBuildPhase>();
            this.ShellScriptsBuildPhases = new Bam.Core.Array<ShellScriptBuildPhase>();
            this.CopyFilesBuildPhases = new Bam.Core.Array<CopyFilesBuildPhase>();
            this.ContainerItemProxies = new Bam.Core.Array<ContainerItemProxy>();
            this.ReferenceProxies = new Bam.Core.Array<ReferenceProxy>();
            this.TargetDependencies = new Bam.Core.Array<TargetDependency>();
            this.ProjectReferences = new System.Collections.Generic.Dictionary<Group, FileReference>();

            this.Groups.Add(new Group()); // main group
            this.Groups.Add(new Group("Products")); // product ref group
            this.MainGroup.AddChild(this.ProductRefGroup);

            var configList = new ConfigurationList(this);
            this.ConfigurationLists.Add(configList);
        }
Exemplo n.º 3
0
 public VSSettingsGroup(
     Bam.Core.Module module,
     ESettingsGroup group,
     Bam.Core.TokenizedString include = null)
 {
     this.Module = module;
     this.Group = group;
     this.Include = include;
     if (null != include)
     {
         this.RelativeDirectory = module.CreateTokenizedString("@trimstart(@relativeto(@dir($(0)),$(packagedir)),../)", include);
     }
     this.Settings = new Bam.Core.Array<VSSetting>();
 }
Exemplo n.º 4
0
 AddFilters(
     Bam.Core.Module module,
     Bam.Core.TokenizedString filterPath)
 {
     var path = filterPath.Parse();
     if (!this.Filters.ContainsKey(path))
     {
         this.Filters.Add(path, new Bam.Core.Array<VSSettingsGroup>());
     }
     if (!path.Contains(System.IO.Path.DirectorySeparatorChar))
     {
         return;
     }
     // the entire hierarchy needs to be added, even if they are empty
     var parent = module.CreateTokenizedString("@dir($(0))", filterPath);
     this.AddFilters(module, parent);
 }
Exemplo n.º 5
0
        Convert(
            this C.ICommonLinkerSettings settings,
            Bam.Core.Module module,
            XcodeBuilder.Configuration configuration)
        {
            switch (settings.Bits)
            {
            case C.EBit.ThirtyTwo:
                {
                    configuration["VALID_ARCHS"] = new XcodeBuilder.UniqueConfigurationValue("i386");
                    configuration["ARCHS"] = new XcodeBuilder.UniqueConfigurationValue("$(ARCHS_STANDARD_32_BIT)");
                }
                break;

            case C.EBit.SixtyFour:
                {
                    configuration["VALID_ARCHS"] = new XcodeBuilder.UniqueConfigurationValue("x86_64");
                    configuration["ARCHS"] = new XcodeBuilder.UniqueConfigurationValue("$(ARCHS_STANDARD_64_BIT)");
                }
                break;

            default:
                throw new Bam.Core.Exception("Unknown bit depth, {0}", settings.Bits.ToString());
            }
            switch (settings.OutputType)
            {
            case C.ELinkerOutput.Executable:
                {
                    configuration["EXECUTABLE_PREFIX"] = new XcodeBuilder.UniqueConfigurationValue(string.Empty);
                    var ext = module.CreateTokenizedString("$(exeext)").Parse().TrimStart(new [] {'.'});
                    configuration["EXECUTABLE_EXTENSION"] = new XcodeBuilder.UniqueConfigurationValue(ext);
                }
                break;

            case C.ELinkerOutput.DynamicLibrary:
                {
                    if ((module is C.Plugin) || (module is C.Cxx.Plugin))
                    {
                        var prefix = module.CreateTokenizedString("$(pluginprefix)").Parse();
                        configuration["EXECUTABLE_PREFIX"] = new XcodeBuilder.UniqueConfigurationValue(prefix);
                        var ext = module.CreateTokenizedString("$(pluginext)").Parse().TrimStart(new [] {'.'});
                        configuration["EXECUTABLE_EXTENSION"] = new XcodeBuilder.UniqueConfigurationValue(ext);
                    }
                    else
                    {
                        var prefix = module.CreateTokenizedString("$(dynamicprefix)").Parse();
                        configuration["EXECUTABLE_PREFIX"] = new XcodeBuilder.UniqueConfigurationValue(prefix);
                        var ext = module.CreateTokenizedString("$(dynamicextonly)").Parse().TrimStart(new [] {'.'});
                        configuration["EXECUTABLE_EXTENSION"] = new XcodeBuilder.UniqueConfigurationValue(ext);
                    }
                    configuration["MACH_O_TYPE"] = new XcodeBuilder.UniqueConfigurationValue("mh_dylib");

                    var versionString = module.CreateTokenizedString("$(MajorVersion).$(MinorVersion)#valid(.$(PatchVersion))").Parse();
                    configuration["DYLIB_CURRENT_VERSION"] = new XcodeBuilder.UniqueConfigurationValue(versionString);
                    configuration["DYLIB_COMPATIBILITY_VERSION"] = new XcodeBuilder.UniqueConfigurationValue(versionString);
                }
                break;
            }
            if (settings.LibraryPaths.Count > 0)
            {
                var option = new XcodeBuilder.MultiConfigurationValue();
                foreach (var path in settings.LibraryPaths)
                {
                    option.Add(path.Parse());
                }
                configuration["LIBRARY_SEARCH_PATHS"] = option;
            }
            if (settings.DebugSymbols)
            {
                var option = new XcodeBuilder.MultiConfigurationValue();
                option.Add("-g");
                configuration["OTHER_LDFLAGS"] = option;
            }
        }
Exemplo n.º 6
0
 public FileReference MakeLinkableAlias(
     Bam.Core.Module module,
     Project project)
 {
     return project.EnsureFileReferenceExists(
         module.CreateTokenizedString("$(packagename)/$CONFIGURATION/@filename($(0))", this.Path),
         this.Type,
         explicitType: false,
         sourceTree: ESourceTree.Group);
 }