From 0acfc907172c0d2379b8638583a6c40e193608cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 30 Jan 2019 21:16:13 +0100 Subject: [PATCH] Fix CorError header file generation (dotnet/coreclr#22294) The checked in batch script was only usable if you have a Razzle environment and even then it didn't update the right files. Commit migrated from https://github.com/dotnet/coreclr/commit/6a43dd765ea6341310fde3f83bb41ff88d94b435 --- src/coreclr/src/inc/genheaders.cs | 13 ++++++++++++- .../src/pal/prebuilt/corerror/makecorerror.bat | 22 +++------------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/coreclr/src/inc/genheaders.cs b/src/coreclr/src/inc/genheaders.cs index af33b1d..6a55cd8 100644 --- a/src/coreclr/src/inc/genheaders.cs +++ b/src/coreclr/src/inc/genheaders.cs @@ -1,3 +1,7 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + using System; using System.Xml; using System.Xml.Schema; @@ -31,8 +35,9 @@ public class GenerateHeaders { int minHR = MakeHresult(SeverityError,FaciltyUrt,0); int maxHR = MakeHresult(SeverityError,FaciltyUrt,0xffff); - + PrintLicenseHeader(HSW); PrintHeader(HSW); + PrintLicenseHeader(RSW); PrintResourceHeader(RSW); XmlTextReader rdr = new XmlTextReader(args[0]); @@ -150,6 +155,12 @@ public class GenerateHeaders { Environment.Exit(-1); } + private static void PrintLicenseHeader(StreamWriter SW) { + SW.WriteLine("// Licensed to the .NET Foundation under one or more agreements."); + SW.WriteLine("// The .NET Foundation licenses this file to you under the MIT license."); + SW.WriteLine("// See the LICENSE file in the project root for more information."); + SW.WriteLine(); + } private static void PrintHeader(StreamWriter SW) { diff --git a/src/coreclr/src/pal/prebuilt/corerror/makecorerror.bat b/src/coreclr/src/pal/prebuilt/corerror/makecorerror.bat index f9b964f..7e5d6e8 100644 --- a/src/coreclr/src/pal/prebuilt/corerror/makecorerror.bat +++ b/src/coreclr/src/pal/prebuilt/corerror/makecorerror.bat @@ -4,24 +4,8 @@ REM The .NET Foundation licenses this file to you under the MIT license. REM See the LICENSE file in the project root for more information. setlocal -if "%_NTROOT%" == "" goto LUsage +csc ..\..\..\inc\genheaders.cs -set MANAGED_TOOLS_PATH=%MANAGED_TOOLS_ROOT%\%MANAGED_TOOLS_VERSION% -set CORERROR_PATH=%_NTROOT%\ndp\clr\src\inc - -%MANAGED_TOOLS_PATH%\genheaders.exe %CORERROR_PATH%\corerror.xml ..\inc\corerror.h mscorurt.rc - -goto LExit - -:LUsage - -echo. -echo makecorerror.bat -echo. -echo Builds corerror.h for PALRT -echo. -echo Should be run inside razzle environment, depends on %%_NTROOT%% environment variable. -echo. - -:LExit +genheaders.exe ..\..\..\inc\corerror.xml ..\inc\corerror.h mscorurt.rc +del genheaders.exe -- 2.7.4