IoTSharp.csproj 5.5 KB
Newer Older
麦壳饼's avatar
麦壳饼 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <Company>IoT#</Company>
    <Product>IoTSharp</Product>
    <Authors>IoT#</Authors>
    <PackageProjectUrl>https://github.com/IoTSharp/IoTSharp</PackageProjectUrl>
    <PackageLicenseUrl>https://github.com/IoTSharp/IoTSharp/blob/master/LICENSE</PackageLicenseUrl>
    <RepositoryUrl>https://github.com/IoTSharp/IoTSharp</RepositoryUrl>
    <PackageReleaseNotes>
      Open-source IoT Platform - Device management, data collection, processing and visualization.   https://www.iotsharp.net
    </PackageReleaseNotes>
麦壳饼's avatar
麦壳饼 已提交
14
    <Description>Open-source IoT Platform - Device management, data collection, processing and visualization.</Description>
麦壳饼's avatar
麦壳饼 已提交
15
    <PackageId>IoTSharp</PackageId>
麦壳饼's avatar
麦壳饼 已提交
16
    <UserSecretsId>18970590-05bf-4a1f-a70b-3c8a120d12cb</UserSecretsId>
麦壳饼's avatar
麦壳饼 已提交
17 18 19 20 21 22 23
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
    <TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
    <IsPackable>false</IsPackable>
    <SpaRoot>ClientApp\</SpaRoot>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>

    <!-- Set this to true if you enable server-side prerendering -->
麦壳饼's avatar
麦壳饼 已提交
24
    <BuildServerSideRenderer>true</BuildServerSideRenderer>
麦壳饼's avatar
麦壳饼 已提交
25
  </PropertyGroup>
麦壳饼's avatar
麦壳饼 已提交
26 27 28 29 30 31 32

  <ItemGroup>
    <Compile Remove="Migrations\**" />
    <Content Remove="Migrations\**" />
    <EmbeddedResource Remove="Migrations\**" />
    <None Remove="Migrations\**" />
  </ItemGroup>
麦壳饼's avatar
麦壳饼 已提交
33
  <ItemGroup>
麦壳饼's avatar
麦壳饼 已提交
34
    <PackageReference Include="Changwei.AspNetCore.SpaServices.Extensions.VueCli" Version="1.0.0" />
麦壳饼's avatar
麦壳饼 已提交
35 36 37 38 39 40 41 42
    <PackageReference Include="IoTSharp.X509Extensions" Version="1.3.3" />
    <PackageReference Include="LiteDB" Version="4.1.4" />
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
麦壳饼's avatar
麦壳饼 已提交
43 44 45 46
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.2" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.2" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.2" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.2" />
麦壳饼's avatar
麦壳饼 已提交
47
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="1.1.6" />
麦壳饼's avatar
麦壳饼 已提交
48
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.2" />
麦壳饼's avatar
麦壳饼 已提交
49
    <PackageReference Include="MQTTnet" Version="2.8.5" />
50
    <PackageReference Include="MQTTnet.AspNetCore" Version="2.8.5" />
麦壳饼's avatar
麦壳饼 已提交
51
    <PackageReference Include="MQTTnet.AspNetCoreEx" Version="1.0.0" />
52
    <PackageReference Include="MQTTnet.Extensions.Rpc" Version="2.8.5" />
麦壳饼's avatar
麦壳饼 已提交
53
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0" />
麦壳饼's avatar
麦壳饼 已提交
54
    <PackageReference Include="NSwag.AspNetCore" Version="12.0.15" />
麦壳饼's avatar
麦壳饼 已提交
55 56
    <PackageReference Include="QuartzHostedService" Version="0.0.4" />
    <PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
麦壳饼's avatar
麦壳饼 已提交
57
  </ItemGroup>
58 59 60 61 62
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties appsettings_1Development_1json__JSONSchema="http://json.schemastore.org/bungee-plugin" />
    </VisualStudio>
  </ProjectExtensions>
麦壳饼's avatar
麦壳饼 已提交
63 64 65 66 67 68 69 70 71 72 73 74 75 76
  <ItemGroup>
    <!-- Don't publish the SPA source files, but do show them in the project files list -->
    <Content Remove="$(SpaRoot)**" />
    <None Remove="$(SpaRoot)**" />
    <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
  </ItemGroup>

  <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
    <!-- Ensure Node.js is installed -->
    <Exec Command="node --version" ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
    </Exec>
    <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." />
    <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
麦壳饼's avatar
麦壳饼 已提交
77
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
麦壳饼's avatar
麦壳饼 已提交
78 79 80 81
  </Target>

  <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
    <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
麦壳饼's avatar
麦壳饼 已提交
82
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
麦壳饼's avatar
麦壳饼 已提交
83 84
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build   --prod" />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr   --prod" Condition=" '$(BuildServerSideRenderer)' == 'true' " />
麦壳饼's avatar
麦壳饼 已提交
85 86 87 88 89 90 91 92 93 94 95 96 97

    <!-- Include the newly-built files in the publish output -->
    <ItemGroup>
      <DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**" />
      <DistFiles Include="$(SpaRoot)node_modules\**" Condition="'$(BuildServerSideRenderer)' == 'true'" />
      <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
        <RelativePath>%(DistFiles.Identity)</RelativePath>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </ResolvedFileToPublish>
    </ItemGroup>
  </Target>

</Project>