2
0
Эх сурвалжийг харах

Scripting engine dev0 removed. Refs: #14.

Josef Templ 10 жил өмнө
parent
commit
3d0f1d1875

BIN
Cons/Mod/Build.odc


BIN
Cons/Mod/Compiler.odc


BIN
Cons/Mod/Interp.odc


BIN
Cons/Mod/Log.odc


BIN
Interp/Docu/Quick-Start.odc


BIN
Interp/Mod/Config.odc


BIN
Interp/Mod/Console.odc


BIN
Interp/Mod/HostConsole.odc


BIN
Interp/Mod/HostDates.odc


BIN
Interp/Mod/HostDialog.odc


BIN
Interp/Mod/HostFiles.odc


BIN
Interp/Mod/HostFonts.odc


BIN
Interp/Mod/HostLang.odc


BIN
Interp/Mod/HostPackedFiles.odc


BIN
Interp/Mod/HostWindows.odc


BIN
Interp/Mod/Init.odc


+ 10 - 25
README.txt

@@ -1,41 +1,26 @@
-This repository contains the sources for the BlackBox Component Builder
-and the command line compiler(s). A command line compiler is necessary for the CI
-(continues integration) process used for BlackBox development.
-For details of the build process see appbuild/build*.py.
+This repository contains the sources, resources, and documentation
+of the BlackBox Component Builder and a scripting tool that allows one
+to run BlackBox commands from the command line.
+A scripting tool is necessary for the CI (continues integration) 
+process used for BlackBox development.
+For details of the build process see appbuild/build.py.
 
 
 The general purpose BlackBox scripting tool bbscript.exe is based
 on the scripting engine introduced in subsystem Script, which is 
 not part of the generated BlackBox distribution.
 
-For compiling the BlackBox Component Builder:
+
+For compiling and linking the BlackBox Component Builder:
 
     bbscript.exe /PAR Dev/Docu/Build-Tool.odc
 
+
 For building a new bbscript.exe:
 
     bbscript.exe /PAR appbuild/newbbscript.txt
 
     or
 
-    1. Add 'Script' folder to your BlackBox directory
+    1. Add the 'Script' folder to your BlackBox directory
     2. Execute all commands from appbuild/newbbscript.txt
-
-
-The command line compiler dev0 is based on a general purpose but limited
-BlackBox scripting feature introduced in the directories Cons and Interp,
-which are not part of the generated BlackBox distribution.
-
-
-For compiling the BlackBox Component Builder:
-
-    dev0.exe < appbuild/build.txt
-
-For building a new dev0.exe:
-
-    dev0.exe < appbuild/newdev0.txt
-
-    or
-
-    1. Add 'Cons' and 'Interp' folders to your BlackBox directory
-    2. Execute all commanders from Interp/Docu/Quick-Start.odc

+ 0 - 45
appbuild/build.txt

@@ -1,45 +0,0 @@
-# This script is essentially a copy of 'Dev/Docu/Build-Tool.odc'.
-# It compiles and links  BlackBox Component Builder.
-# In addition it sets version related System properties
-# Usage: dev0.exe < build.txt
-
-
-DevCompiler.CompileThis WinApi WinOle WinCtl WinCmc WinOleAut WinOleCtl WinDlg WinOleDlg WinMM WinSql WinRpc WinNet WinGL WinGLAux WinGLUtil 
-
-DevCompiler.CompileThis Kernel Files HostFiles StdLoader Math SMath Log Strings Dates Meta Dialog Services Fonts Ports Printers Stores Converters Sequencers Models Views Controllers Properties Printing Mechanisms Containers Documents Windows StdCFrames Controls StdInterpreter StdDialog StdApi StdCmds 
-
-DevCompiler.CompileThis HostRegistry HostFonts HostPorts OleData HostMechanisms HostWindows HostPrinters HostClipboard HostCFrames HostDialog HostCmds HostMenus HostPictures 
-
-DevCompiler.CompileThis TextModels TextRulers TextSetters TextViews TextControllers TextMappers StdLog TextCmds StdHeaders 
-
-DevCompiler.CompileThis FormModels FormViews FormControllers FormGen FormCmds StdFolds StdLinks 
-
-DevCompiler.CompileThis DevCommanders StdTables StdTabViews HostTabFrames StdViewSizer DevMarkers DevDebug DevHeapSpy DevSearch DevSubTool DevAlienTool HostPackedFiles DevPacker DevDependencies DevReferences DevCmds DevInspector 
-
-DevCompiler.CompileThis HostTextConv HostBitmaps HostMail StdMenuTool StdClocks StdStamps StdLogos StdDebug StdCoder StdScrollers Out DevCPM DevCPT DevCPS DevCPB DevCPP DevCPE DevCPH DevCPL486 DevCPC486 DevCPV486 DevSelectors DevCompiler DevBrowser DevLinker DevRBrowser OleStorage OleServer OleClient CtlT CtlC OleViews StdETHConv In XYplane Init Config Integers DevTypeLibs DevComInterfaceGen DevComDebug DevProfiler DevLinkChk DevMsgSpy DevAnalyzer CommStreams CommTCP CommV24 SqlDrivers SqlOdbc SqlOdbc3 SqlDB SqlControls SqlBrowser SqlObxDB SqlObxUI SqlObxNets SqlObxViews SqlObxGen SqlObxExt SqlObxInit SqlObxTab ComTools ComEnumRect ComObject ComConnect ComAggregate ComKoala ComKoalaTst ComKoalaExe ComKoalaDll ComEnum ComPhoneBook ComPhoneBookActiveX ComPhoneBookClient 
-
-DevCompiler.CompileThis XhtmlWriters XhtmlStdFileWriters XhtmlEntitySets XhtmlTextTableMarkers XhtmlExporter 
-
-DevCompiler.CompileThis CtlStdType CtlOffice CtlVBIDE CtlOfficeBinder CtlMSForms CtlExcel8 CtlWord8 CtlGraph8 CtlPowerPoint8 CtlOutlook8 CtlDAO35 CtlAccess8 CtlExcel9 CtlWord9 CtlGraph9 CtlPowerPoint9 CtlOutlook9 CtlDAO36 CtlADODB CtlAccess9 CtlExcel5 
-
-DevCompiler.CompileThis ObxActions ObxAddress0 ObxAddress1 ObxAddress2 ObxAscii ObxBitmap ObxBlackBox ObxButtons ObxCalc ObxCaps ObxControls ObxDialog ObxConv ObxCount0 ObxCount1 ObxCubes ObxDB ObxExcel ObxFact ObxRandom ObxFern ObxFldCtrls ObxGraphs ObxHello0 ObxHello1 ObxLines ObxLinks ObxPhoneDB ObxLookup0 ObxLookup1 ObxMMerge ObxOmosi ObxOpen0 ObxOpen1 ObxOrders ObxParCmd ObxPatterns ObxPDBRep0 ObxPDBRep1 ObxPDBRep2 ObxPDBRep3 ObxPDBRep4 ObxPhoneUI ObxPhoneUI1 ObxRatCalc ObxScroll ObxSample ObxTabs ObxTickers ObxTrap ObxTwins ObxViews0 ObxViews1 ObxViews2 ObxViews3 ObxViews4 ObxViews5 ObxViews6 ObxViews10 ObxViews11 ObxViews12 ObxViews13 ObxViews14 ObxWrappers ObxContIter ObxPi ObxUnitConv ObxLabelLister ObxControlShifter ObxFileTree ObxTabViews ObxWordEdit ObxStores ObxCtrls
-
-DevCompiler.CompileThis CommObxStreamsClient CommObxStreamsServer
-
-
-DevLinker.Link BlackBox.exe := Kernel$+ Files HostFiles StdLoader 1 BlackBox.res 1 Applogo.ico 2 Doclogo.ico 3 SFLogo.ico 4 CFLogo.ico 5 DtyLogo.ico 6 folderimg.ico 7 openimg.ico 8 leafimg.ico 1 Move.cur 2 Copy.cur 3 Link.cur 4 Pick.cur 5 Stop.cur 6 Hand.cur 7 Table.cur 
-
-
-DevCompiler.CompileThis ConsBuild
-
-ConsBuild.AppendProperty appVersion "{#AppVersion}"
-
-ConsBuild.AppendProperty buildNum "{#BuildNum}"
-
-ConsBuild.AppendProperty buildDate "{#BuildDate}"
-
-ConsBuild.AppendProperty commitHash "{#CommitHash}"
-
-
-Kernel.Quit(0)
-

+ 0 - 257
appbuild/build_with_dev0.py

@@ -1,257 +0,0 @@
-#!/usr/bin/python
-
-# Automated build of the BlackBox Component Builder for Windows under Linux Debian 7.
-# Looks at branches 'master' and 'development'.
-#
-# Ivan Denisov, Josef Templ
-#
-# Creates 3 artefacts:
-# 1. a build log file named blackbox-<AppVersion>.<buildnr>-buildlog.html
-# 2. a Windows installer file named blackbox-<AppVersion>.<buildnr>-setup.exe
-# 3. a zipped package named blackbox-<AppVersion>-<buildnr>.zip
-# In case of building a final release, buildnr is not included.
-#
-# By always rebuilding dev0.exe it avoids problems with changes in the symbol or object file formats
-# and acts as a rigorous test for some parts of BlackBox, in particular for the compiler itself.
-#
-# A note on error handling:
-# Stops building when a shell command writes to stderr, unless stopOnError is False.
-# Stops building when there is a Python exception.
-# Leaves temporary directory 'bb' in place in order to signal that the build has not been finished.
-# If an error is encountered in the BlackBox compiler or linker, 'bb' will be removed and the
-# branch's hash file will be updated but not the build number file.
-# 
-# TODO git checkout reports a message on stderr but it works, so it is ignored
-# TODO detect errors in BlackBox compiler or linker
-# TODO at least add a test for starting BlackBox using Xvfb
-
-from subprocess import Popen, PIPE
-import sys, datetime, fileinput, os.path
-
-buildDate = datetime.datetime.now().isoformat()
-buildDir = "/var/www/tribiq/makeapp"
-bbName = "bb"
-bbDir = buildDir + "/" + bbName
-appbuildDir = bbDir + "/appbuild"
-localRepository = "/var/www/git/blackbox.git" 
-unstableDir = "/var/www/tribiq/unstable" 
-stableDir = "/var/www/tribiq/stable"
-wine = "/usr/local/bin/wine" 
-iscc = "/usr/local/bin/iscc"
-windres="/usr/bin/i586-mingw32msvc-windres"
-branch = None
-commitHash = None
-logFile = None
-
-def repositoryLocked():
-    return os.path.exists(localRepository + ".lock")
-
-def hashFilePath():
-    return buildDir + "/lastBuildHash/" + branch
-
-def getLastHash():
-    if os.path.exists(hashFilePath()):
-        hashFile = open(hashFilePath(), "r")
-        commit = hashFile.readline().strip()
-        hashFile.close()
-        return commit
-    else:
-        return ""
-
-def getCommitHash():
-    gitLog = shellExec(localRepository, "git log " + branch + " -1")
-    global commitHash
-    commitHash = gitLog.split("\n")[0].split(" ")[1]
-    return commitHash
-
-def needsRebuild():
-    return getLastHash() != getCommitHash()
-
-def selectBranch():
-    global branch
-    branch = "master"
-    if needsRebuild():
-        return branch
-    branch = "development"
-    if needsRebuild():
-        return branch
-    return None
-
-def openLog():
-    global logFile
-    logFile = open(unstableDir + "/logFile.html", "w")
-    
-def log(text, startMarkup="", endMarkup=""):
-    if text != "" and logFile != None:    
-        for line in text.split("\n"):
-            logFile.write(startMarkup + line + endMarkup + "<br/>\n")
-        logFile.flush()
-
-def logErr(text): # use color red
-    log(text, '<font color="#FF0000">', '</font>')
-
-def logStep(text): # use bold font
-    log(text, '<b>', '</b>')
-
-def shellExec(wd, cmd, stopOnError=True):
-    log("shellExec: " + "cd " + wd + " && " + cmd)
-    (stdout, stderr) = Popen("cd " + wd + " && " + cmd, stdout=PIPE, stderr=PIPE, shell=True).communicate()
-    log(stdout)
-    if stderr == "":
-        return stdout
-    elif not stopOnError:
-        logErr(stderr)
-        logErr("--- error ignored ---")
-        return stdout
-    else:
-        logErr(stderr)
-        logErr("--- build aborted ---")
-        print "--- build aborted ---"
-        sys.exit()
-
-def prepareCompileAndLink():
-    logStep("Preparing BlackBox.rc")
-    vrsn = versionInfoVersion.replace(".", ",")
-    shellExec(bbDir + "/Win/Rsrc", "mv BlackBox.rc BlackBox.rc_template")
-    shellExec(bbDir + "/Win/Rsrc", "sed s/{#VERSION}/" + vrsn + "/ < BlackBox.rc_template > BlackBox.rc")
-    shellExec(bbDir + "/Win/Rsrc", "rm BlackBox.rc_template")
-    logStep("Creating the BlackBox.res resource file")
-    shellExec(bbDir + "/Win/Rsrc", windres + " -i BlackBox.rc -o BlackBox.res")
-    logStep("Preparing dev0.exe")
-    shellExec(buildDir, "cp dev0.exe " + bbDir + "/")
-
-def errorInBlackBox():
-    return False  #TODO
-
-def buildDev0():
-    logStep("Building command line compiler dev0.exe")
-    shellExec(bbDir, wine + " dev0.exe < appbuild/newdev0.txt 2>&1")
-    shellExec(bbDir, "mv newdev0.exe dev0.exe && chmod a+x dev0.exe")
-    shellExec(bbDir, "rm -R Code Sym */*/*.osf */*/*.ocf BlackBox.exe")
-
-def compileAndLink():
-    logStep("Setting system properties in build.txt")
-    shellExec(appbuildDir, "sed s/{#AppVersion}/" + appVersion + "/ < build.txt > build_.txt")
-    shellExec(appbuildDir, "sed s/{#BuildNum}/" + str(buildNum) + "/ < build_.txt > build.txt")
-    shellExec(appbuildDir, "sed s/{#BuildDate}/" + buildDate[:10] + "/ < build.txt > build_.txt")
-    shellExec(appbuildDir, "sed s/{#CommitHash}/" + commitHash + "/ < build_.txt > build.txt")
-    logStep("Compiling and linking BlackBox")
-    shellExec(bbDir, wine + " dev0.exe < appbuild/build.txt 2>&1")
-    if errorInBlackBox():
-        updateCommitHash()
-        cleanup()
-        logErr("build terminated due to BlackBox compile/link error") 
-        sys.exit()
-    logStep("Moving Code and Sym to System") 
-    shellExec(bbDir, "mv Code System/ && mv Sym System/")
-
-def buildSetupFile():
-    logStep("Building " + outputNamePrefix + "-setup.exe file")
-    shellExec(bbDir, "cp Win/Rsrc/BlackBox.iss appbuild/")
-    shellExec(appbuildDir, iscc + " - < ./BlackBox.iss" \
-                  + '  "/dAppVersion=' + appVersion
-                  + '" "/dAppVerName=' + appVerName
-                  + '" "/dVersionInfoVersion=' + versionInfoVersion
-                  + '"', False)
-    shellExec(appbuildDir + "/Output", "mv setup.exe " + outputPathPrefix + "-setup.exe")
-
-def updateDev0():
-    # if setup file creation was successfull, we know that the new dev0.exe works well
-    logStep("Updating dev0.exe")
-    shellExec(bbDir, "mv dev0.exe " + buildDir + "/")
-
-def buildZipFile():
-    logStep("Removing auxiliary files and directories") 
-    shellExec(bbDir, "rm -R *.txt appbuild Cons Interp Script")
-    logStep("Zipping package to file " + outputNamePrefix + ".zip") 
-    shellExec(bbDir, "zip -r " + outputPathPrefix + ".zip *")
-
-def getAppVerName(appVersion):
-    x = appVersion
-    if appVersion.find("-a") >= 0:
-    	x = appVersion.replace("-a", " Alpha ")
-    elif appVersion.find("-b") >= 0:
-   	x = appVersion.replace("-b", " Beta ")
-    elif appVersion.find("-rc") >= 0:
-    	x = appVersion.replace("-rc", " Release Candidate ")
-    return "BlackBox Component Builder " + x
-
-def getVersionInfoVersion(appVersion, buildNum):
-    version = appVersion.split("-")[0]
-    v = version.split(".")
-    v0 = v[0] if len(v) > 0 else "0"
-    v1 = v[1] if len(v) > 1 else "0"
-    v2 = v[2] if len(v) > 2 else "0"
-    return v0 + "." + v1 + "." + v2 + "." + str(buildNum)
-
-def isFinal(appVersion):
-    return appVersion.find("-") < 0
-
-def updateCommitHash():
-    logStep("Updating commit hash for branch '" + branch + "'") 
-    hashFile = open(hashFilePath(), "w")
-    hashFile.write(commitHash)
-    hashFile.close()
-
-def incrementBuildNumber():
-    logStep("Updating build number to " + str(buildNum + 1)) 
-    numberFile.seek(0)
-    numberFile.write(str(buildNum+1))
-    numberFile.truncate()
-    numberFile.close()
-
-def cleanup():
-    logStep("Cleaning up") 
-    shellExec(buildDir, "rm " + bbName + " -R")
-
-def closeLog():
-    logStep("Renaming 'logFile.html' to '" + outputNamePrefix + "-buildlog.html'")
-    global logFile
-    logFile.close()
-    logFile = None
-    shellExec(unstableDir, "mv logFile.html " + outputPathPrefix + "-buildlog.html")
-
-if os.path.exists(bbDir):  # previous build is still running or was terminated after an error
-    sys.exit()
-if repositoryLocked():
-    sys.exit()
-if selectBranch() == None:
-    sys.exit()
-
-# this file contains the build number to be used for this build; incremented after successfull build
-numberFile = open(buildDir + "/" + "number", "r+")
-
-buildNum = int(numberFile.readline().strip())
-openLog()
-
-print "<br/>Build " + str(buildNum) + " from '" + branch + "' at " + buildDate + "<br/>"
-log("<h2>Build " + str(buildNum) + " from '" + branch + "' at " + buildDate + "</h2>")
-log("git commit hash is: " + commitHash)
-
-logStep("Cloning repository into temporary folder '" + bbName + "'") 
-shellExec(buildDir, "git clone " + localRepository + " " + bbName)
-
-logStep("Checking out branch '" + branch + "' into temporary folder '" + bbName + "'") 
-shellExec(bbDir, "git checkout " + branch, False)
-
-appVersion = open(appbuildDir + "/AppVersion.txt", "r").readline().strip()
-appVerName = getAppVerName(appVersion)
-versionInfoVersion = getVersionInfoVersion(appVersion, buildNum)
-finalRelease = isFinal(appVersion)
-outputNamePrefix = "blackbox-" + appVersion + ("" if finalRelease else ("." + str(buildNum).zfill(3)))
-outputDir = stableDir if finalRelease else unstableDir
-outputPathPrefix = outputDir + "/" + outputNamePrefix
-
-prepareCompileAndLink()
-compileAndLink() #1
-buildDev0()
-compileAndLink() #2
-buildDev0()
-compileAndLink() #3
-buildSetupFile()
-updateDev0()
-buildZipFile()
-updateCommitHash()
-incrementBuildNumber()
-cleanup()
-closeLog()

+ 0 - 21
appbuild/newdev0.txt

@@ -1,21 +0,0 @@
-# that is the text copy of Interp/Docu/QuickStart.odc
-# to rebuild 'dev0.exe' run:  dev0.exe < "newdev0.txt"
-# the result will be writen to 'newdev0.exe'
-
-DevCompiler.CompileThis Windows Views Strings Stores Services Sequencers Properties Printing Printers Ports Models Meta Mechanisms Math Log Fonts Documents Dialog Dates Converters Controls Controllers Containers 
-
-DevCompiler.CompileThis InterpConsole 
-
-DevCompiler.CompileThis ConsLog ConsCompiler ConsInterp 
-
-DevCompiler.CompileThis InterpHostConsole InterpHostFiles InterpHostFonts InterpHostWindows InterpHostLang InterpHostDates InterpHostPackedFiles InterpHostDialog InterpConfig InterpInit 
-
-DevLinker.Link dos newdev0.exe := Kernel$+ Files HostFiles HostPackedFiles StdLoader 
-
-DevPacker.PackThis newdev0.exe := Code/Init.ocf Host/Code/Console.ocf Code/Console.ocf Host/Code/Lang.ocf Code/Dialog.ocf Host/Code/Fonts.ocf Code/Fonts.ocf Host/Code/Windows.ocf Code/Windows.ocf Code/Ports.ocf Code/Services.ocf Code/Stores.ocf Code/Strings.ocf Code/Math.ocf Code/Sequencers.ocf Code/Models.ocf Code/Views.ocf Code/Log.ocf Code/Converters.ocf Code/Meta.ocf Code/Controllers.ocf Code/Properties.ocf Code/Containers.ocf Code/Mechanisms.ocf Code/Documents.ocf Code/Dates.ocf Code/Printers.ocf Code/Printing.ocf Host/Code/Dates.ocf Host/Code/Dialog.ocf Std/Code/Interpreter.ocf Std/Code/Dialog.ocf Std/Code/Log.ocf Text/Code/Models.ocf Text/Code/Mappers.ocf Text/Code/Rulers.ocf Text/Code/Views.ocf Text/Code/Setters.ocf Text/Code/Controllers.ocf Cons/Code/Log.ocf Code/Config.ocf Cons/Code/Interp.ocf Dev/Code/Commanders.ocf Code/Controls.ocf Std/Code/CFrames.ocf Dev/Code/Compiler.ocf Dev/Code/Markers.ocf Dev/Code/Selectors.ocf Dev/Code/CPM.ocf Dev/Code/CPT.ocf Dev/Code/CPB.ocf Dev/Code/CPP.ocf Dev/Code/CPS.ocf Dev/Code/CPE.ocf Dev/Code/CPV486.ocf Dev/Code/CPH.ocf Dev/Code/CPL486.ocf Dev/Code/CPC486.ocf Std/Code/ETHConv.ocf Host/Code/TextConv.ocf Dev/Code/Linker.ocf Cons/Code/Compiler.ocf Host/Code/Registry.ocf Dev/Code/Debug.ocf Dev/Code/HeapSpy.ocf Dev/Code/ComDebug.ocf 
-
-
-DevCompiler.CompileThis HostFiles HostFonts HostWindows HostPackedFiles HostDialog Config Init 
-
-Kernel.Quit(0)
-