|
From: Andreas H. <ah...@us...> - 2004-12-23 00:24:11
|
Update of /cvsroot/jvcl/dev/JVCL3/devtools/PackagesGenerator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24333/devtools/PackagesGenerator Modified Files: FileUtils.pas GenerateUtils.pas UtilsJcl.pas Log Message: New jvcl.inc structure Index: UtilsJcl.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/devtools/PackagesGenerator/UtilsJcl.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UtilsJcl.pas 20 May 2004 09:18:50 -0000 1.3 --- UtilsJcl.pas 23 Dec 2004 00:23:58 -0000 1.4 *************** *** 26,34 **** -----------------------------------------------------------------------------} {$I jvcl.inc} {$I windowsonly.inc} - unit UtilsJcl; - interface --- 26,34 ---- -----------------------------------------------------------------------------} + unit UtilsJcl; + {$I jvcl.inc} {$I windowsonly.inc} interface Index: FileUtils.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/devtools/PackagesGenerator/FileUtils.pas,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileUtils.pas 7 Apr 2004 00:20:39 -0000 1.6 --- FileUtils.pas 23 Dec 2004 00:23:58 -0000 1.7 *************** *** 1,11 **** - {$I jvcl.inc} unit FileUtils; interface uses Windows; {$IFNDEF COMPILER6_UP} ! {$DEFINE MSWINDOWS} {$ENDIF COMPILER6_UP} // returns the relative path between Origin and Destination // This is the string you would have to type after the 'cd' --- 1,15 ---- unit FileUtils; + {$I jvcl.inc} + interface + uses Windows; + {$IFNDEF COMPILER6_UP} ! {$DEFINE MSWINDOWS} {$ENDIF COMPILER6_UP} + // returns the relative path between Origin and Destination // This is the string you would have to type after the 'cd' Index: GenerateUtils.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/devtools/PackagesGenerator/GenerateUtils.pas,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** GenerateUtils.pas 25 Nov 2004 21:49:10 -0000 1.70 --- GenerateUtils.pas 23 Dec 2004 00:23:58 -0000 1.71 *************** *** 1,6 **** - {$I jvcl.inc} - unit GenerateUtils; interface --- 1,6 ---- unit GenerateUtils; + {$I jvcl.inc} + interface *************** *** 175,178 **** --- 175,179 ---- GCallBack : TGenerateCallBack; GPackagesLocation : string; + GIncDefFileName : string; GIncFileName : string; GPrefix : string; *************** *** 509,512 **** --- 510,514 ---- ClxReplacementList := TClxReplacementList.Create(Node.Items.ItemNamed['ClxReplacements']); + GIncDefFileName := Node.Properties.ItemNamed['incdeffile'].Value; GIncFileName := Node.Properties.ItemNamed['IncFile'].Value; GPackagesLocation := Node.Properties.ItemNamed['packages'].Value; *************** *** 1494,1497 **** --- 1496,1529 ---- end; + // loads the .inc file into Defines and returns True if the Filename contains + // a "%t" + function LoadDefines(const Target: string; Filename: string): Boolean; + var + incfile : TStringList; + ps: Integer; + begin + Result := False; + FreeAndNil(DefinesList); + + // read the include file for this target or the default file if jvclxx.inc does not exist + incfile := TStringList.Create; + try + ps := Pos('%t', Filename); + if ps > 0 then + begin + Delete(Filename, ps, 2); + Insert(LowerCase(Target), Filename, ps); + if not FileExists(Filename) then + Filename := GIncDefFileName; + Result := True; + end; + if FileExists(Filename) then + incfile.LoadFromFile(Filename); + DefinesList := TDefinesList.Create(incfile); + finally + incfile.free; + end; + end; + function Generate(packages : TStrings; targets : TStrings; *************** *** 1515,1519 **** persoTarget : string; target : string; ! incfile : TStringList; begin --- 1547,1551 ---- persoTarget : string; target : string; ! GenericIncFile: Boolean; begin *************** *** 1536,1551 **** IsBinaryCache.Clear; - FreeAndNil(DefinesList); if incFileName = '' then incFileName := GIncFileName; ! // read the include file ! incfile := TStringList.Create; ! try ! if FileExists(IncFileName) then ! incfile.LoadFromFile(IncFileName); ! DefinesList := TDefinesList.Create(incfile); ! finally ! incfile.free; ! end; GCallBack := CallBack; --- 1568,1574 ---- IsBinaryCache.Clear; if incFileName = '' then incFileName := GIncFileName; ! GenericIncFile := LoadDefines('', incFileName); GCallBack := CallBack; *************** *** 1570,1573 **** --- 1593,1599 ---- begin target := targets[i]; + if GenericIncFile then + LoadDefines(target, incFileName); + SendMsg(SysUtils.Format('Generating packages for %s', [target])); // find all template files for that target |