Skip to content
Snippets Groups Projects
Commit 8207f12e authored by POLITO Guillermo Andres's avatar POLITO Guillermo Andres
Browse files

making n2s3 a multi project sbt project

parent 91575953
No related branches found
No related tags found
No related merge requests found
Showing
with 37 additions and 56 deletions
File moved
File moved
File moved
lazy val commonSettings = Seq(
version := "0.3-SNAPSHOT",
organization := "fr.univ-lille.cristal",
scalaVersion := "2.11.6",
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8"),
test in assembly := {},
// Special repository resolver. Used to download project dependencies
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
lazy val n2s3 = (project in file("n2s3")).
settings(commonSettings: _*)
lazy val examples = (project in file("n2s3_examples")).
settings(commonSettings: _*).
dependsOn(n2s3)
\ No newline at end of file
......@@ -7,13 +7,6 @@
lazy val n2s3 = (project in file(".")).settings(
name := "N2S3",
version := "0.3-SNAPSHOT",
organization := "fr.univ-lille.cristal",
scalaVersion := "2.11.6",
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8"),
// Special repository resolver. Used to download project dependencies
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
/*********************************************************************************************************************
* Dependencies
......@@ -35,23 +28,6 @@ lazy val n2s3 = (project in file(".")).settings(
)
},
//Old dependencies:
//"jfree" % "jfreechart" % "1.0.13",
//To see which and how managed dependencies are loaded
//unmanagedBase := baseDirectory.value / "lib_managed",
assemblyExcludedJars in assembly := {
val cp = (fullClasspath in assembly).value
cp.filter( x => x.data.getName == "jcommon-1.0.9.jar" || x.data.getName == "jfreechart-1.0.13.jar")
},
//Avoiding tests in generated assembly
test in assembly := {},
// retrieveManaged := true,
assemblyJarName in assembly := "n2s3.jar",
/********************************************************************************************************************
* Publishing options
******************************************************************************************************************/
......
......@@ -9,7 +9,7 @@ import java.io.IOException
import fr.univ_lille.cristal.emeraude.n2s3.UnitSpec
class TestAERInputStream extends UnitSpec {
val filename = "src/test/resources/aerdata/freeway2.mat.dat"
val filename = this.getClass.getResource("/aerdata/freeway2.mat.dat").getFile
//TODO: Using the following file makes the tests fail. Is the file right?
//val filename = "src/test/resources/aerdata/freeway.mat.dat"
......
......@@ -10,8 +10,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.UnitSpec
import fr.univ_lille.cristal.emeraude.n2s3.features.io.input.MnistFileInputStream
class TestMnistInputStream extends UnitSpec {
val testImageFileName: String = "src/test/resources/train2k-images.idx3-ubyte"
val testLabelFileName: String = "src/test/resources/train2k-labels.idx1-ubyte"
val testImageFileName: String = this.getClass.getResource("/train2k-images.idx3-ubyte").getFile
val testLabelFileName: String = this.getClass.getResource("/train2k-labels.idx1-ubyte").getFile
"MnistInputStream" should "not be at the end of a not read file" in {
val inputStream = new MnistFileInputStream(testImageFileName, testLabelFileName)
......
......@@ -7,8 +7,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.support.io.InputStreamCombinators._
* Created by guille on 6/2/16.
*/
class TestFlatMapInputStream extends UnitSpec {
val testImageFileName: String = "data/train2k-images.idx3-ubyte"
val testLabelFileName: String = "data/train2k-labels.idx1-ubyte"
val testImageFileName: String = this.getClass.getResource("/train2k-images.idx3-ubyte").getFile
val testLabelFileName: String = this.getClass.getResource("/train2k-labels.idx1-ubyte").getFile
"Flatmap an empty array" should "be at end" in {
val stream = InputStream(new Array[Seq[Int]](0)).flatMap(array => array)
......
......@@ -9,8 +9,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.features.io.input.MnistFileInputStrea
* Created by guille on 6/2/16.
*/
class TestGroupByInputStream extends UnitSpec {
val testImageFileName: String = "data/train2k-images.idx3-ubyte"
val testLabelFileName: String = "data/train2k-labels.idx1-ubyte"
val testImageFileName: String = this.getClass.getResource("/train2k-images.idx3-ubyte").getFile
val testLabelFileName: String = this.getClass.getResource("/train2k-labels.idx1-ubyte").getFile
"GroupBy input stream" should "group all subsequent elements by condition" in {
val wrappee = new SequenceInputStream(List(1,1,1,1))
......
......@@ -7,8 +7,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.features.io.input.MnistFileInputStrea
* Created by guille on 6/2/16.
*/
class TestOptionInputStream extends UnitSpec {
val testImageFileName: String = "src/test/resources/train2k-images.idx3-ubyte"
val testLabelFileName: String = "src/test/resources/train2k-labels.idx1-ubyte"
val testImageFileName: String = this.getClass.getResource("/train2k-images.idx3-ubyte").getFile
val testLabelFileName: String = this.getClass.getResource("/train2k-labels.idx1-ubyte").getFile
"Option input stream" should "return Some element if available" in {
val wrappee = new MnistFileInputStream(testImageFileName, testLabelFileName)
......
......@@ -7,8 +7,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.features.io.input.MnistFileInputStrea
* Created by guille on 6/2/16.
*/
class TestPositionInputStream extends UnitSpec {
val testImageFileName: String = "src/test/resources/train2k-images.idx3-ubyte"
val testLabelFileName: String = "src/test/resources/train2k-labels.idx1-ubyte"
val testImageFileName: String = this.getClass.getResource("/train2k-images.idx3-ubyte").getFile
val testLabelFileName: String = this.getClass.getResource("/train2k-labels.idx1-ubyte").getFile
"Position input stream" should "start in zero" in {
val wrappee = new MnistFileInputStream(testImageFileName, testLabelFileName)
......
......@@ -7,8 +7,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.features.io.input.MnistFileInputStrea
* Created by guille on 6/2/16.
*/
class TestRepeatInputStream extends UnitSpec {
val testImageFileName: String = "src/test/resources/train2k-images.idx3-ubyte"
val testLabelFileName: String = "src/test/resources/train2k-labels.idx1-ubyte"
val testImageFileName: String = this.getClass.getResource("/train2k-images.idx3-ubyte").getFile
val testLabelFileName: String = this.getClass.getResource("/train2k-labels.idx1-ubyte").getFile
"Repeat input stream 1 times" should "yield the wrappee" in {
val wrappee = new MnistFileInputStream(testImageFileName, testLabelFileName)
......
......@@ -9,8 +9,8 @@ import fr.univ_lille.cristal.emeraude.n2s3.features.io.input.MnistFileInputStrea
* Created by guille on 6/2/16.
*/
class TestTakeInputStream extends UnitSpec {
val testImageFileName: String = "src/test/resources/train2k-images.idx3-ubyte"
val testLabelFileName: String = "src/test/resources/train2k-labels.idx1-ubyte"
val testImageFileName: String = this.getClass.getResource("/train2k-images.idx3-ubyte").getFile
val testLabelFileName: String = this.getClass.getResource("/train2k-labels.idx1-ubyte").getFile
"Take input stream" should "read up to its limit if wrappee is bigger" in {
val wrappee = new MnistFileInputStream(testImageFileName, testLabelFileName)
......
......@@ -4,14 +4,6 @@
lazy val n2s3_examples = (project in file(".")).settings(
name := "N2S3_examples",
version := "0.3-SNAPSHOT",
organization := "fr.univ-lille.cristal",
scalaVersion := "2.11.6",
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8"),
// Special repository resolver. Used to download project dependencies
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
/*********************************************************************************************************************
* Dependencies
......@@ -19,15 +11,7 @@ lazy val n2s3_examples = (project in file(".")).settings(
libraryDependencies ++= {
val akkaV = "2.3.7"
Seq(
"fr.univ-lille.cristal" %% "n2s3" % "0.3-SNAPSHOT",
"com.typesafe.akka" %% "akka-cluster" % akkaV
)
}
)
\ No newline at end of file
lazy val publishNessyLocal = taskKey[Unit]("Publishes the latest version of n2s3 to the local repository to use it as dependency of the examples")
publishNessyLocal := {
scala.sys.process.Process("sbt publish-local", new File(new File("").getAbsoluteFile().getParentFile(), "n2s3")).!
}
compile <<= (compile in Compile) dependsOn publishNessyLocal
\ No newline at end of file
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
\ No newline at end of file
// create eclipse definition project
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment