Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 75711ac

Browse files
committed
Fixed VSIs to use the 2008 projects.
1 parent 9533f64 commit 75711ac

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

lib/DotNetOpenAuth.BuildTasks.dll

0 Bytes
Binary file not shown.

lib/DotNetOpenAuth.BuildTasks.pdb

2 KB
Binary file not shown.

projecttemplates/projecttemplates.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@
211211
Projects="@(ProjectTemplates2008Layout)"
212212
Condition="'%(Extension)' == '.csproj'"
213213
DowngradeMvc2ToMvc1="$(DowngradeMvc2ToMvc1)"
214+
InPlaceDowngrade="true"
214215
/>
215216

216217
<Purge Directories="$(ProjectTemplates2008LayoutPath)"

src/DotNetOpenAuth.BuildTasks/DowngradeProjects.cs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ public class DowngradeProjects : Task {
2525
[Required]
2626
public ITaskItem[] Projects { get; set; }
2727

28+
/// <summary>
29+
/// Gets or sets a value indicating whether project files are downgraded and re-saved to the same paths.
30+
/// </summary>
31+
public bool InPlaceDowngrade { get; set; }
32+
33+
/// <summary>
34+
/// Gets or sets the set of newly created project files. Empty if <see cref="InPlaceDowngrade"/> is <c>true</c>.
35+
/// </summary>
2836
[Output]
2937
public ITaskItem[] DowngradedProjects { get; set; }
3038

@@ -44,9 +52,12 @@ public override bool Execute() {
4452
switch (GetClassification(taskItem)) {
4553
case ProjectClassification.VS2010Project:
4654
case ProjectClassification.VS2010Solution:
47-
string projectNameForVS2008 = Path.Combine(
48-
Path.GetDirectoryName(taskItem.ItemSpec),
49-
Path.GetFileNameWithoutExtension(taskItem.ItemSpec) + "-vs2008" + Path.GetExtension(taskItem.ItemSpec));
55+
string projectNameForVS2008 = InPlaceDowngrade
56+
? taskItem.ItemSpec
57+
: Path.Combine(
58+
Path.GetDirectoryName(taskItem.ItemSpec),
59+
Path.GetFileNameWithoutExtension(taskItem.ItemSpec) + "-vs2008" +
60+
Path.GetExtension(taskItem.ItemSpec));
5061
newProjectToOldProjectMapping[taskItem.ItemSpec] = projectNameForVS2008;
5162
break;
5263
}
@@ -131,7 +142,11 @@ public override bool Execute() {
131142
}
132143
}
133144

134-
this.DowngradedProjects = createdProjectFiles.ToArray();
145+
if (InPlaceDowngrade) {
146+
this.DowngradedProjects = new ITaskItem[0];
147+
} else {
148+
this.DowngradedProjects = createdProjectFiles.ToArray();
149+
}
135150

136151
return !this.Log.HasLoggedErrors;
137152
}

0 commit comments

Comments
 (0)