diff --git a/src/main/scala/sbttrickle/Autobump.scala b/src/main/scala/sbttrickle/Autobump.scala index c38c55b..9aad2e8 100644 --- a/src/main/scala/sbttrickle/Autobump.scala +++ b/src/main/scala/sbttrickle/Autobump.scala @@ -40,7 +40,7 @@ trait Autobump { log: Logger): Seq[OutdatedRepository] = { val lm = new Resolver(dependencyResolution, workDir, log) outdatedRepositories.map { o => - val available = o.updates.filter(updateInfo => lm.isArtifactAvailable(updateInfo.dependency)) + val available = o.updates.filter(updateInfo => lm.isArtifactAvailable(updateInfo.dependency.withRevision(updateInfo.newRevision))) o.copy(updates = available) }.filterNot(_.updates.isEmpty) } diff --git a/src/main/scala/sbttrickle/TrickleKeys.scala b/src/main/scala/sbttrickle/TrickleKeys.scala index 9dbbd85..ac39c3b 100644 --- a/src/main/scala/sbttrickle/TrickleKeys.scala +++ b/src/main/scala/sbttrickle/TrickleKeys.scala @@ -37,6 +37,7 @@ trait TrickleKeys { val trickleCheckDependencies = inputKey[Unit]("Verifies that a dependency has the expected version") val trickleIntransitiveResolve = settingKey[Boolean]("If true, only check direct dependency availability") val trickleLogUpdatableRepositories = taskKey[Unit]("Log what needs to be updates") + val trickleUpdatedDependencies = taskKey[Set[ModuleUpdateData]]("Set of all dependencies that were updated in this repository") val trickleOutdatedDependencies = taskKey[Set[ModuleUpdateData]]("Set of updates available on this repository") val trickleUpdateDependencies = taskKey[Unit]("Updates all managed dependencies to the latest version") val trickleUpdateSessionDependencies = taskKey[StateTransform]("Updates all managed dependencies to the latest version") diff --git a/src/main/scala/sbttrickle/TricklePlugin.scala b/src/main/scala/sbttrickle/TricklePlugin.scala index 1d7d433..9f33a4e 100644 --- a/src/main/scala/sbttrickle/TricklePlugin.scala +++ b/src/main/scala/sbttrickle/TricklePlugin.scala @@ -146,6 +146,16 @@ object TricklePlugin extends AutoPlugin { Autobump.checkSessionDependencies(project, dependencies, modules, log) } + lazy val trickleUpdatedDependenciesTask: Initialize[Task[Set[ModuleUpdateData]]] = Def.task { + val log = streams.value.log + val repository = trickleGitDbRepository.value + val sv = scalaBinaryVersion.value + val config = trickleGitConfig.value.withRemote(trickleDbURI.value).withDry(trickleDryMode.?.value) + val repository = trickleRepositoryName.value + val metadata = GitDb.getBuildMetadata(repository, sv, config, log) + val topology = BuildTopology(metadata) + } + lazy val trickleOutdatedDependenciesTask: Initialize[Task[Set[ModuleUpdateData]]] = Def.task { val buildTopology = trickleBuildTopology.value val repository = trickleRepositoryName.value @@ -306,6 +316,7 @@ object TricklePlugin extends AutoPlugin { commits ++ tags }.getOrElse(Seq.empty) - token(Space ~> NotQuoted.examples(FixedSetExamples(suggestions))) + // FIXME: bugged? + token(Space) ~> token(NotQuoted.examples(FixedSetExamples(suggestions))) } } diff --git a/src/main/scala/sbttrickle/git/GitDb.scala b/src/main/scala/sbttrickle/git/GitDb.scala index de1ce39..e416849 100644 --- a/src/main/scala/sbttrickle/git/GitDb.scala +++ b/src/main/scala/sbttrickle/git/GitDb.scala @@ -91,7 +91,7 @@ trait GitDb { /** * Reads all metadata from repository. * - * @param repository Repository directory, as in the return value of `getRepository` + * @param repository Repository directory, as in the return value of [[#getRepository]] */ def getBuildMetadata(repository: File, scalaBinaryVersion: String, @@ -111,7 +111,7 @@ trait GitDb { /** * Save metadata to repository and update remote if changed. * - * @param repository Repository directory, as in the return value of `getRepository` + * @param repository Repository directory, as in the return value of [[#getRepository]] * @param commitMsg Commit message in the git format * @return File where metadata was saved */ @@ -146,7 +146,7 @@ trait GitDb { /** * All commits reachable from HEAD. * - * @param repository Repository directory, as in the return value of `getRepository` + * @param repository Repository directory, as in the return value of [[#getRepository]] */ def commits(repository: File, config: GitConfig, log: Logger): Seq[String] = { if (isValidRepository(repository) && isConfigurationCorrect(repository, config, log)) { @@ -162,7 +162,7 @@ trait GitDb { /** * All tags. * - * @param repository Repository directory, as in the return value of `getRepository` + * @param repository Repository directory, as in the return value of [[#getRepository]] */ def tags(repository: File, config: GitConfig, log: Logger): Seq[String] = { if (isValidRepository(repository) && isConfigurationCorrect(repository, config, log)) { @@ -178,7 +178,7 @@ trait GitDb { * Resets HEAD to `commit`. * * @param commit sha-1 or reference (branches, tags and remotes), possibly abbreviated - * @param repository Repository directory, as in the return value of `getRepository` + * @param repository Repository directory, as in the return value of [[#getRepository]] */ def reset(commit: String, repository: File, config: GitConfig, log: Logger): Unit = { if (isValidRepository(repository) && isConfigurationCorrect(repository, config, log)) {