IoTSharp.csproj 7.1 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
    <Company>IoT#</Company>
    <Product>IoTSharp</Product>
    <Authors>IoT#</Authors>
    <PackageProjectUrl>https://github.com/IoTSharp/IoTSharp</PackageProjectUrl>
14
    <PackageLicenseUrl></PackageLicenseUrl>
麦壳饼's avatar
麦壳饼 已提交
15
    <RepositoryUrl>https://github.com/IoTSharp/IoTSharp</RepositoryUrl>
16
    <PackageReleaseNotes>Open-source IoT Platform - Device management, data collection, processing and visualization.   https://www.iotsharp.net</PackageReleaseNotes>
麦壳饼's avatar
麦壳饼 已提交
17
    <Description>Open-source IoT Platform - Device management, data collection, processing and visualization.</Description>
麦壳饼's avatar
麦壳饼 已提交
18
    <PackageId>IoTSharp</PackageId>
麦壳饼's avatar
麦壳饼 已提交
19
    <UserSecretsId>18970590-05bf-4a1f-a70b-3c8a120d12cb</UserSecretsId>
麦壳饼's avatar
麦壳饼 已提交
20 21 22 23 24 25 26
    <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  
麦壳饼 已提交
27
    <BuildServerSideRenderer>false</BuildServerSideRenderer>
28 29 30 31 32
    <Version>0.1.99</Version>
    <PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
    <RepositoryType>git</RepositoryType>
    <PackageTags>IoT</PackageTags>
    <PackageIconUrl>https://avatars2.githubusercontent.com/u/44353254?s=200&amp;v=4</PackageIconUrl>
麦壳饼's avatar
麦壳饼 已提交
33
  </PropertyGroup>
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
  <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>
51
    <PackageReference Include="CoAP.NET.Core" Version="1.1.0" />
52
    <PackageReference Include="Microsoft.AspNetCore.Hosting.WindowsServices" Version="2.2.0" />
麦壳饼's avatar
78  
麦壳饼 已提交
53
    <PackageReference Include="Packaging.Targets" Version="0.1.78" />
麦壳饼's avatar
麦壳饼 已提交
54

55
  </ItemGroup>
麦壳饼's avatar
麦壳饼 已提交
56 57 58 59 60
  <ItemGroup>
    <Compile Remove="Migrations\**" />
    <Content Remove="Migrations\**" />
    <EmbeddedResource Remove="Migrations\**" />
    <None Remove="Migrations\**" />
61 62 63 64
    <None Include="..\LICENSE.txt">
      <Pack>True</Pack>
      <PackagePath></PackagePath>
    </None>
麦壳饼's avatar
麦壳饼 已提交
65
  </ItemGroup>
麦壳饼's avatar
麦壳饼 已提交
66
  <ItemGroup>
麦壳饼's avatar
isca  
麦壳饼 已提交
67
    <PackageReference Include="Changwei.AspNetCore.SpaServices.Extensions.VueCli" Version="1.0.0" />
麦壳饼's avatar
麦壳饼 已提交
68 69
    <PackageReference Include="IoTSharp.X509Extensions" Version="1.3.3" />
    <PackageReference Include="LiteDB" Version="4.1.4" />
麦壳饼's avatar
isca  
麦壳饼 已提交
70

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

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

麦壳饼's avatar
麦壳饼 已提交
120 121 122 123 124 125 126 127 128 129 130 131 132

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