Skip to content

Commit c58f240

Browse files
authored
Merge pull request #234 from servicetitan/upstream/multitarget_build
Support for global TargetFrameworks setting by using DO_TargetFrameworks environment variable
2 parents 876d43e + bd64f84 commit c58f240

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Directory.Build.props

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,25 @@
4040
<PropertyGroup>
4141
<NoLogo>true</NoLogo>
4242
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
43-
<TargetFramework>net5.0</TargetFramework>
43+
<TargetFrameworks>$(TargetFrameworks)</TargetFrameworks> <!-- the property -->
44+
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">$(DO_TargetFrameworks)</TargetFrameworks> <!-- env var -->
45+
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net5.0</TargetFrameworks> <!-- fallback to default -->
4446
<LangVersion>9.0</LangVersion>
4547
<SolutionDir Condition="$(SolutionDir) == ''">$([MSBuild]::EnsureTrailingSlash(
4648
$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileDirectory)', 'Orm.sln'))))</SolutionDir>
4749
<Configuration Condition="$(Configuration) == ''">Debug</Configuration>
4850
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
4951
<ArtifactsDir Condition="'$(ArtifactsDir)'==''">$(SolutionDir)_Build\</ArtifactsDir>
5052
<BaseIntermediateOutputPath>$(ArtifactsDir)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
51-
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
53+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework)\</IntermediateOutputPath>
5254
<BaseOutputPath>$(ArtifactsDir)bin\$(Configuration)\</BaseOutputPath>
5355
<BaseOutputPath Condition="$(MSBuildProjectName.Contains('Tests'))
5456
OR $(MSBuildProjectName) == 'TestCommon'
5557
OR $(MSBuildProjectName) == 'Xtensive.Orm.Manual'">$(ArtifactsDir)tests\$(Configuration)\</BaseOutputPath>
5658
<OutputPath>$(BaseOutputPath)lib\</OutputPath>
5759
<MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
5860
<ProjectAssetsFile>$(MSBuildProjectExtensionsPath)project.assets.json</ProjectAssetsFile>
59-
<ProjectAssetsCacheFile>$(MSBuildProjectExtensionsPath)$(MSBuildProjectName).assets.cache</ProjectAssetsCacheFile>
61+
<ProjectAssetsCacheFile>$(MSBuildProjectExtensionsPath)$(TargetFramework)\$(MSBuildProjectName).assets.cache</ProjectAssetsCacheFile>
6062
<OrmKeyFile>$(SolutionDir)Orm\Orm.snk</OrmKeyFile>
6163
</PropertyGroup>
6264

MSBuild/DataObjects.Net.targets

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
<CompileDependsOn>$(CompileDependsOn);XtensiveOrmBuild</CompileDependsOn>
1313
<XtensiveOrmPath Condition="'$(XtensiveOrmPath)'==''">$(MSBuildThisFileDirectory)</XtensiveOrmPath>
1414
<XtensiveOrmPath Condition="!HasTrailingSlash('$(XtensiveOrmPath)')">$(XtensiveOrmPath)\</XtensiveOrmPath>
15-
<XtensiveOrmWeaver Condition="'$(XtensiveOrmWeaver)'==''">$(XtensiveOrmPath)tools\weaver\Xtensive.Orm.Weaver.dll</XtensiveOrmWeaver>
15+
<XtensiveWeaverFramework>net6.0</XtensiveWeaverFramework> <!-- works for net7.0 as well -->
16+
<XtensiveWeaverFramework Condition="'$(TargetFramework)'=='net5.0'">net5.0</XtensiveWeaverFramework>
17+
<XtensiveOrmWeaver Condition="'$(XtensiveOrmWeaver)'==''">$(XtensiveOrmPath)tools\weaver\$(XtensiveWeaverFramework)\Xtensive.Orm.Weaver.dll</XtensiveOrmWeaver>
1618
<XtensiveOrmBuildDependsOn>$(XtensiveOrmBuildDependsOn)</XtensiveOrmBuildDependsOn>
1719
</PropertyGroup>
1820

Weaver/Xtensive.Orm.Weaver/Xtensive.Orm.Weaver.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
66
<SignAssembly>true</SignAssembly>
77
<AssemblyOriginatorKeyFile>$(OrmKeyFile)</AssemblyOriginatorKeyFile>
8-
<OutputPath>$(BaseOutputPath)tools\weaver\</OutputPath>
8+
<OutputPath>$(BaseOutputPath)tools\weaver\$(TargetFramework)\</OutputPath>
99
<RollForward>Major</RollForward>
1010
</PropertyGroup>
1111
<ItemGroup>

0 commit comments

Comments
 (0)