PowerBuilder – Bootstrapping using ORCA Script
Oftmals das gleiche…
Es liegen nur ein Haufen von *.sr* und *.pbg Dateien vor und es ist klar, wo und welches das application object ist.
In diesem Fall ist ein Bootstrapping von nöten – aber wie?
Seit PowerBuilder 9 kann dies mit Hilfe von ORCA Script geschehen. Jedoch müssen dazu ein entsprechendes ORCA Script und ein entsprechendes Target her.
An dieser Stelle eine nahezu unkommentierte Version. Ach so, der gute alte sed wird hier ebenfalls genutzt.
@echo off
@rem script
@%1 = appname (example)
@%2 = relative app libraryname (pfc_examples)
@rem use cmd /v !
@set SED_EXE=d:\unixutils\bin\sed.exe
@set PBT_FILE=%1.pbt
@SET ORC_FILE=create_pbl.orc
@SET ORC_LOAD=bootload.orc
@set LIBLIST=
@set SEPARATOR=
echo start session>%ORC_FILE%
@FOR /F "tokens=*" %%d IN ('DIR /b /ad') do for %%f in (%%d\*.pbg) do (( set LIBLIST=!LIBLIST!!SEPARATOR!%%f)& set SEPARATOR=;& echo create library "%%f" "">>%ORC_FILE% )
echo end session>>%ORC_FILE%
echo Save Format v3.0(19990112)>%PBT_FILE%
echo @begin Projects>>%PBT_FILE%
echo @end;>>%PBT_FILE%
echo appname "%1";>>%PBT_FILE%
echo applib "%2";>>%PBT_FILE%
echo LibList "%LIBLIST%";>>%PBT_FILE%
echo type "pb";>>%PBT_FILE%
@rem // Post Processing by sed !
%SED_EXE% s/.pbg/.pbl/g %ORC_FILE% | %SED_EXE% s/\\/\//g >%ORC_FILE%.new
move %ORC_FILE%.new %ORC_FILE%
type %ORC_FILE%
%SED_EXE% s/.pbg/.pbl/g %PBT_FILE% | %SED_EXE% s/\\/\\\\/g >%PBT_FILE%.new
move %PBT_FILE%.new %PBT_FILE%
type %PBT_FILE%
@rem Create Bootload.orc
echo start session>%ORC_LOAD%
echo scc set connect property provider "PB Native">>%ORC_LOAD%
echo scc set connect property userid "BuildPBLs">>%ORC_LOAD%
echo scc set connect property localprojpath ".\">>%ORC_LOAD%
echo scc set connect property project ".\">>%ORC_LOAD%
echo scc set connect property logfile ".\SCC.log">>%ORC_LOAD%
echo scc set connect property logappend "TRUE">>%ORC_LOAD%
echo scc set connect property deletetempfiles "FALSE">>%ORC_LOAD%
echo scc connect>>%ORC_LOAD%
echo scc set target ".\%1.pbt" "refresh_all importonly">>%ORC_LOAD%
echo scc refresh target "full">>%ORC_LOAD%
echo scc close>>%ORC_LOAD%
echo end session>>%ORC_LOAD%
type %ORC_LOAD%
Schreibe einen Kommentar
Du musst angemeldet sein, um einen Kommentar abzugeben.