Forum > Lazarus Extra Components
Package Projtemplates
(1/1)
Inthya:
Hello,
I tried to configure the package ProjTemplates. After some experimentation today I was able to successfully create a new project out of a template with this package. But it seems there is a problem with the detection inside __PROJNAME__.lpi.
After creating the new project, Lazarus told me, that the created lpi-file seems no ordinary lpi-file. So I looked into the lpi-file with a basic editor. In fact the package replaced the section name
<ProjectOptions>
<\ProjectOptions>
with the name of the new Project. For example, if my given name for the new Project is “test” the package replaces
<ProjectOptions>
<\ProjectOptions>
with
<testOptions>
<\testOptions>
Obviously Lazarus isn’t able to read the informations between
<testOptions>
<\testOptions>
Is there something I’m doing wrong?
Below are my templatefiles and the files created by projtemplates. I named the new project "test". Take a look at lines 3 and 39 of __PROJNAME__.lpi and compare it with lines 3 and 39 of test.lpi.
My project.ini file
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---[Variables] [Project]Name=FUH_2Description=Einfache Lazarus-Anwendung an die Vorgaben der FUH angepasst.
My __PROJNAME__.lpr file
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$R+}{$B+} program __PROJNAME__ (output); { Das Programm nacht ... und gibt ... aus } { constant definition part } { type definition part} { variable declaration part} { function declaration part} begin end.
My __PROJNAME__.lpi file
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<?xml version="1.0" encoding="UTF-8"?><CONFIG> <ProjectOptions> <Version Value="11"/> <PathDelim Value="\"/> <General> <Flags> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> <MainUnitHasScaledStatement Value="False"/> </Flags> <MainUnit Value="0"/> <Title Value="__PROJNAME__"/> <UseAppBundle Value="False"/> <ResourceType Value="res"/> </General> <BuildModes Count="1" Active="Default"> <Item1 Name="Default" Default="True"/> </BuildModes> <PublishOptions> <Version Value="2"/> <UseFileFilters Value="True"/> </PublishOptions> <RunParams> <FormatVersion Value="2"/> <Modes Count="0"/> </RunParams> <Units Count="1"> <Unit0> <Filename Value="__PROJNAME__.lpr"/> <IsPartOfProject Value="True"/> <IsVisibleTab Value="True"/> <CursorPos X="5" Y="18"/> <UsageCount Value="20"/> <Loaded Value="True"/> </Unit0> </Units> <JumpHistory HistoryIndex="-1"/> </ProjectOptions> <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> <Target> <Filename Value="__PROJNAME__"/> </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> </CompilerOptions> <Debugging> <Exceptions Count="3"> <Item1> <Name Value="EAbort"/> </Item1> <Item2> <Name Value="ECodetoolError"/> </Item2> <Item3> <Name Value="EFOpenError"/> </Item3> </Exceptions> </Debugging></CONFIG>
The created test.lpr file
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$R+}{$B+} program test (output); { Das Programm nacht ... und gibt ... aus } { constant definition part } { type definition part} { variable declaration part} { function declaration part} begin end.
The created test.lpi file
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---<?xml version="1.0" encoding="UTF-8"?><CONFIG> <testOptions> <Version Value="11"/> <PathDelim Value="\"/> <General> <Flags> <MainUnitHasCreateFormStatements Value="False"/> <MainUnitHasTitleStatement Value="False"/> <MainUnitHasScaledStatement Value="False"/> </Flags> <MainUnit Value="0"/> <Title Value="test"/> <UseAppBundle Value="False"/> <ResourceType Value="res"/> </General> <BuildModes Count="1" Active="Default"> <Item1 Name="Default" Default="True"/> </BuildModes> <PublishOptions> <Version Value="2"/> <UseFileFilters Value="True"/> </PublishOptions> <RunParams> <FormatVersion Value="2"/> <Modes Count="0"/> </RunParams> <Units Count="1"> <Unit0> <Filename Value="test.lpr"/> <IsPartOftest Value="True"/> <IsVisibleTab Value="True"/> <CursorPos X="5" Y="18"/> <UsageCount Value="20"/> <Loaded Value="True"/> </Unit0> </Units> <JumpHistory HistoryIndex="-1"/> </testOptions> <CompilerOptions> <Version Value="11"/> <PathDelim Value="\"/> <Target> <Filename Value="test"/> </Target> <SearchPaths> <IncludeFiles Value="$(ProjOutDir)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> </CompilerOptions> <Debugging> <Exceptions Count="3"> <Item1> <Name Value="EAbort"/> </Item1> <Item2> <Name Value="ECodetoolError"/> </Item2> <Item3> <Name Value="EFOpenError"/> </Item3> </Exceptions> </Debugging></CONFIG>
Navigation
[0] Message Index