Browse Source

Merge pull request #219 from theavege/upd/ci

Upd/ci
Leandro Oscar Ezequiel Diaz 10 months ago
parent
commit
af0959542e

+ 143 - 133
.github/workflows/make.pas

@@ -1,8 +1,8 @@
-#!/usr/bin/env instantfpc
+//https://castle-engine.io/modern_pascal
 
 
 program Make;
 program Make;
 {$mode objfpc}{$H+}
 {$mode objfpc}{$H+}
-{$unitpath /usr/lib64/lazarus/components/lazutils}
+
 uses
 uses
   Classes,
   Classes,
   SysUtils,
   SysUtils,
@@ -12,114 +12,141 @@ uses
   fphttpclient,
   fphttpclient,
   RegExpr,
   RegExpr,
   openssl,
   openssl,
+  LazUTF8,
   opensslsockets,
   opensslsockets,
+  eventlog,
   Process;
   Process;
 
 
-const
-  Target: string = 'test';
-  Dependencies: array of string = ('BGRABitmap');
-
-type
-  TLog = (audit, info, error);
-  Output = record
-    Success: boolean;
-    Output: string;
-  end;
-
-  procedure OutLog(Knd: TLog; Msg: string);
+  function OutLog(const Knd: TEventType; const Msg: string): string;
   begin
   begin
     case Knd of
     case Knd of
-        error: Writeln(stderr, #27'[31m', Msg, #27'[0m');
-        info:  Writeln(stderr, #27'[32m', Msg, #27'[0m');
-        audit: Writeln(stderr, #27'[33m', Msg, #27'[0m');
+      etError: Result := #27'[31m%s'#27'[0m';
+      etInfo:  Result := #27'[32m%s'#27'[0m';
+      etDebug: Result := #27'[33m%s'#27'[0m';
     end;
     end;
+    Writeln(stderr, UTF8ToConsole(Result.Format([Msg])));
   end;
   end;
 
 
-  function CheckModules: Output;
+  function AddPackage(const Path: string): string;
   begin
   begin
-    if FileExists('.gitmodules') then
-      if RunCommand('git', ['submodule', 'update', '--init', '--recursive',
-        '--force', '--remote'], Result.Output) then
-        OutLog(info, Result.Output);
+    if RunCommand('lazbuild', ['--add-package-link', Path], Result, [poStderrToOutPut]) then
+      OutLog(etDebug, 'Add package:'#9 + Path)
+    else
+    begin
+      ExitCode += 1;
+      OutLog(etError, Result);
+    end;
   end;
   end;
 
 
-  function AddPackage(Path: string): Output;
+  function SelectString(const Input, Reg: string): string;
+  var
+    Line: string;
   begin
   begin
+    Result := EmptyStr;
     with TRegExpr.Create do
     with TRegExpr.Create do
     begin
     begin
-      Expression :=
-        {$IFDEF MSWINDOWS}
-          '(cocoa|x11|_template)'
-        {$ELSE}
-          '(cocoa|gdi|_template)'
-        {$ENDIF}
-      ;
-      if not Exec(Path) and RunCommand('lazbuild', ['--add-package-link', Path],
-        Result.Output) then
-        OutLog(audit, 'added ' + Path);
+      Expression := Reg;
+      for Line in Input.Split(LineEnding) do
+        if Exec(Line) then
+          Result += Line + LineEnding;
       Free;
       Free;
     end;
     end;
   end;
   end;
 
 
-  function BuildProject(Path: string): Output;
+  function RunTest(const Path: String): string;
+  begin
+    OutLog(etDebug, #9'run:'#9 + Path);
+    if RunCommand(Path, ['--all', '--format=plain'], Result, [poStderrToOutPut]) then
+      OutLog(etInfo, #9'success!')
+    else
+    begin
+      ExitCode += 1;
+      OutLog(etError, Result);
+    end;
+  end;
+
+  function AddDDL(const Path: String): string;
+  const
+    LibPath: string = '/usr/lib/';
   var
   var
-    Line: string;
+    List: array of string;
+    Last: integer;
   begin
   begin
-    OutLog(audit, 'build from ' + Path);
-    try
-      Result.Success := RunCommand('lazbuild', ['--build-all', '--recursive',
-        '--no-write-project', Path], Result.Output);
-      if Result.Success then
-        for Line in SplitString(Result.Output, LineEnding) do
-        begin
-          if ContainsStr(Line, 'Linking') then
-          begin
-            Result.Output := SplitString(Line, ' ')[2];
-            OutLog(info, ' to ' + Result.Output);
-            break;
-          end;
-        end
+    OutLog(etDebug, #9'add:'#9 + Path);
+    List := Path.Split(DirectorySeparator);
+    Last := High(List);
+    if not FileExists(LibPath + List[Last]) then
+      if RunCommand('sudo', ['bash', '-c', 'cp %s %s; ldconfig --verbose'.Format([Path, LibPath])], Result, [poStderrToOutPut]) then
+        OutLog(etInfo, #9'success!')
       else
       else
       begin
       begin
         ExitCode += 1;
         ExitCode += 1;
-        for Line in SplitString(Result.Output, LineEnding) do
-          with TRegExpr.Create do
-          begin
-            Expression := '(Fatal|Error):';
-            if Exec(Line) then
-              OutLog(error, #10 + Line);
-            Free;
-          end;
+        OutLog(etError, Result);
       end;
       end;
-    except
-      on E: Exception do
-        OutLog(error, E.ClassName + #13#10 + E.Message);
-    end;
   end;
   end;
 
 
-  function RunTest(Path: string): Output;
+  function BuildProject(const Path: string): string;
   var
   var
-    Temp: string;
+    Text: string;
   begin
   begin
-    Result := BuildProject(Path);
-    Temp:= Result.Output;
-    if Result.Success then
-        try
-          if not RunCommand(Temp, ['--all', '--format=plain', '--progress'], Result.Output) then
-          begin
-            ExitCode += 1;
-            OutLog(error, Result.Output);
-          end;
-        except
-          on E: Exception do
-            OutLog(error, E.ClassName + #13#10 + E.Message);
-        end;
+    OutLog(etDebug, 'Build from:'#9 + Path);
+    if RunCommand('lazbuild',
+      ['--build-all', '--recursive', '--no-write-project', Path], Result, [poStderrToOutPut]) then
+    begin
+      Result := SelectString(Result, 'Linking').Split(' ')[2].Replace(LineEnding, EmptyStr);
+      OutLog(etInfo, #9'to:'#9 + Result);
+      Text := ReadFileToString(Path.Replace('.lpi', '.lpr'));
+      if Text.Contains('program') and Text.Contains('consoletestrunner') then
+        RunTest(Result)
+      else if Text.Contains('library') and Text.Contains('exports') then
+        AddDDL(Result)
+    end
+    else
+    begin
+      ExitCode += 1;
+      OutLog(etError, SelectString(Result, '(Fatal|Error):'));
+    end;
   end;
   end;
 
 
-  function InstallOPM(Path: string): string;
+  function DownloadFile(const Uri: string): string;
   var
   var
-    OutFile, Uri: string;
-    Zip: TStream;
+    OutFile: TStream;
+  begin
+    InitSSLInterface;
+    Result := GetTempFileName;
+    OutFile := TFileStream.Create(Result, fmCreate or fmOpenWrite);
+    with TFPHttpClient.Create(nil) do
+    begin
+      try
+        AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)');
+        AllowRedirect := True;
+        Get(Uri, OutFile);
+        OutLog(etDebug, 'Download from %s to %s'.Format([Uri, Result]));
+      finally
+        Free;
+        OutFile.Free;
+      end;
+    end;
+  end;
+
+  procedure UnZip(const ZipFile, ZipPath: string);
+  begin
+    with TUnZipper.Create do
+    begin
+      try
+        FileName := ZipFile;
+        OutputPath := ZipPath;
+        Examine;
+        UnZipAllFiles;
+        OutLog(etDebug, 'Unzip from'#9 + ZipFile + #9'to'#9 + ZipPath);
+        DeleteFile(ZipFile);
+      finally
+        Free;
+      end;
+    end;
+  end;
+
+  function InstallOPM(const Path: string): string;
   begin
   begin
     Result :=
     Result :=
       {$IFDEF MSWINDOWS}
       {$IFDEF MSWINDOWS}
@@ -128,74 +155,57 @@ type
       GetEnvironmentVariable('HOME') + '/.lazarus/onlinepackagemanager/packages/'
       GetEnvironmentVariable('HOME') + '/.lazarus/onlinepackagemanager/packages/'
       {$ENDIF}
       {$ENDIF}
       + Path;
       + Path;
-    OutFile := GetTempFileName;
-    Uri := 'https://packages.lazarus-ide.org/' + Path + '.zip';
     if not DirectoryExists(Result) then
     if not DirectoryExists(Result) then
     begin
     begin
-      Zip := TFileStream.Create(OutFile, fmCreate or fmOpenWrite);
-      with TFPHttpClient.Create(nil) do
-      begin
-        try
-          AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)');
-          AllowRedirect := True;
-          Get(Uri, Zip);
-          OutLog(audit, 'Download from ' + Uri + ' to ' + OutFile);
-        finally
-          Free;
-          Zip.Free;
-        end;
-      end;
-      CreateDir(Result);
-      with TUnZipper.Create do
-      begin
-        try
-          FileName := OutFile;
-          OutputPath := Result;
-          Examine;
-          UnZipAllFiles;
-          OutLog(audit, 'Unzip from ' + OutFile + ' to ' + Result);
-        finally
-          Free;
-        end;
-      end;
-      DeleteFile(OutFile);
+      if ForceDirectories(Result) then
+        UnZip(DownloadFile('https://packages.lazarus-ide.org/%s.zip'.Format([Path])), Result);
     end;
     end;
   end;
   end;
 
 
-  procedure BuildAll;
+  function BuildAll(const Target: string; const Dependencies: array of string): string;
   var
   var
-    Each: string;
     List: TStringList;
     List: TStringList;
+    DT: TDateTime;
   begin
   begin
-    CheckModules;
-    InitSSLInterface;
-    List := FindAllFiles(GetCurrentDir, '*.lpk', True);
+    DT := Time;
+    if FileExists('.gitmodules') then
+      if RunCommand('git', ['submodule', 'update', '--init', '--recursive',
+        '--force', '--remote'], Result, [poStderrToOutPut]) then
+        OutLog(etInfo, Result)
+      else
+      begin
+        ExitCode += 1;
+        OutLog(etError, Result);
+      end;
+    List := FindAllFiles(GetCurrentDir, '*.lpk');
     try
     try
-      for Each in Dependencies do
-        List.AddStrings(FindAllFiles(InstallOPM(Each), '*.lpk', True));
-      for Each in List do
-        AddPackage(Each);
-      List := FindAllFiles(Target, '*.lpi', True);
-      for Each in List do
-        if not ContainsStr(Each, 'zengl') then
-          if ContainsStr(ReadFileToString(ReplaceStr(Each, '.lpi', '.lpr')),
-            'consoletestrunner') then
-            RunTest(Each)
-          else
-            BuildProject(Each);
+      for Result in Dependencies do
+        List.AddStrings(FindAllFiles(InstallOPM(Result), '*.lpk'));
+      for Result in List do
+        AddPackage(Result);
+      List := FindAllFiles(Target, '*.lpi');
+      List.Sort;
+      for Result in List do
+        if not Result.Contains('backup') then
+          BuildProject(Result);
     finally
     finally
       List.Free;
       List.Free;
     end;
     end;
+    if not RunCommand('delp', ['-r', GetCurrentDir], Result, [poStderrToOutPut]) then
+      OutLog(etError, Result);
+    OutLog(etDebug, 'Duration:'#9 + FormatDateTime('hh:nn:ss', Time - DT));
   end;
   end;
 
 
 begin
 begin
-  if ParamCount <> 0 then
-    case ParamStr(1) of
-      'build': BuildAll;
-      else OutLog(audit, 'Nothing!');
+  try
+    BuildAll('.', ['BGRABitmap']);
+    case ExitCode of
+      0: OutLog(etInfo, 'Errors:'#9 + ExitCode.ToString);
+      else
+        OutLog(etError, 'Errors:'#9 + ExitCode.ToString);
     end;
     end;
-  if ExitCode <> 0 then
-    OutLog(error, #10 + 'Errors: ' + IntToStr(ExitCode))
-  else
-    OutLog(info, #10 + 'Errors: ' + IntToStr(ExitCode));
+  except
+    on E: Exception do
+      Writeln(E.ClassName, #9, E.Message);
+  end;
 end.
 end.

+ 0 - 1
.github/workflows/make.yml

@@ -37,4 +37,3 @@ jobs:
           sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null
           sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null
           instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \
           instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \
             .github/workflows/make.pas build
             .github/workflows/make.pas build
-          delp -r "${PWD}"

+ 17 - 6
test/test_bckeyboard/test_bckeyboard.lpi

@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
 <CONFIG>
   <ProjectOptions>
   <ProjectOptions>
-    <Version Value="9"/>
+    <Version Value="12"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <General>
     <General>
+      <Flags>
+        <CompatibilityMode Value="True"/>
+      </Flags>
       <SessionStorage Value="InProjectDir"/>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="test_bckeyboard"/>
       <Title Value="test_bckeyboard"/>
       <ResourceType Value="res"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <UseXPManifest Value="True"/>
@@ -24,6 +26,7 @@
           </Target>
           </Target>
           <SearchPaths>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir)"/>
             <IncludeFiles Value="$(ProjOutDir)"/>
+            <OtherUnitFiles Value="..\.."/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           </SearchPaths>
           <Parsing>
           <Parsing>
@@ -64,6 +67,7 @@
           </Target>
           </Target>
           <SearchPaths>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir)"/>
             <IncludeFiles Value="$(ProjOutDir)"/>
+            <OtherUnitFiles Value="..\.."/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           </SearchPaths>
           <CodeGeneration>
           <CodeGeneration>
@@ -90,9 +94,10 @@
       <Version Value="2"/>
       <Version Value="2"/>
     </PublishOptions>
     </PublishOptions>
     <RunParams>
     <RunParams>
-      <local>
-        <FormatVersion Value="1"/>
-      </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default"/>
+      </Modes>
     </RunParams>
     </RunParams>
     <RequiredPackages Count="2">
     <RequiredPackages Count="2">
       <Item1>
       <Item1>
@@ -102,7 +107,7 @@
         <PackageName Value="LCL"/>
         <PackageName Value="LCL"/>
       </Item2>
       </Item2>
     </RequiredPackages>
     </RequiredPackages>
-    <Units Count="2">
+    <Units Count="3">
       <Unit0>
       <Unit0>
         <Filename Value="test_bckeyboard.lpr"/>
         <Filename Value="test_bckeyboard.lpr"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
@@ -114,6 +119,11 @@
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
       </Unit1>
       </Unit1>
+      <Unit2>
+        <Filename Value="..\..\bcnumerickeyboard.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="BCNumericKeyboard"/>
+      </Unit2>
     </Units>
     </Units>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>
@@ -124,6 +134,7 @@
     </Target>
     </Target>
     <SearchPaths>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>
       <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="..\..;..\..\lcl"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     </SearchPaths>
     <Linking>
     <Linking>

+ 1 - 1
test/test_bckeyboard/test_bckeyboard.lpr

@@ -7,7 +7,7 @@ uses
   cthreads,
   cthreads,
   {$ENDIF}{$ENDIF}
   {$ENDIF}{$ENDIF}
   Interfaces, // this includes the LCL widgetset
   Interfaces, // this includes the LCL widgetset
-  Forms, umain
+  Forms, BCNumericKeyboard, umain
   { you can add units after this };
   { you can add units after this };
 
 
 {$R *.res}
 {$R *.res}

+ 17 - 6
test/test_bcnumerickeyboard/test_bcnumerickeyboard.lpi

@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
 <CONFIG>
   <ProjectOptions>
   <ProjectOptions>
-    <Version Value="9"/>
+    <Version Value="12"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <General>
     <General>
+      <Flags>
+        <CompatibilityMode Value="True"/>
+      </Flags>
       <SessionStorage Value="InProjectDir"/>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="BC Numeric Keyboard"/>
       <Title Value="BC Numeric Keyboard"/>
       <ResourceType Value="res"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <UseXPManifest Value="True"/>
@@ -24,6 +26,7 @@
           </Target>
           </Target>
           <SearchPaths>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir)"/>
             <IncludeFiles Value="$(ProjOutDir)"/>
+            <OtherUnitFiles Value="..\.."/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           </SearchPaths>
           <Parsing>
           <Parsing>
@@ -64,6 +67,7 @@
           </Target>
           </Target>
           <SearchPaths>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir)"/>
             <IncludeFiles Value="$(ProjOutDir)"/>
+            <OtherUnitFiles Value="..\.."/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           </SearchPaths>
           <CodeGeneration>
           <CodeGeneration>
@@ -90,9 +94,10 @@
       <Version Value="2"/>
       <Version Value="2"/>
     </PublishOptions>
     </PublishOptions>
     <RunParams>
     <RunParams>
-      <local>
-        <FormatVersion Value="1"/>
-      </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default"/>
+      </Modes>
     </RunParams>
     </RunParams>
     <RequiredPackages Count="2">
     <RequiredPackages Count="2">
       <Item1>
       <Item1>
@@ -102,7 +107,7 @@
         <PackageName Value="LCL"/>
         <PackageName Value="LCL"/>
       </Item2>
       </Item2>
     </RequiredPackages>
     </RequiredPackages>
-    <Units Count="2">
+    <Units Count="3">
       <Unit0>
       <Unit0>
         <Filename Value="test_bcnumerickeyboard.lpr"/>
         <Filename Value="test_bcnumerickeyboard.lpr"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
@@ -114,6 +119,11 @@
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
       </Unit1>
       </Unit1>
+      <Unit2>
+        <Filename Value="..\..\bcnumerickeyboard.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="BCNumericKeyboard"/>
+      </Unit2>
     </Units>
     </Units>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>
@@ -124,6 +134,7 @@
     </Target>
     </Target>
     <SearchPaths>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>
       <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="..\.."/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     </SearchPaths>
     <Linking>
     <Linking>

+ 1 - 1
test/test_bcnumerickeyboard/test_bcnumerickeyboard.lpr

@@ -7,7 +7,7 @@ uses
   cthreads,
   cthreads,
   {$ENDIF}{$ENDIF}
   {$ENDIF}{$ENDIF}
   Interfaces, // this includes the LCL widgetset
   Interfaces, // this includes the LCL widgetset
-  Forms, umain
+  Forms, umain, BCNumericKeyboard
   { you can add units after this };
   { you can add units after this };
 
 
 {$R *.res}
 {$R *.res}

+ 9 - 5
test/test_bcrealnumerickeyboard/test_bcnumerickeyboard.lpi

@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
 <CONFIG>
   <ProjectOptions>
   <ProjectOptions>
-    <Version Value="9"/>
+    <Version Value="12"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <General>
     <General>
+      <Flags>
+        <CompatibilityMode Value="True"/>
+      </Flags>
       <SessionStorage Value="InProjectDir"/>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="BC Numeric Keyboard"/>
       <Title Value="BC Numeric Keyboard"/>
       <ResourceType Value="res"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <UseXPManifest Value="True"/>
@@ -90,9 +92,10 @@
       <Version Value="2"/>
       <Version Value="2"/>
     </PublishOptions>
     </PublishOptions>
     <RunParams>
     <RunParams>
-      <local>
-        <FormatVersion Value="1"/>
-      </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default"/>
+      </Modes>
     </RunParams>
     </RunParams>
     <RequiredPackages Count="2">
     <RequiredPackages Count="2">
       <Item1>
       <Item1>
@@ -124,6 +127,7 @@
     </Target>
     </Target>
     <SearchPaths>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>
       <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="..\.."/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     </SearchPaths>
     <Linking>
     <Linking>

+ 9 - 22
test/test_bgrapascalscript/test_bgrapascalscript.lpi

@@ -1,11 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <CONFIG>
 <CONFIG>
   <ProjectOptions>
   <ProjectOptions>
-    <Version Value="9"/>
+    <Version Value="12"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <General>
     <General>
+      <Flags>
+        <CompatibilityMode Value="True"/>
+      </Flags>
       <SessionStorage Value="InProjectDir"/>
       <SessionStorage Value="InProjectDir"/>
-      <MainUnit Value="0"/>
       <Title Value="test_bgrapascalscript"/>
       <Title Value="test_bgrapascalscript"/>
       <ResourceType Value="res"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <UseXPManifest Value="True"/>
@@ -14,9 +16,6 @@
     <i18n>
     <i18n>
       <EnableI18N LFM="False"/>
       <EnableI18N LFM="False"/>
     </i18n>
     </i18n>
-    <VersionInfo>
-      <StringTable ProductVersion=""/>
-    </VersionInfo>
     <BuildModes Count="2">
     <BuildModes Count="2">
       <Item1 Name="Debug" Default="True"/>
       <Item1 Name="Debug" Default="True"/>
       <Item2 Name="Release">
       <Item2 Name="Release">
@@ -47,12 +46,6 @@
               </Win32>
               </Win32>
             </Options>
             </Options>
           </Linking>
           </Linking>
-          <Other>
-            <CompilerMessages>
-              <MsgFileName Value=""/>
-            </CompilerMessages>
-            <CompilerPath Value="$(CompPath)"/>
-          </Other>
         </CompilerOptions>
         </CompilerOptions>
       </Item2>
       </Item2>
     </BuildModes>
     </BuildModes>
@@ -60,9 +53,10 @@
       <Version Value="2"/>
       <Version Value="2"/>
     </PublishOptions>
     </PublishOptions>
     <RunParams>
     <RunParams>
-      <local>
-        <FormatVersion Value="1"/>
-      </local>
+      <FormatVersion Value="2"/>
+      <Modes Count="1">
+        <Mode0 Name="default"/>
+      </Modes>
     </RunParams>
     </RunParams>
     <RequiredPackages Count="4">
     <RequiredPackages Count="4">
       <Item1>
       <Item1>
@@ -82,7 +76,6 @@
       <Unit0>
       <Unit0>
         <Filename Value="test_bgrapascalscript.lpr"/>
         <Filename Value="test_bgrapascalscript.lpr"/>
         <IsPartOfProject Value="True"/>
         <IsPartOfProject Value="True"/>
-        <UnitName Value="test_bgrapascalscript"/>
       </Unit0>
       </Unit0>
       <Unit1>
       <Unit1>
         <Filename Value="umain.pas"/>
         <Filename Value="umain.pas"/>
@@ -90,7 +83,6 @@
         <ComponentName Value="Form1"/>
         <ComponentName Value="Form1"/>
         <HasResources Value="True"/>
         <HasResources Value="True"/>
         <ResourceBaseClass Value="Form"/>
         <ResourceBaseClass Value="Form"/>
-        <UnitName Value="umain"/>
       </Unit1>
       </Unit1>
     </Units>
     </Units>
   </ProjectOptions>
   </ProjectOptions>
@@ -102,6 +94,7 @@
     </Target>
     </Target>
     <SearchPaths>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>
       <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="..\.."/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     </SearchPaths>
     <Parsing>
     <Parsing>
@@ -129,12 +122,6 @@
         </Win32>
         </Win32>
       </Options>
       </Options>
     </Linking>
     </Linking>
-    <Other>
-      <CompilerMessages>
-        <MsgFileName Value=""/>
-      </CompilerMessages>
-      <CompilerPath Value="$(CompPath)"/>
-    </Other>
   </CompilerOptions>
   </CompilerOptions>
   <Debugging>
   <Debugging>
     <Exceptions Count="3">
     <Exceptions Count="3">

+ 1 - 0
test/test_bgrascript/test_bgrascript.lpi

@@ -131,6 +131,7 @@
     </Target>
     </Target>
     <SearchPaths>
     <SearchPaths>
       <IncludeFiles Value="$(ProjOutDir)"/>
       <IncludeFiles Value="$(ProjOutDir)"/>
+      <OtherUnitFiles Value="..\.."/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
       <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
     </SearchPaths>
     </SearchPaths>
     <Linking>
     <Linking>

BIN
test/test_bgrathemes/test