JohnReedLOL / scala-trace-debug

Macro based print debugging. Locates log statements in your IDE.
https://github.com/JohnReedLOL/pos
MIT License
115 stars 5 forks source link

using sbt %% #1

Closed MasseGuillaume closed 8 years ago

JohnReedLOL commented 8 years ago

I cannot accept this pull request because copy-pasting this:

libraryDependencies += "scala-trace-debug" % "scala-trace-debug" % "2.11"

resolvers += "johnreed2 bintray" at "http://dl.bintray.com/content/johnreed2/maven"

into my build.sbt file did not work. I had to instead do this:

resolvers += "johnreed2 bintray" at "http://dl.bintray.com/content/johnreed2/maven"

libraryDependencies += "scala-trace-debug" % "scala-trace-debug_2.11" % "0.1.1"

Thank you

MasseGuillaume commented 8 years ago

oh ops I will rebase with: "scala-trace-debug" %% "scala-trace-debug" % "0.1.1"

MasseGuillaume commented 8 years ago

oh ok you got it into master.

MasseGuillaume commented 8 years ago

here you go ;-)

JohnReedLOL commented 8 years ago

"If you use groupID %% artifactID % revision rather than groupID % artifactID % revision (the difference is the double %% after the groupID), sbt will add your project’s Scala version to the artifact name."

This is not what I want. If you have Scala version 2.10 and you do "scala-trace-debug" %% "scala-trace-debug" % "0.1.1", the project will not work - the traceExpression and assertExpression features requires scala version 2.11

JohnReedLOL commented 8 years ago

If you really want to help, there are two things that I think need to be done, one big and one small. The small thing is to replace the example of traceExpression at the bottom of the README with a screenshot showing the use of traceExpression and assertExpression. The big thing is that there is a design flaw.

The design flaw is that printing, tracing, and asserting are all in one big implicit class and you can't selectively decide to include only printing or only tracing. It needs to be re-factored into three separate implicit classes. Once the big implicit class is split into three, each needs to be put into a separate file. One file for ImplicitTrace, one for ImplicitAssert, and one for ImplicitPrint. If the user chooses to import one of the three files, they get only that methods in that one implicit class. Once the implicit classes are moved out of the package object named "debug", that package object needs implicit conversion methods so that people who want to import all three at the same time can do so.

If the user imports the package object, they import the three implicit conversion methods and those methods apply the implicit conversions. "import info.collaborationstation.debug." must still produce an "all you can eat buffer" of implicit methods, but "import info.collaboration_station.debug.ImplicitTrace", "import info.collaboration_station.debug.ImplicitAssert", and "import info.collaboration_station.debug.ImplicitPrint" should allow the user to selectively import just trace, just assert, or just println.

JohnReedLOL commented 8 years ago

Make that three things if you include issue https://github.com/JohnReedLOL/scala-trace-debug/issues/2

MasseGuillaume commented 8 years ago

if you use % "name_2.11" it will fail at runtime if you are not using scala 2.11. If you use %% and scala 2.10, it will fail in sbt with a resolver failure.

JohnReedLOL commented 8 years ago

My bad. change accepted