Windows shortcuts

 IT  Kommentare deaktiviert für Windows shortcuts
Dez 142011
 

Remote-Desktop: mstsc

System properties: sysdmlcpl

Command Prompt: cmd

Task Manager: taskmgr

Windows Services: services.msc

Calculator: calc

Notepad: notepad

Management Console: mmc

versioned jar with ant

 IT, Java  Kommentare deaktiviert für versioned jar with ant
Dez 062011
 

Versioned jars (like MyCode-1.2.jar) can be easily generated with ant.

First you have to set the necessary Properties:

<property name="major-version-number" value="0" />
<property name="project-name" value="${ant.project.name}" />
<property name="src" value="src"/>
<property name="build" value="bin" />

Then you need a compile-task:

<target name="compile" description="compile the source" >
    <javac srcdir="${src}" destdir="${build}"/>
</target>

Then you need a method for generating jars:

<target name="jar-version">
  <buildnumber />
  <property name="version-number" value="${major-version-number}.${build.number}" />
  <jar basedir="bin" destfile="build-version/${project-name}-${version-number}.jar">
    <manifest>
     <attribute name="Built-By" value="${builder}" />
     <attribute name="Built-On" value="${build-info.current-date}" />
     <attribute name="Built-At" value="${build-info.current-time}" />
     <attribute name="Implementation-Version" value="${version-number}" />
    </manifest>
  </jar>
</target>

At last you need a method that compiles the files, generates the build-number and the jar-File:

<target name="build-jar-version">
    <antcall target="compile" />
    <mkdir dir="build-version" />
    <antcall target="jar-version" />
</target>