Permalink
Browse files

Replacing RazorGenerator custom tool with msbuild task

  • Loading branch information...
1 parent eb0b39e commit 9d7862e099d385575456ebf730dabae9850aebb3 @pranavkm pranavkm committed Dec 9, 2011
Showing with 176 additions and 8,817 deletions.
  1. BIN 3rdParty/RazorGenerator/RazorGenerator.Core.dll
  2. BIN 3rdParty/RazorGenerator/RazorGenerator.MsBuild.dll
  3. +23 −0 3rdParty/RazorGenerator/RazorGenerator.targets
  4. +1 −5 Scripts/NuGetGallery.msbuild
  5. +94 −92 Website/{Views/Helpers → App_Code}/ViewHelpers.cshtml
  6. +1 −35 Website/AuthenticationController.generated.cs
  7. +0 −7 Website/Controllers/ForgotPasswordViewModel.cs
  8. +0 −46 Website/DataServices/FeedPackage.cs
  9. +0 −3 Website/DataServices/Feeds.svc
  10. +0 −110 Website/DataServices/Feeds.svc.cs
  11. +0 −17 Website/DataServices/FeedsContext.cs
  12. 0 Website/DataServices/{V1Feeds.svc → V1Feed.svc}
  13. 0 Website/DataServices/{V1Feeds.svc.cs → V1Feed.svc.cs}
  14. +2 −1 Website/Errors/404.cshtml
  15. +2 −1 Website/Errors/ErrorLayout.cshtml
  16. +2 −1 Website/Errors/_PageStart.cshtml
  17. +8 −26 Website/Properties/AssemblyInfo.cs
  18. +0 −202 Website/Views/Authentication/LogOn.generated.cs
  19. +0 −648 Website/Views/Helpers/ViewHelpers.generated.cs
  20. +0 −135 Website/Views/Packages/ConfirmOwner.generated.cs
  21. +0 −234 Website/Views/Packages/ContactOwners.generated.cs
  22. +0 −219 Website/Views/Packages/Delete.generated.cs
  23. +0 −1,115 Website/Views/Packages/DisplayPackage.generated.cs
  24. +0 −94 Website/Views/Packages/Download.generated.cs
  25. +0 −88 Website/Views/Packages/Edit.generated.cs
  26. +0 −254 Website/Views/Packages/ListPackages.generated.cs
  27. +0 −211 Website/Views/Packages/ManagePackageOwners.generated.cs
  28. +0 −263 Website/Views/Packages/ReportAbuse.generated.cs
  29. +0 −120 Website/Views/Packages/UploadPackage.generated.cs
  30. +0 −355 Website/Views/Packages/VerifyPackage.generated.cs
  31. +0 −346 Website/Views/Packages/_ListPackage.generated.cs
  32. +0 −95 Website/Views/Pages/Home.generated.cs
  33. +0 −217 Website/Views/Pages/Privacy.generated.cs
  34. +0 −278 Website/Views/Pages/Terms.generated.cs
  35. +0 −181 Website/Views/Shared/EditorTemplates/Object.generated.cs
  36. +0 −98 Website/Views/Shared/Error.generated.cs
  37. +0 −342 Website/Views/Shared/Layout.generated.cs
  38. +0 −95 Website/Views/Shared/TwoColumnLayout.generated.cs
  39. +0 −137 Website/Views/Shared/UserDisplay.generated.cs
  40. +0 −200 Website/Views/Users/Account.generated.cs
  41. +0 −157 Website/Views/Users/ChangePassword.generated.cs
  42. +0 −146 Website/Views/Users/Confirm.generated.cs
  43. +0 −240 Website/Views/Users/Edit.generated.cs
  44. +0 −159 Website/Views/Users/ForgotPassword.generated.cs
  45. +0 −419 Website/Views/Users/Packages.generated.cs
  46. +0 −58 Website/Views/Users/PasswordChanged.generated.cs
  47. +0 −115 Website/Views/Users/PasswordSent.generated.cs
  48. +0 −289 Website/Views/Users/Profiles.generated.cs
  49. +0 −170 Website/Views/Users/Register.generated.cs
  50. +0 −169 Website/Views/Users/ResendConfirmation.generated.cs
  51. +0 −159 Website/Views/Users/ResetPassword.generated.cs
  52. +0 −140 Website/Views/Users/Thanks.generated.cs
  53. +43 −325 Website/Website.csproj
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,23 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <RazorGeneratorMsBuildPath Condition=" '$(RazorGeneratorMsBuildPath)' == '' ">$(MSBuildThisFileDirectory)\RazorGenerator.MsBuild.dll</RazorGeneratorMsBuildPath>
+
+ <CompileDependsOn>
+ PrecompileRazorFiles;
+ $(CompileDependsOn);
+ </CompileDependsOn>
+ </PropertyGroup>
+
+ <UsingTask AssemblyFile="$(RazorGeneratorMsBuildPath)" TaskName="RazorCodeGen" />
+ <Target Name="PrecompileRazorFiles" Returns="@(FilesGenerated)">
+ <ItemGroup>
+ <RazorSrcFiles Include="**\*.cshtml" />
+ </ItemGroup>
+ <RazorCodeGen ProjectRoot="$(MsBuildProjectDirectory)" FilesToPrecompile="@(RazorSrcFiles)" RootNamespace="$(RootNamespace)">
+ <Output TaskParameter="GeneratedFiles" ItemName="FilesGenerated" />
+ </RazorCodeGen>
+ <ItemGroup>
+ <Compile Include="@(FilesGenerated)" />
+ </ItemGroup>
+ </Target>
+</Project>
@@ -28,12 +28,8 @@
<UpdateDatabase />
</Target>
- <Target Name="BuildViews" DependsOnTargets="Build">
- <MSBuild Projects="..\Website\Website.csproj" Targets="MvcBuildViews" Properties="MvcBuildViews=true" />
- </Target>
-
<Target Name="CIBuild" DependsOnTargets="RunFacts" />
- <Target Name="FullBuild" DependsOnTargets="RunFacts;UpdateDatabase;BuildViews" />
+ <Target Name="FullBuild" DependsOnTargets="RunFacts;UpdateDatabase" />
</Project>
@@ -1,93 +1,95 @@
- @* Generator: MvcHelper *@
-
-@using System.Linq;
-@using System.Collections;
-@using NuGetGallery;
-
-@helper PreviousNextPager(IPreviousNextPager pager) {
- if (pager.HasNextPage || pager.HasPreviousPage) {
- <ul class="pager">
- <li class="previous">
- @if (pager.HasPreviousPage) {
- <a href="@pager.PreviousPageUrl" title="Go to the previous page.">Previous</a>
- }
- else {
- <text>Previous</text>
- }
- </li>
- <li class="next">
- @if (pager.HasNextPage) {
- <a href="@pager.NextPageUrl" title="Go to the next page.">Next</a>
- }
- else {
- <text>Next</text>
- }
- </li>
- </ul>
- }
-}
-
-@helper Option(string value, string label, string currentValue) {
- <option value="@value" @if (value == currentValue) {<text>selected="selected"</text>}>@label</option>
-}
-
-@helper UploadSequence(int currentStep) {
- <ol class="sequence">
- @SequenceStep(1, "Upload", currentStep)
- @SequenceStep(2, "Verify Details", currentStep)
- @SequenceStep(3, "Enjoy", currentStep)
- </ol>
- <div class="clear-fix"><!--Sad Panda--></div>
-}
-
-@helper SequenceStep(int step, string caption, int currentStep) {
- if (currentStep > step) {
- <li class="past">@caption</li>
- }
- else if (currentStep == step) {
- <li class="current">@caption</li>
- }
- else {
- <li>@caption</li>
- }
-}
-
-@helper OwnersGravatar(IEnumerable<User> owners, int size, UrlHelper url, bool showName = true) {
- <ul class="owners">
- @foreach (var owner in owners) {
- <li>
- @ViewHelpers.OwnerGravatar(owner, size, url, showName)
- </li>
- }
- </ul>
-}
-
-@helper OwnerGravatar(User owner, int size, UrlHelper url, bool showName = true) {
- <a class="owner" href="@url.Action(MVC.Users.Profiles(owner.Username))" title="@owner.Username">
- @GravatarImage(owner.EmailAddress, owner.Username, size)
- @if (showName) {
- <text>@owner.Username</text>
- }
- </a>
-}
-
-@helper GravatarImage(string email, string username, int size) {
- <text>
- @Gravatar.GetHtml(email, size, "retro", GravatarRating.G, attributes: new { width = size, height = size, title = username, @class = "owner-image" })
- </text>
-}
-
-@helper ReleaseTag(){
- string name = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseName"];
- string sha = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseSha"];
- string branch = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseBranch"];
- string time = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseTime"];
- if(!String.IsNullOrEmpty(name) && !String.IsNullOrEmpty(sha) && !String.IsNullOrEmpty(branch) && !String.IsNullOrEmpty(time)){
- <p id="releaseTag">
- @name -
- Deployed from <a href="https://github.com/NuGet/NuGetGallery/commit/@sha" title="View the commit.">@sha.Substring(0,10)</a>
- on <a href="https://github.com/NuGet/NuGetGallery/branches/@branch" title="View the branch.">@branch</a>
- at @time.
- </p>
- }
+ @* Generator: MvcHelper *@
+
+@using System.Linq;
+@using System.Collections;
+@using System.Web.Mvc;
+@using Microsoft.Web.Helpers;
+@using NuGetGallery;
+
+@helper PreviousNextPager(IPreviousNextPager pager) {
+ if (pager.HasNextPage || pager.HasPreviousPage) {
+ <ul class="pager">
+ <li class="previous">
+ @if (pager.HasPreviousPage) {
+ <a href="@pager.PreviousPageUrl" title="Go to the previous page.">Previous</a>
+ }
+ else {
+ <text>Previous</text>
+ }
+ </li>
+ <li class="next">
+ @if (pager.HasNextPage) {
+ <a href="@pager.NextPageUrl" title="Go to the next page.">Next</a>
+ }
+ else {
+ <text>Next</text>
+ }
+ </li>
+ </ul>
+ }
+}
+
+@helper Option(string value, string label, string currentValue) {
+ <option value="@value" @if (value == currentValue) {<text>selected="selected"</text>}>@label</option>
+}
+
+@helper UploadSequence(int currentStep) {
+ <ol class="sequence">
+ @SequenceStep(1, "Upload", currentStep)
+ @SequenceStep(2, "Verify Details", currentStep)
+ @SequenceStep(3, "Enjoy", currentStep)
+ </ol>
+ <div class="clear-fix"><!--Sad Panda--></div>
+}
+
+@helper SequenceStep(int step, string caption, int currentStep) {
+ if (currentStep > step) {
+ <li class="past">@caption</li>
+ }
+ else if (currentStep == step) {
+ <li class="current">@caption</li>
+ }
+ else {
+ <li>@caption</li>
+ }
+}
+
+@helper OwnersGravatar(IEnumerable<User> owners, int size, UrlHelper url, bool showName = true) {
+ <ul class="owners">
+ @foreach (var owner in owners) {
+ <li>
+ @ViewHelpers.OwnerGravatar(owner, size, url, showName)
+ </li>
+ }
+ </ul>
+}
+
+@helper OwnerGravatar(User owner, int size, UrlHelper url, bool showName = true) {
+ <a class="owner" href="@url.Action(MVC.Users.Profiles(owner.Username))" title="@owner.Username">
+ @GravatarImage(owner.EmailAddress, owner.Username, size)
+ @if (showName) {
+ <text>@owner.Username</text>
+ }
+ </a>
+}
+
+@helper GravatarImage(string email, string username, int size) {
+ <text>
+ @Gravatar.GetHtml(email, size, "retro", GravatarRating.G, attributes: new { width = size, height = size, title = username, @class = "owner-image" })
+ </text>
+}
+
+@helper ReleaseTag(){
+ string name = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseName"];
+ string sha = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseSha"];
+ string branch = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseBranch"];
+ string time = System.Configuration.ConfigurationManager.AppSettings["Gallery:ReleaseTime"];
+ if(!String.IsNullOrEmpty(name) && !String.IsNullOrEmpty(sha) && !String.IsNullOrEmpty(branch) && !String.IsNullOrEmpty(time)){
+ <p id="releaseTag">
+ @name -
+ Deployed from <a href="https://github.com/NuGet/NuGetGallery/commit/@sha" title="View the commit.">@sha.Substring(0,10)</a>
+ on <a href="https://github.com/NuGet/NuGetGallery/branches/@branch" title="View the branch.">@branch</a>
+ at @time.
+ </p>
+ }
}
@@ -20,14 +20,8 @@
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
-
-
-
namespace NuGetGallery {
-
public partial class AuthenticationController {
-
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
protected AuthenticationController(Dummy d) { }
@@ -37,14 +31,12 @@ public partial class AuthenticationController {
return RedirectToRoute(callInfo.RouteValueDictionary);
}
-
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public System.Web.Mvc.ActionResult LogOff() {
return new T4MVC_ActionResult(Area, Name, ActionNames.LogOff);
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public AuthenticationController Actions { get { return MVC.Authentication; } }
[GeneratedCode("T4MVC", "2.0")]
@@ -57,70 +49,44 @@ public partial class AuthenticationController {
public ActionNamesClass ActionNames { get { return s_actions; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionNamesClass {
-
-
public readonly string LogOn = "LogOn";
-
-
public readonly string LogOff = "LogOff";
-
}
-
static readonly ViewNames s_views = new ViewNames();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewNames Views { get { return s_views; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ViewNames {
-public readonly string LogOn = "~/Views/Authentication/LogOn.cshtml";
-
+ public readonly string LogOn = "~/Views/Authentication/LogOn.cshtml";
}
}
-
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class T4MVC_AuthenticationController: NuGetGallery.AuthenticationController {
public T4MVC_AuthenticationController() : base(Dummy.Instance) { }
-
public override System.Web.Mvc.ActionResult LogOn() {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.LogOn);
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult LogOn(NuGetGallery.SignInRequest request, string returnUrl) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.LogOn);
-
-
callInfo.RouteValueDictionary.Add("request", request);
-
callInfo.RouteValueDictionary.Add("returnUrl", returnUrl);
-
-
return callInfo;
}
-
public override System.Web.Mvc.ActionResult LogOff(string returnUrl) {
var callInfo = new T4MVC_ActionResult(Area, Name, ActionNames.LogOff);
-
-
callInfo.RouteValueDictionary.Add("returnUrl", returnUrl);
-
-
return callInfo;
}
-
}
-
-
}
-
-
#endregion T4MVC
#pragma warning restore 1591
@@ -1,7 +0,0 @@
-
-namespace NuGetGallery.Controllers
-{
- class ForgotPasswordViewModel
- {
- }
-}
@@ -1,46 +0,0 @@
-using System;
-using System.Data.Services.Common;
-
-namespace NuGetGallery {
- [HasStream]
- [DataServiceKey("Id", "Version")]
- [EntityPropertyMapping("Id", SyndicationItemProperty.Title, SyndicationTextContentKind.Plaintext, keepInContent: false)]
- [EntityPropertyMapping("Authors", SyndicationItemProperty.AuthorName, SyndicationTextContentKind.Plaintext, keepInContent: false)]
- [EntityPropertyMapping("LastUpdated", SyndicationItemProperty.Updated, SyndicationTextContentKind.Plaintext, keepInContent: false)]
- [EntityPropertyMapping("Summary", SyndicationItemProperty.Summary, SyndicationTextContentKind.Plaintext, keepInContent: false)]
- public class FeedPackage {
- public string Id { get; set; }
- public string Version { get; set; }
-
- public string Authors { get; set; }
- public string Copyright { get; set; }
- public DateTime Created { get; set; }
- public string Dependencies { get; set; }
- public string Description { get; set; }
- public int DownloadCount { get; set; }
- public string ExternalPackageUri { get; set; }
- public string GalleryDetailsUrl { get; set; }
- public string IconUrl { get; set; }
- public bool IsLatestVersion { get; set; }
- public bool IsAbsoluteLatestVersion { get; set; }
- public DateTime LastUpdated { get; set; }
- public string LicenseUrl { get; set; }
- public string PackageHash { get; set; }
- public string PackageHashAlgorithm { get; set; }
- public long PackageSize { get; set; }
- public string ProjectUrl { get; set; }
- public DateTime? Published { get; set; }
- public string ReportAbuseUrl { get; set; }
- public bool RequireLicenseAcceptance { get; set; }
- public string Summary { get; set; }
- public string Tags { get; set; }
- public string Title { get; set; }
- public int VersionDownloadCount { get; set; }
-
- // TODO: remove these from the feed in the future, is possible, if they aren't used
- public string Categories { get { return string.Empty; } }
- public string Language { get { return ""; } }
- public string PackageType { get { return "Package"; } }
- public decimal Price { get { return 0; } }
- }
-}
@@ -1,3 +0,0 @@
-
-
-<%@ ServiceHost Language="C#" Factory="System.Data.Services.DataServiceHostFactory, System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Service="NuGetGallery.Feeds" %>
Oops, something went wrong.

0 comments on commit 9d7862e

Please sign in to comment.