#
# Copyright (c) 2009-2010, Oracle and/or its affiliates. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
#   this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
#   this list of conditions and the following disclaimer in the documentation
#   and/or other materials provided with the distribution.
#
# * Neither the name of Oracle nor the names of its contributors
#   may be used to endorse or promote products derived from this software without
#   specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#

Follow these steps to create a sample project from a set of existing sources:

1) Copy the source files to a disk folder of your choice. In this example we use /tmp/Quote.
   Don't copy makefiles or other build scripts.
2) Use the IDE to create a C/C++ project in the work folder (/tmp/Quote). Add C/C++ source files to Source Files, 
   header files to Header Files, and other files to Resource files. 
3) If there is a readme file, add it to Important Files for easy viewing. Make sure it has a .txt suffix.
4) Make sure the project builds (without warnings!) and runs on *all* supported platforms using both Sun 
   Compiler Set (Solaris) and GNU Compiler Set (Windows/Linux).
5) Make sure all text files have proper copyright notices.
6) Remove 'build' and 'dist' folders from work folder (/tmp/Quote).
7) Remove all hidden files like .make.state files from work folder (/tmp/Quote).
8) Remove all generated makefiles (Makefile-*) in nbproject folder in work folder (/tmp/Quote).
9) Edit .../nbproject/configurations.xml and remove all <toolsSet>...</toolsSet> blocks. This is to ensure
   the project is platform/compiler neutral.
10) Remove all files in .../nbproject/private.
11) Pick a name for the project that is not already taken. In this example we pick 'quote'.
12) Create a folder in .../cnd/makeproject/src/org/netbeans/modules/cnd/makeproject/samples
   with the name of the project (quote).
13) Copy all source files and project metadata files from work folder (/tmp/Quote) to samples folder (.../samples/quote).
14) Edit makeproject's layer file and add an entry similar to this:
<file name="quote.zip" url="samples/quote.zip">
  <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.cnd.makeproject.ui.wizards.Bundle"/>
  <attr name="template" boolvalue="true"/>
  <attr name="instantiatingWizardURL" urlvalue="nbresloc:/org/netbeans/modules/cnd/makeproject/ui/resources/samples/quote.html"/>
  <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/cnd/makeproject/ui/resources/makeProject.gif"/>
  <attr name="instantiatingIterator" newvalue="org.netbeans.modules.cnd.makeproject.ui.wizards.MakeSampleProjectIterator"/>
</file>
15) Edit org.netbeans.modules.cnd.makeproject.ui.wizards.Bundle.properties and add an entry similar to this:
Templates/Project/Samples/Native/Applications/quote.zip=Quote
This is the default project name for the samle project.
16) Create a file with the name 'quote.html' in org.netbeans.modules.cnd.makeproject.ui.resources.samples with a description (html)
   of what the sample does
17) Edit the makefile project build script (makeproject/build.xml) and add an entry similar to this:
<zip zipfile="${sample-dist}/quote.zip" >
  <fileset dir="${sample-src}/quote">
   <patternset refid="sample-src-pattern-set"/>
  </fileset>
</zip>
