Changeset f6c8e44 for launchers/macosx


Ignore:
Timestamp:
May 1, 2018 11:15:11 AM (2 years ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
c326bb7
Parents:
345e741
Message:

Jar deployment, SBT hacking, and more related to launcher code.
Some refactoring, bugfixing, and self awareness of launcher jar.

Location:
launchers/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • launchers/macosx/build.sbt

    r345e741 rf6c8e44  
    3232resourceDirectory in Compile := baseDirectory.value / ".." / ".." / "installer" / "resources"
    3333
     34// Unmanaged base will be included in a fat jar
     35unmanagedBase in Compile := baseDirectory.value / ".." / ".." / "build"
     36
    3437// Unmanaged classpath will be available at compile time
    3538unmanagedClasspath in Compile ++= Seq(
    36   baseDirectory.value / ".." / ".." / "build" / "*.jar",
    37   baseDirectory.value / ".." / ".." / "router" / "java" / "src"
     39  baseDirectory.value / ".." / ".." / "build" / "*.jar"
    3840)
    39 
    40 // Please note the difference between browserbundle, this has
    41 // the "in Compile" which limit it's scope to that.
    42 //unmanagedBase in Compile := baseDirectory.value / ".." / ".." / "build"
    43 
    44 libraryDependencies ++= Seq(
    45   "net.i2p" % "router" % i2pVersion % Compile
    46 )
    47 
    4841
    4942//assemblyOption in assembly := (assemblyOption in assembly).value.copy(prependShellScript = Some(defaultShellScript))
    5043
    51 assemblyJarName in assembly := s"${name.value}-${version.value}"
     44assemblyJarName in assembly := s"OSXLauncher"
    5245
    5346
     
    7265  val dirsToCopy = List("certificates","locale","man")
    7366
     67  val launcherBinary = Some(assembly.value)
     68  launcherBinary.map { l => IO.copyFile( new File(l.toString), new File(paths.get("execBundlePath").get, "I2P") ) }
     69
     70
    7471  /**
    7572    *
     
    8683  dirsToCopy.map { d => IO.copyDirectory( new File(resDir, d), new File(paths.get("i2pbaseBunldePath").get, d) ) }
    8784  warsForCopy.map { w => IO.copyFile( new File(i2pBuildDir, w), new File(paths.get("webappsBunldePath").get, w) ) }
    88   warsForCopy.map { j => IO.copyFile( new File(i2pBuildDir, j), new File(paths.get("i2pJarsBunldePath").get, j) ) }
     85  jarsForCopy.map { j => IO.copyFile( new File(i2pBuildDir, j), new File(paths.get("i2pJarsBunldePath").get, j) ) }
    8986}
  • launchers/macosx/src/main/scala/net/i2p/MacOSXRouterLauncherApp.scala

    r345e741 rf6c8e44  
    11package net.i2p
    22
    3 import net.i2p.router.Router
     3import java.io.File
     4
     5import collection.JavaConverters._
    46import net.i2p.launchers.{OSXDefaults, OSXDeployment}
    5 import java.io.File
    67
    78/**
     
    3536object MacOSXRouterLauncherApp extends App {
    3637
    37   val i2pBaseDir = new File(OSXDefaults.getOSXBaseDirectory)
     38  val i2pBaseDir = OSXDefaults.getOSXBaseDirectory
     39
    3840
    3941  new OSXDeployment()
     
    4244  System.setProperty("user.dir", i2pBaseDir.getAbsolutePath)
    4345
    44   Router.main(args)
     46  val i2pJarDir = new File(i2pBaseDir.getAbsolutePath, "lib")
     47  i2pJarDir.list().toList.map { jar => {
     48    val jarFile = new File(i2pJarDir, jar)
     49    println(s"Loading jar: ${jarFile.toURI.toURL} => ${MacOSXRouterLauncher.addJarToClassPath(jarFile.toURI.toURL)}")
     50
     51  } }
     52
     53  MacOSXRouterLauncher.runRouter(args)
     54  //net.i2p.Router.main(args)
    4555}
Note: See TracChangeset for help on using the changeset viewer.