Skip to content

Commit

Permalink
Made the Quoter service work again
Browse files Browse the repository at this point in the history
- Wrapped the csproj in a project.json so that the references work
- Commit the project.lock.json for the wrapped proejct because VS
doesn't restore project references in other project.json files outside
of the solution (bug)
- Remove coreclr support (until the quoter itself supports .NET Core)
- Downgrade the Quoter to .NET 4.6
  • Loading branch information
davidfowl committed Feb 24, 2016
1 parent 6a5f93c commit a8c7895
Show file tree
Hide file tree
Showing 9 changed files with 2,143 additions and 21 deletions.
6 changes: 5 additions & 1 deletion Quoter.sln
Expand Up @@ -9,11 +9,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{6FCB47
ProjectSection(SolutionItems) = preProject
.nuget\NuGet.Config = .nuget\NuGet.Config
.nuget\NuGet.exe = .nuget\NuGet.exe
.nuget\NuGet.targets = .nuget\NuGet.targets
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "QuoterService", "src\QuoterService\QuoterService.xproj", "{5A5372E1-6DE1-46E5-ABF1-EE5515C8EA3C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B30A4555-BB08-46D0-BEB5-31FC122F89CD}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
9 changes: 9 additions & 0 deletions global.json
@@ -0,0 +1,9 @@
{
"projects": [
"src",
"wrap"
],
"sdk": {
"version": "1.0.0-rc1-update1"
}
}
10 changes: 2 additions & 8 deletions src/Quoter/Quoter.csproj
Expand Up @@ -7,7 +7,7 @@
<ProjectGuid>{927AB47F-479C-423A-B21F-5DEC48533E1D}</ProjectGuid>
<OutputType>Exe</OutputType>
<AssemblyName>Quoter</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<UseVSHostingProcess>false</UseVSHostingProcess>
<Prefer32Bit>false</Prefer32Bit>
Expand Down Expand Up @@ -70,16 +70,10 @@
<Compile Include="Tests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
</Project>
3 changes: 3 additions & 0 deletions src/Quoter/app.config
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
18 changes: 9 additions & 9 deletions src/QuoterService/Controllers/QuoterController.cs
Expand Up @@ -31,16 +31,16 @@ public class QuoterController : Controller
{
try
{
//var quoter = new Quoter
//{
// OpenParenthesisOnNewLine = openCurlyOnNewLine,
// ClosingParenthesisOnNewLine = closeCurlyOnNewLine,
// UseDefaultFormatting = !preserveOriginalWhitespace,
// RemoveRedundantModifyingCalls = !keepRedundantApiCalls,
// ShortenCodeWithUsingStatic = !avoidUsingStatic
//};
var quoter = new Quoter
{
OpenParenthesisOnNewLine = openCurlyOnNewLine,
ClosingParenthesisOnNewLine = closeCurlyOnNewLine,
UseDefaultFormatting = !preserveOriginalWhitespace,
RemoveRedundantModifyingCalls = !keepRedundantApiCalls,
ShortenCodeWithUsingStatic = !avoidUsingStatic
};

//responseText = quoter.Quote(sourceText);
responseText = quoter.Quote(sourceText);
}
catch (Exception ex)
{
Expand Down
5 changes: 4 additions & 1 deletion src/QuoterService/QuoterService.xproj
Expand Up @@ -14,5 +14,8 @@
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Quoter\Quoter.csproj" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
</Project>
7 changes: 5 additions & 2 deletions src/QuoterService/project.json
Expand Up @@ -21,8 +21,11 @@
},

"frameworks": {
"dnx451": { },
"dnxcore50": { }
"dnx46": {
"dependencies": {
"Quoter": "1.0.0-*"
}
}
},

"exclude": [
Expand Down
21 changes: 21 additions & 0 deletions wrap/Quoter/project.json
@@ -0,0 +1,21 @@
{
"version": "1.0.0-*",
"frameworks": {
"net46": {
"wrappedProject": "../../src/Quoter/Quoter.csproj",
"bin": {
"assembly": "../../src/Quoter/obj/{configuration}/Quoter.exe",
"pdb": "../../src/Quoter/obj/{configuration}/Quoter.pdb"
},
"dependencies": {
"Microsoft.CodeAnalysis.Common": "1.1.1",
"Microsoft.CodeAnalysis.CSharp": "1.1.1",
"Microsoft.CodeAnalysis.CSharp.Scripting": "1.1.1",
"Microsoft.CodeAnalysis.Scripting.Common": "1.1.1",
"System.Collections.Immutable": "1.1.37",
"System.IO.FileSystem": "4.0.0",
"System.Reflection.Metadata": "1.1.0"
}
}
}
}

0 comments on commit a8c7895

Please sign in to comment.