Skip to content

Commit

Permalink
[Csproj] Add the ability for a project to specify its default copy be…
Browse files Browse the repository at this point in the history
…havior for content items.
  • Loading branch information
kudaba committed Feb 10, 2022
1 parent 8d18cd4 commit b16ac73
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 1 addition & 8 deletions Sharpmake.Generators/VisualStudio/Csproj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1630,13 +1630,6 @@ private static void WriteCustomProperties(Dictionary<string, string> customPrope
}
}

internal enum CopyToOutputDirectory
{
Never,
Always,
PreserveNewest
}

private void GenerateFiles(
CSharpProject project,
List<Project.Configuration> configurations,
Expand All @@ -1650,7 +1643,7 @@ List<string> skipFiles
foreach (var file in project.ResolvedContentFullFileNames)
{
string include = Util.PathGetRelative(_projectPathCapitalized, file);
itemGroups.Contents.Add(new ItemGroups.Content { Include = include, LinkFolder = project.GetLinkFolder(include) });
itemGroups.Contents.Add(new ItemGroups.Content { Include = include, CopyToOutputDirectory = project.DefaultContentCopyOperation, LinkFolder = project.GetLinkFolder(include) });
}


Expand Down
8 changes: 8 additions & 0 deletions Sharpmake/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2060,6 +2060,13 @@ public enum FileType
Assembly,
File
}

public enum CopyToOutputDirectory
{
Never,
Always,
PreserveNewest
}

public class PublishFile
{
Expand Down Expand Up @@ -2258,6 +2265,7 @@ public void AddDefaultReferences(Configuration conf)
public class CSharpProject : Project
{
public Strings ContentExtension = new Strings();
public CopyToOutputDirectory? DefaultContentCopyOperation = null;
public Strings VsctExtension = new Strings(".vsct");
public CSharpProjectType ProjectTypeGuids = CSharpProjectType.Default;
public CSharpProjectSchema ProjectSchema = CSharpProjectSchema.Default;
Expand Down

0 comments on commit b16ac73

Please sign in to comment.