public BuildFile EnsureBuildFileExists( FileReference fileRef) { lock (this.BuildFiles) { var existingBuildFile = this.BuildFiles.Where(item => item.FileRef == fileRef).FirstOrDefault(); if (null != existingBuildFile) { return existingBuildFile; } var newBuildFile = new BuildFile(fileRef); this.BuildFiles.Add(newBuildFile); return newBuildFile; } }
public FileReference EnsureFileReferenceExists( Bam.Core.TokenizedString path, FileReference.EFileType type, bool explicitType = true, FileReference.ESourceTree sourceTree = FileReference.ESourceTree.NA) { lock (this.FileReferences) { var existingFileRef = this.FileReferences.Where(item => item.Path.Equals(path)).FirstOrDefault(); if (null != existingFileRef) { return existingFileRef; } var newFileRef = new FileReference(path, type, this, explicitType, sourceTree); this.FileReferences.Add(newFileRef); return newFileRef; } }
private BuildFile 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; }
private void AddFileRefToGroup( FileReference fileRef) { var relDir = this.Module.CreateTokenizedString("@trimstart(@relativeto(@dir($(0)),$(packagedir)),../)", fileRef.Path); var newGroup = this.CreateGroupHierarchy(relDir); var parentGroup = newGroup; while (parentGroup.Parent != null) { parentGroup = parentGroup.Parent; if (parentGroup == this.Project.MainGroup) { break; } } this.Project.MainGroup.AddChild(parentGroup); newGroup.AddChild(fileRef); }
public BuildFile 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; } }
public void 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 BuildFile EnsureFrameworksBuildFileExists( Bam.Core.TokenizedString path, FileReference.EFileType type) { lock (this) { this.EnsureFrameworksBuildPhaseExists(); var buildFile = this.EnsureBuildFileExists(path, type); this.FrameworksBuildPhase.AddBuildFile(buildFile); return buildFile; } }