- Timestamp:
- Jun 30, 2018 1:11:17 PM (3 years ago)
- Branches:
- master
- Children:
- 3b34581
- Parents:
- 0b01cc5
- Location:
- launchers
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
launchers/build.sbt
r0b01cc5 rd4dd0ea 41 41 .settings( 42 42 commonSettings, 43 name := " MacI2PLauncher",43 name := "RouterPack.jar", 44 44 mainClass in assembly := Some("net.i2p.launchers.osx.LauncherAppMain") 45 45 ).dependsOn(common) -
launchers/macosx/build.sbt
r0b01cc5 rd4dd0ea 2 2 import java.util.zip._ 3 3 4 lazy val i2pVersion = "0.9.3 4"4 lazy val i2pVersion = "0.9.35" 5 5 6 6 lazy val cleanAllTask = taskKey[Unit]("Clean up and remove the OSX bundle") … … 25 25 lazy val jarsForCopy = new File(i2pBuildDir, "lib").list.filter { f => f.endsWith(".jar") } 26 26 27 27 // TODO: Meeh: To be removed - logic is moved to obj-cpp 28 28 def defaultOSXLauncherShellScript(javaOpts: Seq[String] = Seq.empty): Seq[String] = { 29 29 val javaOptsString = javaOpts.map(_ + " ").mkString … … 139 139 launcherBinary.map { l => IO.copyFile( new File(l.toString), new File(paths.get("execBundlePath").get, "I2P") ) } 140 140 141 142 val plistFile = new File("./macosx/Info.plist")143 if (plistFile.exists()) {144 println(s"Adding Info.plist...")145 IO.copyFile(plistFile, new File(bundleBuildPath, "I2P.app/Contents/Info.plist"))146 }147 148 141 val zipFilePath = Some(buildDeployZipTask.value) 149 142 -
launchers/macosx/src/main/scala/net/i2p/launchers/osx/LauncherAppMain.scala
r0b01cc5 rd4dd0ea 88 88 } 89 89 90 //Await.result(routerProcess, 5000 millis)91 92 90 } finally { 93 91 System.out.println("Exit?") -
launchers/macosx/src/main/scala/net/i2p/launchers/osx/MacOSXRouterLauncher.scala
r0b01cc5 rd4dd0ea 17 17 */ 18 18 object MacOSXRouterLauncher extends RouterLauncher { 19 20 def pid(p: Process): Long = {21 val procField = p.getClass.getDeclaredField("p")22 procField.synchronized {23 procField.setAccessible(true)24 val proc = procField.get(p)25 try {26 proc match {27 case unixProc28 if unixProc.getClass.getName == "java.lang.UNIXProcess" => {29 val pidField = unixProc.getClass.getDeclaredField("pid")30 pidField.synchronized {31 pidField.setAccessible(true)32 try {33 pidField.getLong(unixProc)34 } finally {35 pidField.setAccessible(false)36 }37 }38 }39 case procImpl:java.lang.Process => {40 val f: Field = p.getClass().getDeclaredField("p")41 val f2: Field = f.get(p).getClass.getDeclaredField("pid")42 try {43 f.setAccessible(true)44 f2.setAccessible(true)45 val pid = f2.getLong(p)46 pid47 } finally {48 f2.setAccessible(false)49 f.setAccessible(false)50 }51 }52 // If someone wants to add support for Windows processes,53 // this would be the right place to do it:54 case _ => throw new RuntimeException(55 "Cannot get PID of a " + proc.getClass.getName)56 }57 } finally {58 procField.setAccessible(false)59 }60 }61 }62 63 19 64 20 // ??? equals "throw not implemented" IIRC - it compiles at least :)
Note: See TracChangeset
for help on using the changeset viewer.