Skip to content

Commit b16ac73

Browse files
committed
[Csproj] Add the ability for a project to specify its default copy behavior for content items.
1 parent 8d18cd4 commit b16ac73

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Sharpmake.Generators/VisualStudio/Csproj.cs

+1-8
Original file line numberDiff line numberDiff line change
@@ -1630,13 +1630,6 @@ private static void WriteCustomProperties(Dictionary<string, string> customPrope
16301630
}
16311631
}
16321632

1633-
internal enum CopyToOutputDirectory
1634-
{
1635-
Never,
1636-
Always,
1637-
PreserveNewest
1638-
}
1639-
16401633
private void GenerateFiles(
16411634
CSharpProject project,
16421635
List<Project.Configuration> configurations,
@@ -1650,7 +1643,7 @@ List<string> skipFiles
16501643
foreach (var file in project.ResolvedContentFullFileNames)
16511644
{
16521645
string include = Util.PathGetRelative(_projectPathCapitalized, file);
1653-
itemGroups.Contents.Add(new ItemGroups.Content { Include = include, LinkFolder = project.GetLinkFolder(include) });
1646+
itemGroups.Contents.Add(new ItemGroups.Content { Include = include, CopyToOutputDirectory = project.DefaultContentCopyOperation, LinkFolder = project.GetLinkFolder(include) });
16541647
}
16551648

16561649

Sharpmake/Project.cs

+8
Original file line numberDiff line numberDiff line change
@@ -2060,6 +2060,13 @@ public enum FileType
20602060
Assembly,
20612061
File
20622062
}
2063+
2064+
public enum CopyToOutputDirectory
2065+
{
2066+
Never,
2067+
Always,
2068+
PreserveNewest
2069+
}
20632070

20642071
public class PublishFile
20652072
{
@@ -2258,6 +2265,7 @@ public void AddDefaultReferences(Configuration conf)
22582265
public class CSharpProject : Project
22592266
{
22602267
public Strings ContentExtension = new Strings();
2268+
public CopyToOutputDirectory? DefaultContentCopyOperation = null;
22612269
public Strings VsctExtension = new Strings(".vsct");
22622270
public CSharpProjectType ProjectTypeGuids = CSharpProjectType.Default;
22632271
public CSharpProjectSchema ProjectSchema = CSharpProjectSchema.Default;

0 commit comments

Comments
 (0)