-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d81bf2c
commit e94e0c8
Showing
39 changed files
with
6,374 additions
and
0 deletions.
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
...9.01.22/Pyja/19.01.22/Study/JRuby/19.06.12-Rooibos/S21-Akka-Qt-FX-Hello-Integer/ORun.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import java.io.File; | ||
import java.io.FileNotFoundException; | ||
import java.io.FileReader; | ||
import java.lang.ClassLoader; | ||
import java.lang.NullPointerException; | ||
import java.lang.reflect.Field; | ||
import java.lang.reflect.Method; | ||
import java.net.URL; | ||
import java.net.URLClassLoader; | ||
import java.nio.file.NotDirectoryException; | ||
import java.util.Date; | ||
import javafx.application.Application; | ||
import javafx.stage.Stage; | ||
import javax.script.ScriptEngine; | ||
import javax.script.ScriptEngineManager; | ||
import javax.script.Invocable; | ||
|
||
public class ORun extends Application { | ||
public static Date ol_st = new Date (); | ||
public static Stage ol_ps; | ||
public static ScriptEngine ol_gr; | ||
public static String ou_gr_fn = System .getenv ("SC_TONO_HM") + File.separator + "SToa.groovy"; | ||
public static ScriptEngine ol_jr; | ||
public static String ou_jr_fn = System .getenv ("SC_TONO_HM") + File.separator + "SToa.rb"; | ||
public static String [] ol_args; | ||
public static void main ( final String [] x_args ) throws Exception { | ||
ol_args = x_args; | ||
launch (ORun.class); | ||
} | ||
@Override | ||
public void start ( final Stage x_stage ) throws Exception { | ||
ol_ps = x_stage; | ||
__oan_run_groovy_script (); | ||
__oan_run_jruby_script (); | ||
} | ||
private static void __oan_run_groovy_script () throws Exception { | ||
final File nu_fl = new File (ou_gr_fn); | ||
if ( ! ( nu_fl .exists () && nu_fl .isFile () ) ) { throw new FileNotFoundException ( "Groovy script file not found => " + ou_gr_fn ); } | ||
ol_gr = new ScriptEngineManager () .getEngineByName ("Groovy"); | ||
if ( ol_gr == null ) { { throw new NullPointerException ( "Groovy script engine not found !!!" ); } } | ||
ol_gr .eval ( new FileReader (nu_fl) ); | ||
} | ||
private static void __oan_run_jruby_script () throws Exception { | ||
try { | ||
final File bu2_fl = new File (ou_jr_fn); | ||
if ( ! ( bu2_fl .exists () && bu2_fl .isFile () ) ) { throw new FileNotFoundException ( "JRuby script file not found => " + ou_jr_fn ); } | ||
ol_jr = new ScriptEngineManager () .getEngineByName ("jruby"); | ||
if ( ol_jr == null ) { { throw new NullPointerException ( "JRuby script engine not found !!!" ); } } | ||
( (Invocable) ol_jr ) .invokeFunction ( "require", ou_jr_fn ); | ||
} catch ( final Exception bu2_ex ) { | ||
final Invocable bu2_gi = (Invocable) ol_gr; | ||
final Object bu2_ex_list = bu2_gi .invokeFunction ( "gf_exception_to_list", new Object [] {bu2_ex} ); | ||
bu2_gi .invokeFunction ( "gp_request_exit", new Object [] { ol_gr .get ("GC_EC_ERROR"), bu2_ex_list } ); | ||
} | ||
} | ||
public static void on_add_jar ( final String x_jar_fn ) throws Exception { | ||
final File nu_jar_fl = new File (x_jar_fn); | ||
if ( ! ( nu_jar_fl .exists () && nu_jar_fl .isFile () ) ) { throw new FileNotFoundException ( "JAR file not found => " + x_jar_fn ); } | ||
final URL nu_url = nu_jar_fl .toURI () .toURL (); | ||
final URLClassLoader nu_cl = (URLClassLoader) ClassLoader .getSystemClassLoader (); | ||
final Method nu_m = URLClassLoader.class .getDeclaredMethod ( "addURL", URL.class ); | ||
nu_m .setAccessible (true); | ||
nu_m .invoke ( nu_cl, nu_url ); | ||
} | ||
public static void on_add_java_library_path ( final String x_java_library_pn ) throws Exception { | ||
final File nu_library_ph = new File (x_java_library_pn); | ||
if ( ! ( nu_library_ph .exists () && nu_library_ph .isDirectory () ) ) { throw new NotDirectoryException ( "Java library path not found => " + x_java_library_pn ); } | ||
final String nu_org_paths = System .getProperty ( "java.library.path" ); | ||
System .setProperty ( "java.library.path", nu_org_paths + File.pathSeparator + x_java_library_pn ); | ||
final Field nu_f = ClassLoader.class .getDeclaredField ("sys_paths"); | ||
nu_f .setAccessible (true); | ||
nu_f .set ( null, null ); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...1.22/Pyja/19.01.22/Study/JRuby/19.06.12-Rooibos/S21-Akka-Qt-FX-Hello-Integer/SCompile.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
SETLOCAL | ||
|
||
SET PATH=%SystemRoot%\system32 | ||
|
||
SET SC_THIS_BN=%~NX0 | ||
SET SC_THIS_JN=%~N0 | ||
|
||
PUSHD "%~DP0" | ||
CD "%~DP0" | ||
SET SC_TONO_HM=%CD% | ||
CD %SC_TONO_HM%\.. | ||
SET SC_MILO_PN=%CD% | ||
CD "%SC_MILO_PN%\..\..\.." | ||
SET SC_PYJA_HM=%CD% | ||
CD "%SC_PYJA_HM%\.." | ||
SET SC_PYJA_RT=%CD% | ||
FOR %%F IN (%SC_PYJA_RT%) DO SET SC_PYJA_NM=%%~NXF | ||
FOR %%F IN (%SC_PYJA_HM%) DO SET SC_PYJA_VR=%%~NXF | ||
POPD | ||
|
||
CALL "%SC_PYJA_HM%\Config\SSet-KAPA.bat" | ||
CALL "%SC_PYJA_HM%\Config\JDK\x64\SSet-JDK-8-212.bat" | ||
|
||
SET JAVA_HOME=%SC_J8_HM% | ||
SET SC_JAVA_XMX=-Xmx9g | ||
|
||
CALL "%SC_PYJA_HM%\Config\MSYS2\x64\SSet-MSYS2.bat" | ||
CALL "%SC_PYJA_HM%\Config\MSYS2\x64\SSet-Ruby-2.6.0.bat" | ||
|
||
SET SC_PATH=%PATH% | ||
|
||
"%SC_RUBY_X_FN%" "%SC_TONO_HM%\%SC_THIS_JN%.rb" %* | ||
|
||
ENDLOCAL |
Oops, something went wrong.