source: Farmatiko/Farmatiko.csproj@ 96108d8

Last change on this file since 96108d8 was 46c298d, checked in by DimitarSlezenkovski <dslezenkovski@…>, 4 years ago

Format code

  • Property mode set to 100644
File size: 3.5 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.SpaServices.Extensions" Version="3.1.6" />
17 <PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.6" />
18 <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.6">
19 <PrivateAssets>all</PrivateAssets>
20 <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
21 </PackageReference>
22 <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6">
23 <PrivateAssets>all</PrivateAssets>
24 <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
25 </PackageReference>
26 <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
27 </ItemGroup>
28
29 <ItemGroup>
30 <!-- Don't publish the SPA source files, but do show them in the project files list -->
31 <Content Remove="$(SpaRoot)**" />
32 <None Remove="$(SpaRoot)**" />
33 <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
34 </ItemGroup>
35
36 <ItemGroup>
37 <ProjectReference Include="..\FarmatikoData\FarmatikoData.csproj" />
38 </ItemGroup>
39
40 <ItemGroup>
41 <Folder Include="Services\" />
42 </ItemGroup>
43
44 <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
45 <!-- Ensure Node.js is installed -->
46 <Exec Command="node --version" ContinueOnError="true">
47 <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
48 </Exec>
49 <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." />
50 <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
51 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
52 </Target>
53
54 <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
55 <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
56 <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
57 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --prod" />
58 <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr -- --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
59
60 <!-- Include the newly-built files in the publish output -->
61 <ItemGroup>
62 <DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
63 <DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
64 <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
65 <RelativePath>%(DistFiles.Identity)</RelativePath>
66 <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
67 <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
68 </ResolvedFileToPublish>
69 </ItemGroup>
70 </Target>
71
72</Project>
Note: See TracBrowser for help on using the repository browser.