Bläddra i källkod

Build Java examples and add wrapper scripts to run them.

tags/v0.99.beta17
Sam Hocevar sam 15 år sedan
förälder
incheckning
ee517d81e5
6 ändrade filer med 26 tillägg och 4 borttagningar
  1. +1
    -0
      java/.gitignore
  2. +11
    -2
      java/Makefile.am
  3. +6
    -0
      java/examples/Driver
  4. +1
    -1
      java/examples/Driver.java
  5. +6
    -0
      java/examples/TrueColor
  6. +1
    -1
      java/org/zoy/caca/Caca.java

+ 1
- 0
java/.gitignore Visa fil

@@ -1,3 +1,4 @@
libjava.jar
examples/*.class
org_zoy_caca_*.h
org/zoy/caca/*.class

+ 11
- 2
java/Makefile.am Visa fil

@@ -4,6 +4,7 @@ jnidir = $(libdir)/jni

if USE_JAVA
jni_LTLIBRARIES = libcaca-java.la
noinst_DATA = examples/Driver.class examples/TrueColor.class
endif

java_src = $(wildcard $(srcdir)/org/zoy/caca/*.java)
@@ -74,11 +75,13 @@ org_zoy_caca_Font.h: org/zoy/caca/Font.class
$(JAVAH) $(JAVAH_FLAGS) org.zoy.caca.Font
@touch org_zoy_caca_Font.h

CLEANFILES = org/zoy/caca/*.class org_zoy_caca_[A-Z]*.h $(java_jar)
CLEANFILES = $(noinst_DATA) $(java_jar) \
org/zoy/caca/*.class org_zoy_caca_[A-Z]*.h
EXTRA_DIST = README

if USE_JAVA
BUILT_SOURCES = $(java_jni_headers) $(java_jni_classes)
endif

libcaca_java_la_CPPFLAGS = $(JAVA_CFLAGS)
libcaca_java_la_SOURCES = \
@@ -91,4 +94,10 @@ libcaca_java_la_LDFLAGS = -shared $(JAVA_LIBS)
libcaca_java_la_LIBADD = ../caca/libcaca.la
libcaca_java_ladir = $(datadir)/java
libcaca_java_la_DATA = $(java_jar)
endif

examples/Driver.class: examples/Driver.java
$(JAVAC) $^

examples/TrueColor.class: examples/TrueColor.java
$(JAVAC) $^


+ 6
- 0
java/examples/Driver Visa fil

@@ -0,0 +1,6 @@
#!/bin/sh

DIR="`dirname $0`"
java -Djava.library.path="${DIR}/../.libs" \
-cp "${DIR}/../libjava.jar:${DIR}" Driver


+ 1
- 1
java/examples/Driver.java Visa fil

@@ -26,7 +26,7 @@ public class Driver {
Display.Driver driver;
int i, cur = 0;
while(true) {
cv.put(1, 0, "Availabl driver");
cv.put(1, 0, "Available drivers");
driver = dp.getDriver();
Display.Driver[] list = Display.getDriverList();
for (i = 0; i < list.length; i++) {


+ 6
- 0
java/examples/TrueColor Visa fil

@@ -0,0 +1,6 @@
#!/bin/sh

DIR="`dirname $0`"
java -Djava.library.path="${DIR}/../.libs" \
-cp "${DIR}/../libjava.jar:${DIR}" TrueColor


+ 1
- 1
java/org/zoy/caca/Caca.java Visa fil

@@ -23,7 +23,7 @@ public class Caca {

synchronized public static void load() {
if (!alreadyLoaded) {
System.loadLibrary("java");
System.loadLibrary("caca-java");
alreadyLoaded = true;
}
}


Laddar…
Avbryt
Spara