Skip to content

Commit aba9fb9

Browse files
fix: Fix scripts and warnings caused in Eftdb.Design
1 parent 6490a52 commit aba9fb9

File tree

9 files changed

+44
-29
lines changed

9 files changed

+44
-29
lines changed

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,10 @@ To build and publish the core libraries to a local NuGet feed for testing, use t
236236

237237
```powershell
238238
# Publish the design-time package
239-
.\Scripts\Publish-Local.ps1 -ProjectName "CmdScale.EntityFrameworkCore.TimescaleDB.Design"
239+
.\Scripts\Publish-Local.ps1 -ProjectName "Eftdb.Design"
240240
241241
# Publish the runtime package
242-
.\Scripts\Publish-Local.ps1 -ProjectName "CmdScale.EntityFrameworkCore.TimescaleDB"
243-
```
244-
245-
By default, this script outputs the `.nupkg` files to:
246-
247-
```
248-
C:\_Dev\NuGet-Packages
242+
.\Scripts\Publish-Local.ps1 -ProjectName "Eftdb"
249243
```
250244

251245
> To change this path, edit the `$LocalNuGetRepo` variable inside the `Publish-Local.ps1` script.

Scripts/Publish-Local.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#>
99
[CmdletBinding()]
1010
param (
11-
[Parameter(Mandatory = $true, HelpMessage = "The name of the project to publish (e.g., 'CmdScale.EntityFrameworkCore.TimescaleDB').")]
11+
[Parameter(Mandatory = $true, HelpMessage = "The name of the project to publish (e.g., 'Eftdb').")]
1212
[string]$ProjectName
1313
)
1414

@@ -20,8 +20,8 @@ $SolutionRoot = (Get-Item $PSScriptRoot).Parent.FullName
2020

2121
# Map PackageId names to actual project paths
2222
$ProjectPathMap = @{
23-
"CmdScale.EntityFrameworkCore.TimescaleDB" = "src\Eftdb"
24-
"CmdScale.EntityFrameworkCore.TimescaleDB.Design" = "src\Eftdb.Design"
23+
"Eftdb" = "src\Eftdb"
24+
"Eftdb.Design" = "src\Eftdb.Design"
2525
}
2626

2727
try {

Scripts/Switch-References.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,14 @@ try {
142142
}
143143

144144
# Publish the core libraries locally using the new central script
145-
foreach ($projectName in $CoreProjectPaths.Keys) {
146-
Write-Host "--- Publishing '$projectName' ---"
145+
foreach ($packageId in $CoreProjectPaths.Keys) {
146+
$projectName = $PackageToProjectMap[$packageId]
147+
Write-Host "--- Publishing '$projectName' (Package: $packageId) ---"
147148
# Execute the central script, passing the project name as a parameter
148149
$newVersion = (& $publishScript -ProjectName $projectName | Out-String).Trim()
149150

150151
if (-not $newVersion) { throw "Publish script for '$projectName' did not output a version." }
151-
$PublishedVersions[$projectName] = $newVersion
152+
$PublishedVersions[$packageId] = $newVersion
152153
Write-Host "--- Published '$projectName' version '$newVersion' ---" -ForegroundColor Green
153154
}
154155

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<ItemGroup>
4+
<ProjectReference Include="..\..\src\Eftdb.Design\Eftdb.Design.csproj" />
5+
</ItemGroup>
6+
37
<PropertyGroup>
48
<TargetFramework>net8.0</TargetFramework>
59
<ImplicitUsings>enable</ImplicitUsings>
@@ -8,8 +12,4 @@
812
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.DatabaseFirst</RootNamespace>
913
</PropertyGroup>
1014

11-
<ItemGroup>
12-
<ProjectReference Include="..\..\src\Eftdb.Design\Eftdb.Design.csproj" />
13-
</ItemGroup>
14-
1515
</Project>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<ItemGroup>
4+
<ProjectReference Include="..\..\src\Eftdb\Eftdb.csproj" />
5+
</ItemGroup>
6+
37
<PropertyGroup>
48
<TargetFramework>net8.0</TargetFramework>
59
<ImplicitUsings>enable</ImplicitUsings>
@@ -8,8 +12,4 @@
812
<RootNamespace>CmdScale.EntityFrameworkCore.TimescaleDB.Samples.Shared</RootNamespace>
913
</PropertyGroup>
1014

11-
<ItemGroup>
12-
<ProjectReference Include="..\..\src\Eftdb\Eftdb.csproj" />
13-
</ItemGroup>
14-
1515
</Project>

src/Eftdb.Design/Eftdb.Design.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<PackagePath>\</PackagePath>
4141
</None>
4242
<Content Include="build\**\*" Pack="true" PackagePath="build\" />
43-
<Content Include="build\**\*" Pack="true" PackagePath="buildTransitive\" />
43+
<Content Include="buildTransitive\**\*" Pack="true" PackagePath="buildTransitive\" />
4444
</ItemGroup>
4545
<ItemGroup>
4646
<ProjectReference Include="..\Eftdb\Eftdb.csproj" />
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project>
2+
<Target Name="InjectTimescaleDesignTimeServices" BeforeTargets="CoreCompile">
3+
4+
<PropertyGroup>
5+
<_TimescaleDesignTimeServicesAttribute>
6+
[assembly: Microsoft.EntityFrameworkCore.Design.DesignTimeServicesReference("CmdScale.EntityFrameworkCore.TimescaleDB.Design.TimescaleDBDesignTimeServices, CmdScale.EntityFrameworkCore.TimescaleDB.Design")]
7+
</_TimescaleDesignTimeServicesAttribute>
8+
</PropertyGroup>
9+
10+
<WriteLinesToFile
11+
File="$(IntermediateOutputPath)GeneratedTimescaleDesignTimeServices.g.cs"
12+
Lines="$(_TimescaleDesignTimeServicesAttribute)"
13+
Overwrite="true" />
14+
15+
<ItemGroup>
16+
<Compile Include="$(IntermediateOutputPath)GeneratedTimescaleDesignTimeServices.g.cs" />
17+
</ItemGroup>
18+
19+
</Target>
20+
</Project>

tests/Eftdb.FunctionalTests/Eftdb.FunctionalTests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
</ItemGroup>
3232

3333
<ItemGroup>
34-
<ProjectReference Include="..\..\src\Eftdb.Design\Eftdb.Design.csproj" />
35-
<ProjectReference Include="..\..\src\Eftdb\Eftdb.csproj" />
34+
<Using Include="Xunit" />
3635
</ItemGroup>
3736

3837
<ItemGroup>
39-
<Using Include="Xunit" />
38+
<ProjectReference Include="..\..\src\Eftdb\Eftdb.csproj" />
39+
<ProjectReference Include="..\..\src\Eftdb.Design\Eftdb.Design.csproj" />
4040
</ItemGroup>
4141

4242
</Project>

tests/Eftdb.Tests/Eftdb.Tests.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
</ItemGroup>
3030

3131
<ItemGroup>
32-
<ProjectReference Include="..\..\src\Eftdb\Eftdb.csproj" />
33-
<ProjectReference Include="..\..\src\Eftdb.Design\Eftdb.Design.csproj" />
32+
<Using Include="Xunit" />
3433
</ItemGroup>
3534

3635
<ItemGroup>
37-
<Using Include="Xunit" />
36+
<ProjectReference Include="..\..\src\Eftdb\Eftdb.csproj" />
37+
<ProjectReference Include="..\..\src\Eftdb.Design\Eftdb.Design.csproj" />
3838
</ItemGroup>
3939

4040
</Project>

0 commit comments

Comments
 (0)