Skip to main content

How to build Faban with NetBeans

  3 posts   Feedicon  
Replies: 2 - Last Post: May 11, 2014 03:55
by: yaominchen
« Older Topic » Newer Topic
showing 1 - 3 of 3
Posted: December 09, 2011 00:09 by zhenyun zhuang
Below are the steps I took to build Faban using NetBeans.
Though I am using NetBeans 7.0.1 on Solaris 11, most of the instructions hold on other systems.

--- Download the faban development source
Follow the instructions to use git to checkout the source; For instance, the following commands are what I used:
//generate public/private keys under your .ssh directory.
//upload your public key to faban.java.net (your profile dashboard - SSH Keys).
//You can verify its working by ssh (username)@git.java.net, where (username is your user name on java.net). You should receive something like: Hi, username! You have successfully authenticated, ....

//prepare git command
mkdir gitFaban
cd gitFaban/
git init
git remote add origin ssh://(username)@git.java.net/faban~source
git clone ssh://(username)@git.java.net/faban~source

--- Downlaod NetBeans
I am using Solaris 11 on Sparc machines, so I download netbeans EE version sparc solaris from NetBeans homepage and install it.
Then ~NetBeans/bin/netbeans to start;

--- General instructions
The projects need to be built in the following order: common, driver/harness, stage.
For all the projects, use "File" ->"new project", then "Java Project with Existing Sources".

Note that NetBeans may complain that there is existing build.xml/nbbuild.xml.
You can certainly remove them and build from scratch, but you lose the benefits of using the existing build.xml/nbbuild.xml.
There is a trick to keep the xml files. Firstly cp build.xml/nbbuild.xml a.xml; after passing the NetBeans stage of specifying project directory, then you click "next";
Before you act on the next step, rename a.xml to nbbuild.xml/build.xml. It will keep all settings.

Each of the projects requires some library and jar files in order to compile the project.
In the following I will focus on what are these libraries and where to find them.
To add libraries/jar files, go to NetBeans Projects view, then right click the project's Libraries item.

---- The "common" project
It only requires jdk 1.6, which is by default there. Build it and it will generate fabancommon.jar.

--- The "driver" project
It requires the fabancommon.jar, java EE API library, tools.jar (under your jdk/lib/), the three jar files from driver/lib directory.

--- The "harness" project
It requires fabancommon.jar, Java EE API library; ant.jar (~netbeans/java/ant/lib); all the jar files under harness/lib directory.

---- The "stage" project
It does not require any library, and there is no source. You can just build-all.

When building stage object, the output directory is specified in build.properties.
By default, it is kit.dir =../../../www/nightly. Feel free to change it to your preferred location, say (www/nightly, which will create the output directory right under stage project)

The output of stage project are two zip files: faban-docs-(date).zip and faban-kit-(date).tar.gz, where (date) will be in the form of 123011, indicating Dec. 30, 2011.

--- deploying

The faban-kit-(date).tar.gz is used to setup faban environment. Copy it to the faban master and unzip it. Then run ~faban/master/bin/startup.sh to start the master; then after deploying your benchmarks, you are ready to run your benchmarks.

Note that all faban agent machines need to be updated whenever you deploy a new faban-kit-(date).tar.gz.
Posted: December 14, 2011 04:27 by yaominchen
---- The "common" project

Select faban~source/common as the original source. You may leave the original build.xml untouched. Netbeans will create a nbbuild.xml.

To build fabancommon.jar, go to Files on the Netbeans UI, expand the "common" project, expand "build.xml", and right click on fabancommon.jar to build the target JAR file.

--- The "driver" project

Select faban~source/driver as the original source. You may leave the original build.xml untouched. Netbeans will create a nbbuild.xml. Once the project is created, right click on the project and select Properties. Select "Libraries", select "Compile" and select "Add JAR/Folder". Add the fabancommon.jar built from the previous project.

To build fabandriver.jar, go to Files on the Netbeans UI, expand the "driver" project, expand "build.xml", and right click on fabandriver.jar to build the target JAR file.


--- The "harness" project

Select faban~source/harness as the original source. You may leave the original build.xml untouched. Netbeans will create a nbbuild.xml. Once the project is created, right click on the project and select Properties. Select "Libraries", select "Compile" and select "Add JAR/Folder". Add the fabancommon.jar built from the "common" project.

Go to Files on the Netbeans UI, expand the "harness" project, expand "build.xml", and right click on "All" to build all targets.

---- The "stage" project

Select faban~source/stage as the original source. You may leave the original build.xml untouched. Netbeans will create a nbbuild.xml. Go to Files on the Netbeans UI, expand the "stage" project, expand "build.xml", and right click on "All" to build all targets. It builds the following targets.

Building zip: /home/yourname/git-repository/faban~source/stage/javadocs.zip
Building zip: /home/yourname/www/nightly/faban-docs-mmddyy.zip
Building zip: /home/yourname/git-repository/faban~source/stage/src.zip
Building tar: /home/yourname/www/nightly/faban-kit-mmddyy.tar.gz

Note that the faban kit is under ~/www/nightly directory but you may modify the build.properties to change the directory.
Posted: May 11, 2014 03:55 by yaominchen
Update for netbeans 7.3.1

Simply right click the 'common' project and select build.

ant -f /home/ychen/Development/faban.java.net/faban~source/common/nbbuild.xml jar
init:
deps-jar:
Created dir: /home/ychen/Development/faban.java.net/faban~source/common/build
Updating property file: /home/ychen/Development/faban.java.net/faban~source/common/build/built-jar.properties
Created dir: /home/ychen/Development/faban.java.net/faban~source/common/build/classes
Created dir: /home/ychen/Development/faban.java.net/faban~source/common/build/empty
Created dir: /home/ychen/Development/faban.java.net/faban~source/common/build/generated-sources/ap-source-output
Compiling 17 source files to /home/ychen/Development/faban.java.net/faban~source/common/build/classes
Copying 1 file to /home/ychen/Development/faban.java.net/faban~source/common/build/classes
compile:
Created dir: /home/ychen/Development/faban.java.net/faban~source/common/dist
Copying 1 file to /home/ychen/Development/faban.java.net/faban~source/common/build
Nothing to copy.
Building jar: /home/ychen/Development/faban.java.net/faban~source/common/dist/FabanCommon.jar
To run this application from the command line without Ant, try:
java -jar "/home/ychen/Development/faban.java.net/faban~source/common/dist/FabanCommon.jar"
jar:
BUILD SUCCESSFUL (total time: 1 second)

Pretty straightforward. Similarly it applies to the 'driver' project except it is more tricky to resolve the dependent libraries. The following jar files are already in the driver/lib directory.
- ehcache-1.3.0.jar
- commons-httpclient-3.1.jar
- commons-math-1.1.jar
The three additional jar files needed are:
- tools.jar - can be found under your JDK installation
- FabanCommon.jar - can be located under common/dist directory
- javaee-api-6.0.jar - can be downloaded from http://mvnrepository.com/artifact/javax/javaee-api/6.0
Replies: 2 - Last Post: May 11, 2014 03:55
by: yaominchen
« Older Topic » Newer Topic
 
 
Close
loading
Please Confirm
Close