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.

Bug 250908 - problems with license header template expansion
Summary: problems with license header template expansion
Status: RESOLVED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Templates (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-04 22:28 UTC by err
Modified: 2015-07-18 01:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2015-03-04 22:28:54 UTC
I have a module project and I'm trying to set it up to use lgpl3 license. 
Here's some issues I've run into. Note, some of these issues are also problems 
with with a plain old java project.

The biggest overal problem is that in a module "${project.displayName}" is not
expanded (it is expanded in a java project). There is no way I have found,
even setting it in <userdir>/config/.../User.properties, to get it to expand.
I do not know if User.properties is broken in general, or just for some select
variables.

I tried puttting the following in both a module's project.properties and the
suite's project.properties (it behaved the same for both)
    project.license=lgpl3
    project.displayName=some name
    application.title=some name

- project.displayName template expansion fails for module projects (see below for example output)

  NOTE: in a java project (not a module) this variable is set from  the
        <name>xxx</name> element in project.xml (which is odd)

- setting project.displayName in userdir/config/Templates/Properties does
  not work as described in http://wiki.netbeans.org/FaqTemplateVariables

  NOTE: this is only a workaround anyway. Can't have a single value for this
        in a multiple project environment .

- No UI to set license template
  see bug 226774 which it seems it did not include module suites/projects

- In a java project there is no way to specify/override project.displayName
  with a project property. It only comes from <name>xxx</name> in project.xml,
  this does not seem right.


===== FAIL example of template exansion in newly created class file ======

 *
 * This file is part of Expression project.displayName is undefined on line 6, column 40 in Templates/Licenses/license-lgpl3.txt..
 *
 * Expression project.displayName is undefined on line 8, column 19 in Templates/Licenses/license-lgpl3.txt. is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
Comment 1 Ondrej Vrabec 2015-07-16 08:15:46 UTC
over 9 million instances of VisualizerNode held by  org.netbeans.modules.csl.navigation.ClassMemberPanelUI$MyBeanTreeView
Also there seems to be 588 tasks scheduled to run in a ClassMemberPanelUI.RP
Comment 2 Ondrej Vrabec 2015-07-16 08:16:25 UTC
sorry, wrong issue, please forget my last comment
Comment 3 Ondrej Vrabec 2015-07-16 09:52:47 UTC
i hope this fix will help you. Now project.name and project.displayName should be able to expand in a template. It's take from:
1) in case of a module suite from app.title in project.properties
2) in case of a module with no license - from the module suite
3) in case of a module with license set - from OpenIDE-Module-Name from a Bundle.properties as set in module's manifest

Fix: http://hg.netbeans.org/core-main/rev/549410f49296
Comment 4 Quality Engineering 2015-07-18 01:47:13 UTC
Integrated into 'main-silver', will be available in build *201507180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/549410f49296
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #250908 - problems with license header template expansion
add project.name/displayName to template attributes.