This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I've found not a single tutorial/help/docs for the C++ file-templates variables (not the template technique) on the web. Like those: %<%CLASSNAME%>%, %<%DEFAULT_HEADER_EXT%>%. At least a list with all the variables or a way to modify them. I haven't found any resources on that topic. Only tons of Java's Freemarker tutorials. And some info on how (if possible) to modify those variables, like the date example in the Java Netbeans wiki: ${date?date?string("yyyy")}
List of supported template variables is: -PACKAGE_AND_NAME -NAME -EXTENSION -GUARD_NAME -CROPPEDNAME -DATE -TIME -QUOTES -USER For example template: -----------------8<----------------- /* PACKAGE_AND_NAME=%<%PACKAGE_AND_NAME%>% NAME=%<%NAME%>% EXTENSION=%<%EXTENSION%>% GUARD_NAME=%<%GUARD_NAME%>% CROPPEDNAME=%<%CROPPEDNAME%>% DATE=%<%DATE%>% TIME=%<%TIME%>% QUOTES=%<%QUOTES%>% USER=%<%USER%>% */ -----------------8<----------------- will generate following code: -----------------8<----------------- /* PACKAGE_AND_NAME=_home_user_NetBeansProjects_CppApplication_15_newClass NAME=newClass EXTENSION=cpp GUARD_NAME=NEWCLASS_CPP CROPPEDNAME=newClass DATE=May 17, 2012 TIME=7:41 PM QUOTES=" USER=user */ -----------------8<-----------------
Thank you for enumerating the variables available. How can these variables be preset? For example I have the following line * Author: %<%USER%>% which should exand to * Author: firstname lastname <email@server.domain> How can I preset variable %USER%? Putting the following into user.properties does not work: user=firstname lastname <email@server.domain>
Could somebody answer him? I've found that, when working with C files on a Mac in 7.2.1, %<%USER%>% cannot be changed. I can change the other things in the User.properties file (just for testing purposes; I set name to a static string and &<&NAME&>& did, in fact, return it.) This has been driving me crazy for a while.
If you are unable to preset the variable USER then, use different variable like AUTHOR in the user setting(ie, User.properties). and all the places in C++ source code use AUTHOR variable instead of USER. It worked for me in Netbeans 7.3.1 for C++.
any alternative for freemaker <#include>(which is used in java and other except C++/CND) template in CND(C++). or when the freemaker will available in C++/CND ?
Integrated into 'main-silver', will be available in build *201504270341* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/da4cb91c0c54 User: Alexander Simon <alexvsimon@netbeans.org> Log: fixing bugs: - Bug #192074 Add Project Name to File Template Keywords - Bug #198793 No File-templates variables for C++ documentation available Migrate c/c++/fortran templates on FreeMarker: - use FreeMarker variables syntax ${var} - add license - change login meme to user name Avaliable containing project variables: - project.name - project.displayName - project.encoding - project.license - project.licensePath To compatibility old variable "USER" has a previous meaning (login name). New variable "user" contains login or user name specified in template properties (Tools->Templates-Settings) If property "project.licensePath" or "project.license" is specified in project properties (nbproject/project.properties or nbproject/private/project.properties), it is used for licence generating. Othewvise the default licence will be inserted in the created file.
(In reply to Quality Engineering from comment #6) > Integrated into 'main-silver', will be available in build *201504270341* on > http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) > > Changeset: http://hg.netbeans.org/main-silver/rev/da4cb91c0c54 > User: Alexander Simon <alexvsimon@netbeans.org> > Log: fixing bugs: > - Bug #192074 Add Project Name to File Template Keywords > - Bug #198793 No File-templates variables for C++ documentation available > Migrate c/c++/fortran templates on FreeMarker: > - use FreeMarker variables syntax ${var} > - add license > - change login meme to user name > > Avaliable containing project variables: > - project.name > - project.displayName > - project.encoding > - project.license > - project.licensePath > > To compatibility old variable "USER" has a previous meaning (login name). > > New variable "user" contains login or user name specified in template > properties (Tools->Templates-Settings) > > If property "project.licensePath" or "project.license" is specified in > project properties (nbproject/project.properties or > nbproject/private/project.properties), > it is used for licence generating. Othewvise the default licence will be > inserted in the created file. I installed build 201504270341 but I see no notable changes in C/C++ project properties. Your change has just slipped to the next build?
(In reply to kazssym from comment #7) > I installed build 201504270341 but I see no notable changes in C/C++ project > properties. Your change has just slipped to the next build? There is no changes in project properties UI. Example how to use license: - Create C/C++ Application - Create file nbproject/project.properties with content: project.licensePath=/Templates/Licenses/license-bsd.txt - Create new C++ main file Created file will have "BSD 2-Clause License" in the beginning of the file.
Integrated into 'main-silver', will be available in build *201505060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/1337405cecce User: Alexander Simon <alexvsimon@netbeans.org> Log: additional fix for Bug #198793 No File-templates variables for C++ documentation available - support freemaker based template with empty extension
(In reply to Alexander Simon from comment #8) > (In reply to kazssym from comment #7) > > I installed build 201504270341 but I see no notable changes in C/C++ project > > properties. Your change has just slipped to the next build? > There is no changes in project properties UI. > Example how to use license: > - Create C/C++ Application > - Create file nbproject/project.properties with content: > project.licensePath=/Templates/Licenses/license-bsd.txt > - Create new C++ main file > Created file will have "BSD 2-Clause License" in the beginning of the file. Hi Simon, have tried to follow your instruction though nothing is displayed. Using 7.3 (Build 201306052037) Any ideas?
(In reply to sundbergad from comment #10) > (In reply to Alexander Simon from comment #8) > > (In reply to kazssym from comment #7) > > > I installed build 201504270341 but I see no notable changes in C/C++ project > > > properties. Your change has just slipped to the next build? > > There is no changes in project properties UI. > > Example how to use license: > > - Create C/C++ Application > > - Create file nbproject/project.properties with content: > > project.licensePath=/Templates/Licenses/license-bsd.txt > > - Create new C++ main file > > Created file will have "BSD 2-Clause License" in the beginning of the file. > > Hi Simon, > have tried to follow your instruction though nothing is displayed. Using 7.3 > (Build 201306052037) > Any ideas? There is no ideas about Netbeans 7.3. Use Netbeans 8.2. Alexanders