Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
Permalink
Browse files

Add sbt profile to allow building and development on Java 10 for #172

  • Loading branch information...
buggtb committed Mar 20, 2019
1 parent 731af98 commit b041bc83c481f82af60b6e3a9b94c5fa292090c8
Showing with 209 additions and 1 deletion.
  1. +1 −1 pom.xml
  2. +135 −0 sparkler-app/build.sbt
  3. +73 −0 sparkler-app/pom.xml
@@ -53,7 +53,7 @@
<args4j.version>2.0.29</args4j.version>
<slf4j.version>1.7.12</slf4j.version>
<tika.version>1.14</tika.version>
<pf4j.version>2.0.0</pf4j.version>
<pf4j.version>2.6.0</pf4j.version>
</properties>
<modules>
<module>sparkler-api</module>
@@ -0,0 +1,135 @@
cancelable := true

developers := List( // TODO replace this with your information
Developer("mslinn",
"Mike Slinn",
"mslinn@micronauticsresearch.com",
url("https://github.com/mslinn")
)
)

// define the statements initially evaluated when entering 'console', 'console-quick', but not 'console-project'
initialCommands in console := """
|""".stripMargin

javacOptions ++= Seq(
"-Xlint:deprecation",
"-Xlint:unchecked",
"-source", "1.8",
"-target", "1.8",
"-g:vars"
)

libraryDependencies ++= Seq(
"edu.usc.irds.sparkler" % "sparkler-api" % "0.2.1-SNAPSHOT",
"org.pf4j" % "pf4j" % "2.0.0",
"org.apache.spark" % "spark-core_2.11" % "1.6.1",
"org.apache.nutch" % "nutch" % "1.13",
"org.apache.kafka" % "kafka-clients" % "0.10.0.0",
"org.scala-lang" % "scala-library" % "2.11.8",
"org.apache.solr" % "solr-solrj" % "6.4.0",
"org.apache.solr" % "solr-core" % "6.4.0",
"org.apache.tika" % "tika-parsers" % "1.14",
"args4j" % "args4j" % "2.0.29",
"org.slf4j" % "slf4j-api" % "1.7.25",
"org.slf4j" % "slf4j-log4j12" % "1.7.25",
"commons-validator" % "commons-validator" % "1.5.1",
"junit" % "junit" % "4.12" % "test",
"org.scalatest" %% "scalatest" % "3.0.3" % Test withSources(),
"junit" % "junit" % "4.12" % Test
)

// If you want to apply a license, such as the Apache 2 license, uncomment the following:
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))

logLevel := Level.Warn

// Only show warnings and errors on the screen for compilations.
// This applies to both test:compile and compile and is Info by default
logLevel in compile := Level.Warn

// Level.INFO is needed to see detailed output when running tests
logLevel in test := Level.Info

name := "my-new-project" // TODO provide a short yet descriptive name

organization := "com.micronautics"

resolvers ++= Seq(
"Typesafe" at "http://repo.typesafe.com/typesafe/releases/",
"Java.net Maven2 Repository" at "http://download.java.net/maven/2/")
resolvers += Resolver.mavenLocal

scalacOptions ++= Seq( // From https://tpolecat.github.io/2017/04/25/scalac-flags.html
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding", "utf-8", // Specify character encoding used by source files.
"-explaintypes", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
//"-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xfuture", // Turn on future language features.
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
"-Xlint:by-name-right-associative", // By-name parameter of right associative operator.
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
"-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:option-implicit", // Option.apply used implicit view.
"-Xlint:package-object-classes", // Class or object defined in package object.
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
"-Xlint:unsound-match", // Pattern match may not be typesafe.
//"-Yno-adapted-args", // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
//"-Ywarn-dead-code", // Warn when dead code is identified.
"-Ywarn-inaccessible", // Warn about inaccessible types in method signatures.
"-Ywarn-infer-any", // Warn when a type argument is inferred to be `Any`.
"-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
"-Ywarn-nullary-unit", // Warn when nullary methods return Unit.
"-Ywarn-numeric-widen" // Warn when numerics are widened.
//"-Ywarn-unused:implicits", // Warn if an implicit parameter is unused.
//"-Ywarn-unused:imports", // Warn if an import selector is not referenced.
//"-Ywarn-unused:locals", // Warn if a local definition is unused.
//"-Ywarn-unused:params", // Warn if a value parameter is unused.
//"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
//"-Ywarn-unused:privates", // Warn if a private member is unused.
//"-Ywarn-value-discard" // Warn when non-Unit expression results are unused.
)

// The REPL can’t cope with -Ywarn-unused:imports or -Xfatal-warnings so turn them off for the console
scalacOptions in (Compile, console) --= Seq("-Ywarn-unused:imports", "-Xfatal-warnings")

scalacOptions in (Compile, doc) ++= baseDirectory.map {
(bd: File) => Seq[String](
"-sourcepath", bd.getAbsolutePath, // todo replace my-new-project with the github project name, and replace mslinn with your github id
"-doc-source-url", "https://github.com/mslinn/my-new-project/tree/master€{FILE_PATH}.scala"
)
}.value


scalaVersion := "2.11.8"

scmInfo := Some(
ScmInfo( // TODO replace mslinn with your github id
url(s"https://github.com/mslinn/$name"),
s"git@github.com:mslinn/$name.git"
)
)






version := "0.1.0"

@@ -306,4 +306,77 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>sbt</id>

<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>none</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>none</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>sbt</executable>
<!-- optional -->
<workingDirectory>.</workingDirectory>
<arguments>
<argument>package</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>process-resources</phase>
<configuration>
<tasks>

<copy todir="target/classes">
<fileset dir="target/scala-2.11/classes/"/>
</copy>

</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

</profiles>
</project>

0 comments on commit b041bc8

Please sign in to comment.
You can’t perform that action at this time.