deep

a Cross Development Platform for Java

User Tools

Site Tools


dev:launcher

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dev:launcher [2016/02/25 13:33] – created - external edit 127.0.0.1dev:launcher [2022/11/16 11:40] (current) – [TestLauncher] ursgraf
Line 4: Line 4:
   - Step   - Step
     * Eclipse Launcher: In Eclipse it possible to define run configurations and perform a run. This event is handled by the //launcher//.     * Eclipse Launcher: In Eclipse it possible to define run configurations and perform a run. This event is handled by the //launcher//.
-    * Standalone Launcher: The //launcher// can be started by command line. +    * Standalone Launcher: The //launcher// can be started on the command line. 
     * Test Launcher: The //launcher// is started directly by running as a regular application. This can be handy for debug purposes, see below.     * Test Launcher: The //launcher// is started directly by running as a regular application. This can be handy for debug purposes, see below.
   - Step   - Step
Line 35: Line 35:
    
 ===== Standalone Launcher ===== ===== Standalone Launcher =====
-In the package //ch.ntb.inf.deep.launcher// there is also a standalone launcher. It can be started from the command line and accepts the project file together with a configuration as parameters.+In the package //org.deepjava.launcher// there is also a standalone launcher. It can be started from the command line and accepts a deep project file together with a configuration as parameters. It compiles and links but does not download to a target. 
 +<code> 
 +Usage: java org.deepjava.launcher.StandAloneLauncher [/config ConfigName] deepfile
  
-===== TestLauncher ===== +  /config     By default the project is compiled for "BootFromRam"
-The TestLauncher is a helper class to start building projects directly from the eclipse development workspace without loading the deep plugin in the first place. The TestLauncher has to be adapted in a way that that the desired actions will be taken. One has to enter the correct path and name of the project file and choose a programmer or none. +              By specifying this switch, you can set a different 
- +              configuration to compile for
-<code java> +  /map        Dumps a mapfile 
-public class TestLauncher { +  deepfile    Project file you want to compile
-  public static void main(String[] args) { +
-    Launcher.buildAll("/PATH/TO/YOUR/PROJECT/ExampleProject.deep", "BootFromRam"); +
- +
-    if (ErrorReporter.reporter.nofErrors == 0) { +
-      Programmer programmer = Configuration.getProgrammer(); +
-      if (programmer != null) { +
-        java.lang.Class<?> cls; +
-        try { +
-          cls = java.lang.Class.forName(programmer.getClassName().toString()); +
-          java.lang.reflect.Method m; +
-          m = cls.getDeclaredMethod("getInstance"); +
-          TargetConnection tc = (TargetConnection) m.invoke(cls); +
-          Launcher.setTargetConnection(tc); +
-          Launcher.openTargetConnection(); +
-   Launcher.downloadTargetImage(); +
-          Launcher.startTarget(); +
-   Launcher.closeTargetConnection(); +
- } catch (ClassNotFoundException e) { +
-   ErrorReporter.reporter.error(811, programmer.getClassName().toString()); +
- } catch (Exception e) { +
-   e.printStackTrace(); +
- }  +
-      } else System.out.println("no programmer defined"); +
-    }  +
-  } +
-}+
 </code> </code>
-The TestLauncher is started as normal Java application.+e.g. 
 +<code> 
 +cd <absolute_path>/Test> 
 +java -cp "<absolute_path>/org.deepjava.compiler/bin" org.deepjava.launcher.StandAloneLauncher -map -config BootFromRam Test.deep 
 +</code> 
 +or if the compiler is packed into a jar file 
 +<code> 
 +java -cp <absolute_path>/compiler.jar org.deepjava.launcher.StandAloneLauncher -map -config BootFromRam Test.deep 
 +</code> 
 +===== TestLauncher ===== 
 +The TestLauncher is a helper class to start building projects directly from the eclipse development workspace without loading the deep plugin in the first place. The TestLauncher has to be launched as Java application with appropriate parameters. Arguments could be: 
 +  * --deepfile 555ExampleProject.deep --targetconfig BootFromRam 
 +  * --deepfile microzedExampleProject.deep --targetconfig BootFromRam --interface-files-path "<path>/org.deepjava.trglib" 
 +  * --deepfile junitHostTest.deep --targetconfig BootFromRam 
 +  * --deepfile microzedjunitTarget.deep --targetconfig BootFromRam
  
 ===== Running and Debugging the Development Workspace ===== ===== Running and Debugging the Development Workspace =====
dev/launcher.1456403585.txt.gz · Last modified: 2016/02/25 13:33 by 127.0.0.1