Wednesday, April 30, 2014

Wednesday, April 16, 2014

Writing git log output to a file

Example:
$ git log --since="04/07/2014 20:37:53" --no-merges  > C:\test.log

It will write generated git log from the specified date and time without including merges to a test.log file.

Monday, April 7, 2014

Creating an executable JAR file for SWT Plug-in - Runnable JAR

You would have developed a small utility application, and now you wanted to create an executable JAR for that application.
Basically, end user should be able to launch the application by just double clicking on that.

Eclipse provides an option called “Runnable JAR” in the export menu items to perform this.






This will generate Plugin_Refactor_x86_1.0.jar file, including with all the required swt jars. 

Since swt native jars will be platform specific, we need to generate 32 bit or 64 bit files separately.

How to check Installed Java is a 32 bit or 64 bit version ?


If you have installed JDK, Java would have registered in the system environment variables.

Go to command prompt and type “java –version”

C:\Users\kh1205>java -version
 java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) 64-Bit Server VM (build 20.5-b03, mixed mode)

If it’s a 64 bit Java, you will be finding “64-Bit Server VM” in the above line.

If it’s a 32 bit java, you will be finding “Client VM” in the above line.

I have another JDK configured in my system, for which I wanted to check java version.
For example, other version of java is available in the location “C:\Program Files (x86)\Java\jdk1.6.0_31

C:\Program Files (x86)\Java\jdk1.6.0_31\bin>java -version
 java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)


“Client VM” in the last line tell you that,  JDK is a 32 bit version.

Friday, March 28, 2014

Microsoft visio for UML

Microsoft visio supports UML diagrams.

  • Class diagram
  • Sequence diagram
  • Use Case diagram
  • Activity diagram
  • State diagram

Download trial version @ http://office.microsoft.com/en-in/visio/

You can download UML2.5 stencils @ http://www.softwarestencils.com/uml/index.html

Friday, March 14, 2014

Eclipse plugins debug tracing facility

Debugging eclipse dropins

If you are attempting to use dropins, but your bundles are not being found, first ensure org.eclipse.equinox.ds and org.eclipse.equinox.p2.reconciler.dropins are marked to auto-start.

You can check these in bundles.info file in eclipse "eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info"

Search for an entries of org.eclipse.equinox.ds and org.eclipse.equinox.p2.reconciler.dropins

Example:
org.eclipse.equinox.ds,1.4.1.v20120926-201320,plugins/org.eclipse.equinox.ds_1.4.1.v20120926-201320.jar,2,true

org.eclipse.equinox.p2.reconciler.dropins,1.1.200.v20120301-2145,plugins/org.eclipse.equinox.p2.reconciler.dropins_1.1.200.v20120301-2145.jar,4,true

Mark both of them to true, if it's not set already.

Resolution errors with dropins are silently ignored. To enable useful logging messages, place the following tracing options in your .options file:

org.eclipse.equinox.p2.core/debug=true
org.eclipse.equinox.p2.core/reconciler=true

We can create this file in eclipse root directory with name .options and add above 2 lines in it.
eclipse/.options

And now run your eclipse in -debug -console mode.


Resources:
https://wiki.eclipse.org/Equinox/p2/Getting_Started