Пример #1
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)
Пример #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, 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)
Пример #3
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)
Пример #4
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)
Пример #5
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)