Changeset a3a8ee1 for launchers/macosx


Ignore:
Timestamp:
May 1, 2018 2:54:36 AM (2 years ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
2d15f8e1
Parents:
4e5a2d00
Message:

Major update for the OSX Launcher code. Now it will bundle
installer resources with the fat jar (we add an exclusion list later)
which the base directory will be built(or updated if lacking files) upon
startup of the I2P router. This is done by the OSXDeployment class which
is an extension for the DeployProfile? class written for Mac OS X.

Since the app bundle itself should be R/O, we use ~/Library/I2P as base path,
and continue using ~/Library/Application? Support/i2p as config path. The BB
code will have other paths.

Location:
launchers/macosx
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/build.sbt

    r4e5a2d00 ra3a8ee1  
    1010lazy val bundleBuildPath = file("./output")
    1111
     12lazy val staticFiles = List(
     13  "blocklist.txt",
     14  "clients.config",
     15  "continents.txt",
     16  "countries.txt",
     17  "hosts.txt",
     18  "geoip.txt",
     19  "router.config",
     20  "webapps.config"
     21)
    1222
    1323// Pointing the resources directory to the "installer" directory
     
    3444  paths.map { case (s,p) => p.mkdirs() }
    3545  val dirsToCopy = List("certificates","locale","man")
     46
     47  /**
     48    *
     49    * First of, if "map" is unknown for you - shame on you :p
     50    *
     51    * It's a loop basically where it loops through a list/array
     52    * with the current indexed item as subject.
     53    *
     54    * The code bellow takes the different lists and
     55    * copy all the directories or files from the i2p.i2p build dir,
     56    * and into the bundle so the launcher will know where to find i2p.
     57    *
     58    */
    3659  dirsToCopy.map { d => IO.copyDirectory( new File(resDir, d), new File(paths.get("i2pbaseBunldePath").get, d) ) }
    3760  warsForCopy.map { w => IO.copyFile( new File(i2pBuildDir, w), new File(paths.get("webappsBunldePath").get, w) ) }
     
    5477
    5578
    56 assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript))
     79//assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript))
    5780
    5881assemblyJarName in assembly := s"${name.value}-${version.value}"
  • launchers/macosx/src/main/scala/net/i2p/MacOSXRouterLauncherApp.scala

    r4e5a2d00 ra3a8ee1  
    22
    33import net.i2p.router.Router
     4import net.i2p.launchers.OSXDeployment
    45import java.io.File
    56
     
    3637  val i2pBaseBundleDir = new File(new File("."), "../Resources/i2pbase")
    3738
     39  new OSXDeployment()
     40
    3841  Router.main(args)
    3942}
Note: See TracChangeset for help on using the changeset viewer.