Esempio n. 1
0
def RegenerateAll(rootDirectory):

    root = pathlib.Path(rootDirectory)

    lexillaBase = root.resolve()

    lex = LexillaData.LexillaData(lexillaBase)

    lexillaDir = lexillaBase
    srcDir = lexillaDir / "src"
    docDir = lexillaDir / "doc"

    Regenerate(srcDir / "Lexilla.cxx", "//", lex.lexerModules)
    Regenerate(srcDir / "lexilla.mak", "#", lex.lexFiles)

    # Discover version information
    version = (lexillaDir / "version.txt").read_text().strip()
    versionDotted = version[0] + '.' + version[1] + '.' + version[2]
    versionCommad = versionDotted.replace(".", ", ") + ', 0'

    rcPath = srcDir / "LexillaVersion.rc"
    UpdateLineInFile(rcPath, "#define VERSION_LEXILLA",
                     "#define VERSION_LEXILLA \"" + versionDotted + "\"")
    UpdateLineInFile(rcPath, "#define VERSION_WORDS",
                     "#define VERSION_WORDS " + versionCommad)
    ReplaceREInFile(docDir / "LexillaDownload.html",
                    r"/www.scintilla.org/([a-zA-Z]+)\d\d\d",
                    r"/www.scintilla.org/\g<1>" + version)

    pathMain = lexillaDir / "doc" / "Lexilla.html"
    UpdateLineInFile(pathMain,
        '          <font color="#FFCC99" size="3"> Release version',
        '          <font color="#FFCC99" size="3"> Release version ' + \
        versionDotted + '<br />')
    UpdateLineInFile(
        pathMain, '           Site last modified',
        '           Site last modified ' + lex.mdyModified + '</font>')
    UpdateLineInFile(
        pathMain, '    <meta name="Date.Modified"',
        '    <meta name="Date.Modified" content="' + lex.dateModified + '" />')

    lexillaXcode = lexillaDir / "src" / "Lexilla"
    lexillaXcodeProject = lexillaXcode / "Lexilla.xcodeproj" / "project.pbxproj"

    lexerReferences = LexillaData.FindLexersInXcode(lexillaXcodeProject)

    UpdateLineInPlistFile(lexillaXcode / "Info.plist",
                          "CFBundleShortVersionString", versionDotted)

    ReplaceREInFile(lexillaXcodeProject, "CURRENT_PROJECT_VERSION = [0-9.]+;",
                    f'CURRENT_PROJECT_VERSION = {versionDotted};')

    RegenerateXcodeProject(lexillaXcodeProject, lex.lexFiles, lexerReferences)

    LexFacer.RegenerateAll(root, False)

    currentDirectory = pathlib.Path.cwd()
    os.chdir(srcDir)
    DepGen.Generate()
    os.chdir(currentDirectory)
Esempio n. 2
0
def UpdateVersionNumbers(sci, root):
    UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_SCINTILLA",
        "#define VERSION_SCINTILLA \"" + sci.versionDotted + "\"")
    UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_WORDS",
        "#define VERSION_WORDS " + sci.versionCommad)
    UpdateLineInFile(root + "qt/ScintillaEditBase/ScintillaEditBase.pro",
        "VERSION =",
        "VERSION = " + sci.versionDotted)
    UpdateLineInFile(root + "qt/ScintillaEdit/ScintillaEdit.pro",
        "VERSION =",
        "VERSION = " + sci.versionDotted)
    UpdateLineInFile(root + "doc/ScintillaDownload.html", "       Release",
        "       Release " + sci.versionDotted)
    ReplaceREInFile(root + "doc/ScintillaDownload.html",
        r"/www.scintilla.org/([a-zA-Z]+)\d\d\d",
        r"/www.scintilla.org/\g<1>" +  sci.version)
    UpdateLineInFile(root + "doc/index.html",
        '          <font color="#FFCC99" size="3"> Release version',
        '          <font color="#FFCC99" size="3"> Release version ' +\
        sci.versionDotted + '<br />')
    UpdateLineInFile(root + "doc/index.html",
        '           Site last modified',
        '           Site last modified ' + sci.mdyModified + '</font>')
    UpdateLineInFile(root + "doc/ScintillaHistory.html",
        '	Released ',
        '	Released ' + sci.dmyModified + '.')
    UpdateLineInPlistFile(root + "cocoa/ScintillaFramework/Info.plist",
        "CFBundleVersion", sci.versionDotted)
    UpdateLineInPlistFile(root + "cocoa/ScintillaFramework/Info.plist",
        "CFBundleShortVersionString", sci.versionDotted)
Esempio n. 3
0
def UpdateVersionNumbers(sci, root):
    UpdateLineInFile(root + "scite/src/SciTE.h", "#define VERSION_SCITE",
                     "#define VERSION_SCITE \"" + sci.versionDotted + "\"")
    UpdateLineInFile(root + "scite/src/SciTE.h", "#define VERSION_WORDS",
                     "#define VERSION_WORDS " + sci.versionCommad)
    UpdateLineInFile(
        root + "scite/src/SciTE.h", "#define COPYRIGHT_DATES",
        '#define COPYRIGHT_DATES "December 1998-' + sci.myModified + '"')
    UpdateLineInFile(root + "scite/src/SciTE.h", "#define COPYRIGHT_YEARS",
                     '#define COPYRIGHT_YEARS "1998-' + sci.yearModified + '"')
    UpdateLineInFile(root + "scite/doc/SciTEDownload.html", "       Release",
                     "       Release " + sci.versionDotted)
    ReplaceREInFile(root + "scite/doc/SciTEDownload.html",
                    r"/www.scintilla.org/([a-zA-Z]+)\d\d\d",
                    r"/www.scintilla.org/\g<1>" + sci.version)
    ReplaceREInFile(root + "scite/doc/SciTEDownload.html",
                    r"/www.scintilla.org/(wscite32_)\d\d\d",
                    r"/www.scintilla.org/\g<1>" + sci.version)
    UpdateLineInFile(root + "scite/doc/SciTE.html",
        '          <font color="#FFCC99" size="3"> Release version',
        '          <font color="#FFCC99" size="3"> Release version ' + \
        sci.versionDotted + '<br />')
    UpdateLineInFile(
        root + "scite/doc/SciTE.html", '           Site last modified',
        '           Site last modified ' + sci.mdyModified + '</font>')
    UpdateLineInFile(
        root + "scite/doc/SciTE.html", '    <meta name="Date.Modified"',
        '    <meta name="Date.Modified" content="' + sci.dateModified + '" />')
Esempio n. 4
0
def UpdateVersionNumbers(sci, pathSciTE):
    pathHeader = os.path.join(pathSciTE, "src", "SciTE.h")
    UpdateLineInFile(pathHeader, '#define VERSION_SCITE',
                     '#define VERSION_SCITE "' + sci.versionDotted + '"')
    UpdateLineInFile(pathHeader, "#define VERSION_WORDS",
                     "#define VERSION_WORDS " + sci.versionCommad)
    UpdateLineInFile(
        pathHeader, '#define COPYRIGHT_DATES',
        '#define COPYRIGHT_DATES "December 1998-' + sci.myModified + '"')
    UpdateLineInFile(pathHeader, '#define COPYRIGHT_YEARS',
                     '#define COPYRIGHT_YEARS "1998-' + sci.yearModified + '"')

    pathDownload = os.path.join(pathSciTE, "doc", "SciTEDownload.html")
    UpdateLineInFile(pathDownload, "       Release",
                     "       Release " + sci.versionDotted)
    ReplaceREInFile(pathDownload, r"/www.scintilla.org/([a-zA-Z]+)\d\d\d",
                    r"/www.scintilla.org/\g<1>" + sci.version)
    ReplaceREInFile(pathDownload, r"/www.scintilla.org/(wscite32_)\d\d\d",
                    r"/www.scintilla.org/\g<1>" + sci.version)
    ReplaceREInFile(pathDownload, r"/www.scintilla.org/(Sc32_)\d\d\d",
                    r"/www.scintilla.org/\g<1>" + sci.version)

    pathMain = os.path.join(pathSciTE, "doc", "SciTE.html")
    UpdateLineInFile(pathMain,
        '          <font color="#FFCC99" size="3"> Release version',
        '          <font color="#FFCC99" size="3"> Release version ' + \
        sci.versionDotted + '<br />')
    UpdateLineInFile(
        pathMain, '           Site last modified',
        '           Site last modified ' + sci.mdyModified + '</font>')
    UpdateLineInFile(
        pathMain, '    <meta name="Date.Modified"',
        '    <meta name="Date.Modified" content="' + sci.dateModified + '" />')
Esempio n. 5
0
def UpdateVersionNumbers(sci, root):
    UpdateLineInFile(root / "win32/ScintRes.rc", "#define VERSION_SCINTILLA",
                     "#define VERSION_SCINTILLA \"" + sci.versionDotted + "\"")
    UpdateLineInFile(root / "win32/ScintRes.rc", "#define VERSION_WORDS",
                     "#define VERSION_WORDS " + sci.versionCommad)
    UpdateLineInFile(root / "qt/ScintillaEditBase/ScintillaEditBase.pro",
                     "VERSION =", "VERSION = " + sci.versionDotted)
    UpdateLineInFile(root / "qt/ScintillaEdit/ScintillaEdit.pro", "VERSION =",
                     "VERSION = " + sci.versionDotted)
    UpdateLineInFile(root / "doc/ScintillaDownload.html", "       Release",
                     "       Release " + sci.versionDotted)
    ReplaceREInFile(root / "doc/ScintillaDownload.html",
                    r"/www.scintilla.org/([a-zA-Z]+)\d\d\d",
                    r"/www.scintilla.org/\g<1>" + sci.version, 0)
    UpdateLineInFile(root / "doc/index.html",
        '          <font color="#FFCC99" size="3"> Release version',
        '          <font color="#FFCC99" size="3"> Release version ' +\
        sci.versionDotted + '<br />')
    UpdateLineInFile(
        root / "doc/index.html", '           Site last modified',
        '           Site last modified ' + sci.mdyModified + '</font>')
    UpdateLineInFile(root / "doc/ScintillaHistory.html", '	Released ',
                     '	Released ' + sci.dmyModified + '.')

    cocoa = root / "cocoa"

    UpdateLineInPlistFile(cocoa / "Scintilla" / "Info.plist",
                          "CFBundleShortVersionString", sci.versionDotted)
    ReplaceREInFile(
        cocoa / "Scintilla" / "Scintilla.xcodeproj" / "project.pbxproj",
        "CURRENT_PROJECT_VERSION = [0-9.]+;",
        f'CURRENT_PROJECT_VERSION = {sci.versionDotted};', 0)
Esempio n. 6
0
def RegenerateAll(rootDirectory):

    root = pathlib.Path(rootDirectory)

    scintillaBase = root.resolve()

    sci = ScintillaData.ScintillaData(scintillaBase)

    lexillaDir = scintillaBase / "lexilla"
    srcDir = lexillaDir / "src"

    Regenerate(srcDir / "Lexilla.cxx", "//", sci.lexerModules)
    Regenerate(srcDir / "lexilla.mak", "#", sci.lexFiles)

    # Discover version information
    version = (lexillaDir / "version.txt").read_text().strip()
    versionDotted = version[0] + '.' + version[1] + '.' + version[2]
    versionCommad = versionDotted.replace(".", ", ") + ', 0'

    rcPath = srcDir / "LexillaVersion.rc"
    UpdateLineInFile(rcPath, "#define VERSION_LEXILLA",
                     "#define VERSION_LEXILLA \"" + versionDotted + "\"")
    UpdateLineInFile(rcPath, "#define VERSION_WORDS",
                     "#define VERSION_WORDS " + versionCommad)

    lexillaXcode = lexillaDir / "src" / "Lexilla"
    lexillaXcodeProject = lexillaXcode / "Lexilla.xcodeproj" / "project.pbxproj"

    lexerReferences = ScintillaData.FindLexersInXcode(lexillaXcodeProject)

    UpdateLineInPlistFile(lexillaXcode / "Info.plist",
                          "CFBundleShortVersionString", versionDotted)

    ReplaceREInFile(lexillaXcodeProject, "CURRENT_PROJECT_VERSION = [0-9.]+;",
                    f'CURRENT_PROJECT_VERSION = {versionDotted};')

    RegenerateXcodeProject(lexillaXcodeProject, sci.lexFiles, lexerReferences)

    currentDirectory = pathlib.Path.cwd()
    os.chdir(srcDir)
    DepGen.Generate()
    os.chdir(currentDirectory)
Esempio n. 7
0
def UpdateVersionNumbers(sci, root):
    UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_SCINTILLA",
                     "#define VERSION_SCINTILLA \"" + sci.versionDotted + "\"")
    UpdateLineInFile(root + "win32/ScintRes.rc", "#define VERSION_WORDS",
                     "#define VERSION_WORDS " + sci.versionCommad)
    UpdateLineInFile(root + "qt/ScintillaEditBase/ScintillaEditBase.pro",
                     "VERSION =", "VERSION = " + sci.versionDotted)
    UpdateLineInFile(root + "qt/ScintillaEdit/ScintillaEdit.pro", "VERSION =",
                     "VERSION = " + sci.versionDotted)
    UpdateLineInFile(root + "doc/ScintillaDownload.html", "       Release",
                     "       Release " + sci.versionDotted)
    ReplaceREInFile(
        root + "doc/ScintillaDownload.html",
        r"(/sourceforge.net/projects/scintilla/files/scintilla/)[\d\.]+(/[a-zA-Z]+)\d+",
        r"\g<1>" + sci.versionDotted + "\g<2>" + sci.version)
    UpdateLineInFile(root + "doc/index.html",
        '          <font color="#FFCC99" size="3"> Release version',
        '          <font color="#FFCC99" size="3"> Release version ' +\
        sci.versionDotted + '<br />')
    UpdateLineInFile(
        root + "doc/index.html", '           Site last modified',
        '           Site last modified ' + sci.mdyModified + '</font>')
    ReplaceREInFile(
        root + "doc/ScintillaHistory.html",
        r"(/sourceforge.net/projects/scintilla/files/scintilla/)[\d\.]+(/[a-zA-Z]+)\d+",
        r"\g<1>" + sci.versionDotted + "\g<2>" + sci.version,
        count=1)
    ReplaceREInFile(root + "doc/ScintillaHistory.html",
                    r">Release [\d\.]+<",
                    ">Release " + sci.versionDotted + "<",
                    count=1)
    UpdateLineInFile(root + "doc/ScintillaHistory.html", '	Released ',
                     '	Released ' + sci.dmyModified + '.')
    UpdateLineInPlistFile(root + "cocoa/ScintillaFramework/Info.plist",
                          "CFBundleVersion", sci.versionDotted)
    UpdateLineInPlistFile(root + "cocoa/ScintillaFramework/Info.plist",
                          "CFBundleShortVersionString", sci.versionDotted)
    UpdateLineInFile(root + "LongTermDownload.html", "       Release",
                     "       Release " + sci.versionDotted)
    ReplaceREInFile(
        root + "LongTermDownload.html",
        r"(/sourceforge.net/projects/scintilla/files/scintilla/)[\d\.]+(/[a-zA-Z]+)\d+",
        r"\g<1>" + sci.versionDotted + "\g<2>" + sci.version)
Esempio n. 8
0
def RegenerateAll(root):

    scintillaBase = os.path.abspath(root)

    sci = ScintillaData.ScintillaData(root + os.sep)

    lexillaDir = os.path.join(root, "lexilla")
    srcDir = os.path.join(lexillaDir, "src")

    Regenerate(os.path.join(srcDir, "Lexilla.cxx"), "//", sci.lexerModules)
    Regenerate(os.path.join(srcDir, "lexilla.mak"), "#", sci.lexFiles)

    # Discover version information
    with open(os.path.join(lexillaDir, "version.txt")) as f:
        version = f.read().strip()
    versionDotted = version[0] + '.' + version[1] + '.' + version[2]
    versionCommad = versionDotted.replace(".", ", ") + ', 0'

    rcPath = os.path.join(srcDir, "LexillaVersion.rc")
    UpdateLineInFile(rcPath, "#define VERSION_LEXILLA",
                     "#define VERSION_LEXILLA \"" + versionDotted + "\"")
    UpdateLineInFile(rcPath, "#define VERSION_WORDS",
                     "#define VERSION_WORDS " + versionCommad)