-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[c#] Exclude files in output dir from implicit codegen
Bond's implicit code generation includes any .bond files in the project's output directories (e.g., `bin/` or `obj/debug/netstandard1.0`). Some projects that copied .bond files into their output directories would then encounter codegen issues when gbc was run on these .bond files implicitly, particularly during incremental builds. Omit any .bond files that match `$(DefaultItemExcludes)` or `$(DefaultExcludesInProjectFolder)` from implicit codegen. Add a regression codegen test. This behavior now matches what the .NET SDK does for .cs files.
- Loading branch information
Showing
11 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
namespace CodegenTest.DefaultIgnoresOutput | ||
{ | ||
public static class UsesCodegen | ||
{ | ||
public static SimpleType Make() | ||
{ | ||
return new SimpleType | ||
{ | ||
_int32 = 42, | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This test ensures that the .bond files automatically added to BondCodegen | ||
exclude files in the project's output paths. | ||
|
||
This directory has some files intentionally committed under the | ||
typically-ignored `bin/` and `obj/` paths. |
2 changes: 2 additions & 0 deletions
2
cs/test/codegen/default-ignore-output/bin/should-not-be-compiled.bond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This file should not be automatically added by the codegen targets because | ||
it is in one of the output directories. |
13 changes: 13 additions & 0 deletions
13
cs/test/codegen/default-ignore-output/default-ignore-output.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="$(MSBuildThisFileDirectory)\..\..\..\build\internal\Common.Internal.props" /> | ||
<PropertyGroup> | ||
<Configurations>Debug;Release</Configurations> | ||
<OutputType>Library</OutputType> | ||
<ProjectGuid>98BF6B10-F821-4402-8923-5F7B726BBFC8</ProjectGuid> | ||
<TargetFrameworks>netstandard1.0</TargetFrameworks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\src\attributes\Attributes.csproj" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildThisFileDirectory)\..\..\..\build\internal\Common.Internal.targets" /> | ||
</Project> |
2 changes: 2 additions & 0 deletions
2
cs/test/codegen/default-ignore-output/obj/debug/netstandard1.0/should-not-be-compiled.bond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This file should not be automatically added by the codegen targets because | ||
it is in one of the output directories. |
2 changes: 2 additions & 0 deletions
2
cs/test/codegen/default-ignore-output/obj/retail/netstandard1.0/should-not-be-compiled.bond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This file should not be automatically added by the codegen targets because | ||
it is in one of the output directories. |
2 changes: 2 additions & 0 deletions
2
cs/test/codegen/default-ignore-output/obj/should-not-be-compiled.bond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This file should not be automatically added by the codegen targets because | ||
it is in one of the output directories. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace CodegenTest.DefaultIgnoresOutput; | ||
|
||
struct SimpleType | ||
{ | ||
0: int32 _int32; | ||
} |