Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Fixes pom.xml in afterSuccess sbt task #251

Merged
merged 6 commits into from
Apr 24, 2017
Merged
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 core/src/main/resources/templates/CONTRIBUTING.md.template
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ The process is simple:
5. Update the documentation
6. Submit pull request

You will be automatically included in the [AUTHORS.md](AUTHORS.md#contributors) file as contributor.
You will be automatically included in the [AUTHORS.md](AUTHORS.md#contributors) file as contributor in the next release.
If you encounter any confusion or frustration during the contribution process, please create a GitHub issue and we'll do our best to improve the process.
10 changes: 5 additions & 5 deletions core/src/main/scala/sbtorgpolicies/libraries.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ object libraries {
type Artifact = (String, String, String)

val v47: Map[String, String] = Map[String, String](
"case-classy" -> "0.3.0",
"case-classy" -> "0.4.0",
"fetch" -> "0.6.1",
"github4s" -> "0.14.3",
"github4s" -> "0.14.5",
"scheckToolboxDatetime" -> "0.2.1"
)

Expand All @@ -32,10 +32,10 @@ object libraries {
"akka-http" -> "10.0.5",
"algebra" -> "0.7.0",
"alleycats" -> "0.1.9",
"aws-sdk" -> "1.11.121",
"aws-sdk" -> "1.11.123",
"base64" -> "0.2.3",
"catalysts" -> "0.0.5",
"catbird" -> "0.13.0",
"catbird" -> "0.14.0",
"cats" -> "0.9.0",
"circe" -> "0.7.1",
"config" -> "1.3.1",
Expand All @@ -47,7 +47,7 @@ object libraries {
"finch" -> "0.14.0",
"fs2" -> "0.9.5",
"fs2-cats" -> "0.3.0",
"h2" -> "1.4.194",
"h2" -> "1.4.195",
"http4s" -> "0.17.0-M1",
"joda-convert" -> "1.8.1",
"joda-time" -> "2.9.9",
Expand Down
41 changes: 25 additions & 16 deletions src/main/scala/sbtorgpolicies/settings/bash.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ trait bash {
}.value
)

val orgPublishReleaseCommand: Command = Command(orgPublishReleaseCommandKey)(_ => OptNotSpace) { (st, _) =>
val orgPublishReleaseCommand: Command = Command(orgPublishReleaseCommandKey)(_ => OptNotSpace) { (inputState, _) =>
val st: State = deferredFetchContributorsState(inputState)
val extracted = Project.extract(st)

val buildV = extracted.get(version in ThisBuild)
Expand Down Expand Up @@ -89,23 +90,11 @@ trait bash {

if (extracted.get(orgAfterCISuccessCheckSetting)) {

val beforeTasksState = (st: State) => {
val envVarToken = extracted.get(orgGithubTokenSetting)
val maybeToken = getEnvVar(envVarToken)

val (fetchContributorsState, contributorList) =
if (maybeToken.nonEmpty) {
extracted.runTask[List[Dev]](orgFetchContributors, st)
} else (st, Nil)

reapply(Seq[Setting[_]](orgContributorsSetting := contributorList), fetchContributorsState)
}

runTaskListCommand(
"orgAfterCISuccess",
orgAfterCISuccessTaskListSetting,
st,
beforeTasksState
deferredFetchContributorsState
)

} else {
Expand Down Expand Up @@ -159,8 +148,7 @@ trait bash {
reapply(Seq[Setting[_]](setSetting.setting := setSetting.value), currentState)

case RunnableItemConfigScope(RunnableProcess(process), _, _, _) =>
process.!
currentState
Command.process(process, currentState)
}
}
} else {
Expand All @@ -169,6 +157,27 @@ trait bash {
}
}

private[this] def deferredFetchContributorsState(st: State) = {
val extracted = Project.extract(st)

val envVarToken = extracted.get(orgGithubTokenSetting)
val projectMaintainers = extracted.get(orgMaintainersSetting)

val maybeToken = getEnvVar(envVarToken)

val (fetchContributorsState, contributorList) =
if (maybeToken.nonEmpty) {
extracted.runTask[List[Dev]](orgFetchContributors, st)
} else (st, Nil)

val devs = projectMaintainers ++ contributorList

val setContributorState =
reapply(Seq[Setting[_]](orgContributorsSetting := contributorList), fetchContributorsState)

reapply(Seq[Setting[_]](pomExtra := <developers> { devs.map(_.pomExtra) } </developers>), setContributorState)
}

private[this] def toStringListRunnableItems(list: List[RunnableItemConfigScope[_]]): String =
s"""
|${list.map(toStringRunnableItem).mkString("\n")}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtorgpolicies/settings/files.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ trait files {
replaced.filter(f => f.status.success && f.status.modified).map(_.file)
} else Nil

val allFiles: List[File] = policyFiles ++ modifiedDocFiles
val allFiles: List[File] = (policyFiles ++ modifiedDocFiles).map(_.getAbsolutePath).distinct.map(file)

if (allFiles.nonEmpty) {
if (orgUpdateDocFilesCommitSetting.value) {
Expand Down