Skip to content
Closed
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
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ If your artifact does not have any binary version it is considered a Java artifa
Yet some Java artifact are closely related to Scala.
In that case you can force its indexing by updating the [non-standard.json](https://github.com/scalacenter/scaladex-contrib/blob/master/non-standard.json) file in the [scaladex-contrib](https://github.com/scalacenter/scaladex-contrib) repository.

At the moment we don't support full Scala binary versions, that are often used in Scala compiler plugins.
Scaladex supports various binary version formats:
- Standard Scala versions: `_2.13`, `_3`, `_2.12`
- Scala.js versions: `_sjs1_2.13`, `_sjs1_3`
- Scala Native versions: `_native0.4_2.13`
- SBT plugin versions: `_2.13_1.0`, `_2.12_0.13`
- Mill plugin versions: `_mill0.9_2.13`

Compiler plugins are currently being added to Scaladex. They typically use full Scala binary versions (e.g., `_2.13.10`).
If you have a compiler plugin that needs to be indexed, please open an issue in the [scaladex-contrib](https://github.com/scalacenter/scaladex-contrib) repository.

#### Does the pom file contain the `scm` attribute and does it points to a public Github repository?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ import scaladex.core.util.Parsers
import fastparse.*
import fastparse.NoWhitespace.*

/** Represents a binary version of a Scala artifact.
*
* The binary version consists of two parts:
* 1. platform: The runtime platform (JVM, Scala.js, Scala Native, SBT plugin, Mill plugin)
* 2. language: The programming language (Java, Scala with version)
*
* Examples:
* - JVM Scala 2.13: BinaryVersion(Jvm, Scala(Version(2, 13, 0)))
* - Scala.js 1.0 with Scala 2.13: BinaryVersion(ScalaJs(Version(1, 0, 0)), Scala(Version(2, 13, 0)))
* - SBT plugin 1.0 with Scala 2.13: BinaryVersion(SbtPlugin(Version(1, 0, 0)), Scala(Version(2, 13, 0)))
*
* TODO: Add support for compiler plugins which use full Scala versions (e.g., 2.13.10)
* This will require:
* 1. Extending the Platform type to include CompilerPlugin
* 2. Updating the Parser to handle full version numbers
* 3. Modifying the artifact indexing logic to recognize compiler plugin artifacts
*/
final case class BinaryVersion(platform: Platform, language: Language):
def isValid: Boolean = platform.isValid && language.isValid

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,20 @@ class BinaryVersionTests extends AnyFunSpec with Matchers with OptionValues with
expected.value shouldBe input
}
}

it("should handle compiler plugin versions (TODO)") {
// This test will be implemented when compiler plugin support is added
// Example test cases:
// val cases = Table(
// ("input", "target"),
// ("_2.13.10", BinaryVersion(CompilerPlugin, Scala(Version(2, 13, 10)))),
// ("_3.3.1", BinaryVersion(CompilerPlugin, Scala(Version(3, 3, 1))))
// )
Comment on lines +61 to +65

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks great

//
// forAll(cases) { (input, expected) =>
// BinaryVersion.parse(input) should contain(expected)
// expected.value shouldBe input
// }
succeed
}
end BinaryVersionTests
Loading