source: launchers/macosx/src/main/scala/net/i2p/launchers/osx/LauncherAppMain.scala @ 70e994fc

Last change on this file since 70e994fc was 70e994fc, checked in by meeh <meeh@…>, 3 years ago

Some changes, after much testing I find it best to spawn an sub java
process for I2P rather than trying to load Router via reflection or
anything runtime fancy stuff. Shell script is implemented in SBT now,
and can now link to download JRE script and so on.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1package net.i2p.launchers.osx
2
3import java.io.File
4
5import net.i2p.launchers.{DeployProfile, OSXDefaults, OSXDeployment}
6
7/**
8  *
9  * For java developers:
10  * A scala object is like an instance of a class.
11  * If you define a method inside an object, it's equals to
12  * java's static methods.
13  *
14  * Also, in scala, the body of a class/object is executed as it's
15  * constructor.
16  *
17  * Also noteworthy;
18  * val is immutable
19  * var is mutable
20  *
21  *
22  * The i2p base directory in the build should be in a relative path from
23  * the launcher, which would be ../Resources/i2pbase - this directory would
24  * need to be copied out to a "writable" area, since we're in a signed "immutable"
25  * bundle. First this launcher will check if i2pbase is already deployed to a
26  * writable area, if it's not, it deploys, if the i2pbase directory has an older
27  * version than the one in the bundle, it upgrades. It does nothing if versions
28  * matches.
29  *
30  *
31  * @author Meeh
32  * @version 0.0.1
33  * @since 0.9.35
34  */
35object LauncherAppMain extends App {
36
37  val i2pBaseDir = OSXDefaults.getOSXBaseDirectory
38
39  new OSXDeployment()
40
41  // Change directory to base dir
42  System.setProperty("user.dir", i2pBaseDir.getAbsolutePath)
43
44  try {
45    MacOSXRouterLauncher.runRouter(i2pBaseDir, args)
46  } finally {
47    System.out.println("Exit.")
48  }
49}
Note: See TracBrowser for help on using the repository browser.