Ant build for simple JFace project [message #246158] |
Thu, 27 May 2004 07:47  |
Eclipse User |
|
|
|
Originally posted by: john.rmts.donpac.ru
Hi,
How can I write build.xml for simple JFace project?
Source:
package jtest.ui;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Display;
public class JTestApp extends ApplicationWindow {
public JTestApp() {
super(null);
}
public static void main(String[] args) {
JTestApp w = new JTestApp();
w.setBlockOnOpen(true);
w.open();
Display.getCurrent().dispose();
}
}
Project files tree:
JTest
bin
jtest
ui
JTestApp.class
src
jtest
ui
JTestApp.java
lib
win32
swt.jar
swt-win32-2135.dll
linux-gtk2
swt.jar
libswt-gtk-2135.so
libswt-pi-gtk-2135.so
linux-motif
swt.jar
libswt-motif-2135.so
boot.jar
jface.jar
runtime.jar
build.xml - ant build script
This project can be compiled by Eclipse IDE.
How can I write crossplatform build.xml (for win32/linux)?
I wrote the next build.xml (for win32 only):
<project name="JTestApp" default="compile" basedir=".">
<target name="init">
<property name="src" value="src" />
<property name="dst" value="bin" />
<property name="lib"
value=" lib/win32/swt.jar;lib/jface.jar;lib/runtime.jar;lib/boot.jar " />
</target>
<target name="clean" depends="init">
<delete dir="${dst}" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="${dst}" />
</target>
<target name="compile" depends="prepare">
<javac classpath=".;$(lib)" srcdir="${src}" destdir="${dst}" />
</target>
</project>
But I can't use it due to following errors:
Buildfile: D:\eclipse\workspace\JTest\build.xml
init:
clean:
[delete] Deleting directory D:\eclipse\workspace\JTest\bin
prepare:
[mkdir] Created dir: D:\eclipse\workspace\JTest\bin
compile:
[javac] Compiling 1 source file to D:\eclipse\workspace\JTest\bin
[javac]
D:\eclipse\workspace\JTest\src\jtest\ui\JTestApp.java:17: package
org.eclipse.jface.window does not exist
[javac] import org.eclipse.jface.window.ApplicationWindow;
[javac] ^
[javac]
D:\eclipse\workspace\JTest\src\jtest\ui\JTestApp.java:18: package
org.eclipse.swt.widgets does not exist
[javac] import org.eclipse.swt.widgets.Display;
[javac] ^
[javac]
D:\eclipse\workspace\JTest\src\jtest\ui\JTestApp.java:24: cannot resolve
symbol
[javac] symbol : class ApplicationWindow
[javac] location: class jtest.ui.JTestApp
[javac] public class JTestApp extends ApplicationWindow {
[javac] ^
[javac]
D:\eclipse\workspace\JTest\src\jtest\ui\JTestApp.java:32: cannot resolve
symbol
[javac] symbol : method setBlockOnOpen (boolean)
[javac] location: class jtest.ui.JTestApp
[javac] w.setBlockOnOpen(true);
[javac] ^
[javac]
D:\eclipse\workspace\JTest\src\jtest\ui\JTestApp.java:33: cannot resolve
symbol
[javac] symbol : method open ()
[javac] location: class jtest.ui.JTestApp
[javac] w.open();
[javac] ^
[javac]
D:\eclipse\workspace\JTest\src\jtest\ui\JTestApp.java:34: cannot resolve
symbol
[javac] symbol : variable Display
[javac] location: class jtest.ui.JTestApp
[javac] Display.getCurrent().dispose();
[javac] ^
[javac] 6 errors
[javac] BUILD FAILED:
file:D:/eclipse/workspace/JTest/build.xml:19: Compile failed; see the
compiler error output for details.
Total time: 1 second
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07585 seconds