View Issue Details

IDProjectCategoryView StatusLast Update
0032870LazarusPackagespublic2017-12-23 13:03
ReporterAlfredAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.9 (SVN)Product BuildTrunk latest 
Target VersionFixed in Version1.9 (SVN) 
Summary0032870: Pas2js designer does not pickup custom path towards pas2js compiler.
DescriptionAfter installing the pas2jsdsgn.lpk, you can set the path towards the pas2js executable.
But this setting is not picked up by the New Project Utility.
Patch to fix (proposal) included.
Additional InformationAs pas2js(.exe) is to be expected to be installed in the fpc(.exe) binary directory, it would be more logical to search first in the FPC binary directory for this exe.
TagsNo tags attached.
Fixed in Revision56825
LazTarget-
Widgetset
Attached Files
  • pas2js01.patch (2,062 bytes)
    Index: components/pas2js/pjsdsgnregister.pas
    ===================================================================
    --- components/pas2js/pjsdsgnregister.pas	(revision 56816)
    +++ components/pas2js/pjsdsgnregister.pas	(working copy)
    @@ -231,6 +231,7 @@
       RunParams : TAbstractRunParamsOptions;
     
       NewSource: String;
    +  Compiler: string;
     begin
       Result:=inherited InitProject(AProject);
     
    @@ -244,8 +245,12 @@
       CompOpts.Win32GraphicApp:=false;
       CompOpts.UnitOutputDirectory:='js';
       CompOpts.TargetFilename:='project1';
    +  if Length(PJSOptions.CompilerFilename)=0 then
    +    Compiler:='$MakeExe(pas2js)'
    +  else
    +    Compiler:=AnsiQuotedStr(PJSOptions.CompilerFilename, '"');
       CompOpts.SetAlternativeCompile(
    -    '$MakeExe(pas2js) -Jc -Jminclude -Tnodejs "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
    +    Compiler+' -Jc -Jminclude -Tnodejs "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
       RunParams:=AProject.RunParameters;
       //RunParams.UseLaunchingApplication:=True;
       //RunParams.LaunchingApplicationPathPlusParams:='$(Pas2JSNodeJS) "$MakeDir($(ProjPath))$NameOnly($(ProjFile)).js"';
    @@ -482,7 +487,7 @@
       MainFile : TLazProjectFile;
       CompOpts: TLazCompilerOptions;
       RunParams : TAbstractRunParamsOptions;
    -
    +  Compiler : string;
     begin
       Result:=inherited InitProject(AProject);
     
    @@ -496,8 +501,12 @@
       CompOpts.Win32GraphicApp:=false;
       CompOpts.UnitOutputDirectory:='js';
       CompOpts.TargetFilename:='project1';
    +  if Length(PJSOptions.CompilerFilename)=0 then
    +    Compiler:='$MakeExe(pas2js)'
    +  else
    +    Compiler:=AnsiQuotedStr(PJSOptions.CompilerFilename, '"');
       CompOpts.SetAlternativeCompile(
    -    '$MakeExe(pas2js) -Jirtl.js -Jc -Jminclude -Tbrowser "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
    +    Compiler+' -Jirtl.js -Jc -Jminclude -Tbrowser "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
       RunParams:=AProject.RunParameters;
       //RunParams.UseLaunchingApplication:=True;
       //RunParams.LaunchingApplicationPathPlusParams:=GetBrowserCommand(CompOpts.TargetFileName);
    pas2js01.patch (2,062 bytes)

Activities

Alfred

2017-12-22 15:12

reporter  

pas2js01.patch (2,062 bytes)
Index: components/pas2js/pjsdsgnregister.pas
===================================================================
--- components/pas2js/pjsdsgnregister.pas	(revision 56816)
+++ components/pas2js/pjsdsgnregister.pas	(working copy)
@@ -231,6 +231,7 @@
   RunParams : TAbstractRunParamsOptions;
 
   NewSource: String;
+  Compiler: string;
 begin
   Result:=inherited InitProject(AProject);
 
@@ -244,8 +245,12 @@
   CompOpts.Win32GraphicApp:=false;
   CompOpts.UnitOutputDirectory:='js';
   CompOpts.TargetFilename:='project1';
+  if Length(PJSOptions.CompilerFilename)=0 then
+    Compiler:='$MakeExe(pas2js)'
+  else
+    Compiler:=AnsiQuotedStr(PJSOptions.CompilerFilename, '"');
   CompOpts.SetAlternativeCompile(
-    '$MakeExe(pas2js) -Jc -Jminclude -Tnodejs "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
+    Compiler+' -Jc -Jminclude -Tnodejs "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
   RunParams:=AProject.RunParameters;
   //RunParams.UseLaunchingApplication:=True;
   //RunParams.LaunchingApplicationPathPlusParams:='$(Pas2JSNodeJS) "$MakeDir($(ProjPath))$NameOnly($(ProjFile)).js"';
@@ -482,7 +487,7 @@
   MainFile : TLazProjectFile;
   CompOpts: TLazCompilerOptions;
   RunParams : TAbstractRunParamsOptions;
-
+  Compiler : string;
 begin
   Result:=inherited InitProject(AProject);
 
@@ -496,8 +501,12 @@
   CompOpts.Win32GraphicApp:=false;
   CompOpts.UnitOutputDirectory:='js';
   CompOpts.TargetFilename:='project1';
+  if Length(PJSOptions.CompilerFilename)=0 then
+    Compiler:='$MakeExe(pas2js)'
+  else
+    Compiler:=AnsiQuotedStr(PJSOptions.CompilerFilename, '"');
   CompOpts.SetAlternativeCompile(
-    '$MakeExe(pas2js) -Jirtl.js -Jc -Jminclude -Tbrowser "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
+    Compiler+' -Jirtl.js -Jc -Jminclude -Tbrowser "-Fu$(ProjUnitPath)" $Name($(ProjFile))',true);
   RunParams:=AProject.RunParameters;
   //RunParams.UseLaunchingApplication:=True;
   //RunParams.LaunchingApplicationPathPlusParams:=GetBrowserCommand(CompOpts.TargetFileName);
pas2js01.patch (2,062 bytes)

Michael Van Canneyt

2017-12-23 12:52

administrator   ~0104964

Fixed, thanks for reporting.

Alfred

2017-12-23 13:03

reporter   ~0104965

This fixed more than the bug itself ... thanks !

Issue History

Date Modified Username Field Change
2017-12-22 15:12 Alfred New Issue
2017-12-22 15:12 Alfred File Added: pas2js01.patch
2017-12-22 15:19 Mattias Gaertner Assigned To => Mattias Gaertner
2017-12-22 15:19 Mattias Gaertner Status new => assigned
2017-12-23 11:09 Michael Van Canneyt Assigned To Mattias Gaertner => Michael Van Canneyt
2017-12-23 12:52 Michael Van Canneyt Fixed in Revision => 56825
2017-12-23 12:52 Michael Van Canneyt LazTarget => -
2017-12-23 12:52 Michael Van Canneyt Note Added: 0104964
2017-12-23 12:52 Michael Van Canneyt Status assigned => resolved
2017-12-23 12:52 Michael Van Canneyt Fixed in Version => 1.9 (SVN)
2017-12-23 12:52 Michael Van Canneyt Resolution open => fixed
2017-12-23 13:03 Alfred Note Added: 0104965
2017-12-23 13:03 Alfred Status resolved => closed