first commit

This commit is contained in:
Erik Bročko 2018-11-29 07:47:20 +01:00
parent 81943c578b
commit c91077f776
7 changed files with 53 additions and 0 deletions

7
compile.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
. "$DIR/conf.sh"
find "$SRCJAVA" -name "*.java" > javasources.txt
javac -d "$BUILDDIR/java" @javasources.txt
rm javasources.txt

6
conf.sh Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
MAINCLASS="me.lixko.tatrop.Main"
BUILDDIR="$DIR/build"
BUILDJAVA="$BUILDDIR/java"
SRCPHP="$DIR/src/php"
SRCJAVA="$DIR/src/java"

5
run.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
. "$DIR/conf.sh"
php "$SRCPHP/main.php" -m "$MAINCLASS" -c "$BUILDJAVA" $@

View File

@ -0,0 +1,7 @@
package me.lixko.tatrop;
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

View File

@ -0,0 +1,9 @@
<?
namespace Tatrop;
class JvmLoader {
function __construct() {
echo "constructed\n";
}
}

19
src/php/main.php Normal file
View File

@ -0,0 +1,19 @@
<?php
function printUsage() {
echo "main.php -m (main class) -c (classpath)\n";
}
$args = getopt("m:c:");
if (!isset($args['m']) || !isset($args['c'])) {
printUsage();
die();
}
$javamain = $args['m'];
$javacp = $args['c'];
echo "main $javamain\n";
echo "cp $javacp\n";