Changeset a92993e0 for launchers


Ignore:
Timestamp:
Jul 13, 2018 10:10:04 AM (23 months ago)
Author:
meeh <meeh@…>
Branches:
master
Children:
17c2a2a
Parents:
8c78d4f8
Message:

Added some more header files, and fixed much of the build system.

Location:
launchers
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • launchers/build.sbt

    r8c78d4f8 ra92993e0  
    4949  .aggregate(common, browserbundle, macosx)
    5050
    51 scalacOptions in Compile := Seq("-deprecated")
     51javacOptions ++= Seq("-source", "1.7", "-target", "1.7")
     52scalacOptions in Compile := Seq("-deprecated","-target:jvm-1.7")
    5253
    5354fork := true
  • launchers/macosx/build.sbt

    r8c78d4f8 ra92993e0  
    1616
    1717
    18 // Pointing the resources directory to the "installer" directory
    19 resourceDirectory in Compile := baseDirectory.value / ".." / ".." / "installer" / "resources"
    20 
    21 // Unmanaged base will be included in a fat jar
    22 unmanagedBase in Compile := baseDirectory.value / ".." / ".." / "pkg-temp" / "lib"
    23 
    24 
    2518// Unmanaged classpath will be available at compile time
    2619unmanagedClasspath in Compile ++= Seq(
    27     baseDirectory.value / ".." / ".." / "pkg-temp" / "lib" / "*.jar"
     20    baseDirectory.value / ".." / ".." / "pkg-temp" / "lib" / "router.jar",
     21    baseDirectory.value / ".." / ".." / "pkg-temp" / "lib" / "i2p.jar"
    2822)
     23
     24unmanagedBase in Compile := baseDirectory.value / ".." / ".." / "pkg-temp" / "lib"
    2925
    3026assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false, includeDependency = false)
     
    3531}
    3632
    37 /*
     33javacOptions ++= Seq("-source", "1.7", "-target", "1.7")
     34scalacOptions in Compile := Seq("-deprecated","-target:jvm-1.7")
    3835
    39 assemblyJarName in assembly := s"package.jar"
    40 
    41 // TODO: MEEH: Add assemblyExcludedJars and load the router from own jar files, to handle upgrades better.
    42 // In fact, most likely the bundle never would need an update except for the router jars/wars.
    43 
    44 convertToICNSTask := {
    45   println("TODO")
    46 }
    47 
    48 cleanAllTask := {
    49   clean.value
    50   IO.delete(bundleBuildPath)
    51 }
    52 
    53 buildDeployZipTask := {
    54   println(s"Starting the zip file build process. This might take a while..")
    55   if (!bundleBuildPath.exists()) bundleBuildPath.mkdir()
    56   val sourceDir = i2pBuildDir
    57   def recursiveListFiles(f: File): Array[File] = {
    58     val these = f.listFiles
    59     these ++ these.filter { f => f.isDirectory }.flatMap(recursiveListFiles).filter(!_.isDirectory)
    60   }
    61   def zip(out: String, files: Iterable[String]) = {
    62     import java.io.{ BufferedInputStream, FileInputStream, FileOutputStream }
    63     import java.util.zip.{ ZipEntry, ZipOutputStream }
    64 
    65     val zip = new ZipOutputStream(new FileOutputStream(out))
    66 
    67     files.foreach { name =>
    68       val fname = sourceDir.toURI.relativize(new File(name).toURI).toString
    69       //println(s"Zipping ${fname}")
    70       if (!new File(name).isDirectory) {
    71         zip.putNextEntry(new ZipEntry(fname))
    72         val in = new BufferedInputStream(new FileInputStream(name))
    73         var b = in.read()
    74         while (b > -1) {
    75           zip.write(b)
    76           b = in.read()
    77         }
    78         in.close()
    79         zip.closeEntry()
    80       }
    81     }
    82     zip.close()
    83   }
    84   val fileList = recursiveListFiles(sourceDir.getCanonicalFile).toList
    85   val zipFileName = new File(bundleBuildPath, "i2pbase.zip").getCanonicalPath
    86   zip(zipFileName, fileList.map { f => f.toString }.toIterable)
    87   zipFileName.toString
    88 }
    89 
    90 buildAppBundleTask := {
    91   println(s"Building Mac OS X bundle for I2P version ${i2pVersion}.")
    92   if (!bundleBuildPath.exists()) bundleBuildPath.mkdir()
    93   val paths = Map[String,File](
    94     "execBundlePath" -> new File(bundleBuildPath, "I2P.app/Contents/MacOS"),
    95     "resBundlePath" -> new File(bundleBuildPath, "I2P.app/Contents/Resources")
    96   )
    97   paths.map { case (s,p) => p.mkdirs() }
    98 
    99   val launcherBinary = Some(assembly.value)
    100   launcherBinary.map { l => IO.copyFile( new File(l.toString), new File(paths.get("execBundlePath").get, "I2P") ) }
    101 
    102   val zipFilePath = Some(buildDeployZipTask.value)
    103 
    104   val zipFileOrigin = new File(zipFilePath.get)
    105   IO.copyFile(zipFileOrigin, new File(paths.get("resBundlePath").get, "i2pbase.zip"))
    106   println(s"Zip placed into bundle :)")
    107 
    108 }
    109 */
  • launchers/macosx/obj-cpp/build.ninja

    r8c78d4f8 ra92993e0  
    2222
    2323rule cleanup
    24   command = rm -fr *.o clauncher I2PLauncher.app
     24  command = rm -fr *.o clauncher I2PLauncher.app base.zip
    2525
    2626# TODO: There must exists a cleaner way to solve this.
     
    2828  command = mkdir -p I2PLauncher.app/Contents/{MacOS,Resources,Frameworks} $
    2929    && cp Info.plist I2PLauncher.app/Contents/Info.plist $
     30    && cd ../../../pkg-temp && zip -r7 ../base.zip * && cd - && mv ../../../base.zip base.zip  $
    3031    && cp base.zip I2PLauncher.app/Contents/Resources/base.zip $
    3132    && cp ../target/scala-2.11/routerLauncher-assembly-0.1.0-SNAPSHOT.jar I2PLauncher.app/Contents/Resources/launcher.jar
Note: See TracChangeset for help on using the changeset viewer.