Skip to content

Commit cecaa0d

Browse files
committed
C#: Clear possibly inherited Directory.Build.props and Directory.Build.targets in stub generator
1 parent 6da0592 commit cecaa0d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

csharp/scripts/stubs/helpers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ def __init__(self, thisScript, relativeWorkDir, template):
7777
self.projectNameIn, '--output', self.projectDirIn])
7878
remove_files(self.projectDirIn, '.cs')
7979

80+
# Clear possibly inherited Directory.Build.props and Directory.Build.targets:
81+
with open(os.path.join(self.workDir, 'Directory.Build.props'), 'w') as f:
82+
f.write('<Project>\n')
83+
f.write('</Project>\n')
84+
with open(os.path.join(self.workDir, 'Directory.Build.targets'), 'w') as f:
85+
f.write('<Project>\n')
86+
f.write('</Project>\n')
87+
8088
def run_cmd(self, cmd, msg="Failed to run command"):
8189
run_cmd_cwd(cmd, self.workDir, msg)
8290

0 commit comments

Comments
 (0)