build: 更改项目目录结构

This commit is contained in:
Argo Zhang 2019-09-02 23:13:57 +08:00
parent 6ff1dcba90
commit 40d3aa3e97
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
622 changed files with 114 additions and 112 deletions

View File

@ -5,68 +5,65 @@ VisualStudioVersion = 16.0.29215.179
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLServer", "SQLServer", "{87319AF5-7C40-4362-B67C-35F9DD737DB4}"
ProjectSection(SolutionItems) = preProject
DatabaseScripts\SqlServer\InitData.sql = DatabaseScripts\SqlServer\InitData.sql
DatabaseScripts\SqlServer\install.ps1 = DatabaseScripts\SqlServer\install.ps1
DatabaseScripts\SqlServer\Install.sql = DatabaseScripts\SqlServer\Install.sql
scripts\SqlServer\InitData.sql = scripts\SqlServer\InitData.sql
scripts\SqlServer\install.ps1 = scripts\SqlServer\install.ps1
scripts\SqlServer\Install.sql = scripts\SqlServer\Install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Admin", "Bootstrap.Admin\Bootstrap.Admin.csproj", "{7B2B7043-3CB2-4C5A-BDF2-8C47F1A5471A}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Admin", "src\admin\Bootstrap.Admin\Bootstrap.Admin.csproj", "{7B2B7043-3CB2-4C5A-BDF2-8C47F1A5471A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{792A0B12-3F41-4BC4-A768-7D8D91C213B2}"
ProjectSection(SolutionItems) = preProject
appveyor.build.ps1 = appveyor.build.ps1
appveyor.test.ps1 = appveyor.test.ps1
appveyor.yml = appveyor.yml
README.md = README.md
README.zh-CN.md = README.zh-CN.md
EndProjectSection
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{586410F2-C1F0-47CD-AB28-2CF506DED2C8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{586410F2-C1F0-47CD-AB28-2CF506DED2C8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client", "src\client\Bootstrap.Client\Bootstrap.Client.csproj", "{C82A6E45-AB90-43D1-8429-5CBE953D8151}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client", "Bootstrap.Client\Bootstrap.Client.csproj", "{C82A6E45-AB90-43D1-8429-5CBE953D8151}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "client", "client", "{C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Client", "Client", "{C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess", "Bootstrap.DataAccess\Bootstrap.DataAccess.csproj", "{8D62BE79-BE13-43C8-969B-C9B00B3C84B7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess", "src\admin\Bootstrap.DataAccess\Bootstrap.DataAccess.csproj", "{8D62BE79-BE13-43C8-969B-C9B00B3C84B7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SQLite", "SQLite", "{523515EC-2AD7-4282-9AF4-9D20371183B0}"
ProjectSection(SolutionItems) = preProject
DatabaseScripts\SQLite\InitData.sql = DatabaseScripts\SQLite\InitData.sql
DatabaseScripts\SQLite\Install.sql = DatabaseScripts\SQLite\Install.sql
scripts\SQLite\InitData.sql = scripts\SQLite\InitData.sql
scripts\SQLite\Install.sql = scripts\SQLite\Install.sql
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess.MongoDB", "Bootstrap.DataAccess.MongoDB\Bootstrap.DataAccess.MongoDB.csproj", "{8336F096-4B4A-4710-A1FA-0F5E44CD8D26}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.DataAccess.MongoDB", "src\admin\Bootstrap.DataAccess.MongoDB\Bootstrap.DataAccess.MongoDB.csproj", "{8336F096-4B4A-4710-A1FA-0F5E44CD8D26}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MongoDB", "MongoDB", "{A06A0AD8-A246-4329-B024-7174AE4A3EDE}"
ProjectSection(SolutionItems) = preProject
DatabaseScripts\MongoDB\Dicts.js = DatabaseScripts\MongoDB\Dicts.js
DatabaseScripts\MongoDB\Groups.js = DatabaseScripts\MongoDB\Groups.js
DatabaseScripts\MongoDB\init.js = DatabaseScripts\MongoDB\init.js
DatabaseScripts\MongoDB\install.sh = DatabaseScripts\MongoDB\install.sh
DatabaseScripts\MongoDB\Navigations.js = DatabaseScripts\MongoDB\Navigations.js
DatabaseScripts\MongoDB\Roles.js = DatabaseScripts\MongoDB\Roles.js
DatabaseScripts\MongoDB\Users.js = DatabaseScripts\MongoDB\Users.js
scripts\MongoDB\Dicts.js = scripts\MongoDB\Dicts.js
scripts\MongoDB\Groups.js = scripts\MongoDB\Groups.js
scripts\MongoDB\init.js = scripts\MongoDB\init.js
scripts\MongoDB\install.sh = scripts\MongoDB\install.sh
scripts\MongoDB\Navigations.js = scripts\MongoDB\Navigations.js
scripts\MongoDB\Roles.js = scripts\MongoDB\Roles.js
scripts\MongoDB\Users.js = scripts\MongoDB\Users.js
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MySQL", "MySQL", "{084E2E94-6B7D-4D3E-9BF1-6972427FBF80}"
ProjectSection(SolutionItems) = preProject
DatabaseScripts\MySQL\initData.sql = DatabaseScripts\MySQL\initData.sql
DatabaseScripts\MySQL\install.sh = DatabaseScripts\MySQL\install.sh
DatabaseScripts\MySQL\install.sql = DatabaseScripts\MySQL\install.sql
DatabaseScripts\MySQL\my.ini = DatabaseScripts\MySQL\my.ini
scripts\MySQL\initData.sql = scripts\MySQL\initData.sql
scripts\MySQL\install.sh = scripts\MySQL\install.sh
scripts\MySQL\install.sql = scripts\MySQL\install.sql
scripts\MySQL\my.ini = scripts\MySQL\my.ini
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "UnitTest\UnitTest.csproj", "{CFE75C48-F9D5-403A-8419-D07939BBD769}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "test\UnitTest\UnitTest.csproj", "{CFE75C48-F9D5-403A-8419-D07939BBD769}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Postgresql", "Postgresql", "{6F61C2AC-84D4-48A9-8A48-680657CC8175}"
ProjectSection(SolutionItems) = preProject
DatabaseScripts\Postgresql\initData.sql = DatabaseScripts\Postgresql\initData.sql
DatabaseScripts\Postgresql\install.sql = DatabaseScripts\Postgresql\install.sql
scripts\Postgresql\initData.sql = scripts\Postgresql\initData.sql
scripts\Postgresql\install.sql = scripts\Postgresql\install.sql
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bootstrap.Client.DataAccess", "Bootstrap.Client.DataAccess\Bootstrap.Client.DataAccess.csproj", "{843811A2-FE49-410F-BF9F-9F1FB14A1DEE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client.DataAccess", "src\client\Bootstrap.Client.DataAccess\Bootstrap.Client.DataAccess.csproj", "{843811A2-FE49-410F-BF9F-9F1FB14A1DEE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bootstrap.Client.DataAccess.MongoDB", "Bootstrap.Client.DataAccess.MongoDB\Bootstrap.Client.DataAccess.MongoDB.csproj", "{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bootstrap.Client.DataAccess.MongoDB", "src\client\Bootstrap.Client.DataAccess.MongoDB\Bootstrap.Client.DataAccess.MongoDB.csproj", "{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{6AD32A76-F3AA-423E-96EA-E5CC679934D1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{41B6D37A-5E5E-42B3-85E4-D81A81E3D757}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "admin", "admin", "{E03B7391-B52F-4449-B400-5CD9DE01F085}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -108,13 +105,19 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{87319AF5-7C40-4362-B67C-35F9DD737DB4} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{7B2B7043-3CB2-4C5A-BDF2-8C47F1A5471A} = {E03B7391-B52F-4449-B400-5CD9DE01F085}
{C82A6E45-AB90-43D1-8429-5CBE953D8151} = {C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}
{C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0} = {41B6D37A-5E5E-42B3-85E4-D81A81E3D757}
{8D62BE79-BE13-43C8-969B-C9B00B3C84B7} = {E03B7391-B52F-4449-B400-5CD9DE01F085}
{523515EC-2AD7-4282-9AF4-9D20371183B0} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{8336F096-4B4A-4710-A1FA-0F5E44CD8D26} = {E03B7391-B52F-4449-B400-5CD9DE01F085}
{A06A0AD8-A246-4329-B024-7174AE4A3EDE} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{084E2E94-6B7D-4D3E-9BF1-6972427FBF80} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{CFE75C48-F9D5-403A-8419-D07939BBD769} = {6AD32A76-F3AA-423E-96EA-E5CC679934D1}
{6F61C2AC-84D4-48A9-8A48-680657CC8175} = {586410F2-C1F0-47CD-AB28-2CF506DED2C8}
{843811A2-FE49-410F-BF9F-9F1FB14A1DEE} = {C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}
{BC1C6D63-ADA9-4C3B-89F0-CEB191A86BF5} = {C7F51A14-2D89-4D1F-AD78-C42B79AB0BF0}
{E03B7391-B52F-4449-B400-5CD9DE01F085} = {41B6D37A-5E5E-42B3-85E4-D81A81E3D757}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {221EAE38-5F75-4391-9A48-E462A9F3B8FC}

View File

@ -1,28 +1,21 @@
<Project>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Keys\Longbow.Utility.snk</AssemblyOriginatorKeyFile>
<Copyright>Longbow</Copyright>
<Authors>Argo Zhang(argo@163.com)</Authors>
<Company>Longbow</Company>
</PropertyGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)src\Keys\Longbow.Utility.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.2'">
<MvcRazorCompileOnPublish>true</MvcRazorCompileOnPublish>
</PropertyGroup>
<ItemGroup>
<None Include="..\Keys\Longbow.Utility.snk" Link="Longbow.Utility.snk" />
</ItemGroup>
<Target Condition=" '$(TargetFramework)' == 'netcoreapp2.2' " Name="PostBuild" AfterTargets="PostBuildEvent">
<Message Text="Copy file -> $(TargetDir)" Importance="high" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(ProjectDir)..\Scripts\Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(TargetDir)" SourceFiles="$(ProjectDir)../Scripts/Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)scripts\Longbow.lic" SkipUnchangedFiles="true" />
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)scripts/Longbow.lic" SkipUnchangedFiles="true" />
</Target>
</Project>

View File

@ -1,15 +1,15 @@
function runCmd ($cmd) {
function runCmd ($cmd) {
write-host $cmd -ForegroundColor Cyan
cmd.exe /c $cmd
}
runCmd "dotnet build"
runCmd "dotnet publish Bootstrap.Admin --configuration Release --no-restore"
runCmd "dotnet build src\admin\Bootstrap.Admin"
runCmd "dotnet publish src\admin\Bootstrap.Admin --configuration Release --no-restore"
$publishFolder = "$($env:appveyor_build_folder)\Bootstrap.Admin\bin\Release\netcoreapp2.2\publish"
$licFile = "$($env:appveyor_build_folder)\Scripts\Longbow.lic"
$publishFolder = "$($env:appveyor_build_folder)\src\admin\Bootstrap.Admin\bin\Release\netcoreapp2.2\publish"
$licFile = "$($env:appveyor_build_folder)\scripts\Longbow.lic"
write-host "copy file $licFile" -ForegroundColor Cyan
xcopy $licFile $publishFolder /y
$dbFile = "$($env:appveyor_build_folder)\Bootstrap.Admin\BootstrapAdmin.db"
$dbFile = "$($env:appveyor_build_folder)\src\admin\Bootstrap.Admin\BootstrapAdmin.db"
write-host "copy file $dbFile" -ForegroundColor Cyan
xcopy $dbFile $publishFolder /y

View File

@ -1,6 +1,6 @@
function installDB() {
function installDB() {
write-host "init sqlserver database..." -ForegroundColor Cyan
$startPath = "$($env:appveyor_build_folder)\DatabaseScripts\SqlServer"
$startPath = "$($env:appveyor_build_folder)\scripts\SqlServer"
$sqlInstance = "(local)\SQL2014"
$outFile = join-path $startPath "output.log"
$sqlFile = join-path $startPath "Install.sql"
@ -14,7 +14,7 @@ function installDB() {
$cmd = $mysql + ' -e "create database BootstrapAdmin;" -uroot'
cmd.exe /c $cmd
$startPath = "$($env:appveyor_build_folder)\DatabaseScripts\MySQL"
$startPath = "$($env:appveyor_build_folder)\scripts\MySQL"
$para = ' -hlocalhost -uroot -DBootstrapAdmin < '
$sqlFile = join-path $startPath "Install.sql"
$cmd = $mysql + $para + $sqlFile
@ -25,7 +25,7 @@ function installDB() {
cmd.exe /c $cmd
write-host "init mongodb data..." -ForegroundColor Cyan
$initFolder = "$($env:appveyor_build_folder)\DatabaseScripts\MongoDB"
$initFolder = "$($env:appveyor_build_folder)\scripts\MongoDB"
cd $initFolder
cmd.exe /c "C:\mongodb\bin\mongo init.js"
@ -37,13 +37,13 @@ function installDB() {
}
function runUnitTest() {
write-host "dotnet test UnitTest" -ForegroundColor Cyan
dotnet test UnitTest --no-restore /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap*]*" /p:ExcludeByFile="../Bootstrap.Admin/Program.cs%2c../Bootstrap.Admin/Startup.cs%2c../Bootstrap.Admin/HttpHeaderOperation.cs" /p:CoverletOutput=../
write-host "dotnet test test\UnitTest" -ForegroundColor Cyan
dotnet test test\UnitTest /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Include="[Bootstrap*]*" /p:ExcludeByFile="..\..\src\admin\Bootstrap.Admin\Program.cs%2c..\..\src\admin\Bootstrap.Admin\Startup.cs%2c..\..\src\admin\Bootstrap.Admin\HttpHeaderOperation.cs" /p:CoverletOutput=..\..\
}
function coverallUnitTest() {
write-host "install coveralls.net tools" -ForegroundColor Cyan
dotnet tool install coveralls.net --version 1.0.0 --tool-path "./tools"
dotnet tool install coveralls.net --version 1.0.0 --tool-path ".\tools"
runUnitTest
write-host "report UnitTest with Coveralls" -ForegroundColor Cyan
cmd.exe /c ".\tools\csmacnz.Coveralls.exe --opencover -i coverage.opencover.xml --useRelativePaths"

View File

@ -27,7 +27,7 @@ install:
dotnet --version
xcopy "$($env:appveyor_build_folder)\DatabaseScripts\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y
xcopy "$($env:appveyor_build_folder)\scripts\MySQL\my.ini" "C:\Program Files\MySQL\MySQL Server 5.7" /y
build_script:
- ps: >-
./appveyor.build.ps1
@ -35,7 +35,7 @@ test_script:
- ps: >-
./appveyor.test.ps1
artifacts:
- path: Bootstrap.Admin\bin\release\netcoreapp2.2\publish\
- path: src\admin\Bootstrap.Admin\bin\release\netcoreapp2.2\publish\
name: BootstrapAdmin
type: WebDeployPackage
deploy:

11
scripts/admin.sh Normal file
View File

@ -0,0 +1,11 @@
#! /bin/bash
cd ~/BootstrapAdmin
git pull
dotnet publish src/admin/Bootstrap.Admin -c Release
rm -f ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp2.2/publish/appsettings*.json
systemctl stop ba.admin
\cp -fr ~/BootstrapAdmin/src/admin/Bootstrap.Admin/bin/Release/netcoreapp2.2/publish/* /usr/local/ba/admin/
systemctl start ba.admin
systemctl status ba.admin

11
scripts/client.sh Normal file
View File

@ -0,0 +1,11 @@
#! /bin/bash
cd ~/BootstrapAdmin
git pull
dotnet publish src/client/Bootstrap.Client -c Release
rm -f ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/appsettings*.json
systemctl stop ba.client
\cp -fr ~/BootstrapAdmin/src/client/Bootstrap.Client/bin/Release/netcoreapp2.2/publish/* /usr/local/ba/client/
systemctl start ba.client
systemctl status ba.client

View File

@ -1,9 +1,7 @@
using Longbow.Tasks;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Bootstrap.Admin.Controllers.Api
{

Some files were not shown because too many files have changed in this diff Show More