Tux Guitar

TuxGuitar Documentation » Building from sources

Building from sources

Requirements:

To build tuxguitar, you must have installed on your system:

Introduction:

TuxGuitar was separated into multiple projects (The main application, and a list of official plugins). This allow us to have a better compatibility with allmost JVMs, without depends if the JVM implements or not some libraries (e.g: if your JVM don’t implements Java Sound Api, so you can run tuxguitar without tuxguitar-jsa plugin ). Another advantage is that anyone can write plugins for tuxguitar even after a version was released.
The source package contains all project folders, but you don’t should try build all plugins for your Operating System. There are some plugins what have native libraries, so they aren’t multi-platform.

Configuring the Application

Exploring the TuxGuitar folder, you’ll found build.xml and build.properties files.

buid.xml

This is the ANT configuration file. It contains standart targets to build, package, and clean the sources. All of this targets will call to another target of a child file if “dist.file” property exists.

build.properties

This file contains some configuration properties:

ant.build.javac.source
Provide source compatibility with specified release

ant.build.javac.target
Generate class files for specific VM version

lib.swt.jni
Path of the SWT native libraries

lib.swt.jar
Full path of the swt.jar library

lib.itext.jar
Full path of the itext.jar library (Only if you will build/install tuxguitar-pdf plugin)

lib.janel-ant.jar
Full path of the janel-ant.jar library (Only for a native launcher under windows, not obligatory)

dist.version
Current version of tuxguitar

dist.file
tuxguitar’s release type. The file build.xml will call ${dist.file} for his own dist.
Supported types: linux,ubuntu,freebsd, mac and windows

dist.jar.path
Installation path for TuxGuitar.jar

dist.bin.path
Installation path for the tuxguitar launcher.

dist.share.path
Installation path for the share folder

dist.doc.path
Installation path for the doc folder

build.xml file, will take the configuration from build.properties and call ${dist.file} targets, if file exists, to create the distribution package.

Basic Application Configurations:

These configurations was default used to build the diferent tuxguitar releases. Be sure that the swt & itext libraries have the correct paths.

Linux build.properties:

ant.build.javac.source=1.4
ant.build.javac.target=1.4
lib.swt.jni=lib/
lib.swt.jar=lib/swt.jar
lib.itext.jar=lib/itext.jar
dist.file=xml/build-linux.xml
dist.version=1.0-rc4
dist.jar.path=./
dist.bin.path=./
dist.share.path=share/
dist.doc.path=doc/

Ubuntu build.properties:

ant.build.javac.source=1.4
ant.build.javac.target=1.4
lib.swt.jni=/usr/lib/jni/
lib.swt.jar=/usr/lib/java/swt.jar
lib.itext.jar=/usr/share/java/itext.jar
dist.file=xml/build-ubuntu.xml
dist.version=1.0-rc4-ubuntu-7.10-1
dist.prefix=/usr
dist.jar.path=${dist.prefix}/share/java/
dist.bin.path=${dist.prefix}/bin/
dist.share.path=${dist.prefix}/share/tuxguitar-${dist.version}/
dist.doc.path=${dist.prefix}/share/doc/tuxguitar-${dist.version}/

MacOS build.properties:

ant.build.javac.source=1.4
ant.build.javac.target=1.4
lib.swt.jni=lib/
lib.swt.jar=lib/swt.jar
lib.itext.jar=lib/itext.jar
dist.file=xml/build-mac.xml
dist.version=1.0-rc4
dist.jar.path=./
dist.bin.path=./
dist.share.path=./share/
dist.doc.path=./doc/

Windows build.properties:

ant.build.javac.source=1.4
ant.build.javac.target=1.4
lib.swt.jni=lib\\
lib.swt.jar=lib\\swt.jar
lib.itext.jar=lib\\itext.jar
lib.janel-ant.jar=lib\\janel-ant-0.1.jar
dist.file=xml/build-windows.xml
dist.version=1.0-rc4
dist.jar.path=
dist.bin.path=
dist.share.path=share\\
dist.doc.path=doc\\

Building the Application:

Once you have configured build.properties, you must execute ant command on a terminal

~$ cd tuxguitar-src-1.0-rc4/TuxGuitar
~$ ant

Configuring Plugins

All tuxguitar plugins are compiled in a similar way. As the main application, they have build.xml and build.properties too.
You just need edit build.properties of the plugins you want to build.

ant.build.javac.source
Provide source compatibility with specified release (Is suggested add same value as used for build tuxguitar)

ant.build.javac.target
Generate class files for specific VM version (Is suggested add same value as used for build tuxguitar)

path.tuxguitar
Full path to tuxguitar.jar or tuxguitar classes folder

path.swt
Full path to swt.jar or swt classes folder
(Required by plugins what use GUI libraries)

path.itext
Full path to itext.jar or itext classes folder
(Required by PDF plugin only)

Building Plugins:

As the main application, you just need execute ant command on a terminal
We can take TuxGuitar-compat plugin as example:

~$ cd tuxguitar-src-1.0-rc4/TuxGuitar-compat
~$ ant

Building Application & Plugins:

Ofcourse you may want to build the main application and some plugins together.
To do that, the best option is by running ANT target by target.
NOTE: You can run ANT from the source root folder by adding the -f argument pointing to the build.xml file.

1: The first what you need, is build tuxguitar classes ( required by plugins ) but without package it ...

~$ ant -f TuxGuitar/build.xml build

2: Now you can build any plugin (assuming build.properties plugin file is pointing to TuxGuitar/build/ folder) and copy it to the TuxGuitar plugins folder
We can take TuxGuitar-compat plugin as example:

~$ ant -f TuxGuitar-compat/build.xml
~$ cp TuxGuitar-compat/tuxguitar-compat.jar TuxGuitar/share/plugins/

3: Once you finish building all wanted plugins, you can package tuxguitar.

~$ ant -f TuxGuitar/build.xml package


doc/build.txt · Last modified: 2008/05/05 17:57 by admin

Show pagesource
Login