generalized cn automation to handle newer Scala/sbt versions