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

Fix empty artifactName for simple modules #20

Merged
merged 1 commit into from
Aug 28, 2023
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
8 changes: 8 additions & 0 deletions itest/src/simple/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ trait CrossScalaJSNative extends CrossPlatform {
def verify(ev: Evaluator) = T.command {
`no-native`("3.3.0").jvm.compile()

locally {
val result = ev.evalOrThrow()(normal.jvm.artifactName)
assert(
result == "normal",
s"Wrong artifactName: $result"
)
}

locally {
val result = ev.evalOrThrow()(core("3.3.0").jvm.artifactName)
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ trait CrossPlatform extends Cross.Module[String] with DynamicModule {
)

private[crossplatform] protected def myArtifactNameParts: Seq[String] =
millModuleSegments.parts.init
millModuleSegments.parts

CrossPlatform.checkMillVersion()
def moduleDeps: Seq[CrossPlatform] = Seq.empty
Expand Down Expand Up @@ -159,6 +159,7 @@ trait CrossPlatform extends Cross.Module[String] with DynamicModule {
trait CrossPlatformCrossScalaModule
extends CrossScalaModule
with CrossPlatformScalaModule {
override def artifactNameParts = container.myArtifactNameParts.init
override def crossValue: String = throw new Exception(
"""CrossPlatformCrossScalaModule defines `def crossValue: String` only because it's required by CrossScalaModule (defined in Cross.Module[String]).
|You shouldn't need to use it directly. If you see this message please report a bug at https://github.com/lolgab/mill-crossplatform/issues/new""".stripMargin
Expand Down
Loading