Skip to content

Commit

Permalink
Do not modify existing .idea/vcs.xml. Closes #31.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeltonen committed Nov 24, 2010
1 parent 59d04a6 commit bafb88f
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sbt-idea-core/src/main/scala/IdeaProjectDescriptor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,17 @@ class IdeaProjectDescriptor(val project: BasicDependencyProject, val log: Logger

if (projectPath.exists) {
val configDir = new File(projectPath, ".idea")
def configFile(name: String) = new File(configDir, name)
configDir.mkdirs

Seq(
"modules.xml" -> project(projectModuleManagerComponent),
"misc.xml" -> miscTransformer.transform(miscXml(configDir)).firstOption.get,
"vcs.xml" -> project(vcsComponent)
"misc.xml" -> miscTransformer.transform(miscXml(configDir)).firstOption.get
) foreach { case (fileName, xmlNode) => saveFile(configDir, fileName, xmlNode) }

val librariesDir = new File(configDir, "libraries")
if (!configFile("vcs.xml").exists) saveFile(configDir, "vcs.xml", project(vcsComponent))

val librariesDir = configFile("libraries")
librariesDir.mkdirs
saveFile(librariesDir, "buildScala.xml", libraryTableComponent("buildScala", buildScalaJarDir, true))
saveFile(librariesDir, "defScala.xml", libraryTableComponent("defScala", defScalaJarDir, false))
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
project.organization=foo
project.name=scripted-test
sbt.version=0.7.4
project.version=1.0
build.scala.versions=2.7.7
project.initialize=false
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import sbt._

class ScriptedTestProject(info: ProjectInfo) extends DefaultProject(info) with ScriptedTestAssertTasks with IdeaProject
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import sbt._

class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
val testedVersion = "0.2-SNAPSHOT"
val groupId = "com.github.mpeltonen"
val ideaPlugin = groupId % "sbt-idea-plugin" % testedVersion
val scriptedTestUtils = groupId % "sbt-idea-tests_2.7.7" % testedVersion
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> update
> idea
> assert-expected-xml-files

0 comments on commit bafb88f

Please sign in to comment.