[RSS]

Checking out from CVS and doing headless builds

Doc Contributor: Varun Nischal


Most of might have already got an idea of what exactly is NetBeans IDE all about, its time to take the next big step- work with NetBeans sources. You might have even encountered some bugs, might have filed them on IssueZilla as well.
Also, you might have tried out the sample Plug-in's as well as other Rich-Client App's etc.

Now, its time to get your hands-on their source code.

Three questions arise
1. Why Its Requried?
2. How can we get hands-on it?
3. From where to get the Source code?

This document is going to provide you ways on how to use CVS effectively. This is my personal experience which I'm sharing with you people. I hope everyone would be able to benefit from this doc.

However, I shall give you a brief introduction on CVS. Then, I would proceed with the more important things to be covered here.

Read Legal Notice as well, its important to know what rights you would be exercising when downloading and using NetBeans source-code.

Introduction


Concurrent Versioning System, abbreviated as CVS, is an open-source version control system that keeps track of all work and all changes in a set of files, typically the implementation of a software project , and allows several (potentially widely-separated) developers to collaborate .
  • In our case, the software project is NetBeans IDE, collaboration is done by NetBeans community members
  • It was invented and developed by Dick Grune in the 1980s. CVS has become popular in the open source software world and is released under the "GNU General Public License".

One can either checkout the sources from the command line, or even using the CVS support built into the IDE itself! Before you start you should know how the sources are organized, both in terms of directory structure , and also branches (most important for login access).

Why Its Requried?

If you are a good programmer and a regular user of such IDE's.
  • As I said before, you might have encountered some bugs and would have thought, that if given a chance, you will correct it on your own and re-build it, as any regular Unix-compliant OS user does!

Then don't waste the opportunity, just grab it.

How can we get hands-on CVS?

There are few methods, to get the CVS client. It was the first time, I used it and learned about it.
  • For command line Versioning;
    • Linux Machines — Most Linux machines have the command-line CVS client installed by default. If you should not have a CVS client, first download and install one of the available clients.
    • Using CVS on Windows — If you use Windows and you don't have a CVS client yet, the community recommends you to download and install this CVS client. Choose cvs-1-11-17.zip or better.
    • Refer To http://www.netbeans.org/community/sources/cvs.html, for precise information.


  • Using NetBeans in-built CVS Versioning Tool;
    • Just click on the Versioning menu, goto CVS > Checkout...
    • That's it, you don't have to do any personal checks.

From where to get the Source code?

  • Browse them online , click on any one of the modules present there and then you would get options, how to checkout them using command-line CVS.

Legal Notice


By downloading builds, source code, or accessing the CVS repository, you acknowledge that you have read, understood, and agree to be bound by the terms and conditions of the applicable licenses:

All the souce code made available on "NB.org" is provided to you under the terms and conditions of "Common Development and Distribution License ( CDDL) v1.0 and the GNU General Public License (GPL) v2".

The software developed at "NB.org" may make use of third-party software components which are distributed under different licenses than the CDDL. Examples of such components may include Apache Ant, Apache Tomcat, JUnit, JavaHelp runtime, Java Compiler - a wrapper around the JDK java compiler.

All those components are either open source software or redistributable binary libraries. They are included in the builds, source code downloads and the CVS repository. Their licenses can be found in the

  • For the IDE installation the license is in the top-level directory
  • For the feature pack the license is in the top-level directory of the feature pack
  • For a module source directory the license texts are in a subdirectory named "external"

It is your obligation to read and accept all such terms and conditions prior to the use of the builds and source code made available on the "NB.org" website or in the "NB.org" CVS repository.

CheckOut - Getting the Sources


Definition

  • A single project (set of related files) managed by CVS is called a ''module''. A CVS server stores the modules it manages in its ''repository''.
  • Acquiring a copy of a module is called checking out . The checked out files serve as a working copy, sandbox or workspace.
Steps To Follow
The following image refers to the recently discussed post on NetBeans Google Group.
For more information, go directly to the section "Role of nbbuild/build.xml" on this page.

Running checkout Target from NB 6.0

Also, Refer to Faqs On Using CVS for NetBeans IDE.

Setting up "nbbuild" folder

First of all, make a folder named nb_all or NetBeans_proj (refer image) or any name you feel like, anywhere in your computer.
Method 1
1. First of all, download the nbbuild.zip from the enclosed attachments on this page.
2. Now, extract the zip folder using Winzip or Winrar, into the above made folder.

Method 2
1. Open NetBeans IDE, click on Versioning Menu, select CVS ---> Checkout...
2. Enter values as shown in the image, anoncvs stands for anonymous user, leave the Password field empty.
3. If you have your NetBeans account, then enter your username in place of anoncvs and password in the empty field.

One can choose any directory, C:\nb_all not mandatory.
But, select module as nbbuild only.
4. Now, create a file user.build.properties inside nbbuild folder, and add following content in it.
nb.clusters.list=nb.cluster.nb ,nb.cluster.platform,nb.cluster.ide,nb.
cluster.harness,nb.cluster.java,nb.cluster.apisupport,nb.cluster.xml,nb.
cluster.j2ee,nb.cluster.profiler
#,nb.cluster.xml,nb.cluster.soa
build.compiler=extJavac
javac.compilerargs=-J-Xmx512m
permit.jdk6.builds=true
sigtest.skip.check=true
5. Verify whether values of nb.clusters.list are in sync with the one present in cluster.properties file in nbbuild folder.
6. If this method doesn't work out, then follow Method 1.

Role Of nbbuild/build.xml

Steps to open "nbbuild" project
1. Open NetBeans 6.0, open Project, browse and locate nbbuild folder.
2. Open the project node in Project Tab on Left Tabbed Pane in NetBeans, double-click build.xml


Steps to Checkout
1. Press Ctrl-F and Search for target name="checkout".
2. Now right-click the XML tag and select "Checkout" option, the checkout process begins. As you can see there's an option "Check new XML" its because, during the checkout process, nbbuild/build.xml got updated, and "Checkout" option got removed from it.

3. Minimize the NetBeans IDE and relax, come back after few hours, to play with your working copy of NetBeans source-code. Then, build it and modify as per your needs.
assure-ant:
bootstrap:

Bootstrapping NetBeans-specific Ant extensions...

init-module-list:
print-cvs-modules:

selectedmodules=[ide/branding, ide/branding/kit, ide/launcher/upgrade, 
ide/updatecenters, ide/welcome, logger/uihandler, logger/uihandlerlib, 
logger/uihandlerreporter, autoupdate/services, autoupdate/ui, core, 
assure-ant:
bootstrap:

Bootstrapping NetBeans-specific Ant extensions...

init-module-list:
print-cvs-modules:

selectedmodules=[ide/branding, ide/branding/kit, ide/launcher/upgrade, ide/updatecenters, 
ide/welcome, logger/uihandler, logger/uihandlerlib, logger/uihandlerreporter, 
autoupdate/services, autoupdate/ui, core, core/applemenu, core/bootstrap, core/execution, 
core/favorites, core/javahelp, core/kit, core/multiview, core/options, core/options/keymap, 
core/output2, core/progress, core/progressui, core/sendopts, core/settings, core/startup, 
core/swing/plaf, core/swing/tabcontrol, core/ui, core/windows, editor/mimelookup, 
editor/mimelookup/impl, graph/lib, libs/jsr223, libs/swing-layout, openide/actions, 
openide/awt, openide/compat, openide/dialogs, openide/execution, openide/explorer, 
openide/fs, openide/io, openide/loaders, openide/masterfs, openide/modules, 
openide/nodes, openide/options, openide/templates, openide/text, openide/util, 
openide/util/enum, openide/windows, projects/queries, ant/project, apisupport/timers, 
classfile, core/ide, core/navigator, core/palette, core/swing/dirchooser, core/tasklist/api, 
core/tasklist/kit, core/tasklist/todo, core/tasklist/ui, db, db/core, db/dbapi, db/drivers, 
db/kit, db/sqleditor, db/visualsqleditor, debuggercore, debuggercore/api, 
debuggercore/viewmodel, diff, editor, editor/bookmarks, editor/bracesmatching, 
editor/codetemplates, editor/completion, editor/errorstripe, editor/errorstripe/api, 
editor/fold, editor/guards, editor/hints, editor/hints/highlights, editor/indent, editor/kit, 
editor/lib, editor/lib2, editor/options, editor/plain, editor/plain/lib, editor/settings, 
editor/settings/storage, editor/util, extbrowser, html, html/editor, html/editor/lib, 
html/lexer, httpserver, httpserver/servletapi, ide/defaults, ide/kit, image, 
javacvs/cvsmodule, javacvs/libmodule, languages/css, languages/diff, languages/engine, 
languages/manifest, lexer, lexer/editorbridge, lexer/nbbridge, libs/commons_logging, 
libs/freemarker, libs/jsch, libs/lucene, libs/resolver, libs/xerces, openidex, 
performance/insanelibmodule, projects/libraries, projects/projectapi, projects/projectui, 
projects/projectuiapi, projects/tasklist, properties, properties/syntax, refactoring/api, 
schema2beans/rt, scripting/bat, scripting/javascript, scripting/sh, subversion/client, 
subversion/ini4j, subversion/main, usersguide, utilities, utilities/jumpto, utilities/gototest, 
utilities/project, versioncontrol, versioncontrol/localhistory, versioncontrol/util, web/css, 
web/libs/flyingsaucer, xml/api, xml/axi, xml/catalog, xml/core, xml/lexer, xml/multiview, 
xml/retriever, xml/schema/api, xml/schema/completion, xml/tageditorsupport, xml/tax, 
xml/text-edit, xml/tools, xml/wsdl/api, xml/xam, xml/xdm, xml/xsl, apisupport/harness, ant, 
ant/browsetask, ant/debugger, ant/freeform, ant/grammar, ant/kit, beans, db/derby, 
db/model, debuggerjpda, debuggerjpda/ant, debuggerjpda/api, debuggerjpda/projects, 
debuggerjpda/ui, form, form/j2ee, form/kit, form/swingapp, i18n, i18n/form, 
j2ee/core/utilities, j2ee/metadata, j2ee/metadata/support, j2ee/persistence, 
j2ee/persistence/kit, j2ee/persistence/refactoring, j2ee/persistence/verification, 
j2ee/persistenceapi, j2ee/toplinklib, java/api, java/editor, java/editor/lib, java/freeform, 
java/guards, java/helpset, java/hints, java/j2seplatform, java/j2seproject, java/kit, 
java/lexer, java/navigation, java/platform, java/project, java/source, java/source/debug, 
java/source/javacapi, java/source/javacimpl, java/source/preprocessorbridge, java/sourceui, 
javadoc, javawebstart, javawebstart/signtask, junit, refactoring/java, 
usersguide/j2seexamples, websvc/jaxws21/jaxws21api, websvc/jaxws21, websvc/serviceapi, 
apisupport/ant, apisupport/kit, apisupport/project, apisupport/refactoring, 
apisupport/samples/PaintApp-sample-ui, apisupport/samples/feedreader-sample-ui, 
xml/catalogsupport, xml/jxpath, xml/kit, xml/nbprefuse, xml/prefuse, xml/refactoring, 
xml/schema, xml/schema/abe, xml/schema/refactoring, xml/schema/schemaui, xml/search, 
xml/validation, xml/wsdl/kit, xml/wsdl/refactoring, xml/wsdlbindingsupport, 
xml/wsdlbindingsupport/api, xml/wsdlext, xml/wsdlextui, xml/wsdlui, xml/xamui, xml/xpath, 
j2ee/archiveproject, j2ee/clientproject, j2ee/ddapi, j2ee/ddloaders, j2ee/debug, 
j2ee/earproject, j2ee/ejbapi, j2ee/ejbcore, j2ee/ejbjarproject, j2ee/ejbrefactoring, 
j2ee/ejbverification, j2ee/genericserver, j2ee/kit, j2ee/platform, j2ee/samples, 
j2ee/utilities, j2eeserver, j2eeserver/ant, j2eeserver/j2eeapis, monitor, serverplugins/jboss4, 
serverplugins/sun/appsrv, serverplugins/sun/appsrv81, serverplugins/sun/sunddapi, 
serverplugins/sun/sunddui, serverplugins/weblogic9, tomcatint/tomcat5, web/core, 
web/el/lexer, web/examples, web/freeform, web/jsf, web/jsf/kit, web/jsf/navigation, 
web/jspdebug, web/jspparser, web/jspsyntax, web/jspsyntax/lexer, web/kit, 
web/libs/commons_fileupload, web/libs/glassfish_logging, web/libs/jsf-1_2, web/libs/jsf-1_2-
ri, web/libs/jstl11, web/libs/servletjspapi, web/project, web/refactoring, web/struts, 
web/webapi, websvc/clientapi, websvc/core, websvc/customization, websvc/design, 
websvc/editorhints, websvc/jaxwsapi, websvc/jaxwsmodel, websvc/kit, websvc/manager, 
websvc/components/strikeiron, websvc/utilities, websvc/websvcapi, websvc/websvcddapi, 
websvc/wsitconf, websvc/wsitmodelext, websvc/examples, debuggerjpda/profiler/heapwalk, 
profiler/libs/common, profiler/libs/jfluid, profiler/libs/jfluid-ui, profiler/modules/freeform, 
profiler/modules/j2ee, profiler/modules/j2ee-jboss, profiler/modules/j2ee-sunas, 
profiler/modules/j2ee-tomcat, profiler/modules/j2ee-weblogic, profiler/modules/j2se, 
profiler/modules/main, profiler/modules/nbmodule]

cvsmodules=[ant, apisupport, autoupdate, beans, classfile, core, db, debuggercore, 
debuggerjpda, diff, editor, extbrowser, form, graph, html, httpserver, i18n, ide, image, j2ee, 
j2eeserver, java, javacvs, javadoc, javawebstart, junit, languages, lexer, libs, logger, monitor, 
nbbuild, openide, openidex, performance, profiler, projects, properties, refactoring, 
schema2beans, scripting, serverplugins, subversion, tomcatint, usersguide, utilities, 
versioncontrol, web, websvc, xml]

checkout:
D:\N_vArUn\JIIT_Projects\Proj_On_OSS\NetBeans_proj\nbbuild\CVS\Tag doesn't exist
D:\N_vArUn\JIIT_Projects\Proj_On_OSS\NetBeans_proj\nbbuild\CVS\Tag doesn't exist

Processing module: ant
U ant/.cvsignore
U ant/apichanges.xml
U ant/arch.xml
U ant/build.xml
more files…

Processed  module: ant (417s)
Processing module: apisupport
U apisupport/ant/.cvsignore
U apisupport/ant/arch.xml
U apisupport/ant/build.xml
more files…

Processed  module: autoupdate (177s) Processing module: beans
U beans/.cvsignore
U beans/build.xml more files…

Processed  module: beans (29s)
Processing module: classfile
U classfile/.cvsignore
U classfile/apichanges.xml
U classfile/arch.xml
U classfile/build.xml more files…

Processed  module: classfile (19s)
Processing module: core
U core/.cvsignore
U core/arch.xml
U core/build.xml
more files…

Processed  module: core (743s)
Processing module: db
U db/.cvsignore
U db/apichanges.xml
U db/arch.xml
U db/build.xml more files…

Processed  module: db (1859s)
Processing module: debuggercore
U debuggercore/.cvsignore
U debuggercore/arch.xml
U debuggercore/build.xml more files…

Processed  module: debuggercore (527s)
Processing module: debuggerjpda
U debuggerjpda/.cvsignore
U debuggerjpda/arch.xml
U debuggerjpda/build.xml more files…

Processed  module: debuggerjpda (116s)
Processing module: diff
U diff/.cvsignore
U diff/apichanges.xml
U diff/arch.xml
U diff/build.xml more files…

Processed  module: diff (56s)
Processing module: editor
U editor/.cvsignore
U editor/apichanges.xml
U editor/arch.xml
U editor/build.xml more files…

Processed  module: editor (445s)
Processing module: extbrowser
U extbrowser/.cvsignore
U extbrowser/arch.xml
U extbrowser/build.xml more files…

Processed  module: extbrowser (21s)
Processing module: form
U form/.cvsignore
U form/arch.xml
U form/build.xml
more files…

Processed  module: form (304s)
Processing module: graph
U graph/examples/.cvsignore
U graph/examples/build.xml more files…

Processed  module: graph (228s)
Processing module: html
U html/.cvsignore
U html/arch.xml
U html/build.xml
more files…

Processed  module: html (132s)
Processing module: httpserver
U httpserver/.cvsignore
U httpserver/build.xml more files…


Processed  module: httpserver (568s)
Processing module: i18n
U i18n/.cvsignore
U i18n/arch.xml
U i18n/build.xml more files…

Processed  module: i18n (70s)
Processing module: ide
U ide/.cvsignore
U ide/bluejl10n.list
U ide/build.xml more files…

Processed  module: ide (419s)
Processing module: image
U image/.cvsignore
U image/build.xml more files…

Processed  module: image (14s)
Processing module: j2ee
U j2ee/.cvsignore
U j2ee/build.xml more files…

Processed  module: j2ee (2643s)
Processing module: j2eeserver
U j2eeserver/.cvsignore
U j2eeserver/apichanges.xml
U j2eeserver/arch.xml
U j2eeserver/build.xml more files…

Processed  module: j2eeserver (61s)
Processing module: java
U java/.cvsignore
U java/api/.cvsignore
U java/api/apichanges.xml
U java/api/arch.xml
U java/api/build.xml more files…

Processed  module: java (680s)
Processing module: javacvs
U javacvs/.cvsignore
U javacvs/build.xml more files…

Processed  module: javacvs (156s)
Processing module: javadoc
U javadoc/.cvsignore
U javadoc/build.xml more files…

Processed  module: javadoc (46s)
Processing module: javawebstart
U javawebstart/.cvsignore
U javawebstart/build.xml more files…

Processed  module: javawebstart (22s)
Processing module: junit
U junit/.cvsignore
U junit/apichanges.xml
U junit/arch.xml
U junit/build.xml more files…

Processed  module: junit (104s)
Processing module: languages
U languages/beta/.cvsignore
U languages/beta/build.xml more files…

Processed  module: languages (76s)
Processing module: lexer
U lexer/.cvsignore
U lexer/apichanges.xml
U lexer/arch.xml
U lexer/build.xml more files…

Processed  module: lexer (74s)
Processing module: libs
U libs/commons_lang/.cvsignore
U libs/commons_lang/build.xml more files…

Processed  module: libs (400s)
Processing module: logger
U logger/.cvsignore more files…

Processed  module: logger (367s)
Processing module: monitor
U monitor/.cvsignore
U monitor/build.xml more files…

Processed  module: monitor (836s)
Processing module: nbbuild
U nbbuild/build.properties
U nbbuild/cluster.properties
more files…

Processed  module: nbbuild (53s)
Processing module: openide
U openide/.cvsignore
U openide/build.xml 
more files…

Processed  module: openide (658s)
Processing module: openidex
U openidex/.cvsignore
U openidex/apichanges.xml
U openidex/arch.xml
U openidex/build.xml 
more files…

Processed  module: openidex (34s)
Processing module: performance
U performance/.cvsignore
U performance/build.xml 
more files…

Processed  module: performance (279s)
Processing module: profiler
U profiler/l10n.list
U profiler/libs/common/.cvsignore
U profiler/libs/common/build.xml 
more files…

Processed  module: profiler (408s)
Processing module: projects
U projects/libraries/.cvsignore
U projects/libraries/apichanges.xml
U projects/libraries/arch.xml
U projects/libraries/build.xml 
more files...

Processed  module: projects (219s)
Processing module: properties
U properties/.cvsignore
U properties/arch.xml
U properties/build.xml 
more files...

Processed  module: properties (41s)
Processing module: refactoring
U refactoring/.cvsignore
U refactoring/api/.cvsignore
U refactoring/api/apichanges.xml
U refactoring/api/arch.xml
U refactoring/api/build.xml 
more files...

Processed  module: refactoring (120s)
Processing module: schema2beans
U schema2beans/.cvsignore
U schema2beans/build.xml 
more files...

Processed  module: schema2beans (53s)
Processing module: scripting
U scripting/.cvsignore
U scripting/bat/.cvsignore
U scripting/bat/build.xml 
more files...

Processed  module: scripting (559s)
Processing module: serverplugins
U serverplugins/.cvsignore
U serverplugins/build.xml 
more files...

Processed  module: serverplugins (815s)
Processing module: subversion
U subversion/.cvsignore
U subversion/build.xml 
more files...

Processed  module: subversion (216s)
Processing module: tomcatint
U tomcatint/tomcat5/.cvsignore
U tomcatint/tomcat5/build.xml 
more files...

Processed  module: tomcatint (761s)
Processing module: usersguide
U usersguide/.cvsignore
U usersguide/build.xml
more files...

Processed  module: usersguide (422s)
Processing module: utilities
U utilities/.cvsignore
U utilities/arch.xml
U utilities/build.xml 
more files...

Processed  module: utilities (53s)
Processing module: versioncontrol
U versioncontrol/.cvsignore
U versioncontrol/apichanges.xml
U versioncontrol/arch.xml
U versioncontrol/build.xml 
more files...

Processed  module: versioncontrol (107s)
Processing module: web
U web/.cvsignore
U web/build.xml 
more files...

Processed  module: web (1250s)
Processing module: websvc
U websvc/arch/arch-websvc-websvcddapi.xml
U websvc/axis2/.cvsignore
U websvc/axis2/build.xml
more files...

  • Finally, the checkout process ends.
    • If suppose, net connectivity gets distruped in between...
    • Don't worry! Firstly, stop the process, by clicking on the red square button as shown above.
  • Then, re-run it by clicking on the green double-arrow button just above stop button.
    • What NB does, is that it checks through its list of modules, which are checked out or not.
    • Then, it simultaneously checks whether the checked-out modules are updated one's or not.
  • Finally, the CVS checkout the remaining modules and finish off the process.

Building NetBeans 6.0 Sources from Its IDE

After checking out the NB sources, its time to build it and modify it. This document will ensure you that, you build NB IDE yourself, efficiently and effectively.

Pre-requisites

  • You must have checkout the NetBeans sources using CVS, as stated above.
  • NetBeans IDE 6.0, if you don't have, you can get it from http://netbeans.org.
  • You must have made atleast a single project using this IDE.

How To Build Sources

Steps
1. After you have checkout the sources.
2. Open the project node of NetBeans Build System as shown below.
3. Right-click the project node and select Build IDE (no-zip) option.

Build Process begins...

Bootstrapping and retrieving data from the log file...

Arguments passed to the Ant build-scripts for the IDE...

Build Successful.

View Development Version

  • NetBeans loading up modules, checking dependencies, configuring the system, connecting to the JDK, JRE, etc.

  • Have a look at the NetBeans Startup Window, similar to the one seen when the NetBeans IDE starts.

References


Checkout using CVS

Netbeans.org
NetBeans Sources
Guided Tutorials
Using NB 5.0
Guided Tour For NB 6.0
NetBeans Wiki
Search Results
Placing a NetBeans projects into CVS

Build Process

  1. Checking Out NB Sources
  2. Getting Source Code Zip-File

Work Ahead


  • Building sources from "zip-file".


Any Queries?


Drop a mail at my NetBeans ID.

Attachments

build-complete.jpg Info on build-complete.jpg 398243 bytes
how-to-build.jpg Info on how-to-build.jpg 174827 bytes
nb-anoncvs-0.jpg Info on nb-anoncvs-0.jpg 167441 bytes
nb-anoncvs.jpg Info on nb-anoncvs.jpg 181333 bytes
nb-cvs-2.jpg Info on nb-cvs-2.jpg 313281 bytes
nb-cvs-7.jpg Info on nb-cvs-7.jpg 317009 bytes
nb-cvs-new.jpg Info on nb-cvs-new.jpg 334629 bytes
nb-cvs.jpg Info on nb-cvs.jpg 333617 bytes
nb-dev-run-0.jpg Info on nb-dev-run-0.jpg 102047 bytes
nb-dev-run-1.jpg Info on nb-dev-run-1.jpg 349628 bytes
nb-dev-run-2.jpg Info on nb-dev-run-2.jpg 424712 bytes
nb-dev-view-1.jpg Info on nb-dev-view-1.jpg 246792 bytes
nb-project.jpg Info on nb-project.jpg 64989 bytes
nb-start.jpg Info on nb-start.jpg 103359 bytes
nbbuild.zip Info on nbbuild.zip 3029032 bytes