mirror of https://github.com/sbt/sbt.git
Moved installer plugin into main sbt build
This commit is contained in:
parent
84e23d6e61
commit
b5a95e11d5
|
|
@ -1,13 +1,8 @@
|
||||||
import sbt._
|
import sbt._
|
||||||
|
|
||||||
trait NoPublish extends ManagedBase
|
trait NoUpdate extends ManagedBase with EmptyTask
|
||||||
{
|
{
|
||||||
override final def publishAction = task { None }
|
override final def updateAction = emptyTask
|
||||||
override final def deliverAction = publishAction
|
|
||||||
}
|
|
||||||
trait NoUpdate extends ManagedBase
|
|
||||||
{
|
|
||||||
override final def updateAction = task { None }
|
|
||||||
}
|
}
|
||||||
trait NoCrossPaths extends Project
|
trait NoCrossPaths extends Project
|
||||||
{
|
{
|
||||||
|
|
@ -46,3 +41,17 @@ trait PrecompiledInterface extends BasicScalaProject with ManagedBase
|
||||||
def mkJarPath(id: String) = outputPath / (id + "-" + version.toString + ".jar")
|
def mkJarPath(id: String) = outputPath / (id + "-" + version.toString + ".jar")
|
||||||
override def ivyXML: scala.xml.NodeSeq = <publications/> // Remove when we build with 0.7.3, which does not unnecessarily add a default artifact
|
override def ivyXML: scala.xml.NodeSeq = <publications/> // Remove when we build with 0.7.3, which does not unnecessarily add a default artifact
|
||||||
}
|
}
|
||||||
|
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
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
import sbt._
|
import sbt._
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|
||||||
|
// TODO: use ProguardProject
|
||||||
protected class InstallExtractProject(info: ProjectInfo, pluginProject: => InstallPluginProject) extends DefaultProject(info) with NoPublish
|
protected class InstallExtractProject(info: ProjectInfo, pluginProject: => InstallPluginProject) extends DefaultProject(info) with NoPublish
|
||||||
{
|
{
|
||||||
override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath
|
override def unmanagedClasspath = super.unmanagedClasspath +++ info.sbtClasspath
|
||||||
|
|
@ -17,7 +18,7 @@ protected class InstallExtractProject(info: ProjectInfo, pluginProject: => Insta
|
||||||
def rootProjectDirectory = rootProject.info.projectPath
|
def rootProjectDirectory = rootProject.info.projectPath
|
||||||
def outputJar = (plugin.outputPath ##) / defaultJarName
|
def outputJar = (plugin.outputPath ##) / defaultJarName
|
||||||
|
|
||||||
/******** Proguard *******/
|
/******** Proguard *******/
|
||||||
lazy val proguard = proguardTask dependsOn(`package`, writeProguardConfiguration, cleanProguard)
|
lazy val proguard = proguardTask dependsOn(`package`, writeProguardConfiguration, cleanProguard)
|
||||||
lazy val writeProguardConfiguration = writeProguardConfigurationTask dependsOn `package`
|
lazy val writeProguardConfiguration = writeProguardConfigurationTask dependsOn `package`
|
||||||
lazy val cleanProguard = cleanTask(outputJar)
|
lazy val cleanProguard = cleanTask(outputJar)
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
/* sbt -- Simple Build Tool
|
/* sbt -- Simple Build Tool
|
||||||
* Copyright 2009, 2010 Mark Harrah
|
* Copyright 2009 Mark Harrah
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import sbt._
|
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
|
import java.nio.charset.Charset
|
||||||
|
|
||||||
protected class InstallPluginProject(info: ProjectInfo, extract: => InstallExtractProject) extends PluginProject(info)
|
protected class InstallPluginProject(info: ProjectInfo, extract: => InstallExtractProject) extends PluginProject(info)
|
||||||
|
|
@ -34,11 +34,13 @@ class XSbt(info: ProjectInfo) extends ParentProject(info) with NoCrossPaths
|
||||||
|
|
||||||
val altCompilerSub = baseProject("main", "Alternate Compiler Test", stdTaskSub, logSub)
|
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 : _*)
|
def baseProject(path: Path, name: String, deps: Project*) = project(path, name, new Base(_), deps : _*)
|
||||||
|
|
||||||
/* Multi-subproject paths */
|
/* Multi-subproject paths */
|
||||||
|
def sbtPath = path("sbt")
|
||||||
def cachePath = path("cache")
|
def cachePath = path("cache")
|
||||||
def tasksPath = path("tasks")
|
def tasksPath = path("tasks")
|
||||||
def launchPath = path("launch")
|
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
|
// 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)
|
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
|
override def deliverProjectDependencies = Nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1 @@
|
||||||
project.name=extract
|
project.version=0.3.1
|
||||||
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
|
|
||||||
|
|
|
||||||
|
|
@ -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}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue