Skip to content

Commit

Permalink
Update logic to check for Scala libraries when generating fake SBT li…
Browse files Browse the repository at this point in the history
…braries
  • Loading branch information
Andres Pipicello authored and lefou committed Jun 28, 2019
1 parent 1ae2061 commit da1436a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions scalalib/src/GenIdeaImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ case class GenIdeaImpl(evaluator: Evaluator,
val artifactNames = Seq("main-moduledefs", "main-api", "main-core", "scalalib", "scalajslib")
val Result.Success(res) = scalalib.Lib.resolveDependencies(
repos.toList,
Lib.depToDependency(_, "2.12.4", ""),
Lib.depToDependency(_, "2.12.8", ""),
for(name <- artifactNames)
yield ivy"com.lihaoyi::mill-$name:${sys.props("MILL_VERSION")}",
false,
Expand Down Expand Up @@ -214,8 +214,9 @@ case class GenIdeaImpl(evaluator: Evaluator,
val pom = xmlParseDom(os.read(pomPath)).flatMap(Pom.project).right.get

val artifactId = pom.module.name.value
val scalaArtifactRegex = ".*_[23]\\.[0-9]{1,2}".r
val artifactWithScalaVersion = artifactId.substring(artifactId.length - 5) match {
case "_2.10" | "_2.11" | "_2.12" => artifactId
case scalaArtifactRegex(_*) => artifactId
case _ => artifactId + "_2.12"
}
s"SBT: ${pom.module.organization.value}:$artifactWithScalaVersion:${pom.version}:jar"
Expand Down
2 changes: 0 additions & 2 deletions scalalib/test/src/GenIdeaTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ object GenIdeaTests extends ScriptTestSuite(false) {
workspacePath / ".idea_modules" /"helloworld.iml",
s"$workspaceSlug/idea_modules/helloworld.test.iml" ->
workspacePath / ".idea_modules" /"helloworld.test.iml",
// s"$workspaceSlug/idea_modules/mill-build.iml" ->
// os.pwd / ".idea_modules" /"mill-build.iml",
s"$workspaceSlug/idea/libraries/scala-library-2.12.4.jar.xml" ->
workspacePath / ".idea" / "libraries" / "scala-library-2.12.4.jar.xml",
s"$workspaceSlug/idea/modules.xml" ->
Expand Down

0 comments on commit da1436a

Please sign in to comment.