IoTSharp.csproj 6.8 KB
Newer Older
麦壳饼's avatar
麦壳饼 已提交
1 2 3 4
<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
5
    <RuntimeIdentifiers>win7-x64;rhel.7-x64;ubuntu.18.04-x64</RuntimeIdentifiers>
6 7 8
    <PreserveCompilationContext>true</PreserveCompilationContext>
    <CreateUser>true</CreateUser>
    <InstallService>true</InstallService>
麦壳饼's avatar
isca  
麦壳饼 已提交
9
    <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
麦壳饼's avatar
麦壳饼 已提交
10 11 12 13 14 15 16 17 18
    <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
麦壳饼 已提交
19
    <Description>Open-source IoT Platform - Device management, data collection, processing and visualization.</Description>
麦壳饼's avatar
麦壳饼 已提交
20
    <PackageId>IoTSharp</PackageId>
麦壳饼's avatar
麦壳饼 已提交
21
    <UserSecretsId>18970590-05bf-4a1f-a70b-3c8a120d12cb</UserSecretsId>
麦壳饼's avatar
麦壳饼 已提交
22 23 24 25 26 27 28
    <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
isca  
麦壳饼 已提交
29
    <BuildServerSideRenderer>false</BuildServerSideRenderer>
麦壳饼's avatar
麦壳饼 已提交
30
  </PropertyGroup>
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
  <ItemGroup>
    <Content Update="appsettings.json">
      <LinuxPath>/etc/iotsharp/appsettings.json</LinuxPath>
    </Content>
    <Content Update="appsettings.Development.json">
      <LinuxPath>/etc/iotsharp/appsettings.Development.json</LinuxPath>
    </Content>
    <Content Include="iotsharp.service" CopyToPublishDirectory="PreserveNewest">
      <LinuxPath>/etc/systemd/system/iotsharp.service</LinuxPath>
    </Content>
    <LinuxFolder Include="/var/log/iotsharp" Group="iotsharp" Owner="iotsharp" RemoveOnUninstall="true" />
    <LinuxFolder Include="/var/run/iotsharp" Group="iotsharp" Owner="iotsharp" RemoveOnUninstall="true" />
    <LinuxFolder Include="/var/lib/iotsharp" Group="iotsharp" Owner="iotsharp" RemoveOnUninstall="true" />
    <RpmDependency Include="libunwind" Version="1.1" />
    <RpmDependency Include="libicu" Version="50.1.2" />
  </ItemGroup>
  <ItemGroup>
48
    <PackageReference Include="CoAP.NET.Core" Version="1.1.0" />
49
    <PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="2.2.0" />
麦壳饼's avatar
78  
麦壳饼 已提交
50
    <PackageReference Include="Packaging.Targets" Version="0.1.78" />
麦壳饼's avatar
麦壳饼 已提交
51

52
  </ItemGroup>
麦壳饼's avatar
麦壳饼 已提交
53 54 55 56 57 58
  <ItemGroup>
    <Compile Remove="Migrations\**" />
    <Content Remove="Migrations\**" />
    <EmbeddedResource Remove="Migrations\**" />
    <None Remove="Migrations\**" />
  </ItemGroup>
麦壳饼's avatar
麦壳饼 已提交
59
  <ItemGroup>
麦壳饼's avatar
isca  
麦壳饼 已提交
60
    <PackageReference Include="Changwei.AspNetCore.SpaServices.Extensions.VueCli" Version="1.0.0" />
麦壳饼's avatar
麦壳饼 已提交
61 62
    <PackageReference Include="IoTSharp.X509Extensions" Version="1.3.3" />
    <PackageReference Include="LiteDB" Version="4.1.4" />
麦壳饼's avatar
isca  
麦壳饼 已提交
63

麦壳饼's avatar
麦壳饼 已提交
64 65 66 67 68 69
    <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
麦壳饼 已提交
70 71 72 73
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.4" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
麦壳饼's avatar
麦壳饼 已提交
74
    <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="1.1.6" />
麦壳饼's avatar
麦壳饼 已提交
75
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
麦壳饼's avatar
麦壳饼 已提交
76 77 78 79
    <PackageReference Include="MQTTnet" Version="3.0.2" />
    <PackageReference Include="MQTTnet.AspNetCore" Version="3.0.2" />
    <PackageReference Include="MQTTnet.AspNetCoreEx" Version="3.0.2" />
    <PackageReference Include="MQTTnet.Extensions.Rpc" Version="3.0.2" />
80 81
    <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.4" />
    <PackageReference Include="NSwag.AspNetCore" Version="12.3.1" />
82
    <PackageReference Include="QuartzHostedService" Version="0.0.5" />
麦壳饼's avatar
麦壳饼 已提交
83
    <PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
麦壳饼's avatar
麦壳饼 已提交
84
  </ItemGroup>
85 86 87 88 89
  <ProjectExtensions>
    <VisualStudio>
      <UserProperties appsettings_1Development_1json__JSONSchema="http://json.schemastore.org/bungee-plugin" />
    </VisualStudio>
  </ProjectExtensions>
麦壳饼's avatar
麦壳饼 已提交
90 91 92 93 94 95 96 97 98 99 100 101 102 103
  <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
麦壳饼 已提交
104 105
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install " />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install -g @vue/cli " />
麦壳饼's avatar
麦壳饼 已提交
106 107 108 109
  </Target>

  <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
    <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
麦壳饼's avatar
麦壳饼 已提交
110
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install " />
麦壳饼's avatar
isca  
麦壳饼 已提交
111 112
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:prod" />

麦壳饼's avatar
麦壳饼 已提交
113 114 115 116 117 118 119 120 121 122 123 124 125

    <!-- 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>