source: Farmatiko/Farmatiko.csproj@ ad60966

Last change on this file since ad60966 was d23bf72, checked in by DimitarSlezenkovski <dslezenkovski@…>, 3 years ago

Add SystemService, Auth, fix a lil bugs :)

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