source: Farmatiko/Farmatiko.csproj@ 8e74e2f

Last change on this file since 8e74e2f was 1db5673, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago

Fix bugs, add some more

  • Property mode set to 100644
File size: 4.1 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 <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
55 <!-- Ensure Node.js is installed -->
56 <Exec Command="node --version" ContinueOnError="true">
57 <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
58 </Exec>
59 <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." />
60 <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
61 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
62 </Target>
63
64 <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
65 <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
66 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
67 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
68 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
69
70 <!-- Include the newly-built files in the publish output -->
71 <ItemGroup>
72 <DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
73 <DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
74 <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
75 <RelativePath>%(DistFiles.Identity)</RelativePath>
76 <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
77 <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
78 </ResolvedFileToPublish>
79 </ItemGroup>
80 </Target>
81
82</Project>
Note: See TracBrowser for help on using the repository browser.