mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-05 11:17:45 +02:00
releasecreator: copy rtl.js
This commit is contained in:
parent
d988972752
commit
975d5f5051
@ -46,6 +46,7 @@ type
|
||||
procedure CreateBuildSourceDir(const TargetOS, TargetCPU: string);
|
||||
procedure BuildTools(const TargetOS, TargetCPU: string);
|
||||
procedure CopySourceFolders;
|
||||
procedure CopyRTL;
|
||||
|
||||
procedure RunTool(WorkDir, Exe: string; const ProcParams: TStringDynArray); overload;
|
||||
procedure RunTool(WorkDir, Exe: string; ProcParams: TStringList); overload;
|
||||
@ -161,6 +162,7 @@ begin
|
||||
CreateBuildSourceDir(TargetOS,TargetCPU);
|
||||
BuildTools(TargetOS,TargetCPU);
|
||||
CopySourceFolders;
|
||||
CopyRTL;
|
||||
|
||||
// stop program loop
|
||||
Terminate;
|
||||
@ -446,8 +448,12 @@ procedure TPas2jsReleaseCreator.CopySourceFolders;
|
||||
// git restore SrcDir
|
||||
RunTool(SourceDir,GitFilename,['restore',SrcDir]);
|
||||
// copy
|
||||
Log(etInfo,'Copying folder "'+SrcDir+'" -> "'+DestDir+'"');
|
||||
CopyDirTree(SrcDir,DestDir,[cffCreateDestDirectory]);
|
||||
if Simulate then begin
|
||||
Log(etInfo,'Simulate: Copying folder "'+SrcDir+'" -> "'+DestDir+'"');
|
||||
end else begin
|
||||
Log(etInfo,'Copying folder "'+SrcDir+'" -> "'+DestDir+'"');
|
||||
CopyDirTree(SrcDir,DestDir,[cffCreateDestDirectory,cffPreserveTime]);
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
@ -470,6 +476,21 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPas2jsReleaseCreator.CopyRTL;
|
||||
var
|
||||
SrcFilename, DestFilename: String;
|
||||
begin
|
||||
SrcFilename:=SourceDir+SetDirSeparators('compiler/utils/pas2js/dist/rtl.js');
|
||||
DestFilename:=BuildDir_Sources+SetDirSeparators('packages/rtl/src/rtl.js');
|
||||
if Simulate then begin
|
||||
Log(etInfo,'Simulate: Copying "'+SrcFilename+'" -> "'+DestFilename+'"');
|
||||
end else begin
|
||||
Log(etInfo,'Copying "'+SrcFilename+'" -> "'+DestFilename+'"');
|
||||
if not CopyFile(SrcFilename,DestFilename,[cffOverwriteFile,cffPreserveTime],false) then
|
||||
Err('Unable to copy "'+SrcFilename+'" -> "'+DestFilename+'"');
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TPas2jsReleaseCreator.RunTool(WorkDir, Exe: string;
|
||||
const ProcParams: TStringDynArray);
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user