AsString(
            this FileReference.EFileType type)
        {
            switch (type)
            {
            case FileReference.EFileType.SourceCodeC:
                return("sourcecode.c.c");

            case FileReference.EFileType.SourceCodeCxx:
                return("sourcecode.cpp.cpp");

            case FileReference.EFileType.SourceCodeObjC:
                return("sourcecode.c.objc");

            case FileReference.EFileType.SourceCodeObjCxx:
                return("sourcecode.cpp.objcpp");

            case FileReference.EFileType.HeaderFile:
                return("sourcecode.c.h");

            case FileReference.EFileType.Archive:
                return("archive.ar");

            case FileReference.EFileType.Executable:
                return("compiled.mach-o.executable");

            case FileReference.EFileType.DynamicLibrary:
                return("compiled.mach-o.dylib");

            case FileReference.EFileType.WrapperFramework:
                return("wrapper.framework");

            case FileReference.EFileType.ApplicationBundle:
                return("wrapper.application");

            case FileReference.EFileType.Project:
                return("wrapper.pb-project");

            case FileReference.EFileType.LexFile:
                return("sourcecode.lex");

            case FileReference.EFileType.YaccFile:
                return("sourcecode.yacc");

            case FileReference.EFileType.TextBasedDylibDefinition:
                return("sourcecode.text-based-dylib-definition");

            case FileReference.EFileType.TextFile:
                return("text");

            case FileReference.EFileType.Assembler:
                return("sourecode.asm");

            case FileReference.EFileType.ZipArchive:
                return("archive.zip");

            default:
                throw new Bam.Core.Exception("Unrecognized file type {0}", type.ToString());
            }
        }
Exemple #2
0
 EnsureBuildFileExists(
     Bam.Core.TokenizedString path,
     FileReference.EFileType type)
 {
     lock (this.Project)
     {
         var relativePath = this.Project.GetRelativePathToProject(path);
         var sourceTree   = FileReference.ESourceTree.NA;
         if (null == relativePath)
         {
             sourceTree = FileReference.ESourceTree.Absolute;
         }
         else
         {
             sourceTree = FileReference.ESourceTree.SourceRoot;
         }
         var fileRef = this.Project.EnsureFileReferenceExists(
             path,
             relativePath,
             type,
             sourceTree: sourceTree);
         var buildFile = this.Project.EnsureBuildFileExists(fileRef, this);
         return(buildFile);
     }
 }
 EnsureFileReferenceExists(
     Bam.Core.TokenizedString path,
     FileReference.EFileType type,
     bool explicitType = true,
     FileReference.ESourceTree sourceTree = FileReference.ESourceTree.NA)
 {
     return(this.EnsureFileReferenceExists(path, null, type, explicitType, sourceTree));
 }
Exemple #4
0
 EnsureFrameworksBuildFileExists(
     Bam.Core.TokenizedString path,
     FileReference.EFileType type)
 {
     lock (this.FrameworksBuildPhase)
     {
         var buildFile = this.EnsureBuildFileExists(path, type);
         this.FrameworksBuildPhase.Value.AddBuildFile(buildFile);
         return(buildFile);
     }
 }
Exemple #5
0
        EnsureBuildFileExists(
            Bam.Core.TokenizedString path,
            FileReference.EFileType type)
        {
            var fileRef = this.Project.EnsureFileReferenceExists(
                path,
                type,
                sourceTree: FileReference.ESourceTree.Absolute);
            var buildFile = this.Project.EnsureBuildFileExists(fileRef);

            return(buildFile);
        }
Exemple #6
0
 EnsureSourceBuildFileExists(
     Bam.Core.TokenizedString path,
     FileReference.EFileType type)
 {
     lock (this.SourcesBuildPhase)
     {
         var buildFile = this.EnsureBuildFileExists(path, type);
         this.AddFileRefToGroup(buildFile.FileRef);
         this.SourcesBuildPhase.Value.AddBuildFile(buildFile);
         return(buildFile);
     }
 }
Exemple #7
0
 EnsureOutputFileReferenceExists(
     Bam.Core.TokenizedString path,
     FileReference.EFileType type,
     Target.EProductType productType)
 {
     this.SetType(productType);
     System.Threading.LazyInitializer.EnsureInitialized(ref this.FileReference, () =>
     {
         var fileRef = this.Project.EnsureFileReferenceExists(path, type, sourceTree: FileReference.ESourceTree.BuiltProductsDir);
         this.Project.ProductRefGroup.AddChild(fileRef);
         return(fileRef);
     });
 }
Exemple #8
0
        EnsureOutputFileReferenceExists(
            Bam.Core.TokenizedString path,
            FileReference.EFileType type,
            Target.EProductType productType)
        {
            this.SetProductType(productType);

            var fileRef = this.Project.EnsureFileReferenceExists(path, type, sourceTree: FileReference.ESourceTree.BuiltProductsDir);

            if (null == this.FileReference)
            {
                this.FileReference = fileRef;
                this.Project.ProductRefGroup.AddChild(fileRef);
            }
        }
        public ReferenceProxy(
            Project project,
            FileReference.EFileType fileType,
            Bam.Core.TokenizedString path,
            Object remoteRef,
            FileReference.ESourceTree sourceTree)
            :
            base(project, null, "PBXReferenceProxy", project.GUID, fileType.ToString(), path.Parse(), remoteRef.GUID, sourceTree.ToString())
        {
            this.FileType   = fileType;
            this.Path       = path;
            this.RemoteRef  = remoteRef;
            this.SourceTree = sourceTree;

            project.ReferenceProxies.AddUnique(this);
        }
Exemple #10
0
        public ReferenceProxy(
            Project project,
            FileReference.EFileType fileType,
            Bam.Core.TokenizedString path,
            Object remoteRef,
            FileReference.ESourceTree sourceTree)
        {
            this.IsA        = "PBXReferenceProxy";
            this.Name       = "PBXReferenceProxy";
            this.FileType   = fileType;
            this.Path       = path;
            this.RemoteRef  = remoteRef;
            this.SourceTree = sourceTree;

            project.ReferenceProxies.AddUnique(this);
        }
Exemple #11
0
        EnsureFileOfTypeExists(
            Bam.Core.TokenizedString path,
            FileReference.EFileType type,
            string relativePath = null,
            bool explicitType   = true)
        {
            var sourceTree = (relativePath != null) ? FileReference.ESourceTree.SourceRoot : FileReference.ESourceTree.Absolute;
            var fileRef    = this.Project.EnsureFileReferenceExists(
                path,
                relativePath,
                type,
                explicitType: explicitType,
                sourceTree: sourceTree);

            this.AddFileRefToGroup(fileRef);
        }
Exemple #12
0
 EnsureFileReferenceExists(
     Bam.Core.TokenizedString path,
     FileReference.EFileType type,
     bool explicitType = true,
     FileReference.ESourceTree sourceTree = FileReference.ESourceTree.NA)
 {
     lock (this.FileReferences)
     {
         var existingFileRef = this.FileReferences.FirstOrDefault(item => item.Path.Equals(path));
         if (null != existingFileRef)
         {
             return(existingFileRef);
         }
         var newFileRef = new FileReference(path, type, this, explicitType, sourceTree);
         this.FileReferences.Add(newFileRef);
         return(newFileRef);
     }
 }
Exemple #13
0
        AsString(
            this FileReference.EFileType type)
        {
            switch (type)
            {
            case FileReference.EFileType.SourceCodeC:
                return("sourcecode.c.c");

            case FileReference.EFileType.SourceCodeCxx:
                return("sourcecode.cpp.cpp");

            case FileReference.EFileType.SourceCodeObjC:
                return("sourcecode.c.objc");

            case FileReference.EFileType.SourceCodeObjCxx:
                return("sourcecode.cpp.objcpp");

            case FileReference.EFileType.HeaderFile:
                return("sourcecode.c.h");

            case FileReference.EFileType.Archive:
                return("archive.ar");

            case FileReference.EFileType.Executable:
                return("compiled.mach-o.executable");

            case FileReference.EFileType.DynamicLibrary:
                return("compiled.mach-o.dylib");

            case FileReference.EFileType.WrapperFramework:
                return("wrapper.framework");

            case FileReference.EFileType.ApplicationBundle:
                return("wrapper.application");

            case FileReference.EFileType.Project:
                return("wrapper.pb-project");

            default:
                throw new Bam.Core.Exception("Unrecognized file type {0}", type.ToString());
            }
        }
Exemple #14
0
        EnsureSourceBuildFileExists(
            Bam.Core.TokenizedString path,
            FileReference.EFileType type)
        {
            lock (this)
            {
                if (null == this.SourcesBuildPhase)
                {
                    this.SourcesBuildPhase = new SourcesBuildPhase();
                    if (null == this.BuildPhases)
                    {
                        this.BuildPhases = new Bam.Core.Array <BuildPhase>();
                    }
                    this.BuildPhases.Add(this.SourcesBuildPhase);
                    this.Project.SourcesBuildPhases.Add(this.SourcesBuildPhase);
                }

                var buildFile = this.EnsureBuildFileExists(path, type);
                this.AddFileRefToGroup(buildFile.FileRef);
                this.SourcesBuildPhase.AddBuildFile(buildFile);
                return(buildFile);
            }
        }