Skip to content

Commit cdea76e

Browse files
authored
fix(core): build intermediates need to be captured by cache for DTE / parallel builds (#596)
1 parent 2ea2570 commit cdea76e

File tree

19 files changed

+221
-25
lines changed

19 files changed

+221
-25
lines changed

Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<ProjectRelativePath>$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectDirectory)))</ProjectRelativePath>
1010
<BaseOutputPath>$(RepoRoot)dist/$(ProjectRelativePath)</BaseOutputPath>
1111
<OutputPath>$(BaseOutputPath)</OutputPath>
12+
<BaseIntermediateOutputPath>$(RepoRoot)dist/intermediates/$(ProjectRelativePath)/obj</BaseIntermediateOutputPath>
13+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)</IntermediateOutputPath>
1214
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
1315
</PropertyGroup>
1416
<PropertyGroup>

demo/apps/web-frontend/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
3-
"name": "demo-web-frontend",
3+
"name": "demo-frontend",
44
"sourceRoot": "demo/apps/web-frontend/src",
55
"projectType": "application",
66
"targets": {

demo/apps/webapi/Controllers/WeatherForecastController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class WeatherForecastController : ControllerBase
1414
private readonly ILogger<WeatherForecastController> _logger;
1515

1616
public WeatherForecastController(ILogger<WeatherForecastController> logger)
17-
{
17+
{
1818
_logger = logger;
1919
}
2020

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
32
<PropertyGroup>
4-
53
<TargetFramework>net6.0</TargetFramework>
6-
74
<Nullable>enable</Nullable>
8-
95
<ImplicitUsings>enable</ImplicitUsings>
10-
11-
<OutputPath>../../../dist/demo/apps/webapi</OutputPath>
126
</PropertyGroup>
13-
7+
148
<ItemGroup>
15-
16-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3"/>
17-
9+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\..\libs\csharp-models\NxDotnet.Demo.Libs.CsharpModels.csproj" />
1814
</ItemGroup>
19-
2015
</Project>

demo/apps/webapi/project.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
22
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
3-
"name": "demo-apps-webapi",
3+
"name": "demo-webapi",
44
"projectType": "application",
55
"sourceRoot": "demo/apps/webapi",
66
"targets": {
77
"build": {
88
"executor": "@nx-dotnet/core:build",
9-
"outputs": ["{workspaceRoot}/dist/demo/apps/webapi"],
9+
"outputs": [
10+
"{workspaceRoot}/dist/demo/apps/webapi",
11+
"{workspaceRoot}/dist/intermediates/demo/apps/webapi"
12+
],
1013
"options": {
1114
"configuration": "Debug",
1215
"noDependencies": true

demo/libs/csharp-models/Class1.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
namespace NxDotnet.Demo.Libs.CsharpModels;
2+
public class Class1
3+
{
4+
5+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "demo-csharp-models",
3+
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
4+
"projectType": "library",
5+
"sourceRoot": "demo/libs/csharp-models",
6+
"targets": {
7+
"build": {
8+
"executor": "@nx-dotnet/core:build",
9+
"outputs": [
10+
"{workspaceRoot}/dist/demo/libs/csharp-models",
11+
"{workspaceRoot}/dist/intermediates/demo/libs/csharp-models/obj"
12+
],
13+
"options": {
14+
"configuration": "Debug",
15+
"noDependencies": true
16+
},
17+
"configurations": {
18+
"production": {
19+
"configuration": "Release"
20+
}
21+
}
22+
},
23+
"lint": {
24+
"executor": "@nx-dotnet/core:format"
25+
}
26+
},
27+
"tags": []
28+
}

demo/libs/generated/webapi-swagger/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
}
1616
}
1717
},
18-
"implicitDependencies": ["demo-apps-webapi"]
18+
"implicitDependencies": ["demo-webapi"]
1919
}

nx.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
"{workspaceRoot}/tsconfig.base.json",
6464
"{workspaceRoot}/tslint.json",
6565
"{workspaceRoot}/nx.json",
66-
"{workspaceRoot}/babel.config.json"
66+
"{workspaceRoot}/babel.config.json",
67+
"{workspaceRoot}/Directory.Build.props",
68+
"{workspaceRoot}/Directory.Build.targets"
6769
],
6870
"production": [
6971
"default",

0 commit comments

Comments
 (0)