forked from I2P_Developers/i2p.i2p
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.
This commit is contained in:
@@ -9,6 +9,16 @@ lazy val i2pVersion = "0.9.34"
|
||||
lazy val buildAppBundleTask = taskKey[Unit](s"Build an Mac OS X bundle for I2P ${i2pVersion}.")
|
||||
lazy val bundleBuildPath = file("./output")
|
||||
|
||||
lazy val staticFiles = List(
|
||||
"blocklist.txt",
|
||||
"clients.config",
|
||||
"continents.txt",
|
||||
"countries.txt",
|
||||
"hosts.txt",
|
||||
"geoip.txt",
|
||||
"router.config",
|
||||
"webapps.config"
|
||||
)
|
||||
|
||||
// Pointing the resources directory to the "installer" directory
|
||||
resourceDirectory in Compile := baseDirectory.value / ".." / ".." / "installer" / "resources"
|
||||
@@ -33,6 +43,19 @@ buildAppBundleTask := {
|
||||
)
|
||||
paths.map { case (s,p) => p.mkdirs() }
|
||||
val dirsToCopy = List("certificates","locale","man")
|
||||
|
||||
/**
|
||||
*
|
||||
* First of, if "map" is unknown for you - shame on you :p
|
||||
*
|
||||
* It's a loop basically where it loops through a list/array
|
||||
* with the current indexed item as subject.
|
||||
*
|
||||
* The code bellow takes the different lists and
|
||||
* copy all the directories or files from the i2p.i2p build dir,
|
||||
* and into the bundle so the launcher will know where to find i2p.
|
||||
*
|
||||
*/
|
||||
dirsToCopy.map { d => IO.copyDirectory( new File(resDir, d), new File(paths.get("i2pbaseBunldePath").get, d) ) }
|
||||
warsForCopy.map { w => IO.copyFile( new File(i2pBuildDir, w), new File(paths.get("webappsBunldePath").get, w) ) }
|
||||
warsForCopy.map { j => IO.copyFile( new File(i2pBuildDir, j), new File(paths.get("i2pJarsBunldePath").get, j) ) }
|
||||
@@ -53,6 +76,6 @@ libraryDependencies ++= Seq(
|
||||
)
|
||||
|
||||
|
||||
assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript))
|
||||
//assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript))
|
||||
|
||||
assemblyJarName in assembly := s"${name.value}-${version.value}"
|
||||
|
||||
2
launchers/macosx/project/plugins.sbt
Normal file
2
launchers/macosx/project/plugins.sbt
Normal file
@@ -0,0 +1,2 @@
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.4")
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.i2p
|
||||
|
||||
import net.i2p.router.Router
|
||||
import net.i2p.launchers.OSXDeployment
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
@@ -35,5 +36,7 @@ object MacOSXRouterLauncherApp extends App {
|
||||
|
||||
val i2pBaseBundleDir = new File(new File("."), "../Resources/i2pbase")
|
||||
|
||||
new OSXDeployment()
|
||||
|
||||
Router.main(args)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user