Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2015-12-04 21:02:56 +0300
committerMichal Strehovský <MichalStrehovsky@users.noreply.github.com>2015-12-04 21:02:56 +0300
commit94ce4ec438e10b56f6990fbb4f3ad65c649bcc9b (patch)
treea7d5f176e07566c3b8f42672e54f69777174db77 /src/Common
parentb485b15f31bf66d5b8cfa1d95d4cd26618ffb348 (diff)
parent0d3c1ac77e5af91cf95a2964b35f7e997091b14c (diff)
Merge pull request #482 from MichalStrehovsky/updateSchema
Add script to run native format generator
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/src/Internal/Metadata/NativeFormat/Script/CsMdBinaryRWCommonGen.py4
-rw-r--r--src/Common/src/Internal/Metadata/NativeFormat/Script/CsPublicGen2.py2
-rw-r--r--src/Common/src/Internal/Metadata/NativeFormat/Script/CsReaderGen2.py2
-rw-r--r--src/Common/src/Internal/Metadata/NativeFormat/Script/CsWriterGen2.py2
-rw-r--r--src/Common/src/Internal/Metadata/NativeFormat/UpdateNativeFormatSources.cmd32
5 files changed, 37 insertions, 5 deletions
diff --git a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsMdBinaryRWCommonGen.py b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsMdBinaryRWCommonGen.py
index f355ba575..3bf85b88f 100644
--- a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsMdBinaryRWCommonGen.py
+++ b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsMdBinaryRWCommonGen.py
@@ -174,7 +174,7 @@ else
#------------------------------------------------------------------------------------------------------
def CsEmitSource(self):
# Source MdBinaryReaderGen.cs
- with open(r'System\Reflection\Metadata\MdBinaryReaderGen.cs', 'w') as output :
+ with open(r'MdBinaryReaderGen.cs', 'w') as output :
ns = NamespaceDef('Internal.Metadata.NativeFormat')
ns.members.add(self.CreateMdBinaryReaderClass())
@@ -193,7 +193,7 @@ else
ns.CsDefine(iprint)
# Source MdBinaryWriterGen.cs
- with open(r'..\..\..\PnToolChain\Metadata\NativeFormatWriter\MdBinaryWriterGen.cs', 'w') as output :
+ with open(r'..\..\..\..\..\ILCompiler.MetadataWriter\src\Internal\Metadata\NativeFormat\Writer\MdBinaryWriterGen.cs', 'w') as output :
ns = NamespaceDef('Internal.Metadata.NativeFormat.Writer')
ns.members.add(self.CreateMdBinaryWriterClass())
diff --git a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsPublicGen2.py b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsPublicGen2.py
index dbef8d78b..008566781 100644
--- a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsPublicGen2.py
+++ b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsPublicGen2.py
@@ -314,7 +314,7 @@ def CsEmitSource():
sig = [hnd, [(Ty.MetadataReader, 'reader')]]))
# Source NativeFormatReaderCommonGen.cs
- with open(r'System\Reflection\Metadata\NativeFormatReaderCommonGen.cs', 'w') as output :
+ with open(r'NativeFormatReaderCommonGen.cs', 'w') as output :
iprint = IPrint(output)
CsEmitFileHeader(iprint)
iprint('using System;')
diff --git a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsReaderGen2.py b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsReaderGen2.py
index dba885efa..9d61c4509 100644
--- a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsReaderGen2.py
+++ b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsReaderGen2.py
@@ -538,7 +538,7 @@ def CsEmitSource():
Ty.MetadataReader.members += CreateReaderMembers(Ty.MetadataReader, records, handles)
# Source NativeFormatReaderGen.cs
- with open(r'System\Reflection\Metadata\NativeFormatReaderGen.cs', 'w') as output :
+ with open(r'NativeFormatReaderGen.cs', 'w') as output :
iprint = IPrint(output)
CsEmitFileHeader(iprint)
iprint('#pragma warning disable 649')
diff --git a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsWriterGen2.py b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsWriterGen2.py
index 79302b9e8..439624256 100644
--- a/src/Common/src/Internal/Metadata/NativeFormat/Script/CsWriterGen2.py
+++ b/src/Common/src/Internal/Metadata/NativeFormat/Script/CsWriterGen2.py
@@ -389,7 +389,7 @@ finally
# ns.members.add(CreateHandleEnumerable(reader, hnd))
# Source NativeFormatReaderGen.cs
- with open(r'..\..\..\PnToolChain\Metadata\NativeFormatWriter\NativeFormatWriterGen.cs', 'w') as output :
+ with open(r'..\..\..\..\..\ILCompiler.MetadataWriter\src\Internal\Metadata\NativeFormat\Writer\NativeFormatWriterGen.cs', 'w') as output :
iprint = IPrint(output)
CsEmitFileHeader(iprint)
iprint('#pragma warning disable 649')
diff --git a/src/Common/src/Internal/Metadata/NativeFormat/UpdateNativeFormatSources.cmd b/src/Common/src/Internal/Metadata/NativeFormat/UpdateNativeFormatSources.cmd
new file mode 100644
index 000000000..238a8d174
--- /dev/null
+++ b/src/Common/src/Internal/Metadata/NativeFormat/UpdateNativeFormatSources.cmd
@@ -0,0 +1,32 @@
+@echo off
+
+setlocal
+
+if "%PYTHON%"=="" (
+ echo PYTHON environment variable not set. Point this to a Python interpreter EXE (e.g. ipy.exe for IronPython^)
+ exit /b 1
+)
+
+set __py=%PYTHON% -W "ignore::DeprecationWarning::"
+
+echo Generating public APIs.
+%__py% Script\CsPublicGen2.py
+if ERRORLEVEL 1 goto Fail
+
+echo Generating native format reader sources.
+%__py% Script\CsReaderGen2.py
+if ERRORLEVEL 1 goto Fail
+
+echo Generating native format writer sources.
+%__py% Script\CsWriterGen2.py
+if ERRORLEVEL 1 goto Fail
+
+echo Generating binary format reader and writer sources.
+%__py% Script\CsMdBinaryRWCommonGen.py
+if ERRORLEVEL 1 goto Fail
+
+goto :EOF
+
+:Fail
+echo ERROR: Failed running script
+exit /b 1