Blogging after 2 weeks…I have been focusing on my college activities more, I should rather say that I was working on my final year project. So, I thought of sharing some key learnings with you!
Final Year Project
I am working on a project that’s based on NetBeans Platform. Initially, its intended to provide first-class support for NetBeans Wiki markup editing, syntax highlighting, auto completion, etc. This would help any user using NetBeans Wiki, to edit/create the pages and then, preview them locally (offline).
So, I asked Caoyuan Deng (NetBeans Dream Team Member), winner of NBIG Gold Award, experienced developer on integrating languages like Erlang, Scala into the IDE, on how to go about using GSF?
If you want to make use of Specification Version of GSF modules, he suggested to add my module as friend to the GSF modules. Making friends is an easy task (as per my experience). That’s possible in two ways-
Case #1- I commit my code to /main/contrib and request the GSF Module Owner to add my specific modules as friends. As I had already versioned my project with SVN at java.net! So, I went for the second way.
Case #2- I should clone the NetBeans sources, and then run my choice of NetBeans IDE. Then, open the necessary GSF modules (from the clone repos)- tweak them (so as to add my module as a friend).
Tips and Tricks
Actually, I made my module friend of all the three GSF modules- /gsf, /gsf.api and /gsfpath.api
So, you are required to open the /nbproject/project.xml file of one of the GSF modules and add a friend tag with text equivalent to the Code Name Base of your module.
<friend-packages> <!--Many modules added as friends are added here--> <friend>code.name.base.of.my.module</friend> </friend-packages>
So, open all these modules in your NetBeans IDE (6.0/6.1 onwards). Tweak those project.xml files by searching for a tag “<friend-packages>” there you would see many module’s code name base have been added as friends using tag “<friend>”, also specific packages can be added using tag “<package>”.
Build the sources…
Once you have followed the second approach, its time to build the sources. Firstly, open the project NetBeans Build System (/main-golden/nbbuild). To know more about how to build the sources, give it a read :) Here’s an excerpt from the entry-
I referred a document for information on Mercurial Access. So, I found out /main-golden would be fine for us. As its guaranteed that build would succeed..
Once you get the build successful, you must now run the IDE either from /main-golden/nbbuild/netbeans/bin/ OR extract the distributable zip you must have created by running the target “build”.
Its done, now you can open your project modules in the newly created build of NetBeans IDE. As and when you make use of the Gsf API’s, build would definitely succeed.