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

smithy4sUpdateLSPConfig: Plugin-inherited repos get rendered in duplicates (on file creation) #1491

Closed
kubukoz opened this issue Apr 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kubukoz
Copy link
Member

kubukoz commented Apr 15, 2024

Reproduction:

  1. sbt build
val subproj = project

val subproj2 = project.enablePlugins(Smithy4sCodegenPlugin)

val root = project
  .in(file("."))
  .aggregate(subproj, subproj2)
  1. sbt plugin (in e.g. project/MyPlugin.scala)
package demo

import sbt.plugins.JvmPlugin

import _root_.sbt.Keys._
import _root_.sbt._

object MyPlugin extends AutoPlugin {
  override def trigger = allRequirements
  override def requires = JvmPlugin

  override def buildSettings: Seq[Def.Setting[_]] = Seq(
    resolvers ++= Resolver.sonatypeOssRepos("snapshots")
  )

}
  1. Run smithy4sUpdateLSPConfig
  2. Look at smithy-build.json:
{
    "version": "1.0",
    "imports": [
        "subproj2/src/main/smithy",
        "subproj2/target/scala-2.12/src_managed/main/smithy"
    ],
    "maven": {
        "dependencies": [
            "com.disneystreaming.alloy:alloy-core:0.3.4"
        ],
        "repositories": [
            {
                "url": "https://oss.sonatype.org/content/repositories/snapshots"
            },
            {
                "url": "https://s01.oss.sonatype.org/content/repositories/snapshots"
            },
            {
                "url": "https://oss.sonatype.org/content/repositories/snapshots"
            },
            {
                "url": "https://s01.oss.sonatype.org/content/repositories/snapshots"
            },
            {
                "url": "https://oss.sonatype.org/content/repositories/snapshots"
            },
            {
                "url": "https://s01.oss.sonatype.org/content/repositories/snapshots"
            }
        ]
    }
}
  1. Run the command again
  2. The json file now looks right:
{
    "version": "1.0",
    "imports": [
        "subproj2/src/main/smithy",
        "subproj2/target/scala-2.12/src_managed/main/smithy"
    ],
    "maven": {
        "dependencies": [
            "com.disneystreaming.alloy:alloy-core:0.3.4"
        ],
        "repositories": [
            {
                "url": "https://oss.sonatype.org/content/repositories/snapshots"
            },
            {
                "url": "https://s01.oss.sonatype.org/content/repositories/snapshots"
            }
        ]
    }
}

Ready-to-use reproduction: https://github.com/kubukoz/demos/tree/smithy4s-issue-lsp-config

@kubukoz kubukoz added the bug Something isn't working label Apr 15, 2024
@kubukoz kubukoz changed the title smithy4sUpdateLSPConfig: Plugin-inherited repos get rendered in duplicates (on file creation) smithy4sUpdateLSPConfig: Plugin-inherited repos get rendered in duplicates (on file creation) Apr 15, 2024
@kubukoz
Copy link
Member Author

kubukoz commented May 13, 2024

Fixed in #1508 (0.18.17)

@kubukoz kubukoz closed this as completed May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant