source: Farmatiko/Farmatiko.csproj@ e0cdea2

Last change on this file since e0cdea2 was e0cdea2, checked in by Dimitar Slezenkovski <dslezenkovski@…>, 3 years ago

Fix all bugs

  • Property mode set to 100644
File size: 4.2 KB
Line 
1<Project Sdk="Microsoft.NET.Sdk.Web">
2
3 <PropertyGroup>
4 <TargetFramework>netcoreapp3.1</TargetFramework>
5 <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
6 <TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
7 <IsPackable>false</IsPackable>
8 <SpaRoot>ClientApp\</SpaRoot>
9 <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
10
11 <!-- Set this to true if you enable server-side prerendering -->
12 <BuildServerSideRenderer>false</BuildServerSideRenderer>
13 </PropertyGroup>
14
15 <ItemGroup>
16 <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.9" />
17 <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.10" />
18 <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.10" />
19 <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="3.1.6" />
20 <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.10" />
21 <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.10">
22 <PrivateAssets>all</PrivateAssets>
23 <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
24 </PackageReference>
25 <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.10">
26 <PrivateAssets>all</PrivateAssets>
27 <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28 </PackageReference>
29 <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
30 <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
31 </ItemGroup>
32
33 <ItemGroup>
34 <!-- Don't publish the SPA source files, but do show them in the project files list -->
35 <Content Remove="$(SpaRoot)**" />
36 <None Remove="$(SpaRoot)**" />
37 <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
38 </ItemGroup>
39
40 <ItemGroup>
41 <Compile Remove="Controllers\WeatherForecastController.cs" />
42 <Compile Remove="WeatherForecast.cs" />
43 </ItemGroup>
44
45 <ItemGroup>
46 <None Include="..\.editorconfig" Link=".editorconfig" />
47 </ItemGroup>
48
49 <ItemGroup>
50 <ProjectReference Include="..\FarmatikoData\FarmatikoData.csproj" />
51 <ProjectReference Include="..\FarmatikoServices\FarmatikoServices.csproj" />
52 </ItemGroup>
53
54 <ItemGroup>
55 <Folder Include="ExcellDocs\" />
56 </ItemGroup>
57
58 <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
59 <!-- Ensure Node.js is installed -->
60 <Exec Command="node --version" ContinueOnError="true">
61 <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
62 </Exec>
63 <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
64 <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
65 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
66 </Target>
67
68 <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
69 <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
70 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
71 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
72 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
73
74 <!-- Include the newly-built files in the publish output -->
75 <ItemGroup>
76 <DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
77 <DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
78 <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
79 <RelativePath>%(DistFiles.Identity)</RelativePath>
80 <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
81 <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
82 </ResolvedFileToPublish>
83 </ItemGroup>
84 </Target>
85
86</Project>
Note: See TracBrowser for help on using the repository browser.