Exemplo n.º 1
0
def prepareSourceTree():

    # remove and recreat dir and cd into it...
    if os.path.isdir(options.packageRoot):
        shutil.rmtree(options.packageRoot)

    os.makedirs(options.packageRoot)
    os.chdir(options.packageRoot)

    # set up the perforce client...
    tmpFile = open("p4spec.tmp", "w")
    tmpFile.write("Root: %s\n" % (options.packageRoot))
    tmpFile.write("Owner: %s\n" % options.p4User)
    tmpFile.write("Client: %s\n" % options.p4Client)
    tmpFile.write("View:\n")
    tmpFile.write("        //depot/qt/%s/...  //%s/qt/...\n" % (options.qtBranch, options.p4Client))
    tmpFile.write("        -//depot/qt/%s/examples/... //qt-builder/qt/examples/...\n" % options.qtBranch)
    tmpFile.write("        -//depot/qt/%s/tests/... //qt-builder/qt/tests/...\n" % options.qtBranch)
    tmpFile.write("        -//depot/qt/%s/demos/... //qt-builder/qt/demos/...\n" % options.qtBranch)
    tmpFile.write("        -//depot/qt/%s/doc/... //qt-builder/qt/doc/...\n" % options.qtBranch)
    tmpFile.write("        -//depot/qt/%s/tmake/... //qt-builder/qt/tmake/...\n" % options.qtBranch)
    tmpFile.write("        -//depot/qt/%s/translations/... //qt-builder/qt/translations/...\n" % options.qtBranch)
    tmpFile.write("        -//depot/qt/%s/dist/... //qt-builder/qt/dist/...\n" % options.qtBranch)
    tmpFile.close()
    os.system("p4 -u %s -c %s client -i < p4spec.tmp" % (options.p4User, options.p4Client) );
    os.remove("p4spec.tmp")

    # sync p4 client spec into subdirectory...
    label = ""
    if options.qtLabel:
        label = "@" + options.qtLabel
    pkgutil.debug(" - syncing p4...")
    os.system("p4 -u %s -c %s sync -f //%s/... %s > .p4sync.buildlog" % (options.p4User, options.p4Client, options.p4Client, label))
    os.system("chmod -R u+w .")
Exemplo n.º 2
0
def prepareSourceTree():

    # remove and recreat dir and cd into it...
    if os.path.isdir(options.packageRoot):
        shutil.rmtree(options.packageRoot)
    os.makedirs(options.packageRoot)
    os.chdir(options.packageRoot)

    # set up the perforce client...
    tmpFile = open("p4spec.tmp", "w")
    tmpFile.write("Root: %s\n" % (options.packageRoot))
    tmpFile.write("Owner: %s\n" % options.p4User)
    tmpFile.write("Client: %s\n" % options.p4Client)
    tmpFile.write("View:\n")
    tmpFile.write("        //depot/qtjambi/%s/...  //qt-builder/qtjambi/...\n" % options.qtJambiVersion)
    tmpFile.write("        //depot/qt/%s/src/tools/uic/...  //qt-builder/qt/src/tools/uic/...\n" % options.qtVersion)
    tmpFile.write("        //depot/qt/%s/tools/designer/src/lib/...  //qt-builder/qt/tools/designer/src/lib/...\n" % options.qtVersion)
    tmpFile.write("        //depot/eclipse/qtjambi-4.5/...  //qt-builder/qtjambi/eclipse/qtjambi-4.5/...\n")
    tmpFile.write("        //depot/ide/main/shared/designerintegrationv2/...  //qt-builder/qtjambi/ide/main/shared/designerintegrationv2/...\n")
    tmpFile.write("        //depot/ide/main/shared/namespace_global.h  //qt-builder/qtjambi/ide/main/shared/namespace_global.h\n")
    tmpFile.close()
    os.system("p4 -u %s -c %s client -i < p4spec.tmp" % (options.p4User, options.p4Client) )
    os.remove("p4spec.tmp")

    # sync p4 client spec into subdirectory...
    pkgutil.debug(" - syncing p4...")
    os.system("p4 -u %s -c %s sync -f //%s/... > .p4sync.buildlog" % (options.p4User, options.p4Client, options.p4Client))
    os.system("chmod -R a+wX .")
Exemplo n.º 3
0
def removeFiles(package):
    for (root, dirs, files) in os.walk(package.packageDir, False):
        for pattern in package.removePatterns:
            for relfile in files:
                file = os.path.join(root, relfile)
                if pattern.search(file):
                    package.removeFiles.append(file)
            for reldir in dirs:
                dir = os.path.join(root, reldir)
                if pattern.search(dir):
                    package.removeDirs.append(dir)
                    
    rmlist = [];
    for fileToRemove in package.removeFiles:
        try:
            if os.path.isfile(fileToRemove):
                os.remove(fileToRemove)
                rmlist.append("remove file: " + fileToRemove);
        except:
            pkgutil.debug("Failed to delete file: " + fileToRemove)

    for dirToRemove in package.removeDirs:
        try:
            if os.path.isdir(dirToRemove):
                shutil.rmtree(dirToRemove)
                rmlist.append("remove dir: " + dirToRemove)
        except:
            pkgutil.debug("Failed to delete directory: " + dirToRemove)

    package.writeLog(rmlist, "removelog")
Exemplo n.º 4
0
 def writeLog(self, list, subname):
     logName = os.path.join(options.packageRoot,
                            ".%s.%s" % (self.name(), subname))
     pkgutil.debug("   - log into: " + logName)
     log = open(logName, "w")
     log.write("\n".join(list))
     log.close()
Exemplo n.º 5
0
def packageSourcePackage(package):
    pkgutil.debug("packaging source package: %s..." % package.name())

    os.chdir(options.packageRoot)

    if os.path.isdir(package.name()):
        shutil.rmtree(package.name())

    shutil.copytree("qtjambi", package.name())

    postProcessPackage(package)
Exemplo n.º 6
0
def prepareSourceTree():

    # remove and recreat dir and cd into it...
    if os.path.isdir(options.packageRoot):
        shutil.rmtree(options.packageRoot)

    os.makedirs(options.packageRoot)
    os.chdir(options.packageRoot)

    # set up the perforce client...
    tmpFile = open("p4spec.tmp", "w")
    tmpFile.write("Root: %s\n" % (options.packageRoot))
    tmpFile.write("Owner: %s\n" % options.p4User)
    tmpFile.write("Client: %s\n" % options.p4Client)
    tmpFile.write("View:\n")
    tmpFile.write("        //depot/qt/%s/...  //%s/qt/...\n" %
                  (options.qtBranch, options.p4Client))
    tmpFile.write(
        "        -//depot/qt/%s/examples/... //qt-builder/qt/examples/...\n" %
        options.qtBranch)
    tmpFile.write(
        "        -//depot/qt/%s/tests/... //qt-builder/qt/tests/...\n" %
        options.qtBranch)
    tmpFile.write(
        "        -//depot/qt/%s/demos/... //qt-builder/qt/demos/...\n" %
        options.qtBranch)
    tmpFile.write("        -//depot/qt/%s/doc/... //qt-builder/qt/doc/...\n" %
                  options.qtBranch)
    tmpFile.write(
        "        -//depot/qt/%s/tmake/... //qt-builder/qt/tmake/...\n" %
        options.qtBranch)
    tmpFile.write(
        "        -//depot/qt/%s/translations/... //qt-builder/qt/translations/...\n"
        % options.qtBranch)
    tmpFile.write(
        "        -//depot/qt/%s/dist/... //qt-builder/qt/dist/...\n" %
        options.qtBranch)
    tmpFile.close()
    os.system("p4 -u %s -c %s client -i < p4spec.tmp" %
              (options.p4User, options.p4Client))
    os.remove("p4spec.tmp")

    # sync p4 client spec into subdirectory...
    label = ""
    if options.qtLabel:
        label = "@" + options.qtLabel
    pkgutil.debug(" - syncing p4...")
    os.system("p4 -u %s -c %s sync -f //%s/... %s > .p4sync.buildlog" %
              (options.p4User, options.p4Client, options.p4Client, label))
    os.system("chmod -R u+w .")
Exemplo n.º 7
0
def main():
    for i in range(0, len(sys.argv)):
        arg = sys.argv[i];
        if arg == "--package-root":
            options.packageRoot = sys.argv[i+1]
        elif arg == "--qt-branch":
            options.qtBranch = sys.argv[i+1]
        elif arg == "--qt-label":
            options.qtLabel = sys.argv[i+1]
        elif arg == "--no-p4sync":
            options.p4Resync = False
        elif arg == "--verbose":
            pkgutil.VERBOSE = 1
        elif arg == "--no-mac":
            options.buildMac = False
        elif arg == "--no-win":
            options.buildWindows = False
        elif arg == "--no-linux":
            options.buildLinux = False
        elif arg == "--no-32bit":
            options.build32 = False
        elif arg == "--no-64bit":
            options.build64 = False

    pkgutil.debug("Options:")
    print "  - Qt Branch: %s" % options.qtBranch
    print "  - Qt Label: %s" % options.qtLabel
    print "  - Package Root: " + options.packageRoot
    print "  - P4 User: "******"  - P4 Client: " + options.p4Client
    print "  - P4 Resync: %s" % options.p4Resync
    print "  - buildMac: %s" % options.buildMac
    print "  - buildWindows: %s" % options.buildWindows
    print "  - buildLinux: %s" % options.buildLinux
    print "  - build32: %s" % options.build32
    print "  - build64: %s" % options.build64

    if not options.qtBranch:
        pkgutil.debug("At the very least, you must specify --qt-branch")
        return

    if options.p4Resync:
        pkgutil.debug("preparing source tree...")
        prepareSourceTree()

    pkgutil.debug("setting up packages..")
    setupServers()

    for server in servers:
        packageAndSend(server)

    waitForResponse()
Exemplo n.º 8
0
def main():
    for i in range(0, len(sys.argv)):
        arg = sys.argv[i]
        if arg == "--package-root":
            options.packageRoot = sys.argv[i + 1]
        elif arg == "--qt-branch":
            options.qtBranch = sys.argv[i + 1]
        elif arg == "--qt-label":
            options.qtLabel = sys.argv[i + 1]
        elif arg == "--no-p4sync":
            options.p4Resync = False
        elif arg == "--verbose":
            pkgutil.VERBOSE = 1
        elif arg == "--no-mac":
            options.buildMac = False
        elif arg == "--no-win":
            options.buildWindows = False
        elif arg == "--no-linux":
            options.buildLinux = False
        elif arg == "--no-32bit":
            options.build32 = False
        elif arg == "--no-64bit":
            options.build64 = False

    pkgutil.debug("Options:")
    print "  - Qt Branch: %s" % options.qtBranch
    print "  - Qt Label: %s" % options.qtLabel
    print "  - Package Root: " + options.packageRoot
    print "  - P4 User: "******"  - P4 Client: " + options.p4Client
    print "  - P4 Resync: %s" % options.p4Resync
    print "  - buildMac: %s" % options.buildMac
    print "  - buildWindows: %s" % options.buildWindows
    print "  - buildLinux: %s" % options.buildLinux
    print "  - build32: %s" % options.build32
    print "  - build64: %s" % options.build64

    if not options.qtBranch:
        pkgutil.debug("At the very least, you must specify --qt-branch")
        return

    if options.p4Resync:
        pkgutil.debug("preparing source tree...")
        prepareSourceTree()

    pkgutil.debug("setting up packages..")
    setupServers()

    for server in servers:
        packageAndSend(server)

    waitForResponse()
Exemplo n.º 9
0
def waitForResponse():
    packagesRemaining = options.binaryPackageCount
    pkgutil.debug("Waiting for build server responses...")

    while packagesRemaining:
        displayStatus()
        (sock, (host, port)) = serversocket.accept()
        pkgutil.debug(" - got response from %s:%d" % (host, port))
        match = False
        for pkg in packages:
            if pkg.binary and socket.gethostbyname(pkg.buildServer) == host and not pkg.done:
                pkg.done = True
                pkg.dataFile = options.packageRoot + "/" + pkg.name() + ".zip"
                pkgutil.getDataFile(sock, pkg.dataFile)
                pkgutil.debug(" - uncompressing to %s" % (pkg.packageDir))
                pkgutil.uncompress(pkg.dataFile, pkg.packageDir);
                try:
                    postProcessPackage(pkg)
                except:
                    traceback.print_exc()
                packagesRemaining = packagesRemaining - 1
                match = True
                break
        if not match:
            print "   - unknown host... %s" % host
    displayStatus()
Exemplo n.º 10
0
def waitForResponse():
    packagesRemaining = len(servers)
    pkgutil.debug("Waiting for build server responses...")

    while packagesRemaining:
        (sock, (host, port)) = serversocket.accept()
        pkgutil.debug(" - got response from %s:%d" % (host, port))
        match = False
        for server in servers:
            if socket.gethostbyname(server.host) == host:
                dataFile = options.packageRoot + "/" + server.host + ".zip"
                outDir = options.packageRoot + "/" + server.host;
                pkgutil.getDataFile(sock, dataFile)
                pkgutil.debug(" - uncompressing to %s" % outDir)
                pkgutil.uncompress(dataFile, outDir);

                if os.path.isfile(outDir + "/FATAL.ERROR"):
                    print "Build server: %s Failed!!!!" % server.host
                else:
                    print "Build server: %s ok!" % server.host

                match = True

        if match:
            packagesRemaining = packagesRemaining - 1
Exemplo n.º 11
0
def packageAndSend(server):
    pkgutil.debug("sending to %s, script=%s..." % (server.host, server.task))

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")
    os.makedirs("tmptree")

    print " - setting up lgpl subdir..."
    shutil.copytree("qt", "tmptree/lgpl")
    pkgutil.expandMacroes("tmptree/lgpl", lgpl_header)

    print " - setting up commercial subdir..."
    shutil.copytree("qt", "tmptree/commercial")
    pkgutil.expandMacroes("tmptree/commercial", commercial_header)

    if server.platform == pkgutil.PLATFORM_WINDOWS:
        shutil.copy(server.task, "tmptree/task.bat")
    else:
        shutil.copy(server.task, "tmptree/task.sh")

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending to host: %s.." % (server.host))
    pkgutil.sendDataFileToHost(server.host, pkgutil.PORT_SERVER, zipFile)
Exemplo n.º 12
0
def packageAndSend(server):
    pkgutil.debug("sending to %s, script=%s..." % (server.host, server.task))

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")
    os.makedirs("tmptree")

    print " - setting up lgpl subdir..."
    shutil.copytree("qt", "tmptree/lgpl");
    pkgutil.expandMacroes("tmptree/lgpl", lgpl_header)
    

    print " - setting up commercial subdir..."
    shutil.copytree("qt", "tmptree/commercial");
    pkgutil.expandMacroes("tmptree/commercial", commercial_header)


    if server.platform == pkgutil.PLATFORM_WINDOWS:
        shutil.copy(server.task, "tmptree/task.bat")
    else:
        shutil.copy(server.task, "tmptree/task.sh")

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending to host: %s.." % (server.host))
    pkgutil.sendDataFileToHost(server.host, pkgutil.PORT_SERVER, zipFile)
Exemplo n.º 13
0
def waitForResponse():
    packagesRemaining = len(servers)
    pkgutil.debug("Waiting for build server responses...")

    while packagesRemaining:
        (sock, (host, port)) = serversocket.accept()
        pkgutil.debug(" - got response from %s:%d" % (host, port))
        match = False
        for server in servers:
            if socket.gethostbyname(server.host) == host:
                dataFile = options.packageRoot + "/" + server.host + ".zip"
                outDir = options.packageRoot + "/" + server.host
                pkgutil.getDataFile(sock, dataFile)
                pkgutil.debug(" - uncompressing to %s" % outDir)
                pkgutil.uncompress(dataFile, outDir)

                if os.path.isfile(outDir + "/FATAL.ERROR"):
                    print "Build server: %s Failed!!!!" % server.host
                else:
                    print "Build server: %s ok!" % server.host

                match = True

        if match:
            packagesRemaining = packagesRemaining - 1
Exemplo n.º 14
0
def main():
    for i in range(0, len(sys.argv)):
        arg = sys.argv[i];
        if arg == "--qt-version":
            options.qtVersion = sys.argv[i+1]
        elif arg == "--package-root":
            options.packageRoot = sys.argv[i+1]
        elif arg == "--package-extra-name":
            options.packageExtraName = sys.argv[i+1]
        elif arg == "--qt-jambi-version":
            options.qtJambiVersion = sys.argv[i+1]
        elif arg == "--no-mac":
            options.buildMac = False
        elif arg == "--no-win":
            options.buildWindows = False
        elif arg == "--no-linux":
            options.buildLinux = False
        elif arg == "--no-eval":
            options.buildEval = False
        elif arg == "--gpl":
            options.buildGpl = True
        elif arg == "--no-lgpl":
            options.buildLgpl = False
        elif arg == "--no-commercial":
            options.buildCommercial = False
        elif arg == "--no-32bit":
            options.build32 = False
        elif arg == "--no-64bit":
            options.build64 = False
        elif arg == "--no-source":
            options.buildSource = False
        elif arg == "--no-binary":
            options.buildBinary = False
        elif arg == "--no-webstart":
            options.buildWebstart = False
        elif arg == "--no-keystore-reset":
            options.resetKeystore = False;
        elif arg == "--verbose":
            pkgutil.VERBOSE = 1
        elif arg == "--preview":
            options.buildPreview = True

    if options.buildPreview:
        options.buildGpl = False
        options.buildLgpl = False
        options.buildEval = False
        options.buildCommercial = False

    options.startDir = os.getcwd()
    options.qtDir = "%s/qt" % options.packageRoot

    pkgutil.debug("Options:")
    print "  - Qt Version: " + options.qtVersion
    print "  - Qt Directory: " + options.qtDir
    print "  - Package Root: " + options.packageRoot
    print "  - Qt Jambi Version: " + options.qtJambiVersion
    print "  - P4 User: "******"  - P4 Client: " + options.p4Client
    print "  - Package Extra Name: " + options.packageExtraName
    print "  - buildMac: %s" % options.buildMac
    print "  - buildWindows: %s" % options.buildWindows
    print "  - buildLinux: %s" % options.buildLinux
    print "  - buildEval: %s" % options.buildEval
    print "  - buildGpl: %s" % options.buildGpl
    print "  - buildLgpl: %s" % options.buildLgpl
    print "  - buildCommercial: %s" % options.buildCommercial
    print "  - build32: %s" % options.build32
    print "  - build64: %s" % options.build64
    print "  - buildBinary: %s" % options.buildBinary
    print "  - buildSource: %s" % options.buildSource
    print "  - package for webstart: %s" % options.buildWebstart
    print "  - reset keystore: %s" % options.resetKeystore
    print "  - Preview Packages: %s" % options.buildPreview

    pkgutil.debug("preparing source tree...")
    prepareSourceTree()

    pkgutil.debug("configuring packages...");
    setupPackages()
    pkgutil.debug(" - %d packages in total..." % len(packages))


    # Package and send all packages, finish off by closing all sockets
    # to make sure they are properly closed...
    for package in packages:
        if package.binary:
            packageAndSend(package)
            options.binaryPackageCount = options.binaryPackageCount + 1

    for package in packages:
        if not package.binary:
            packageSourcePackage(package)

    if options.binaryPackageCount:
        waitForResponse()

    if options.buildBinary and options.buildGpl and options.buildWebstart:
        signWebstartJars();
Exemplo n.º 15
0
def postProcessPackage(package):
    pkgutil.debug("Post process package " + package.name())
    os.chdir(package.packageDir)

    if os.path.isfile("FATAL.ERROR"):
        print "\nFATAL ERROR on package %s\n" % (package.name())
        return

    if package.hasEclipse():
        doEclipse(package)
    logFile = package.packageDir + "/.task.log"
    if os.path.isfile(logFile):
        shutil.copy(logFile, options.packageRoot + "/." + package.name() + ".tasklog");

    pkgutil.debug(" - creating directories...")
    for mkdir in package.mkdirs:
        os.makedirs(mkdir)

    pkgutil.debug(" - copying files around...")
    copyFiles(package)

    pkgutil.debug(" - deleting files and directories...")
    removeFiles(package)

    # Patch uic.pri since this does not include all necessary files
    if not package.binary:
        pkgutil.debug(" - patching uic.pri")
        tmpFile = open("juic/uic.pri", "a")
        tmpFile.write("\nSOURCES += uic.cpp\n")
        tmpFile.write("HEADERS += uic.h\n")
        tmpFile.close()
    
    if package.binary:
        # move platform jar to startdir for webstart, take the examples and classes from windows
        if package.license == pkgutil.LICENSE_LGPL:
            shutil.copy(package.platformJarName, options.startDir)
            if package.platform == pkgutil.PLATFORM_WINDOWS:
                shutil.copy("qtjambi-%s.jar" % (options.qtJambiVersion), options.startDir);
                shutil.copy("qtjambi-examples-%s.jar" % (options.qtJambiVersion), options.startDir);
        
        # unjar docs into doc directory...
        pkgutil.debug(" - doing docs...")
        os.makedirs("doc/html")
        os.chdir("doc/html")
        os.system("jar -xf %s/javadoc-%s.jar" % (options.startDir, options.qtJambiVersion) )
        os.chdir(package.packageDir)

        # unpack the platform .jar to get the correct binary content into
        # the package...
        pkgutil.debug(" - doing native libraries...")
        os.system("jar -xf %s" % package.platformJarName)
        shutil.rmtree("%s/META-INF" % package.packageDir)
        os.remove("qtjambi-deployment.xml")

        if package.license == pkgutil.LICENSE_EVAL:
            # Eval packages cannot use platform jar's as these cannot
            # be patched with eval key...
            os.remove(package.platformJarName)

        if not package.platform == pkgutil.PLATFORM_WINDOWS:
            os.system("chmod a+rx designer.sh qtjambi.sh")
            os.system("chmod -R a+rw .")
            if package.license == pkgutil.LICENSE_EVAL:
                os.system("chmod a+rx binpatch")

        if package.platform == pkgutil.PLATFORM_LINUX:
            os.chdir("lib")
            os.system("ln -s libqtjambi.so libqtjambi.so.1")
            os.chdir(package.packageDir)

        if package.platform == pkgutil.PLATFORM_MAC:
            os.chdir("lib")
            os.system("ln -s libqtjambi.jnilib libqtjambi.1.jnilib")
            os.chdir(package.packageDir)
            if not package.license == pkgutil.LICENSE_EVAL:
                os.system("chmod a+x Demos.app/Contents/MacOS/JavaApplicationStub")

        if package.platform == pkgutil.PLATFORM_WINDOWS:
            shutil.copytree("plugins/imageformats/Microsoft.VC80.CRT", "plugins/designer/Microsoft.VC80.CRT");

    pkgutil.expandMacroes(package.packageDir, package.licenseHeader)
 
    bundle(package)

    package.success = True
Exemplo n.º 16
0
def packageAndSend(package):
    pkgutil.debug("packaging and sending: %s..." % package.name())

    os.chdir(options.packageRoot)

    if os.path.isdir("tmptree"):
        shutil.rmtree("tmptree")

    shutil.copytree("qtjambi", "tmptree");

    qtEdition = "qt-" + package.license;
    if package.license == pkgutil.LICENSE_PREVIEW:
        qtEdition = "qt-commercial"

    pkgutil.debug(" - creating task script")
    arch = "x86";
    if arch == pkgutil.ARCH_64:
        arch = "x86_64"
    if package.platform == pkgutil.PLATFORM_WINDOWS:
        buildFile = open("tmptree/task.bat", "w")
        buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\" + qtEdition))

        # build eclipse on 32-bit windows...
        if package.hasEclipse():
#            if package.license == pkgutil.LICENSE_EVAL:
#                buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\qt-commercial"))
            buildFile.write("cd scripts\n")
            buildFile.write("call build_eclipse.bat %%cd%%\\..\\eclipse\\qtjambi-4.5 %s %s\n" % (options.eclipseVersion, arch))
            buildFile.write("cd ..\n")
#            if package.license == pkgutil.LICENSE_EVAL:
#                buildFile.write("call qt_pkg_setup %s %s\n" % (package.compiler, "c:\\tmp\\qtjambi-package-builder\\" + qtEdition))
            
        buildFile.write("call ant\n")
        buildFile.write('if "%ERRORLEVEL%" == "0" ' + package.make + ' clean\n')
        buildFile.write("copy %QTDIR%\\bin\\designer.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\lrelease.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\lupdate.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\linguist.exe bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtDesigner4.dll bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtDesignerComponents4.dll bin\n")
        buildFile.write("copy %QTDIR%\\bin\\QtScript4.dll bin\n")

    else:
        buildFile = open("tmptree/task.sh", "w")

        qtLocation = "/tmp/qtjambi-package-builder/" + qtEdition
        
        buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, qtLocation))
        buildFile.write("ant\n")
        buildFile.write(package.make + " clean \n")
        
        if package.hasEclipse():
            # a little trick needed to bypass that eclipse tools use
            # gui which will pop up eval dialogs on the build
            # servers...
#            if package.license == pkgutil.LICENSE_EVAL: 
#                buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, "/tmp/qtjambi-package-builder/qt-commercial"))            
            buildFile.write("cd scripts\n")
            buildFile.write("bash ./build_eclipse.sh $PWD/../eclipse/qtjambi-4.5 %s %s\n" % (options.eclipseVersion, arch))
            buildFile.write("cd ..\n")
            buildFile.write("cp -v lib/libqtdesigner.so lib/libqtdesignerplugin.so\n")
            buildFile.write("rm -v lib/libqtdesigner.*\n")
#            if package.license == pkgutil.LICENSE_EVAL: 
#                buildFile.write(". qt_pkg_setup %s %s\n" % (package.compiler, qtLocation))

        if package.platform == pkgutil.PLATFORM_LINUX:
            buildFile.write("cp -v $QTDIR/bin/designer bin\n")
            buildFile.write("cp -v $QTDIR/bin/lrelease bin\n")
            buildFile.write("cp -v $QTDIR/bin/lupdate bin\n")
            buildFile.write("cp -v $QTDIR/bin/linguist bin\n")
            buildFile.write("jar -xf qtjambi-linux*.jar\n")
            buildFile.write("rm -rf META-INF\n");
            buildFile.write("cp -v $QTDIR/lib/libQtDesigner.so.4 lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtDesignerComponents.so.4 lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtScript.so.4 lib\n")
            buildFile.write("chmod 755 scripts/update_rpath.sh\n");
            buildFile.write("./scripts/update_rpath.sh\n");
        else:
            buildFile.write("cp -vR $QTDIR/bin/Designer.app bin\n")
            buildFile.write("cp -v $QTDIR/bin/lrelease bin\n")
            buildFile.write("cp -v $QTDIR/bin/lupdate bin\n")
            buildFile.write("cp -vR $QTDIR/bin/Linguist.app bin\n")
            buildFile.write("jar -xf qtjambi-mac*.jar\n");
            buildFile.write("rm -rf META-INF\n");
            buildFile.write("cp -v $QTDIR/lib/libQtDesigner.4.dylib lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtDesignerComponents.4.dylib lib\n")
            buildFile.write("cp -v $QTDIR/lib/libQtScript.4.dylib lib\n")
            buildFile.write("chmod 755 scripts/update_installname.sh\n");
            buildFile.write("./scripts/update_installname.sh\n");

    buildFile.close()

    pkgutil.debug(" - expanding macroes prior to sending...");
    pkgutil.expandMacroes("tmptree", package.licenseHeader)

    zipFile = os.path.join(options.packageRoot, "tmp.zip")
    pkgutil.debug(" - compressing...")
    pkgutil.compress(zipFile, os.path.join(options.packageRoot, "tmptree"))
    pkgutil.debug(" - sending %s to host: %s.." % (package.name(), package.buildServer))
    pkgutil.sendDataFileToHost(package.buildServer, pkgutil.PORT_SERVER, zipFile)
Exemplo n.º 17
0
 def writeLog(self, list, subname):
     logName = os.path.join(options.packageRoot, ".%s.%s" % (self.name(), subname))
     pkgutil.debug("   - log into: " + logName)
     log = open(logName, "w")
     log.write("\n".join(list))
     log.close()