From 34f3d10608d6f11deb90979066d69d31b7a8fe4f Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Thu, 6 Apr 2017 01:24:27 +0000 Subject: change IntelliJ plugin draft to follow now recommend plugin style --- stage2/plugins/IntelliJ.scala | 70 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 stage2/plugins/IntelliJ.scala (limited to 'stage2/plugins') diff --git a/stage2/plugins/IntelliJ.scala b/stage2/plugins/IntelliJ.scala new file mode 100644 index 0000000..c41ea51 --- /dev/null +++ b/stage2/plugins/IntelliJ.scala @@ -0,0 +1,70 @@ +package cbt + +import java.io.{ File, FileWriter } + +trait IntelliJ extends BaseBuild { + private // this plugin is not functional right now, needs fixing + def intellij = { + lib.writeIfChanged( + projectDirectory / name ++ ".iml", + IntelliJ.iml( + scalaVersion, + transitiveDependencies + ) + ) + } +} + +// TODO: +// - projects, their builds, their build builds, etc should be represented individually +// ideally with cbt's main sources being editable, but not the sources of other cbt versions +object IntelliJ { + def iml( + scalaVersion: String, + transitiveDependencies: Seq[Dependency] + ): String = { + """""" ++ "\n" ++ +// format: OFF + + + + + + + + + + + + + + + + + + + + + + + + + + + { + transitiveDependencies.flatMap( _.exportedClasspath.files ).map( _.string ).map { cp => + + + + + + + + + + } + } + +.buildString( stripComments = false ) // format: ON + } +} -- cgit v1.2.3