|
1 | 1 | <Project Sdk="Microsoft.NET.Sdk"> |
2 | 2 |
|
3 | | - <Sdk Name="Aspire.AppHost.Sdk" Version="9.5.1" /> |
| 3 | + <Sdk Name="Aspire.AppHost.Sdk" Version="13.0.0" /> |
4 | 4 |
|
5 | 5 | <PropertyGroup> |
6 | 6 | <OutputType>Exe</OutputType> |
7 | | - <TargetFramework>net9.0</TargetFramework> |
8 | 7 | <NoWarn>CS1591</NoWarn> |
9 | 8 | <IsAspireHost>true</IsAspireHost> |
10 | 9 | <UserSecretsId>d11b339a-7d36-4112-8969-2ebfad7419e0</UserSecretsId> |
11 | 10 | </PropertyGroup> |
12 | 11 |
|
13 | 12 | <ItemGroup> |
14 | | - <PackageReference Include="Aspire.Hosting.AppHost" Version="9.5.1" /> |
15 | | - <PackageReference Include="Aspire.Hosting.Docker" Version="9.5.1-preview.1.25502.11" /> |
16 | | - <PackageReference Include="Aspire.Hosting.Python" Version="9.5.1" /> |
| 13 | + <PackageReference Include="Aspire.Hosting.AppHost" Version="13.0.0" /> |
| 14 | + <PackageReference Include="Aspire.Hosting.Docker" Version="13.0.0-preview.1.25560.3" /> |
| 15 | + <PackageReference Include="Aspire.Hosting.Python" Version="13.0.0" /> |
17 | 16 | </ItemGroup> |
18 | 17 |
|
19 | 18 | <ItemGroup> |
20 | 19 | <ProjectReference Include="..\LibStored.Net.Example.Console\LibStored.Net.Example.Console.csproj" /> |
21 | 20 | </ItemGroup> |
22 | 21 |
|
23 | | - <!-- Example to automatically install the python venv from https://github.com/dotnet/aspire-samples/tree/main/samples/AspireWithPython --> |
24 | | - <!-- Properties, Items, and targets to ensure Python apps are initialized --> |
25 | | - <PropertyGroup> |
26 | | - <PythonVirtualEnvironmentName>.venv</PythonVirtualEnvironmentName> |
27 | | - </PropertyGroup> |
28 | | - |
29 | | - <ItemGroup> |
30 | | - <PipRequirementsTxt Include="python\requirements.txt" /> |
31 | | - </ItemGroup> |
32 | | - |
33 | | - <Target Name="SetPipInstallSentinelFilePath"> |
34 | | - <PropertyGroup> |
35 | | - <PipInstallSentinelFilePath>$(IntermediateOutputPath)piprestored.sentinel</PipInstallSentinelFilePath> |
36 | | - </PropertyGroup> |
37 | | - </Target> |
38 | | - |
39 | | - <Target Name="CreatePythonVirtualEnvironments"> |
40 | | - <PropertyGroup> |
41 | | - <PipRequirementsTxtDir>%(PipRequirementsTxt.RootDir)%(PipRequirementsTxt.Directory)</PipRequirementsTxtDir> |
42 | | - <VenvDir>$(PipRequirementsTxtDir)$(PythonVirtualEnvironmentName)/</VenvDir> |
43 | | - <CreateVenv Condition="!Exists('$(VenvDir)')">True</CreateVenv> |
44 | | - </PropertyGroup> |
45 | | - |
46 | | - <Message Importance="Normal" Text="Initializing virtual environment for $(PipRequirementsTxtDir)" /> |
47 | | - |
48 | | - <Exec Command="python -m venv $(VenvDir)" WorkingDirectory="$(PipRequirementsTxtDir)" Condition=" '$(CreateVenv)' == 'True' " /> |
49 | | - </Target> |
50 | | - |
51 | | - <Target Name="PipInstall" AfterTargets="PrepareForBuild" DependsOnTargets="SetPipInstallSentinelFilePath;CreatePythonVirtualEnvironments" Condition=" '$(DesignTimeBuild)' != 'True' " Inputs="@(PipRequirementsTxt)" Outputs="$(PipInstallSentinelFilePath)"> |
52 | | - <PropertyGroup> |
53 | | - <PipRequirementsTxtDir>%(PipRequirementsTxt.RootDir)%(PipRequirementsTxt.Directory)</PipRequirementsTxtDir> |
54 | | - <PipCmd Condition=" '$(OS)' == 'Windows_NT' ">pip</PipCmd> |
55 | | - <PipCmd Condition=" '$(OS)' != 'Windows_NT' ">python -m pip</PipCmd> |
56 | | - <PipInstallCmd>$(PipCmd) install -r %(PipRequirementsTxt.Filename)%(PipRequirementsTxt.Extension)</PipInstallCmd> |
57 | | - <RestoreCmd Condition=" '$(OS)' == 'Windows_NT' ">call $(PythonVirtualEnvironmentName)\Scripts\activate.bat && $(PipInstallCmd)</RestoreCmd> |
58 | | - <RestoreCmd Condition=" '$(OS)' != 'Windows_NT' ">. ./$(PythonVirtualEnvironmentName)/bin/activate && $(PipInstallCmd)</RestoreCmd> |
59 | | - </PropertyGroup> |
60 | | - |
61 | | - <Message Importance="Normal" Text="Restoring packages for $(PipRequirementsTxtDir)" /> |
62 | | - |
63 | | - <Exec Command="$(RestoreCmd)" WorkingDirectory="$(PipRequirementsTxtDir)" /> |
64 | | - |
65 | | - <Touch Files="$(PipInstallSentinelFilePath)" AlwaysCreate="True" /> |
66 | | - |
67 | | - <ItemGroup> |
68 | | - <FileWrites Include="$(PipInstallSentinelFilePath)" /> |
69 | | - </ItemGroup> |
70 | | - </Target> |
71 | | - |
72 | 22 | </Project> |
0 commit comments