refactor: 增加 build 脚本复制文件到输出目录
This commit is contained in:
parent
c89d589f31
commit
c00c04c561
|
@ -0,0 +1,15 @@
|
||||||
|
<Project>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<IsTestProject>true</IsTestProject>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Target Condition=" '$(TargetFramework)' == 'netcoreapp3.0' " Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Message Text="Copy db file -> $(TargetDir)" Importance="high" />
|
||||||
|
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)..\src\admin\keys\Longbow.lic" SkipUnchangedFiles="true" />
|
||||||
|
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)../src/admin/keys/Longbow.lic" SkipUnchangedFiles="true" />
|
||||||
|
<Copy Condition="'$(OS)' == 'Windows_NT'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)..\src\admin\Bootstrap.Admin\BootstrapAdmin.db" SkipUnchangedFiles="true" />
|
||||||
|
<Copy Condition="'$(OS)' == 'UNIX'" DestinationFolder="$(TargetDir)" SourceFiles="$(MSBuildThisFileDirectory)../src/admin/Bootstrap.Admin/BootstrapAdmin.db" SkipUnchangedFiles="true" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
</Project>
|
Binary file not shown.
|
@ -37,10 +37,6 @@ namespace UnitTest
|
||||||
{
|
{
|
||||||
if (providerName == DatabaseProviderType.SQLite)
|
if (providerName == DatabaseProviderType.SQLite)
|
||||||
{
|
{
|
||||||
var dbPath = RetrievePath($"UnitTest{Path.DirectorySeparatorChar}DB{Path.DirectorySeparatorChar}UnitTest.db");
|
|
||||||
var dbFile = Path.Combine(AppContext.BaseDirectory, "UnitTest.db");
|
|
||||||
File.Copy(dbPath, dbFile, true);
|
|
||||||
|
|
||||||
builder.ConfigureAppConfiguration(app => app.AddInMemoryCollection(new KeyValuePair<string, string>[] {
|
builder.ConfigureAppConfiguration(app => app.AddInMemoryCollection(new KeyValuePair<string, string>[] {
|
||||||
new KeyValuePair<string, string>("DB:0:Enabled", "false"),
|
new KeyValuePair<string, string>("DB:0:Enabled", "false"),
|
||||||
new KeyValuePair<string, string>("DB:1:Enabled", "true")
|
new KeyValuePair<string, string>("DB:1:Enabled", "true")
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
"Enabled": false,
|
"Enabled": false,
|
||||||
"ProviderName": "Sqlite",
|
"ProviderName": "Sqlite",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"ba": "Data Source=UnitTest.db;"
|
"ba": "Data Source=BootstrapAdmin.db;"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue