From 8930627531ee5853fc8bd71ec1b3c33c9cffd3a6 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Sat, 4 Mar 2017 12:56:59 +0300 Subject: [PATCH] Add script for build default stubs and libs --- mps/.gitignore | 1 + mps/README.txt | 9 -------- mps/make.sh | 18 +++++++++++++++ mps/{ => src}/F.java | 0 mps/{ => src}/FS.java | 0 mps/{ => src}/FW.java | 0 mps/{ => src}/H.java | 0 mps/src/M.java | 23 +++++++++++++++++++ mps/{ => src}/P.java | 0 mps/{ => src}/RS.java | 0 mps/{ => src}/Real.java | 0 mps/{ => src}/S.java | 0 mps/{ => src}/SM.java | 0 .../microedition/lcdui/game/GameCanvas.java | 7 ++++++ 14 files changed, 49 insertions(+), 9 deletions(-) create mode 100644 mps/.gitignore delete mode 100644 mps/README.txt create mode 100755 mps/make.sh rename mps/{ => src}/F.java (100%) rename mps/{ => src}/FS.java (100%) rename mps/{ => src}/FW.java (100%) rename mps/{ => src}/H.java (100%) create mode 100644 mps/src/M.java rename mps/{ => src}/P.java (100%) rename mps/{ => src}/RS.java (100%) rename mps/{ => src}/Real.java (100%) rename mps/{ => src}/S.java (100%) rename mps/{ => src}/SM.java (100%) create mode 100644 mps/src/javax/microedition/lcdui/game/GameCanvas.java diff --git a/mps/.gitignore b/mps/.gitignore new file mode 100644 index 0000000..6b468b6 --- /dev/null +++ b/mps/.gitignore @@ -0,0 +1 @@ +*.class diff --git a/mps/README.txt b/mps/README.txt deleted file mode 100644 index 83d9c74..0000000 --- a/mps/README.txt +++ /dev/null @@ -1,9 +0,0 @@ -For building this stubs, just call the java compiler and then the preverifier in the regular way. - -For example, assumbing you have both in the path, the WTK is in C:\WTK25, and that you have a subdirectory called "bin" to hold the preverified class output, for building the SM class you can do: - -javac -g:none -classpath c:\WTK25\lib\midpapi10.jar;c:\WTK25\lib\cldcapi10.jar;c:\WTK25\lib\wma11.jar -source 1.3 -target 1.1 SM.java -preverify1.1 -nofp -nofinalize -nonative -classpath c:\WTK25\lib\midpapi10.jar;c:\WTK25\lib\cldcapi10.jar;c:\WTK25\lib\wma11.jar -d "bin" "SM" - -Enjoy, -Javier Santo Domingo diff --git a/mps/make.sh b/mps/make.sh new file mode 100755 index 0000000..3a65050 --- /dev/null +++ b/mps/make.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +LIBDIR=/usr/share/java/microemulator/lib + +rm -rf classes stubs +mkdir -p classes stubs +javac -Xlint:-options -encoding ISO-8859-1 -g:none -d classes \ + -classpath `find $LIBDIR -type f -name '*.jar' -printf '%p:'` \ + -source 1.3 -target 1.1 `find src -type f -name '*.java'` +rm -rf classes/javax +proguard -injars classes -outjars stubs \ + -libraryjars $LIBDIR/midpapi20.jar \ + -libraryjars $LIBDIR/cldcapi11.jar \ + -libraryjars $LIBDIR/microemu-jsr-120.jar \ + -dontshrink -microedition -dontobfuscate \ + -overloadaggressively -repackageclasses '' -allowaccessmodification \ + -keep public class FW +rm -rf classes stubs/M.class diff --git a/mps/F.java b/mps/src/F.java similarity index 100% rename from mps/F.java rename to mps/src/F.java diff --git a/mps/FS.java b/mps/src/FS.java similarity index 100% rename from mps/FS.java rename to mps/src/FS.java diff --git a/mps/FW.java b/mps/src/FW.java similarity index 100% rename from mps/FW.java rename to mps/src/FW.java diff --git a/mps/H.java b/mps/src/H.java similarity index 100% rename from mps/H.java rename to mps/src/H.java diff --git a/mps/src/M.java b/mps/src/M.java new file mode 100644 index 0000000..38e09a8 --- /dev/null +++ b/mps/src/M.java @@ -0,0 +1,23 @@ +/* Just a stub for stubs */ + +import java.lang.*; +import java.util.*; +import javax.microedition.lcdui.*; +import javax.microedition.lcdui.game.*; + +public class M extends GameCanvas implements Runnable { + public static Random RNG; + public static Image I; + public static M T; + public static Graphics G; + public static int KC; + public static int KP; + public static int[] IC; + + public M() {} + public static void R() throws Exception {} + public void paint(Graphics g) {} + public void run() {} + public void keyPressed(int k) {} + public void keyReleased(int k) {} +} diff --git a/mps/P.java b/mps/src/P.java similarity index 100% rename from mps/P.java rename to mps/src/P.java diff --git a/mps/RS.java b/mps/src/RS.java similarity index 100% rename from mps/RS.java rename to mps/src/RS.java diff --git a/mps/Real.java b/mps/src/Real.java similarity index 100% rename from mps/Real.java rename to mps/src/Real.java diff --git a/mps/S.java b/mps/src/S.java similarity index 100% rename from mps/S.java rename to mps/src/S.java diff --git a/mps/SM.java b/mps/src/SM.java similarity index 100% rename from mps/SM.java rename to mps/src/SM.java diff --git a/mps/src/javax/microedition/lcdui/game/GameCanvas.java b/mps/src/javax/microedition/lcdui/game/GameCanvas.java new file mode 100644 index 0000000..10b188c --- /dev/null +++ b/mps/src/javax/microedition/lcdui/game/GameCanvas.java @@ -0,0 +1,7 @@ +/* Stub for stub for stubs O_o */ + +package javax.microedition.lcdui.game; + +import javax.microedition.lcdui.*; + +public abstract class GameCanvas extends Canvas {} -- 2.29.2