-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmartOrder.csproj
More file actions
143 lines (129 loc) · 5.16 KB
/
SmartOrder.csproj
File metadata and controls
143 lines (129 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<Version>0.2.2</Version>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>9cdec653-23e1-486d-8377-fa7decc71749</UserSecretsId>
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest>
<NoWarn>1591</NoWarn>
<NoWarn>$(NoWarn);NETSDK1057</NoWarn>
</PropertyGroup>
<!-- Third Party Dependencies -->
<ItemGroup>
<PackageReference Include="Auth0.AspNetCore.Authentication" Version="1.4.1" />
<PackageReference Include="AutoMapper" Version="12.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.*-*" />
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="8.*" />
<PackageReference Include="System.Drawing.Common" Version="8.*" />
</ItemGroup>
<ItemGroup>
<Reference Include="SMART.Common">
<HintPath>lib/SMART.Common.dll</HintPath>
</Reference>
<Reference Include="SMART.Common.Functions">
<HintPath>lib/SMART.Common.Functions.dll</HintPath>
</Reference>
<Reference Include="SMART.Utility.Globalization">
<HintPath>lib/SMART.Utility.Globalization.dll</HintPath>
</Reference>
</ItemGroup>
<!-- Internal Dependencies -->
<ItemGroup Condition="'$(Configuration)'!='Release'">
<ProjectReference Include="../SmartOrderApi/SmartOrderApi.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)'=='Release'">
<PackageReference Include="SmartOrderApi" Version="*" />
</ItemGroup>
<!--
Use local node_modules binaries if they exist.
If there is another directory, say in the CI/CD environment, that tailwindcss
is stored, then we should add another <Exec> to this block with the condition
that it only run when `'$(CI)' == 'true'`. That will ensure that this can find
the bin anytime
-->
<Target Name="UseLocalNodeModules" Condition="Exists('node_modules/.bin')">
<Exec Command="export PATH="$(MSBuildProjectDirectory)/node_modules/.bin:$PATH"" />
</Target>
<!-- Integrate TailwindCSS -->
<ItemGroup>
<!--
This gives us a list of files we can process in a loop later
Ultimately, we get an `IItemList[]` collection of files that are
found under `./Styles` with a `.css` extension. For each item in the list, a
property, `OutputPath`, will be attached, using `RecursiveDir` to maintain the
directory structure that was found below `./Styles`
-->
<CssStyles Include="./Styles/**/*.css">
<!-- %(RecursiveDir): The directory traversed during wildcard expansion -->
<!-- The other two are probably self-explanatory -->
<OutputPath>./wwwroot/css/%(RecursiveDir)%(Filename)%(Extension)</OutputPath>
</CssStyles>
</ItemGroup>
<PropertyGroup>
<TailwindCssPath>/usr/local/bin/tailwindcss</TailwindCssPath>
</PropertyGroup>
<Target Name="FindTailwindCss" DependsOnTargets="UseLocalNodeModules">
<Exec Command="where tailwindcss" ConsoleToMSBuild="true" Condition="'$(OS)' == 'Windows_NT'">
<Output TaskParameter="ConsoleOutput" PropertyName="TailwindCssPath" />
</Exec>
<Exec Command="command -v tailwindcss" ConsoleToMSBuild="true" Condition="'$(OS)' != 'Windows_NT'">
<Output TaskParameter="ConsoleOutput" PropertyName="TailwindCssPath" />
</Exec>
</Target>
<Target
Name="ProcessScopedCssFilesWithTailwind"
AfterTargets="_GenerateScopedCssFiles"
>
<MSBuild
Projects="$(MSBuildProjectFile)"
Properties="CurrentScopedCssFile=%(_ScopedCssOutputs.Identity)"
Targets="ProcessScopedCssFileWithTailwind"
>
</MSBuild>
</Target>
<Target
Name="ProcessScopedCssFileWithTailwind"
DependsOnTargets="FindTailwindCss"
>
<Message
Importance="high"
Text="Processing with Tailwind: $(CurrentScopedCssFile)"
/>
<Exec
Command="$(TailwindCssPath) -i $(CurrentScopedCssfile) -o $(CurrentScopedCssFile)"
WorkingDirectory="$(MSBuildProjectDirectory)"
/>
</Target>
<!-- Normal build process -->
<Target
Name="CleanTailwindCss"
BeforeTargets="PreBuildEvent"
>
<Exec
Command="rm -f ./wwwroot/css/*.css"
WorkingDirectory="$(MSBuildProjectDirectory)"
/>
</Target>
<Target
Name="BuildTailwindCss"
BeforeTargets="PreBuildEvent"
DependsOnTargets="CleanTailwindCss;FindTailwindCss;"
Inputs="@(CssStyles)"
Outputs="%(CssStyles.OutputPath)"
>
<Exec
Command="$(TailwindCssPath) build -i %(CssStyles.Identity) -o %(CssStyles.OutputPath)"
WorkingDirectory="$(MSBuildProjectDirectory)"
/>
</Target>
<!-- run tailwindcss watch process by using `dotnet watch run` (or just `dotnet watch`)-->
<!-- <Target
Name="Watch TailwindCss"
BeforeTargets="PreBuildEvent"
DependsOnTargets="FindTailwindCss"
Condition="'$(DotNetWatchBuild)' == 'true'"
>
<Exec Command="$(TailwindCssPath) build -i ./Styles/site.css -o ./wwwroot/css/site.css -w" />
</Target> -->
</Project>