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

Draft PR Update Test #4

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion src/main/scala/sbttrickle/Autobump.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/sbttrickle/TrickleKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
13 changes: 12 additions & 1 deletion src/main/scala/sbttrickle/TricklePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)))
}
}
10 changes: 5 additions & 5 deletions src/main/scala/sbttrickle/git/GitDb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
*/
Expand Down Expand Up @@ -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)) {
Expand All @@ -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)) {
Expand All @@ -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)) {
Expand Down