Skip to content
38 changes: 37 additions & 1 deletion src/installer/tests/Assets/Projects/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />
<!-- Calculate necessary paths manually without depending on repo-level properties -->
<PropertyGroup>
<!-- Determine the repo root by walking up from this directory.
Hard-coded path traversal is intentional to avoid automatic discovery of parent Directory.Build.props.
Path: src/installer/tests/Assets/Projects -> repo root requires 5 levels up. -->
<RepoRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '..', '..', '..', '..', '..'))</RepoRoot>
<RepositoryEngineeringDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'eng'))</RepositoryEngineeringDir>
<ArtifactsDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts'))</ArtifactsDir>
<ArtifactsBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin'))</ArtifactsBinDir>
</PropertyGroup>

<!-- Import Versions.props to get MajorVersion/MinorVersion for NetCoreAppCurrentVersion -->
<Import Project="$(RepositoryEngineeringDir)Versions.props" />

<!-- Define the target framework version these test assets should build against -->
<PropertyGroup>
<NetCoreAppCurrentVersion Condition="'$(NetCoreAppCurrentVersion)' == ''">$(MajorVersion).$(MinorVersion)</NetCoreAppCurrentVersion>
<NetCoreAppCurrent>net$(NetCoreAppCurrentVersion)</NetCoreAppCurrent>
</PropertyGroup>

<PropertyGroup>
<MicrosoftNetCoreAppRefPackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.ref'))</MicrosoftNetCoreAppRefPackDir>
<MicrosoftNetCoreAppRefPackRefDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'ref', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRefPackRefDir>
<MicrosoftNetCoreAppRefPackDataDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRefPackDir)', 'data'))</MicrosoftNetCoreAppRefPackDataDir>

<MicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'microsoft.netcore.app.runtime.$(TargetRid)', '$(LibrariesConfiguration)'))</MicrosoftNetCoreAppRuntimePackDir>
<MicrosoftNetCoreAppRuntimePackRidDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackDir)', 'runtimes', '$(TargetRid)'))</MicrosoftNetCoreAppRuntimePackRidDir>
<MicrosoftNetCoreAppRuntimePackRidLibTfmDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'lib', '$(NetCoreAppCurrent)'))</MicrosoftNetCoreAppRuntimePackRidLibTfmDir>
<MicrosoftNetCoreAppRuntimePackNativeDir>$([MSBuild]::NormalizeDirectory('$(MicrosoftNetCoreAppRuntimePackRidDir)', 'native'))</MicrosoftNetCoreAppRuntimePackNativeDir>
</PropertyGroup>

<PropertyGroup>
<!-- Allow nullable, but don't check for correctness -->
<Nullable>annotations</Nullable>
<RunAnalyzers>false</RunAnalyzers>
</PropertyGroup>

<!-- Test asset build configuration -->
<PropertyGroup>
<EnableDefaultItems>true</EnableDefaultItems>
<UseLocalTargetingRuntimePack>true</UseLocalTargetingRuntimePack>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>HelloWorld</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<OutputType>Exe</OutputType>
<SelfContained>true</SelfContained>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
Expand Down
Loading