ide + tools: support rsj files

git-svn-id: trunk@43745 -
This commit is contained in:
paul 2014-01-17 01:14:53 +00:00
parent 94e8ee0649
commit 39ebe8df60
4 changed files with 18 additions and 9 deletions

View File

@ -238,7 +238,7 @@ function MakeLazarus(Profile: TBuildLazarusProfile;
end
else begin
Ext:=LowerCase(ExtractFileExt(FileInfo.Name));
if (Ext='.ppu') or (Ext='.o') or (Ext='.rst') then begin
if (Ext='.ppu') or (Ext='.o') or (Ext='.rst') or (Ext='.rsj') then begin
if not DeleteFileUTF8(Filename) then
debugln(['CleanLazarusSrcDir failed to delete file "',Filename,'"']);
end;

View File

@ -212,7 +212,7 @@ begin
exit(true);
end;
// find all .rst files in package output directory
// find all .rst/.rsj files in package output directory
// TODO: lrt files...
PODirectory:=AppendPathDelim(PODirectory);
@ -225,8 +225,9 @@ begin
Item:=nil;
// collect all rst/po files that needs update
for i:=0 to Files.Count-1 do begin
if (CompareFileExt(Files[i],'.rst',false)<>0)
and (CompareFileExt(Files[i],'.lrt',false)<>0)
if (CompareFileExt(Files[i],'.rst',false)<>0) and
(CompareFileExt(Files[i],'.lrt',false)<>0) and
(CompareFileExt(Files[i],'.rsj',false)<>0)
then continue;
RSTFilename:=RSTDirectory+Files[i];
if POFilename='' then
@ -332,6 +333,8 @@ begin
FileType:=stLrt
else if CompareFileExt(Filename,'.rst',false)=0 then
FileType:=stRst
else if CompareFileExt(Filename,'.rsj',false)=0 then
FileType:=stRsj
else
continue;
SrcBuf:=CodeToolBoss.LoadFile(Filename,true,false);

View File

@ -4211,6 +4211,7 @@ var
LRTFilename: String;
UnitOutputDir: String;
RSTFilename: String;
RSJFilename: String;
FileList: TStringList;
begin
Result:=mrCancel;
@ -4261,19 +4262,24 @@ begin
if FileExistsCached(LRTFilename)
and ((not POFileAgeValid) or (FileAgeCached(LRTFilename)>POFileAge)) then
Files[LRTFilename]:=nil;
// check .rst file
// check .rst/.rsj file
RSTFilename:=ChangeFileExt(CurFilename,'.rst');
RSJFilename:=ChangeFileExt(CurFilename,'.rsj');
// the compiler puts the .rst in the unit output directory if -FU is given
if AProject.CompilerOptions.UnitOutputDirectory<>'' then
begin
UnitOutputDir:=AProject.GetOutputDirectory;
if UnitOutputDir<>'' then
begin
RSTFilename:=TrimFilename(AppendPathDelim(UnitOutputDir)+ExtractFilename(RSTFilename));
RSJFilename:=TrimFilename(AppendPathDelim(UnitOutputDir)+ExtractFilename(RSJFilename));
end;
end;
//DebugLn(['TMainIDE.UpdateProjectPOFile Looking for .rst file ="',RSTFilename,'"']);
if FileExistsCached(RSTFilename)
and ((not POFileAgeValid) or (FileAgeCached(RSTFilename)>POFileAge)) then
if FileExistsCached(RSTFilename) and ((not POFileAgeValid) or (FileAgeCached(RSTFilename)>POFileAge)) then
Files[RSTFilename]:=nil;
if FileExistsCached(RSJFilename) and ((not POFileAgeValid) or (FileAgeCached(RSJFilename)>POFileAge)) then
Files[RSJFilename]:=nil;
end;
// update po files

View File

@ -86,14 +86,14 @@ begin
if not FileExistsUTF8(Filename) then begin
if (Ext='.rst') or (Ext='.lrt') then
if (Ext='.rst') or (Ext='.lrt') or (Ext='.rsj') then
continue; // ignore resource files
writeln('ERROR: file not found: ',FileName);
exit;
end;
if (Ext<>'.po') and (Ext<>'.rst') and (Ext<>'.lrt') then begin
if (Ext<>'.po') and (Ext<>'.rst') and (Ext<>'.lrt') and (Ext<>'.rsj') then begin
writeln('ERROR: invalid extension: ',Filename);
exit;
end;