From ce520f9a262e0f76dab432d1ff655b8e747d711a Mon Sep 17 00:00:00 2001 From: Nathan Fischer Date: Thu, 4 Apr 2019 14:29:47 -0700 Subject: Documentation around artifact name for publishing Added a line to the documentation on how to change the artifact id. Updated the scaladoc on JavaModule to explain the difference between artifactName and artifactId. --- scalalib/src/JavaModule.scala | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scalalib/src') diff --git a/scalalib/src/JavaModule.scala b/scalalib/src/JavaModule.scala index 82776b8a..75a0339d 100644 --- a/scalalib/src/JavaModule.scala +++ b/scalalib/src/JavaModule.scala @@ -524,10 +524,18 @@ trait JavaModule extends mill.Module with TaskModule { outer => } } - // publish artifact with name "mill_2.12.4" instead of "mill_2.12" - + /** + * Override this to change the published artifact id. + * For example, by default a scala module foo.baz might be published as foo-baz_2.12 and a java module would be foo-baz. + * Setting this to baz would result in a scala artifact baz_2.12 or a java artifact baz. + */ def artifactName: T[String] = millModuleSegments.parts.mkString("-") + /** + * The exact id of the artifact to be published. You probably don't want to override this. + * If you want to customize the name of the artifact, override artifactName instead. + * If you want to customize the scala version in the artifact id, see ScalaModule.artifactScalaVersion + */ def artifactId: T[String] = artifactName() def intellijModulePath: os.Path = millSourcePath -- cgit v1.2.3