Skip to content

Commit 151e39e

Browse files
Scaffolded project
0 parents  commit 151e39e

File tree

41 files changed

+1651
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1651
-0
lines changed

.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf
10+
11+
max_line_length = 120

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.idea
2+
target/
3+
project/target
4+
*~

.jvmopts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-Xms768m
2+
-Xmx2048m
3+
-Xss8m

.scalafmt.conf

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
maxColumn = 120
2+
style = IntelliJ
3+
align = most
4+
align.openParenCallSite = true
5+
align.tokens.add = ["=",":"]
6+
assumeStandardLibraryStripMargin = true
7+
newlines.sometimesBeforeColonInMethodReturnType = false
8+
optIn.breakChainOnFirstMethodDot = false
9+
optIn.configStyleArguments = true
10+
runner.optimizer.forceConfigStyleOnOffset = 120
11+
runner.optimizer.forceConfigStyleMinArgCount = 1
12+
spaces.inImportCurlyBraces = true
13+
14+
rewrite.rules = [
15+
PreferCurlyFors,
16+
RedundantBraces,
17+
RedundantParens,
18+
SortImports
19+
]
20+
21+
project.git = true
22+
project.includeFilters = [
23+
"modules/.+\\.scala"
24+
]

.travis.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: scala
2+
scala:
3+
- 2.12.6
4+
jdk:
5+
- openjdk8
6+
- oraclejdk8
7+
dist: trusty
8+
cache:
9+
- "~/.ivy2"
10+
- "~/.sbt"
11+
install:
12+
- sudo apt-get update
13+
- sudo apt-get install zsh
14+
- sudo chmod +x scripts/*
15+
- scripts/sbt update
16+
script: scripts/run-all-tests.sh
17+
after_script:
18+
- scripts/prepare-test-results-for-ci.sh
19+
- find $HOME/.sbt -name "*.lock" | xargs rm
20+
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
21+
notifications:
22+
email:
23+
on_success: never
24+
on_failure: change

catnip.sbt

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import sbt._
2+
import Settings._
3+
4+
lazy val root = project.root
5+
.setName("catnip")
6+
.setDescription("Macro annotations for Kittens library")
7+
.configureRoot
8+
.aggregate(common, first, second)
9+
10+
lazy val common = project.from("common")
11+
.setName("common")
12+
.setDescription("Common utilities")
13+
.setInitialImport("_")
14+
.configureModule
15+
.configureTests()
16+
.configureFunctionalTests()
17+
.configureIntegrationTests()
18+
.settings(Compile / resourceGenerators += task[Seq[File]] {
19+
val file = (Compile / resourceManaged).value / "catnip-version.conf"
20+
IO.write(file, s"version=${version.value}")
21+
Seq(file)
22+
})
23+
24+
lazy val first = project.from("first")
25+
.setName("first")
26+
.setDescription("First project")
27+
.setInitialImport("first._")
28+
.configureModule
29+
.configureTests()
30+
.compileAndTestDependsOn(common)
31+
.configureRun("io.scalaland.catnip.first.First")
32+
33+
lazy val second = project.from("second")
34+
.setName("second")
35+
.setDescription("Second project")
36+
.setInitialImport("second._")
37+
.configureModule
38+
.configureTests()
39+
.compileAndTestDependsOn(common)
40+
.configureRun("io.scalaland.catnip.second.Second")
41+
42+
addCommandAlias("fullTest", ";test;fun:test;it:test;scalastyle")
43+
44+
addCommandAlias("fullCoverageTest", ";coverage;test;fun:test;it:test;coverageReport;coverageAggregate;scalastyle")
45+
46+
addCommandAlias("relock", ";unlock;reload;update;lock")

lock.sbt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// DON'T EDIT THIS FILE.
2+
// This file is auto generated by sbt-lock 0.5.0.
3+
// https://github.com/tkawachi/sbt-lock/
4+
dependencyOverrides ++= Seq(
5+
"org.scoverage" % "scalac-scoverage-runtime_2.12" % "1.3.1"
6+
)
7+
// LIBRARY_DEPENDENCIES_HASH 858dbdeeb1557e498f00e97d35046644f5b00a3b

modules/common/lock.sbt

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// DON'T EDIT THIS FILE.
2+
// This file is auto generated by sbt-lock 0.5.0.
3+
// https://github.com/tkawachi/sbt-lock/
4+
dependencyOverrides ++= Seq(
5+
"ch.qos.logback" % "logback-classic" % "1.2.3",
6+
"ch.qos.logback" % "logback-core" % "1.2.3",
7+
"com.chuusai" % "shapeless_2.12" % "2.3.3",
8+
"com.github.pureconfig" % "pureconfig-macros_2.12" % "0.9.1",
9+
"com.github.pureconfig" % "pureconfig_2.12" % "0.9.1",
10+
"com.github.scopt" % "scopt_2.12" % "3.7.0",
11+
"com.typesafe" % "config" % "1.3.3",
12+
"com.typesafe.scala-logging" % "scala-logging_2.12" % "3.9.0",
13+
"io.monix" % "monix-eval_2.12" % "3.0.0-RC1",
14+
"io.monix" % "monix-execution_2.12" % "3.0.0-RC1",
15+
"org.reactivestreams" % "reactive-streams" % "1.0.2",
16+
"org.scoverage" % "scalac-scoverage-runtime_2.12" % "1.3.1",
17+
"org.slf4j" % "slf4j-api" % "1.7.25",
18+
"org.typelevel" % "cats-core_2.12" % "1.1.0",
19+
"org.typelevel" % "cats-effect_2.12" % "0.10",
20+
"org.typelevel" % "cats-kernel_2.12" % "1.1.0",
21+
"org.typelevel" % "cats-macros_2.12" % "1.1.0",
22+
"org.typelevel" % "machinist_2.12" % "0.6.2",
23+
"org.typelevel" % "macro-compat_2.12" % "1.1.1"
24+
)
25+
// LIBRARY_DEPENDENCIES_HASH b87dd926583675c99c070f068c6ec36b25833d82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<configuration>
2+
3+
<!-- Logs internal actions for programmer -->
4+
5+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder>
7+
<pattern>%d{HH:mm:ss.SSS} | %-5level %-40logger{38} | %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<!--<root level="error">-->
12+
<root level="off">
13+
<appender-ref ref="STDOUT" />
14+
</root>
15+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.scalaland.catnip
2+
3+
import org.specs2.mock.Mockito
4+
import org.specs2.mutable.Specification
5+
6+
class CommonFunSpec extends Specification with Mockito {
7+
8+
"Common integration" should {
9+
10+
"function in Church" in {
11+
1 mustEqual 1
12+
}
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<configuration>
2+
3+
<!-- Logs internal actions for programmer -->
4+
5+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder>
7+
<pattern>%d{HH:mm:ss.SSS} | %-5level %-40logger{38} | %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<!--<root level="error">-->
12+
<root level="off">
13+
<appender-ref ref="STDOUT" />
14+
</root>
15+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.scalaland.catnip
2+
3+
import org.specs2.mock.Mockito
4+
import org.specs2.mutable.Specification
5+
6+
class CommonItSpec extends Specification with Mockito {
7+
8+
"Common integration" should {
9+
10+
"integrate with Cauchy" in {
11+
1 mustEqual 1
12+
}
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package io.scalaland.catnip
2+
3+
object Common
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<configuration>
2+
3+
<!-- Logs internal actions for programmer -->
4+
5+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder>
7+
<pattern>%d{HH:mm:ss.SSS} | %-5level %-40logger{38} | %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<!--<root level="error">-->
12+
<root level="off">
13+
<appender-ref ref="STDOUT" />
14+
</root>
15+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package io.scalaland.catnip
2+
3+
import org.specs2.mock.Mockito
4+
import org.specs2.mutable.Specification
5+
6+
class CommonSpec extends Specification with Mockito {
7+
8+
"Common" should {
9+
10+
"measure units" in {
11+
1 mustEqual 1
12+
}
13+
}
14+
}

modules/first/lock.sbt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// DON'T EDIT THIS FILE.
2+
// This file is auto generated by sbt-lock 0.5.0.
3+
// https://github.com/tkawachi/sbt-lock/
4+
dependencyOverrides ++= Seq(
5+
"ch.qos.logback" % "logback-classic" % "1.2.3",
6+
"ch.qos.logback" % "logback-core" % "1.2.3",
7+
"com.chuusai" % "shapeless_2.12" % "2.3.3",
8+
"com.github.pureconfig" % "pureconfig-macros_2.12" % "0.9.1",
9+
"com.github.pureconfig" % "pureconfig_2.12" % "0.9.1",
10+
"com.github.scopt" % "scopt_2.12" % "3.7.0",
11+
"com.typesafe" % "config" % "1.3.3",
12+
"com.typesafe.scala-logging" % "scala-logging_2.12" % "3.9.0",
13+
"io.monix" % "monix-eval_2.12" % "3.0.0-RC1",
14+
"io.monix" % "monix-execution_2.12" % "3.0.0-RC1",
15+
"org.aspectj" % "aspectjrt" % "1.9.1",
16+
"org.reactivestreams" % "reactive-streams" % "1.0.2",
17+
"org.scoverage" % "scalac-scoverage-runtime_2.12" % "1.3.1",
18+
"org.slf4j" % "slf4j-api" % "1.7.25",
19+
"org.typelevel" % "cats-core_2.12" % "1.1.0",
20+
"org.typelevel" % "cats-effect_2.12" % "0.10",
21+
"org.typelevel" % "cats-kernel_2.12" % "1.1.0",
22+
"org.typelevel" % "cats-macros_2.12" % "1.1.0",
23+
"org.typelevel" % "machinist_2.12" % "0.6.2",
24+
"org.typelevel" % "macro-compat_2.12" % "1.1.1"
25+
)
26+
// LIBRARY_DEPENDENCIES_HASH 7fbc5e8ecd882e5a6c50c76a87e5e9bf3930d364
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include "catnip-version"
2+
3+
first {
4+
version = ${version}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<configuration>
2+
3+
<!-- Logs internal actions for programmer -->
4+
5+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder>
7+
<pattern>%d{HH:mm:ss.SSS} | %-5level %-40logger{38} | %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<root level="trace">
12+
<!--<root level="info">-->
13+
<appender-ref ref="STDOUT" />
14+
</root>
15+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package io.scalaland.catnip.first
2+
3+
import com.typesafe.scalalogging.Logger
4+
import pureconfig._
5+
6+
object First {
7+
8+
val config = loadConfig[FirstConfig]("first").getOrElse(FirstConfig("undefined"))
9+
10+
val logger = Logger(getClass)
11+
12+
def main(args: Array[String]): Unit = logger.info(s"Run first at version: ${config.version}")
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package io.scalaland.catnip.first
2+
3+
final case class FirstConfig(
4+
version: String
5+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package io.scalaland.catnip.first
2+
3+
import org.specs2.mock.Mockito
4+
import org.specs2.mutable.Specification
5+
6+
class FirstSpec extends Specification with Mockito

modules/second/lock.sbt

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// DON'T EDIT THIS FILE.
2+
// This file is auto generated by sbt-lock 0.5.0.
3+
// https://github.com/tkawachi/sbt-lock/
4+
dependencyOverrides ++= Seq(
5+
"ch.qos.logback" % "logback-classic" % "1.2.3",
6+
"ch.qos.logback" % "logback-core" % "1.2.3",
7+
"com.chuusai" % "shapeless_2.12" % "2.3.3",
8+
"com.github.pureconfig" % "pureconfig-macros_2.12" % "0.9.1",
9+
"com.github.pureconfig" % "pureconfig_2.12" % "0.9.1",
10+
"com.github.scopt" % "scopt_2.12" % "3.7.0",
11+
"com.typesafe" % "config" % "1.3.3",
12+
"com.typesafe.scala-logging" % "scala-logging_2.12" % "3.9.0",
13+
"io.monix" % "monix-eval_2.12" % "3.0.0-RC1",
14+
"io.monix" % "monix-execution_2.12" % "3.0.0-RC1",
15+
"org.aspectj" % "aspectjrt" % "1.9.1",
16+
"org.reactivestreams" % "reactive-streams" % "1.0.2",
17+
"org.scoverage" % "scalac-scoverage-runtime_2.12" % "1.3.1",
18+
"org.slf4j" % "slf4j-api" % "1.7.25",
19+
"org.typelevel" % "cats-core_2.12" % "1.1.0",
20+
"org.typelevel" % "cats-effect_2.12" % "0.10",
21+
"org.typelevel" % "cats-kernel_2.12" % "1.1.0",
22+
"org.typelevel" % "cats-macros_2.12" % "1.1.0",
23+
"org.typelevel" % "machinist_2.12" % "0.6.2",
24+
"org.typelevel" % "macro-compat_2.12" % "1.1.1"
25+
)
26+
// LIBRARY_DEPENDENCIES_HASH 7fbc5e8ecd882e5a6c50c76a87e5e9bf3930d364
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include "catnip-version"
2+
3+
second {
4+
version = ${version}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<configuration>
2+
3+
<!-- Logs internal actions for programmer -->
4+
5+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
6+
<encoder>
7+
<pattern>%d{HH:mm:ss.SSS} | %-5level %-40logger{38} | %msg%n</pattern>
8+
</encoder>
9+
</appender>
10+
11+
<root level="trace">
12+
<!--<root level="info">-->
13+
<appender-ref ref="STDOUT" />
14+
</root>
15+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package io.scalaland.catnip.second
2+
3+
import com.typesafe.scalalogging.Logger
4+
import pureconfig.loadConfig
5+
6+
object Second {
7+
8+
val config = loadConfig[SecondConfig]("second").getOrElse(SecondConfig("undefined"))
9+
10+
val logger = Logger(getClass)
11+
12+
def main(args: Array[String]): Unit = logger.info(s"Run first at version: ${config.version}")
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package io.scalaland.catnip.second
2+
3+
final case class SecondConfig(
4+
version: String
5+
)

0 commit comments

Comments
 (0)