Example #1
0
def compile_GME_PGO_Instrument():
    "Compile GME core components (PGO Instrument)"
    # e.g. Dispatch("MGA.MgaParser") locks Parser.dll. FreeLibary it here
    import ctypes
    ctypes.windll.ole32.CoFreeUnusedLibraries()
    import errno
    try:
        os.makedirs(_Release_PGO_dir())
    except OSError as exc:
        if exc.errno != errno.EEXIST:
            raise
    VC_path = os.path.join(
        prefs['VS_dir'],
        r"VC\bin\%s" % (prefs['arch'] == 'x64' and 'amd64\\' or ''))
    copy_if_newer(
        os.path.join(VC_path, r"pgort%s0.dll" % prefs['toolset']),
        os.path.join(_Release_PGO_dir(), 'pgort%s0.dll' % prefs['toolset']))
    sln_file = os.path.join(GME_ROOT, "GME", "GME.sln")
    _remove_dlldata_from_tlog()
    tools.build_VS(sln_file, "Release_PGO_Instrument")
    _remove_dlldata_from_tlog()
    cmd_dir = os.path.join(GME_ROOT, "GME")
    tools.system(['call', 'regPGO.bat'] +
                 (['x64'] if prefs['arch'] == 'x64' else []) + ['<NUL'],
                 cmd_dir)
Example #2
0
def compile_meta():
    "Compile MetaGME components"
    sln_file = os.path.join(GME_ROOT, "Paradigms", "MetaGME", "MetaGME.sln")
    tools.build_VS(sln_file, "Release")
    cmd_dir = os.path.join(GME_ROOT, "Paradigms", "MetaGME")
    tools.system(['call', 'regrelease.bat'] +
                 (['x64'] if prefs['arch'] == 'x64' else []) + ['<NUL'],
                 cmd_dir)
Example #3
0
def compile_JBON():
    "Compile Java component support (JBON)"
    if prefs['arch'] == 'x64': return
    tools.system(
        r"reg add HKLM\Software\GME /t REG_SZ /v JavaClassPath /d".split() +
        [os.path.join(GME_ROOT, "SDK", "Java", "gme.jar"), "/reg:32", "/f"])
    sln_file = os.path.join(GME_ROOT, "SDK", "Java", "native",
                            "JavaSupport.sln")
    tools.build_VS(sln_file, "Release")
Example #4
0
def compile_GME():
    "Compile GME core components"
    if prefs['arch'] == 'x64':
        # To use 32bit Python.exe for the tests, 32bit CoreCollectionHandler must be registered
        sln_file = os.path.join(GME_ROOT, "GME", "GME.sln")
        _remove_dlldata_from_tlog()
        tools.build_VS(sln_file, 'Release', arch='Win32', target='Core')
        _remove_dlldata_from_tlog()
        tools.system([
            'regsvr32', '/s',
            os.path.join(GME_ROOT, "GME", "Release", "Core.dll")
        ])
    sln_file = os.path.join(GME_ROOT, "GME", "GME.sln")
    _remove_dlldata_from_tlog()
    tools.build_VS(sln_file, "Release")
    _remove_dlldata_from_tlog()
    sln_file = os.path.join(GME_ROOT, "GME", "GMEDecorators.sln")
    tools.build_VS(sln_file, "Release")
    cmd_dir = os.path.join(GME_ROOT, "GME")
    tools.system(['call', 'regrelease.bat'] +
                 (['x64'] if prefs['arch'] == 'x64' else []) + ['<NUL'],
                 cmd_dir)
    sln_file = os.path.join(GME_ROOT, "GME", "DotNetPIAs",
                            "DotNetPIAs.vcxproj")
    tools.build_VS(sln_file, "Release")

    for filename in ('policy.1.0.GME.MGA.Core', 'policy.1.0.GME.MGA.Meta',
                     'policy.1.0.GME.MGA', 'policy.1.0.GME',
                     'policy.1.0.GME.Util', 'policy.1.0.GME.MGA.Parser'):
        pia_dir = os.path.join(GME_ROOT, "GME", "DotNetPIAs_1.0.1.0")
        config = '%s.config' % filename
        dll = '%s.dll' % filename
        if newer(os.path.join(pia_dir, config), os.path.join(pia_dir, dll)):
            tools.system([
                r'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\al.exe',
                '/link:' + config, '/out:' + dll,
                '/keyfile:..\MgaDotNetServices\MgaDotNetServicesKey.snk',
                '/platform:anycpu', '/version:1.0.0.0'
            ], pia_dir)
            tools.system([
                r'C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\gacutil.exe',
                '/i', dll
            ], pia_dir)
Example #5
0
def compile_samples():
    "Compile sample components"

    # UML Paradigm
    sln_file = os.path.join(GME_ROOT, "Paradigms", "UML", "decorator",
                            "UMLDecorator.sln")
    tools.build_VS(sln_file, "Release")

    if prefs['arch'] == 'x64': return

    sln_file = os.path.join(GME_ROOT, "SDK", "PatternProcessor",
                            "PatternProcessor.sln")
    tools.build_VS(sln_file, "Release")

    # SF Paradigm
    sln_file = os.path.join(GME_ROOT, "Paradigms", "SF", "SFInterpreter",
                            "SFInterpreter.sln")
    tools.build_VS(sln_file, "Release")
    sln_file = os.path.join(GME_ROOT, "Paradigms", "SF", "BON2SFSample",
                            "BON2SFSample.sln")
    tools.build_VS(sln_file, "Release")
    sln_file = os.path.join(GME_ROOT, "Paradigms", "SF", "BON2SFInterpreter",
                            "BON2SFInterpreter.sln")
    tools.build_VS(sln_file, "Release")

    # HFSM Paradigm
    sln_file = os.path.join(GME_ROOT, "Paradigms", "HFSM", "HFSMSimulator",
                            "HFSMSimulator.sln")
    tools.build_VS(sln_file, "Release")
Example #6
0
def compile_tools():
    "Compile external tool components"
    import _winreg

    # Auto Layout
    sln_file = os.path.join(GME_ROOT, "Tools", "AutoLayout", "AutoLayout.sln")
    tools.build_VS(sln_file, "Release")

    sln_file = os.path.join(GME_ROOT, "SDK", "DotNet", "DsmlGenerator",
                            "DsmlGenerator.sln")
    tools.build_VS(
        sln_file,
        "Release",
        arch='Any CPU',
        msbuild=(prefs['arch'] == 'x64'
                 and tools.MSBUILD.replace('Framework', 'Framework64')
                 or tools.MSBUILD))

    with _winreg.OpenKey(
            _winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft", 0,
            _winreg.KEY_WOW64_32KEY | _winreg.KEY_WRITE
            | _winreg.KEY_READ) as ms:
        with _winreg.CreateKey(
                ms,
                r".NETFramework\v4.0.30319\AssemblyFoldersEx\ISIS.GME.Common"
        ) as key:
            _winreg.SetValueEx(
                key, None, 0, _winreg.REG_SZ,
                os.path.join(
                    os.environ['windir'],
                    r"Microsoft.NET\assembly\GAC_MSIL\ISIS.GME.Common\v4.0_1.0.7.0__1321e6b92842fe54"
                ))

    sln_file = os.path.join(GME_ROOT, "Tools", "DumpWMF", "DumpWMF.sln")
    tools.build_VS(
        sln_file,
        "Release",
        arch='Any CPU',
        msbuild=(prefs['arch'] == 'x64'
                 and tools.MSBUILD.replace('Framework', 'Framework64')
                 or tools.MSBUILD))

    if prefs['arch'] == 'x64':
        tools.system([
            r'%windir%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe',
            '/codebase',
            os.path.join(GME_ROOT, 'Tools', 'DumpWMF', 'bin', 'Release',
                         'DumpWMF.dll')
        ])
        with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,
                             r"CLSID\{A051FEEA-E310-3F6A-8D71-A55E3F4F2E14}",
                             0, _winreg.KEY_WRITE
                             | _winreg.KEY_WOW64_64KEY) as key:
            _winreg.SetValueEx(key, "AppID", 0, _winreg.REG_SZ,
                               "{461F30AF-3BF0-11D4-B3F0-005004D38590}")

        tools.system([
            r'%windir%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe',
            '/codebase',
            os.path.join(GME_ROOT, 'SDK', 'DotNet', 'DsmlGenerator',
                         'CSharpDsmlGenerator', 'bin', 'Release',
                         'CSharpDSMLGenerator.dll')
        ])
        return

    # Table Editor
    sln_file = os.path.join(GME_ROOT, "Tools", "TableEditor",
                            "TableEditor.sln")
    tools.build_VS(sln_file, "Release")

    # GMEplink
    sln_file = os.path.join(GME_ROOT, "Tools", "GMEplink", "GMEplink.sln")
    tools.build_VS(sln_file, "Release")

    sln_file = os.path.join(GME_ROOT, "SDK", "DotNet", "CSharpComponentWizard",
                            "CSharpComponentWizard.sln")
    tools.build_VS(sln_file, "Release")
Example #7
0
def compile_GME_PGO_Optimize():
    "Compile GME core components (PGO Optimize)"
    sln_file = os.path.join(GME_ROOT, "GME", "GME.sln")
    _remove_dlldata_from_tlog()
    tools.build_VS(sln_file, "Release_PGO_Optimize")
    _remove_dlldata_from_tlog()