From d85f04b33efef73ebcd9bf2d5a46c4abc885199d Mon Sep 17 00:00:00 2001 From: "Yang, Bo" Date: Wed, 25 Jan 2023 22:15:23 -0800 Subject: [PATCH] Fix existing -source-links setting syntax --- .../GithubActionsScaladocSourceUrl.scala | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/github-actions/src/main/scala/com/thoughtworks/sbtBestPractice/githubActions/GithubActionsScaladocSourceUrl.scala b/github-actions/src/main/scala/com/thoughtworks/sbtBestPractice/githubActions/GithubActionsScaladocSourceUrl.scala index 782bb40..288a1f4 100644 --- a/github-actions/src/main/scala/com/thoughtworks/sbtBestPractice/githubActions/GithubActionsScaladocSourceUrl.scala +++ b/github-actions/src/main/scala/com/thoughtworks/sbtBestPractice/githubActions/GithubActionsScaladocSourceUrl.scala @@ -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 { @@ -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()