Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hoarder integration test #1

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ ensime.sbt
#
# If you want to add something from your personal setup,
# add it to your ~/.gitignore instead.

# HOARDER stuff
.hoarder-cache
35 changes: 35 additions & 0 deletions project/PreventCompilation.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import sbt._
import Keys._
import sbt.plugins.CorePlugin
import sbt.plugins.JvmPlugin
import org.romanowski.HoarderKeys.cachedCiSetup


object PreventCompilation extends AutoPlugin {

// so we can rewrite default tasks, e.g. compile
override def requires: Plugins = CorePlugin && JvmPlugin

def perConfig = Seq(
manipulateBytecode := {
val res = manipulateBytecode.value

def isIgnored = { // TODO Hoarder#30
name.value.startsWith("testing_") || // TODO Hoarder#30
name.value == "testutil" || // TODO Hoarder#30
name.value == "core" // BuildInfo gets generated...
}

if (res.hasModified && cachedCiSetup.value.shouldUseCache() && !isIgnored)
throw new RuntimeException(s"Compilation wasn't no-op after import for ${name.value}/${configuration.value}")

res
}
)

override def trigger: PluginTrigger = AllRequirements

override def projectSettings: Seq[Setting[_]] ={
inConfig(Compile)(perConfig) ++ inConfig(Test)(perConfig)
}
}
4 changes: 4 additions & 0 deletions project/TestCachedCi.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import org.romanowski.hoarder.actions.ci.TravisPRValidation

object TestCachedCi extends TravisPRValidation.PluginBase

3 changes: 3 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ addSbtPlugin("org.ensime" % "sbt-ensime" % "1.12.7")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "1.5.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1")

//Add Hoarder
addSbtPlugin("com.github.romanowski" % "hoarder" % "1.0-for-test")