Skip to content

Commit

Permalink
Fix existing -source-links setting syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Atry authored Jan 26, 2023
1 parent d7a4cf5 commit d85f04b
Showing 1 changed file with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,6 @@ object GithubActionsScaladocSourceUrl extends AutoPlugin {
originalScalacOptions
}
},
Compile / doc / scalacOptions ++= {
if (scalaBinaryVersion.value == "3") {
for {
repositoryBuilder <- GitPlugin.gitRepositoryBuilder.?.value
workTree <- GitPlugin.gitWorkTree.value
slug <- GithubActionsEnvironmentVariables.githubRepository.?.value
} yield {
val repository = repositoryBuilder.build()
try {
val hash = repository.resolve(Constants.HEAD).name
raw"-source-links:$workTree=github://$slug/$hash"
} finally {
repository.close()
}
}
} else {
None
}
},
scalacOptions in Compile in doc := {
val originalScalacOptions = (scalacOptions in Compile in doc).value
(GitPlugin.gitRepositoryBuilder.?.value, GithubActionsEnvironmentVariables.githubRepository.?.value) match {
Expand All @@ -69,7 +50,7 @@ object GithubActionsScaladocSourceUrl extends AutoPlugin {
}
} else {
val pathPrefix = GitPlugin.gitWorkTree.value.fold("")(_.toString())
originalScalacOptions :+ raw"-source-links:$pathPrefix:github://$slug/$hash"
originalScalacOptions :+ raw"-source-links:$pathPrefix=github://$slug/$hash"
}
} finally {
repository.close()
Expand Down

0 comments on commit d85f04b

Please sign in to comment.