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.
CreateFromTemplateAttributesProvider is not implemented in freeform projects. Therefore it is impossible to, e.g., specify that files added to nbbuild should use CDDL by default.
Jesse, where should be the license stored in the case of freeform project?
Probably not a P3. Would need to be stored in project.xml somewhere. I think it would be OK to add a new field to http://www.netbeans.org/ns/freeform-project/2 since it has not been in an official release yet.
Do you have any suggestion about where to put it? Something like: <project-license></project-license> under the <general-data> element?
Sure, that would work I think. Can use nbbuild/nbproject/project.xml as a test case, BTW.
Created attachment 50089 [details] patch file
I've attached diff for the freeform schema, I think that the patch should be applied now before Beta2 and the actual implementation could be done after Beta2. Please review, thanks.
I don't think it's wise to commit a schema change with no corresponding impl. How can you be sure it works?
Created attachment 50505 [details] patch file
I've attached diff with complete implementation. I will provide tests. I'd like to commit the change on Friday 10/12. Please review. Thanks.
Looks OK.
Fixed. <project-license> element under <general-data> can be used to define license for freeform project, when creating new files from template. RCS file: /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/src/org/foo/NewClass.java,v done Checking in test/unit/data/example-projects/simplewithlicense/src/org/foo/NewClass.java; /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/src/org/foo/NewClass.java,v <-- NewClass.java initial revision: 1.1 done RCS file: /cvs/ant/freeform/test/unit/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProviderTest.java,v done Checking in test/unit/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProviderTest.java; /cvs/ant/freeform/test/unit/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProviderTest.java,v <-- FreeformTemplateAttributesProviderTest.java initial revision: 1.1 done RCS file: /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/nbproject/project.xml,v done Checking in test/unit/data/example-projects/simplewithlicense/nbproject/project.xml; /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/nbproject/project.xml,v <-- project.xml initial revision: 1.1 done Checking in nbproject/project.xml; /cvs/ant/freeform/nbproject/project.xml,v <-- project.xml new revision: 1.31; previous revision: 1.30 done RCS file: /cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProvider.java,v done Checking in src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProvider.java; /cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformTemplateAttributesProvider.java,v <-- FreeformTemplateAttributesProvider.java initial revision: 1.1 done Checking in src/org/netbeans/modules/ant/freeform/FreeformProject.java; /cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/FreeformProject.java,v <-- FreeformProject.java new revision: 1.52; previous revision: 1.51 done RCS file: /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/build.xml,v done Checking in test/unit/data/example-projects/simplewithlicense/build.xml; /cvs/ant/freeform/test/unit/data/example-projects/simplewithlicense/build.xml,v <-- build.xml initial revision: 1.1 done Checking in src/org/netbeans/modules/ant/freeform/resources/freeform-project-general-2.xsd; /cvs/ant/freeform/src/org/netbeans/modules/ant/freeform/resources/freeform-project-general-2.xsd,v <-- freeform-project-general-2.xsd new revision: 1.6; previous revision: 1.5 done
Seems to work: Checking in project.xml; /shared/data/ccvs/repository/nbbuild/nbproject/project.xml,v <-- project.xml new revision: 1.93; previous revision: 1.92 done
The same behavior is seen when creating a standard java project with existing source. There is no corresponding <project-license> element in the xmlns="http://www.netbeans.org/ns/project/1" schema.
Well, there is no need for changes in project.xml for j2seproject. It already works, but it's kind of awkward to set up. You need to open Template manager via Tools -> Templates and select node Licenses. Then you add your license file, which needs to be named as 'license-LicenseID.txt'. Then you open nbproject/project.properties of your project and add new property 'project.license' with value 'LicenseID'. After that your newly created files that are supposed to contain license will contain the new license.