source: launchers/macosx/src/main/scala/net/i2p/MacOSXRouterLauncherApp.scala @ 8adf55a

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

Still WIP, but I've added a new sbt plugin named
sbt-native-packager for future rpm/deb/windows and
maybe even OSX packages. Also, the macosx sbt project
now has a task named buildAppBundleTask and which will
produce an and copy over needed directories/jars/wars
which later needs to be extracted to an writeable area which
would be i2p base directory in runtime.

The MacOSXRouterLauncherApp contains more information about how
the executable in the OS X bundle will locate our R/O i2pbase so
it can copy it to a writable area. The R/O is also to ensure valid
signature on the bundle.

At last, this approach is done casue letting an Mach-O binary load
libjvm.dylib was proved unstable, so MacOSXRouterLauncherApp will
rather use an JNI module to load the needed glue with the
Mac OS X system.

  • Property mode set to 100644
File size: 1.1 KB
1package net.i2p
3import net.i2p.router.Router
7  *
8  * For java developers:
9  * A scala object is like an instance of a class.
10  * If you define a method inside an object, it's equals to
11  * java's static methods.
12  *
13  * Also, in scala, the body of a class/object is executed as it's
14  * constructor.
15  *
16  * Also noteworthy;
17  * val is immutable
18  * var is mutable
19  *
20  *
21  * The i2p base directory in the build should be in a relative path from
22  * the launcher, which would be ../Resources/i2pbase - this directory would
23  * need to be copied out to a "writable" area, since we're in a signed "immutable"
24  * bundle. First this launcher will check if i2pbase is already deployed to a
25  * writable area, if it's not, it deploys, if the i2pbase directory has an older
26  * version than the one in the bundle, it upgrades. It does nothing if versions
27  * matches.
28  *
29  *
30  * @author Meeh
31  * @version 0.0.1
32  * @since 0.9.35
33  */
34object MacOSXRouterLauncherApp extends App {
36  val i2pBaseBundleDir = new File(new File("."), "../Resources/i2pbase")
38  Router.main(args)
Note: See TracBrowser for help on using the repository browser.