diff --git a/project/build/Helpers.scala b/project/build/Helpers.scala index d833ad2b2..d647e93e7 100644 --- a/project/build/Helpers.scala +++ b/project/build/Helpers.scala @@ -1,13 +1,8 @@ import sbt._ -trait NoPublish extends ManagedBase +trait NoUpdate extends ManagedBase with EmptyTask { - override final def publishAction = task { None } - override final def deliverAction = publishAction -} -trait NoUpdate extends ManagedBase -{ - override final def updateAction = task { None } + override final def updateAction = emptyTask } trait NoCrossPaths extends Project { @@ -45,4 +40,18 @@ trait PrecompiledInterface extends BasicScalaProject with ManagedBase override def defaultMainArtifact = Artifact(binID) extra("e:component" -> bincID) def mkJarPath(id: String) = outputPath / (id + "-" + version.toString + ".jar") override def ivyXML: scala.xml.NodeSeq = // Remove when we build with 0.7.3, which does not unnecessarily add a default artifact -} \ No newline at end of file +} +trait EmptyTask extends Project { + def emptyTask = task {None} +} +trait NoRemotePublish extends BasicManagedProject with EmptyTask +{ + override def deliverAction = emptyTask + override def publishAction = emptyTask +} +trait NoLocalPublish extends BasicManagedProject with EmptyTask +{ + override def publishLocalAction = emptyTask + override def deliverLocalAction = emptyTask +} +trait NoPublish extends NoLocalPublish with NoRemotePublish \ No newline at end of file diff --git a/sbt/install/project/build/InstallExtractProject.scala b/project/build/InstallExtractProject.scala similarity index 98% rename from sbt/install/project/build/InstallExtractProject.scala rename to project/build/InstallExtractProject.scala index 255eff382..1c1c01bfa 100644 --- a/sbt/install/project/build/InstallExtractProject.scala +++ b/project/build/InstallExtractProject.scala @@ -5,6 +5,7 @@ import sbt._ import java.io.File +// TODO: use ProguardProject protected class InstallExtractProject(info: ProjectInfo, pluginProject: => InstallPluginProject) extends DefaultProject(info) with NoPublish { override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath @@ -17,7 +18,7 @@ protected class InstallExtractProject(info: ProjectInfo, pluginProject: => Insta def rootProjectDirectory = rootProject.info.projectPath def outputJar = (plugin.outputPath ##) / defaultJarName - /******** Proguard *******/ + /******** Proguard *******/ lazy val proguard = proguardTask dependsOn(`package`, writeProguardConfiguration, cleanProguard) lazy val writeProguardConfiguration = writeProguardConfigurationTask dependsOn `package` lazy val cleanProguard = cleanTask(outputJar) diff --git a/sbt/install/project/build/InstallPluginProject.scala b/project/build/InstallerProject.scala similarity index 60% rename from sbt/install/project/build/InstallPluginProject.scala rename to project/build/InstallerProject.scala index 36e0a7739..fb67c3f74 100644 --- a/sbt/install/project/build/InstallPluginProject.scala +++ b/project/build/InstallerProject.scala @@ -1,8 +1,16 @@ /* sbt -- Simple Build Tool - * Copyright 2009, 2010 Mark Harrah + * Copyright 2009 Mark Harrah */ - import sbt._ + +abstract class InstallerProject(info: ProjectInfo) extends ParentProject(info) with NoPublish +{ + /** Project for the sbt plugin that a project uses to generate the installer jar. */ + lazy val installPlugin: InstallPluginProject = project("plugin", "Installer Plugin", new InstallPluginProject(_, installExtractor), installExtractor) + /** Project for the code that runs when the generated installer jar is run. */ + lazy val installExtractor: InstallExtractProject = project("extract", "Installer Extractor", new InstallExtractProject(_, installPlugin)) +} + import java.nio.charset.Charset protected class InstallPluginProject(info: ProjectInfo, extract: => InstallExtractProject) extends PluginProject(info) diff --git a/project/build/XSbt.scala b/project/build/XSbt.scala index 2907f170d..8c5c78370 100644 --- a/project/build/XSbt.scala +++ b/project/build/XSbt.scala @@ -34,11 +34,13 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths val altCompilerSub = baseProject("main", "Alternate Compiler Test", stdTaskSub, logSub) - val sbtSub = project("sbt", "Simple Build Tool", new SbtProject(_) {}, compilerSub, launchInterfaceSub) + val sbtSub = project(sbtPath, "Simple Build Tool", new SbtProject(_) {}, compilerSub, launchInterfaceSub) + val installerSub = project(sbtPath / "install", "Installer", new InstallerProject(_) {}, sbtSub) def baseProject(path: Path, name: String, deps: Project*) = project(path, name, new Base(_), deps : _*) /* Multi-subproject paths */ + def sbtPath = path("sbt") def cachePath = path("cache") def tasksPath = path("tasks") def launchPath = path("launch") @@ -74,7 +76,7 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths // used to test the retrieving and loading of an application: sample app is packaged and published to the local repository lazy val testSamples = project("test-sample", "Launch Test", new TestSamples(_), interfaceSub, launchInterfaceSub) - class TestSamples(info: ProjectInfo) extends Base(info) with NoCrossPaths with NoPublish { + class TestSamples(info: ProjectInfo) extends Base(info) with NoCrossPaths with NoRemotePublish { override def deliverProjectDependencies = Nil } } diff --git a/sbt/install/project/build.properties b/sbt/install/project/build.properties index ebd6f7ff5..a5ef57355 100644 --- a/sbt/install/project/build.properties +++ b/sbt/install/project/build.properties @@ -1,6 +1 @@ -project.name=extract -project.organization=org.scala-tools.sbt -project.version=0.3.1-SNAPSHOT -sbt.version=0.7.1 -def.scala.version=2.7.7 -build.scala.versions=2.7.7 +project.version=0.3.1 diff --git a/sbt/install/project/build/InstallProject.scala b/sbt/install/project/build/InstallProject.scala deleted file mode 100644 index 701d5bfc7..000000000 --- a/sbt/install/project/build/InstallProject.scala +++ /dev/null @@ -1,20 +0,0 @@ -/* sbt -- Simple Build Tool - * Copyright 2009 Mark Harrah - */ -import sbt._ - -class InstallerProject(info: ProjectInfo) extends ParentProject(info) with NoPublish -{ - /** Project for the sbt plugin that a project uses to generate the installer jar. */ - lazy val installPlugin: InstallPluginProject = project("plugin", "Installer Plugin", new InstallPluginProject(_, installExtractor), installExtractor) - /** Project for the code that runs when the generated installer jar is run. */ - lazy val installExtractor: InstallExtractProject = project("extract", "Installer Extractor", new InstallExtractProject(_, installPlugin)) -} - -trait NoPublish extends BasicManagedProject -{ - override def publishLocalAction = publishAction - override def deliverAction = publishAction - override def deliverLocalAction = publishAction - override def publishAction = task {None} -} \ No newline at end of file