Skip to content

Commit

Permalink
Use scripted resolver in ALL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jvican committed Nov 20, 2017
1 parent cfd307f commit d4bf307
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@ abstract class BridgeProviderSpecification extends UnitSpec {
def currentTarget: File = currentBase / "target" / "ivyhome"
def currentManaged: File = currentBase / "target" / "lib_managed"

val resolvers = Array(ZincComponentCompiler.LocalResolver, Resolver.mavenCentral)
private final val ZincScriptedLocal =
s"$${user.dir}/.ivy2/zinc-scripted-local/${Resolver.localBasePattern}"
private final val ScriptedResolver: Resolver = {
import sbt.librarymanagement.{ FileRepository, Patterns }
val toUse = Vector(ZincScriptedLocal)
val ivyPattern = Patterns().withIsMavenCompatible(false)
val finalPatterns = ivyPattern
.withIvyPatterns(toUse)
.withArtifactPatterns(toUse)
.withSkipConsistencyCheck(true)
FileRepository("zinc-scripted-local", Resolver.defaultFileConfiguration, finalPatterns)
}

// Use the scripted resolver to make sure that we don't mistakenly get user local jars
val resolvers = Array(ScriptedResolver, Resolver.mavenCentral)
private def ivyConfiguration =
getDefaultConfiguration(currentBase, currentTarget, resolvers, log)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,6 @@ final class IncHandler(directory: File, cacheDir: File, scriptedLog: ManagedLogg
type State = Option[IncInstance]
type IncCommand = (ProjectStructure, List[String], IncInstance) => Unit

private final val ZincScriptedLocal =
s"$${user.dir}/.ivy2/zinc-scripted-local/${Resolver.localBasePattern}"
private final val ScriptedResolver: Resolver = {
import sbt.librarymanagement.{ FileRepository, Patterns }
val toUse = Vector(ZincScriptedLocal)
val ivyPattern = Patterns().withIsMavenCompatible(false)
val finalPatterns = ivyPattern
.withIvyPatterns(toUse)
.withArtifactPatterns(toUse)
.withSkipConsistencyCheck(true)
FileRepository("zinc-scripted-local", Resolver.defaultFileConfiguration, finalPatterns)
}

// Use the scripted resolver to make sure that we don't mistakenly get other jars
override val resolvers: Array[Resolver] = Array(ScriptedResolver, Resolver.mavenCentral)

val compiler = new IncrementalCompilerImpl

def initialState: Option[IncInstance] = {
Expand Down

0 comments on commit d4bf307

Please sign in to comment.