/* sbt -- Simple Build Tool
 * Copyright 2009 Mark Harrah
 */
package sbt

import java.io.File
import scala.xml.{Elem, NodeSeq}
import Control._

/** Defines the configurable parameters for the webstart task. */
trait trait WebstartOptions extends java.lang.Object with NotNullWebstartOptions extends NotNullNotNull
{
	/** The main jar to use for webstart.*/
	def => sbt.PathwebstartMainJar: sbt.PathPath
	/** The location to put all generated files for webstart.*/
	def => sbt.PathwebstartOutputDirectory: sbt.PathPath
	/** Generates the .jnlp file using the provided resource descriptions.  Each resource description
	* provides the path of the jar relative to 'webstartOutputDirectory' and whether or not
	* it is the main jar.*/
	def (Seq[sbt.WebstartJarResource])scala.xml.ElemjnlpXML(Seq[sbt.WebstartJarResource]jars: Seq[sbt.WebstartJarResource]Seq[WebstartJarResource]): scala.xml.ElemElem
	/** The location to write the .jnlp file to.  It must be in 'webstartOutputDirectory'.*/
	def => sbt.PathjnlpFile: sbt.PathPath
	/** The location to put all jars that are not the main jar.  It must be in 'webstartOutputDirectory'.*/
	def => sbt.PathwebstartLibDirectory: sbt.PathPath
	/** The libraries needed for webstart.  Note that only jars are used; directories are discarded.*/
	def => sbt.PathFinderwebstartLibraries: sbt.PathFinderPathFinder
	/** Libraries external to the project needed for webstart.  This is mainly for scala libraries.*/
	def => Iterable[java.io.File]webstartExtraLibraries: Iterable[java.io.File]Iterable[File]
	/** Resources to copy to the webstart output directory.*/
	def => sbt.PathFinderwebstartResources: sbt.PathFinderPathFinder
	/** If defined, this specifies where to create a zip of the webstart output directory.  It cannot be
	* in the output directory.*/
	def => Option[sbt.Path]webstartZip: Option[sbt.Path]Option[Path]

	/** If defined, configures signing of jars.  All jars (main and libraries) are signed using
	* this configuration.*/
	def => Option[sbt.SignConfiguration]webstartSignConfiguration: Option[sbt.SignConfiguration]Option[SignConfiguration]
	/** If true, pack200 compression is applied to all jars (main and libraries).  A version of each jar
	* without pack200 compression is still created in the webstart output directory.*/
	def => BooleanwebstartPack200: BooleanBoolean
	/** If true, gzip compression will be applied to all jars.  If pack200 compression is enabled,
	* gzip compression is also applied to the archives with pack200 compression.  A version of
	* each file without gzip compression is still created in the webstart output directory. */
	def => BooleanwebstartGzip: BooleanBoolean
}
/** Represents a library included in the webstart distribution.  Name is the filename of the jar.
* href is the path of the jar relative to the webstart output directory.  isMain is true only for
* the main jar. */
final class class WebstartJarResource extends java.lang.Object with NotNull with ScalaObjectWebstartJarResource(val Stringname: StringString, val Stringhref: StringString, val BooleanisMain: BooleanBoolean) extends NotNullNotNull
/** Configuration for signing jars. */
final class class SignConfiguration extends java.lang.Object with NotNull with ScalaObjectSignConfiguration(val Stringalias: StringString, val Seq[sbt.SignJar.SignOption]options: Seq[sbt.SignJar.SignOption]Seq[SignJar.SignOption]) extends NotNullNotNull
/** A scala project that produces a webstart distribution. */
trait trait WebstartScalaProject extends java.lang.Object with sbt.ScalaProject with ScalaObjectWebstartScalaProject extends sbt.ScalaProjectScalaProject
{
	import WebstartScalaProject._
	/** Creates a task that produces a webstart distribution using the given options.*/
	def (sbt.WebstartOptions)WebstartScalaProject.this.TaskwebstartTask(sbt.WebstartOptionsoptions: sbt.WebstartOptionsWebstartOptions) =
		(=> Option[String])WebstartScalaProject.this.Tasktask
		{
			import options._
			object sbt.FileUtilitiesFileUtilities.(Seq[sbt.Path],sbt.Logger)Option[String]createDirectories(=> sbt.PathwebstartOutputDirectory (sbt.Path)List[sbt.Path]:: => sbt.PathwebstartLibDirectory (sbt.Path)List[sbt.Path]:: object NilNil, => sbt.Loggerlog) // ignore errors
			(sbt.WebstartOptions)UnitverifyOptions(sbt.WebstartOptionsoptions)
			
			def (sbt.Path)sbt.Pathrelativize(sbt.Pathjar: sbt.PathPath) = object sbt.PathPath.(sbt.Path,sbt.Path)Option[sbt.Path]relativize(=> sbt.PathwebstartOutputDirectory => sbt.Path##, sbt.Pathjar) (=> sbt.Path)sbt.PathgetOrElse
				(String)Nothingerror(java.lang.String("Jar (")"Jar (" (Any)java.lang.String+ sbt.Pathjar (Any)java.lang.String+ java.lang.String(") was not in webstart output directory (")") was not in webstart output directory (" (Any)java.lang.String+ => sbt.PathwebstartOutputDirectory (Any)java.lang.String+ java.lang.String(").")").")
			def (List[sbt.Path],sbt.Path)Either[String,List[sbt.Path]]signAndPack(List[sbt.Path]jars: List[sbt.Path]List[Path], sbt.PathtargetDirectory: sbt.PathPath): Either[String,List[sbt.Path]]Either[String, List[Path]] =
			{
				(List[sbt.Path],List[sbt.Path])((List[sbt.Path], sbt.Path) => Either[String,List[sbt.Path]])Either[String,List[sbt.Path]]lazyFold(List[sbt.Path]jars, object NilNil: List[sbt.Path]List[Path])
				{ (List[sbt.Path]allJars, sbt.Pathjar) =>
					val <refinement> extends Either[String,sbt.Jars] with ProductsignPackResult =
						=> Option[sbt.SignConfiguration]webstartSignConfiguration <refinement> extends Either[String,sbt.Jars] with Productmatch
						{
							<refinement> extends Either[String,sbt.Jars] with Productcase Some(sbt.SignConfigurationconfig) =>
								<refinement> extends Either[String,sbt.Jars] with Productif(=> BooleanwebstartPack200)
									(sbt.Path,sbt.SignConfiguration,sbt.Path,sbt.Logger)Either[String,sbt.Jars] with ProductsignAndPack200(sbt.Pathjar, sbt.SignConfigurationconfig, sbt.PathtargetDirectory, => sbt.Loggerlog)
								else
									(sbt.Path,sbt.SignConfiguration,sbt.Path,sbt.Logger)Either[String,sbt.Jars] with ProductsignOnly(sbt.Pathjar, sbt.SignConfigurationconfig, sbt.PathtargetDirectory, => sbt.Loggerlog)
							<refinement> extends Either[String,sbt.Jars] with Productcase object NoneNone =>
								<refinement> extends Either[String,sbt.Jars] with Productif(=> BooleanwebstartPack200)
									(sbt.Path,sbt.Path,sbt.Logger)Either[String,sbt.Jars] with Productpack200Only(sbt.Pathjar, sbt.PathtargetDirectory, => sbt.Loggerlog)
								else
									(sbt.Path,sbt.Path,sbt.Logger)Either[String,List[sbt.Path]] with ProductcopyJar(sbt.Pathjar, sbt.PathtargetDirectory, => sbt.Loggerlog).=> Either.RightProjection[String,List[sbt.Path]]right.((List[sbt.Path]) => sbt.Jars)Either[String,sbt.Jars] with Productmap(List[sbt.Path]jars => sbt.Jarsnew sbt.JarsJars(List[sbt.Path]jars, object NilNil))
						}
					val BooleandeleteOriginal = => BooleanwebstartPack200
					<refinement> extends Either[String,sbt.Jars] with ProductsignPackResult.=> Either.RightProjection[String,sbt.Jars]right ((sbt.Jars) => Either[String,List[sbt.Path]])Either[String,List[sbt.Path]]flatMap { sbt.JarsaddJars =>
						Either[String,List[sbt.Path]]if(=> BooleanwebstartGzip)
							object sbt.ControlControl.(List[sbt.Path],List[sbt.Path])((List[sbt.Path], sbt.Path) => Either[String,List[sbt.Path]])Either[String,List[sbt.Path]]lazyFold(sbt.JarsaddJars.=> List[sbt.Path]gzippable, sbt.JarsaddJars.=> List[sbt.Path]allJars (List[sbt.Path])List[sbt.Path]::: List[sbt.Path]allJars)
								{ (List[sbt.Path]accumulate, sbt.Pathjar) => (sbt.Path,Boolean,sbt.Logger)Either[String,List[sbt.Path]] with ProductgzipJar(sbt.Pathjar, BooleandeleteOriginal, => sbt.Loggerlog).=> Either.RightProjection[String,List[sbt.Path]]right.((List[sbt.Path]) => List[sbt.Path])Either[String,List[sbt.Path]] with Productmap(List[sbt.Path]_ (List[sbt.Path])List[sbt.Path]::: List[sbt.Path]accumulate) }
						else
							(List[sbt.Path])Right[Nothing,List[sbt.Path]]Right(sbt.JarsaddJars.=> List[sbt.Path]allJars (List[sbt.Path])List[sbt.Path]::: List[sbt.Path]allJars)
					}
				}
			}
		
			import FileUtilities._
			
			def (java.io.File)sbt.PathfileToPath(java.io.Filefile: java.io.FileFile): sbt.PathPath = sbt.ProjectDirectorynew sbt.ProjectDirectoryProjectDirectory(java.io.Filefile) // hack, don't do this normally
			val Iterable[sbt.Path]jars = (=> sbt.PathFinderwebstartLibraries.=> scala.collection.Set[sbt.Path]get (Iterable[sbt.Path])Collection[sbt.Path]++ => Iterable[java.io.File]webstartExtraLibraries.((java.io.File) => sbt.Path)Iterable[sbt.Path]map((java.io.File)sbt.PathfileToPath)).((sbt.Path) => Boolean)Iterable[sbt.Path]filter(object sbt.ClasspathUtilitiesClasspathUtilities.(sbt.Path)BooleanisArchive)
			def (Iterable[sbt.Path])Iterable[sbt.Path]process(Iterable[sbt.Path]jars: Iterable[sbt.Path]Iterable[Path]) = for(((sbt.Path) => sbt.Path)Iterable[sbt.Path]jar <- Iterable[sbt.Path]jars if sbt.Pathjar.=> java.io.FileasFile.()java.lang.StringgetName.(java.lang.String)BooleanendsWith(java.lang.String(".jar")".jar")) yield (sbt.Path)sbt.Pathrelativize(sbt.Pathjar)
			
			(Either[String,List[sbt.Path]])((List[sbt.Path]) => Option[String])Option[String]thread((List[sbt.Path],sbt.Path)Either[String,List[sbt.Path]]signAndPack(=> sbt.PathwebstartMainJar (sbt.Path)List[sbt.Path]:: object NilNil, => sbt.PathwebstartOutputDirectory)) { List[sbt.Path]mainJars =>
				(Either[String,List[sbt.Path]])((List[sbt.Path]) => Option[String])Option[String]thread((List[sbt.Path],sbt.Path)Either[String,List[sbt.Path]]signAndPack(Iterable[sbt.Path]jars.=> List[sbt.Path]toList, => sbt.PathwebstartLibDirectory)) { List[sbt.Path]libJars =>
					(scala.xml.Elem,sbt.Path,sbt.Logger)Option[String]writeXML((Seq[sbt.WebstartJarResource])scala.xml.ElemjnlpXML((Iterable[sbt.Path],Iterable[sbt.Path])Seq[sbt.WebstartJarResource]jarResources((Iterable[sbt.Path])Iterable[sbt.Path]process(List[sbt.Path]mainJars), (Iterable[sbt.Path])Iterable[sbt.Path]process(List[sbt.Path]libJars))), => sbt.PathjnlpFile, => sbt.Loggerlog) (=> Option[String])Option[String]orElse
					(Either[String,scala.collection.Set[sbt.Path]])((scala.collection.Set[sbt.Path]) => Option[String])Option[String]thread((Iterable[sbt.Path],sbt.Path,sbt.Logger)Either[String,scala.collection.Set[sbt.Path]] with Productcopy(=> sbt.PathFinderwebstartResources.=> scala.collection.Set[sbt.Path]get, => sbt.PathwebstartOutputDirectory, => sbt.Loggerlog)) { scala.collection.Set[sbt.Path]copiedResources =>
						val sbt.PathFinderkeep = => sbt.PathjnlpFile (sbt.PathFinder)sbt.PathFinder+++ object sbt.PathPath.(=> Iterable[sbt.Path])sbt.PathFinderlazyPathFinder(List[sbt.Path]mainJars (Iterable[sbt.Path])List[sbt.Path]++ List[sbt.Path]libJars (Iterable[sbt.Path])List[sbt.Path]++ scala.collection.Set[sbt.Path]copiedResources) (sbt.PathFinder)sbt.PathFinder+++
							=> sbt.PathwebstartOutputDirectory (sbt.PathFinder)sbt.PathFinder+++ => sbt.PathwebstartLibDirectory
						(sbt.Path,Iterable[sbt.Path],sbt.Logger)Option[String]prune(=> sbt.PathwebstartOutputDirectory, sbt.PathFinderkeep.=> scala.collection.Set[sbt.Path]get, => sbt.Loggerlog) (=> Option[String])Option[String]orElse
						=> Option[sbt.Path]webstartZip.((sbt.Path) => Option[String])Option[String]flatMap( sbt.PathzipPath => (Iterable[sbt.Path],sbt.Path,Boolean,sbt.Logger)Option[String]zip((sbt.Path*)List[sbt.Path]List(=> sbt.PathwebstartOutputDirectory => sbt.Path##), sbt.PathzipPath, Boolean(true)true, => sbt.Loggerlog) )
					}
				}
			}
		}
	/** Creates default XML elements for a JNLP file for the given resources.*/
	protected def (Seq[sbt.WebstartJarResource])scala.xml.NodeSeqdefaultElements(Seq[sbt.WebstartJarResource]resources: Seq[sbt.WebstartJarResource]Seq[WebstartJarResource]): scala.xml.NodeSeqNodeSeq = Seq[sbt.WebstartJarResource]resources.implicit scala.xml.NodeSeq.view : (Seq[scala.xml.Node])scala.xml.NodeSeqmap((sbt.WebstartJarResource)scala.xml.ElemdefaultElement)
	/** Creates a default XML element for a JNLP file for the given resource.*/
	protected def (sbt.WebstartJarResource)scala.xml.ElemdefaultElement(sbt.WebstartJarResourceresource: sbt.WebstartJarResourceWebstartJarResource): scala.xml.ElemElem =
		<jar href={sbt.WebstartJarResourceresource.=> Stringhref} main={sbt.WebstartJarResourceresource.=> BooleanisMain.()java.lang.StringtoString}/>
		
}
private class class Jars extends java.lang.Object with NotNull with ScalaObjectJars(val List[sbt.Path]gzippable: List[sbt.Path]List[Path], val List[sbt.Path]nonGzippable: List[sbt.Path]List[Path]) extends NotNullNotNull
{
	def => List[sbt.Path]allJars = => List[sbt.Path]gzippable (List[sbt.Path])List[sbt.Path]::: => List[sbt.Path]nonGzippable
}
private object object sbt.WebstartScalaProjectWebstartScalaProject
{
	import FileTasks.{runOption, wrapProduct, wrapProducts}
	/** Changes the extension of the Path of the given jar from ".jar" to newExtension.  If append is true,
	* the new extension is simply appended to the jar's filename. */
	private def (sbt.Path,String)sbt.PathappendExtension(sbt.Pathjar: sbt.PathPath, StringnewExtension: StringString) =
		sbt.Pathjar sbt.Pathmatch
		{
			sbt.Pathcase sbt.RelativePathrp: sbt.RelativePathRelativePath => sbt.RelativePathrp.=> sbt.PathparentPath (String)sbt.Path/ (sbt.RelativePathrp.=> Stringcomponent (Any)java.lang.String+ StringnewExtension)
			sbt.Pathcase sbt.Pathx => sbt.Pathx
		}
	private def (sbt.Path)sbt.PathgzipJarPath(sbt.Pathjar: sbt.PathPath) = (sbt.Path,String)sbt.PathappendExtension(sbt.Pathjar, java.lang.String(".gz")".gz")
	private def (sbt.Path)sbt.PathpackPath(sbt.Pathjar: sbt.PathPath) = (sbt.Path,String)sbt.PathappendExtension(sbt.Pathjar, java.lang.String(".pack")".pack")
	private def (sbt.Path,sbt.SignConfiguration,sbt.Path,sbt.Logger)Either[String,sbt.Jars] with ProductsignOnly(sbt.Pathjar: sbt.PathPath, sbt.SignConfigurationsignConfiguration: sbt.SignConfigurationSignConfiguration, sbt.PathtargetDirectory: sbt.PathPath, sbt.Loggerlog: sbt.LoggerLogger) =
	{
		val sbt.PathtargetJar = sbt.PathtargetDirectory (String)sbt.Path/ sbt.Pathjar.=> java.io.FileasFile.()java.lang.StringgetName
		(String,sbt.ProductsSources,sbt.Logger)(=> Option[String])Option[String]runOption(java.lang.String("sign")"sign", implicit sbt.FileTasks.wrapProduct : (=> sbt.Path)sbt.ProductsWrappertargetJar (sbt.PathFinder)sbt.ProductsSourcesfrom sbt.Pathjar, sbt.Loggerlog) {
			sbt.Loggerlog.(=> String)Unitdebug(java.lang.String("Signing ")"Signing " (Any)java.lang.String+ sbt.Pathjar)
			(sbt.Path,sbt.SignConfiguration,sbt.Path,sbt.Logger)Option[String]signAndVerify(sbt.Pathjar, sbt.SignConfigurationsignConfiguration, sbt.PathtargetJar, sbt.Loggerlog)
		}.(=> sbt.Jars)Either[String,sbt.Jars] with ProducttoLeft(sbt.Jarsnew sbt.JarsJars(sbt.PathtargetJar (sbt.Path)List[sbt.Path]:: object NilNil, object NilNil))
	}
	private def (sbt.Path,sbt.SignConfiguration,sbt.Path,sbt.Logger)Option[String]signAndVerify(sbt.Pathjar: sbt.PathPath, sbt.SignConfigurationsignConfiguration: sbt.SignConfigurationSignConfiguration, sbt.PathtargetJar: sbt.PathPath, sbt.Loggerlog: sbt.LoggerLogger) =
	{
		import SignJar._
		(sbt.Path,String,Seq[sbt.SignJar.SignOption],sbt.Logger)Option[String]sign(sbt.Pathjar, sbt.SignConfigurationsignConfiguration.=> Stringalias, (sbt.Path)sbt.SignJar.SignOptionsignedJar(sbt.PathtargetJar) (sbt.SignJar.SignOption)List[sbt.SignJar.SignOption]:: sbt.SignConfigurationsignConfiguration.=> Seq[sbt.SignJar.SignOption]options.=> List[sbt.SignJar.SignOption]toList, sbt.Loggerlog) (=> Option[String])Option[String]orElse
			(sbt.Path,Seq[sbt.SignJar.SignOption],sbt.Logger)Option[String]verify(sbt.Pathjar, sbt.SignConfigurationsignConfiguration.=> Seq[sbt.SignJar.SignOption]options, sbt.Loggerlog).((String) => java.lang.String)Option[java.lang.String]map(Stringerr => java.lang.String("Signed jar failed verification: ")"Signed jar failed verification: " (Any)java.lang.String+ Stringerr)
	}
	private def (sbt.Path,Boolean,sbt.Logger)Either[String,List[sbt.Path]] with ProductgzipJar(sbt.Pathjar: sbt.PathPath, BooleandeleteOriginal: BooleanBoolean, sbt.Loggerlog: sbt.LoggerLogger) =
	{
		val sbt.PathgzipJar = (sbt.Path)sbt.PathgzipJarPath(sbt.Pathjar)
		(String,sbt.ProductsSources,sbt.Logger)(=> Option[String])Option[String]runOption(java.lang.String("gzip")"gzip", implicit sbt.FileTasks.wrapProduct : (=> sbt.Path)sbt.ProductsWrappergzipJar (sbt.PathFinder)sbt.ProductsSourcesfrom sbt.Pathjar, sbt.Loggerlog)
		{
			sbt.Loggerlog.(=> String)Unitdebug(java.lang.String("Gzipping ")"Gzipping " (Any)java.lang.String+ sbt.Pathjar)
			object sbt.FileUtilitiesFileUtilities.(sbt.Path,sbt.Path,sbt.Logger)Option[String]gzip(sbt.Pathjar, sbt.PathgzipJar, sbt.Loggerlog) (=> Option[String])Option[String]orElse
				(Option[String]if(BooleandeleteOriginal) object sbt.FileUtilitiesFileUtilities.(Iterable[sbt.Path],Boolean,sbt.Logger)Option[String]clean(sbt.Pathjar (sbt.Path)List[sbt.Path]:: object NilNil, Boolean(true)true, sbt.Loggerlog) else object NoneNone)
		}.(=> List[sbt.Path])Either[String,List[sbt.Path]] with ProducttoLeft(sbt.PathgzipJar (sbt.Path)List[sbt.Path]:: object NilNil)
	}
	/** Properly performs both signing and pack200 compression and verifies the result.  This method only does anything if
	* its outputs are out of date with respect to 'jar'.  Note that it does not determine if the signing configuration has changed.
	* See java.util.jar.Pack200 for more information.*/
	private def (sbt.Path,sbt.SignConfiguration,sbt.Path,sbt.Logger)Either[String,sbt.Jars] with ProductsignAndPack200(sbt.Pathjar: sbt.PathPath, sbt.SignConfigurationsignConfiguration: sbt.SignConfigurationSignConfiguration, sbt.PathtargetDirectory: sbt.PathPath, sbt.Loggerlog: sbt.LoggerLogger) =
	{
		val sbt.PathsignedJar = sbt.PathtargetDirectory (String)sbt.Path/ sbt.Pathjar.=> java.io.FileasFile.()java.lang.StringgetName
		val sbt.PathpackedJar = (sbt.Path)sbt.PathpackPath(sbt.PathsignedJar)
		import signConfiguration._
		
		(String,sbt.ProductsSources,sbt.Logger)(=> Option[String])Option[String]runOption(java.lang.String("sign and pack200")"sign and pack200", implicit sbt.FileTasks.wrapProducts : (=> Iterable[sbt.Path])sbt.ProductsWrapperList(sbt.PathpackedJar, sbt.PathsignedJar) (sbt.PathFinder)sbt.ProductsSourcesfrom sbt.Pathjar, sbt.Loggerlog) {
			sbt.Loggerlog.(=> String)Unitdebug(java.lang.String("Applying pack200 compression and signing ")"Applying pack200 compression and signing " (Any)java.lang.String+ sbt.Pathjar)
			(sbt.Path,sbt.Path,sbt.Path,String,Seq[sbt.SignJar.SignOption],sbt.Logger)Option[String]signAndPack(sbt.Pathjar, sbt.PathsignedJar, sbt.PathpackedJar, => Stringalias, => Seq[sbt.SignJar.SignOption]options, sbt.Loggerlog) (=> Option[String])Option[String]orElse
			(sbt.Path,sbt.SignConfiguration,sbt.Path,sbt.Logger)Option[String]signAndVerify(sbt.Pathjar, sbt.SignConfigurationsignConfiguration, sbt.PathsignedJar, sbt.Loggerlog)
		}.(=> sbt.Jars)Either[String,sbt.Jars] with ProducttoLeft(sbt.Jarsnew sbt.JarsJars(sbt.PathpackedJar (sbt.Path)List[sbt.Path]:: object NilNil, sbt.PathsignedJar (sbt.Path)List[sbt.Path]:: object NilNil))
	}
	/** Properly performs both signing and pack200 compression and verifies the result.  See java.util.jar.Pack200 for more information.*/
	private def (sbt.Path,sbt.Path,sbt.Path,String,Seq[sbt.SignJar.SignOption],sbt.Logger)Option[String]signAndPack(sbt.PathjarPath: sbt.PathPath, sbt.PathsignedPath: sbt.PathPath, sbt.Pathout: sbt.PathPath, Stringalias: StringString, Seq[sbt.SignJar.SignOption]options: Seq[sbt.SignJar.SignOption]Seq[SignJar.SignOption], sbt.Loggerlog: sbt.LoggerLogger): Option[String]Option[String] =
	{
		import Pack._
		import SignJar._
		(sbt.Path,sbt.Path,sbt.Logger)Option[String]pack(sbt.PathjarPath, sbt.Pathout, sbt.Loggerlog) (=> Option[String])Option[String]orElse
		(sbt.Path,sbt.Path,sbt.Logger)Option[String]unpack(sbt.Pathout, sbt.PathsignedPath, sbt.Loggerlog) (=> Option[String])Option[String]orElse
		(sbt.Path,String,Seq[sbt.SignJar.SignOption],sbt.Logger)Option[String]sign(sbt.PathsignedPath, Stringalias, Seq[sbt.SignJar.SignOption]options, sbt.Loggerlog) (=> Option[String])Option[String]orElse
		(sbt.Path,sbt.Path,sbt.Logger)Option[String]pack(sbt.PathsignedPath, sbt.Pathout, sbt.Loggerlog) (=> Option[String])Option[String]orElse
		(sbt.Path,sbt.Path,sbt.Logger)Option[String]unpack(sbt.Pathout, sbt.PathsignedPath, sbt.Loggerlog) (=> Option[String])Option[String]orElse
		(sbt.Path,Seq[sbt.SignJar.SignOption],sbt.Logger)Option[String]verify(sbt.PathsignedPath, Seq[sbt.SignJar.SignOption]options, sbt.Loggerlog)
	}
	private def (sbt.Path,sbt.Path,sbt.Logger)Either[String,sbt.Jars] with Productpack200Only(sbt.Pathjar: sbt.PathPath, sbt.PathtargetDirectory: sbt.PathPath, sbt.Loggerlog: sbt.LoggerLogger) =
	{
		val sbt.PathtargetJar = sbt.PathtargetDirectory (String)sbt.Path/ sbt.Pathjar.=> java.io.FileasFile.()java.lang.StringgetName
		val sbt.PathpackedJar = (sbt.Path)sbt.PathpackPath(sbt.PathtargetJar)
		val Option[String]packResult =
			(String,sbt.ProductsSources,sbt.Logger)(=> Option[String])Option[String]runOption(java.lang.String("pack200")"pack200", implicit sbt.FileTasks.wrapProduct : (=> sbt.Path)sbt.ProductsWrapperpackedJar (sbt.PathFinder)sbt.ProductsSourcesfrom sbt.Pathjar, sbt.Loggerlog)
			{
				sbt.Loggerlog.(=> String)Unitdebug(java.lang.String("Applying pack200 compression to ")"Applying pack200 compression to " (Any)java.lang.String+ sbt.Pathjar)
				object sbt.PackPack.(sbt.Path,sbt.Path,sbt.Logger)Option[String]pack(sbt.Pathjar, sbt.PathpackedJar, sbt.Loggerlog)
			}
		Option[String]packResult <refinement> extends Either[String,sbt.Jars] with Productmatch
		{
			Left[String,Nothing]case Some(Stringerr) => (String)Left[String,Nothing]Left(Stringerr)
			<refinement> extends Either[String,sbt.Jars] with Productcase object NoneNone => (sbt.Path,sbt.Path,sbt.Logger)Either[String,List[sbt.Path]] with ProductcopyJar(sbt.Pathjar, sbt.PathtargetDirectory, sbt.Loggerlog).=> Either.RightProjection[String,List[sbt.Path]]right.((List[sbt.Path]) => sbt.Jars)Either[String,sbt.Jars] with Productmap(List[sbt.Path]jars => sbt.Jarsnew sbt.JarsJars(sbt.PathpackedJar (sbt.Path)List[sbt.Path]:: object NilNil, List[sbt.Path]jars))
		}
	}
	private def (sbt.Path,sbt.Path,sbt.Logger)Either[String,List[sbt.Path]] with ProductcopyJar(sbt.Pathjar: sbt.PathPath, sbt.PathtargetDirectory: sbt.PathPath, sbt.Loggerlog: sbt.LoggerLogger) =
	{
		val sbt.PathtargetJar = sbt.PathtargetDirectory (String)sbt.Path/ sbt.Pathjar.=> java.io.FileasFile.()java.lang.StringgetName
		(String,sbt.ProductsSources,sbt.Logger)(=> Option[String])Option[String]runOption(java.lang.String("copy jar")"copy jar", implicit sbt.FileTasks.wrapProduct : (=> sbt.Path)sbt.ProductsWrappertargetJar (sbt.PathFinder)sbt.ProductsSourcesfrom sbt.Pathjar, sbt.Loggerlog)( object sbt.FileUtilitiesFileUtilities.(sbt.Path,sbt.Path,sbt.Logger)Option[String]copyFile(sbt.Pathjar, sbt.PathtargetJar, sbt.Loggerlog) ).(=> List[sbt.Path])Either[String,List[sbt.Path]] with ProducttoLeft(sbt.PathtargetJar (sbt.Path)List[sbt.Path]:: object NilNil)
	}
	/** Writes the XML string 'xmlString' to the file 'outputPath'.*/
	private def (String,sbt.Path,sbt.Logger)Option[String]writeXML(StringxmlString: StringString, sbt.PathoutputPath: sbt.PathPath, sbt.Loggerlog: sbt.LoggerLogger): Option[String]Option[String] =
		object sbt.FileUtilitiesFileUtilities.(java.io.File,String,sbt.Logger)Option[String]write(sbt.PathoutputPath.=> java.io.FileasFile, StringxmlString, sbt.Loggerlog)
	/** Writes the XML string 'xmlString' to the file 'outputPath' if the hashes are different.*/
	private def (scala.xml.Elem,sbt.Path,sbt.Logger)Option[String]writeXML(scala.xml.Elemxml: scala.xml.ElemElem, sbt.PathoutputPath: sbt.PathPath, sbt.Loggerlog: sbt.LoggerLogger): Option[String]Option[String] =
	{
		val StringxmlString = scala.xml.object scala.xml.UtilityUtility.(scala.xml.Node,Boolean)StringtoXML(scala.xml.Elemxml, Boolean(false)false)
		Option[String]if(=> Boolean!sbt.PathoutputPath.=> Booleanexists)
		{
			sbt.Loggerlog.(=> String)Unitdebug(java.lang.String("JNLP file did not exist, writing inline XML to ")"JNLP file did not exist, writing inline XML to " (Any)java.lang.String+ sbt.PathoutputPath)
			(String,sbt.Path,sbt.Logger)Option[String]writeXML(StringxmlString, sbt.PathoutputPath, sbt.Loggerlog)
		}
		else
		{
			val Either[String,Option[String]]result =
				for( ((Array[Byte]) => Either[String,Option[String]])Either[String,Option[String]]xmlHash <- (String,sbt.Logger)Either[String,Array[Byte]]Hash(StringxmlString, sbt.Loggerlog).=> Either.RightProjection[String,Array[Byte]]right; ((Array[Byte]) => Option[String])Either[String,Option[String]] with ProductfileHash <- (sbt.Path,sbt.Logger)Either[String,Array[Byte]]Hash(sbt.PathoutputPath, sbt.Loggerlog).=> Either.RightProjection[String,Array[Byte]]right ) yield
				{
					Option[String]if(Array[Byte]xmlHash (Any)BooleandeepEquals Array[Byte]fileHash)
					{
						sbt.Loggerlog.(=> String)Unitdebug(java.lang.String("JNLP file ")"JNLP file " (Any)java.lang.String+ sbt.PathoutputPath (Any)java.lang.String+ java.lang.String(" uptodate.")" uptodate.")
						object NoneNone
					}
					else
					{
						sbt.Loggerlog.(=> String)Unitdebug(java.lang.String("Inline JNLP XML modified, updating file ")"Inline JNLP XML modified, updating file " (Any)java.lang.String+ sbt.PathoutputPath (Any)java.lang.String+ java.lang.String(".")".")
						(String,sbt.Path,sbt.Logger)Option[String]writeXML(StringxmlString, sbt.PathoutputPath, sbt.Loggerlog)
					}
				}
			Either[String,Option[String]]result.((String) => Option[String],(Option[String]) => Option[String])Option[String]fold(Stringerr => (String)Some[String]Some(Stringerr), Option[String]x => Option[String]x)
		}
	}
	private def (Boolean)(sbt.Path)sbt.WebstartJarResourcejarResource(BooleanisMain: BooleanBoolean)(sbt.Pathjar: sbt.PathPath): sbt.WebstartJarResourceWebstartJarResource =
		sbt.WebstartJarResourcenew sbt.WebstartJarResourceWebstartJarResource(sbt.Pathjar.=> java.io.FileasFile.()java.lang.StringgetName, sbt.Pathjar.=> StringrelativePath, BooleanisMain)
	private def (Iterable[sbt.Path],Iterable[sbt.Path])Seq[sbt.WebstartJarResource]jarResources(Iterable[sbt.Path]mainJars: Iterable[sbt.Path]Iterable[Path], Iterable[sbt.Path]libraries: Iterable[sbt.Path]Iterable[Path]): Seq[sbt.WebstartJarResource]Seq[WebstartJarResource] =
		Iterable[sbt.Path]mainJars.((sbt.Path) => sbt.WebstartJarResource)Iterable[sbt.WebstartJarResource]map((Boolean)(sbt.Path)sbt.WebstartJarResourcejarResource(Boolean(true)true)).=> List[sbt.WebstartJarResource]toList (List[sbt.WebstartJarResource])List[sbt.WebstartJarResource]::: Iterable[sbt.Path]libraries.((sbt.Path) => sbt.WebstartJarResource)Iterable[sbt.WebstartJarResource]map((Boolean)(sbt.Path)sbt.WebstartJarResourcejarResource(Boolean(false)false)).=> List[sbt.WebstartJarResource]toList
	
	/** True iff 'directory' is an ancestor (strictly) of 'check'.*/
	private def (sbt.Path,sbt.Path)BooleanisInDirectory(sbt.Pathdirectory: sbt.PathPath, sbt.Pathcheck: sbt.PathPath) = object sbt.PathPath.(sbt.Path,sbt.Path)Option[sbt.Path]relativize(sbt.Pathdirectory, sbt.Pathcheck).=> BooleanisDefined (Boolean)Boolean&& sbt.Pathdirectory (AnyRef)Boolean!= sbt.Pathcheck
	/** Checks the paths in the given options for validity.  See the documentation for WebstartOptions.*/
	private def (sbt.WebstartOptions)UnitverifyOptions(sbt.WebstartOptionsoptions: sbt.WebstartOptionsWebstartOptions)
	{
		import options._
		(Boolean,=> Any)Unitrequire((sbt.Path,sbt.Path)BooleanisInDirectory(=> sbt.PathwebstartOutputDirectory, => sbt.PathwebstartLibDirectory), 
			java.lang.String("Webstart dependency directory (")"Webstart dependency directory (" (Any)java.lang.String+ => sbt.PathwebstartLibDirectory (Any)java.lang.String+ java.lang.String(") must be a subdirectory of webstart output directory (")") must be a subdirectory of webstart output directory (" (Any)java.lang.String+
				=> sbt.PathwebstartOutputDirectory (Any)java.lang.String+ java.lang.String(").")").")
		(Boolean,=> Any)Unitrequire((sbt.Path,sbt.Path)BooleanisInDirectory(=> sbt.PathwebstartOutputDirectory, => sbt.PathjnlpFile), java.lang.String("Webstart JNLP file output location (")"Webstart JNLP file output location (" (Any)java.lang.String+ => sbt.PathjnlpFile (Any)java.lang.String+
			java.lang.String(") must be in the webstart output directory (")") must be in the webstart output directory (" (Any)java.lang.String+ => sbt.PathwebstartOutputDirectory (Any)java.lang.String+ java.lang.String(").")").")
		for(((sbt.Path) => Unit)Unitwz <- => Option[sbt.Path]webstartZip)
			(Boolean,=> Any)Unitrequire(=> Boolean!(sbt.Path,sbt.Path)BooleanisInDirectory(=> sbt.PathwebstartOutputDirectory, sbt.Pathwz),
				java.lang.String("Webstart output zip location (")"Webstart output zip location (" (Any)java.lang.String+ sbt.Pathwz (Any)java.lang.String+ java.lang.String(" cannot be in webstart output directory (")" cannot be in webstart output directory (" (Any)java.lang.String+ => sbt.PathwebstartOutputDirectory (Any)java.lang.String+ java.lang.String(").")").")
	}
}
/** The default extension point for a webstart project.  There is one method that is required to be defined: jnlpXML.
* 'webstartSignConfiguration', 'webstartPack200', and 'webstartGzip' are methods of interest. */
abstract class class DefaultWebstartProject extends sbt.BasicWebstartProject with ScalaObjectDefaultWebstartProject(val sbt.ProjectInfoinfo: sbt.ProjectInfoProjectInfo) extends sbt.BasicWebstartProjectBasicWebstartProject
/** Defines default implementations of all methods in WebstartOptions except for jnlpXML.  packageAction is overridden
* to create a webstart distribution after the normal package operation. */
abstract class class BasicWebstartProject extends sbt.BasicScalaProject with sbt.WebstartScalaProject with sbt.WebstartPaths with ScalaObjectBasicWebstartProject extends sbt.BasicScalaProjectBasicScalaProject with sbt.WebstartScalaProjectWebstartScalaProject with sbt.WebstartPathsWebstartPaths
{
	def => Option[sbt.SignConfiguration]webstartSignConfiguration: Option[sbt.SignConfiguration]Option[SignConfiguration] = object NoneNone
	
	def => Iterable[java.io.File]webstartExtraLibraries = => Iterable[java.io.File]scalaJars
	def => sbt.PathFinderwebstartLibraries = => sbt.PathFinderrunClasspath (sbt.PathFinder)sbt.PathFinder+++ => sbt.PathFinderjarsOfProjectDependencies
	def => sbt.PathFinderwebstartResources = (sbt.PathFinder,sbt.FileFilter)sbt.PathFinderdescendents(=> sbt.PathjnlpResourcesPath => sbt.Path##, object sbt.AllPassFilterAllPassFilter)

	def => BooleanwebstartPack200 = Boolean(true)true
	def => BooleanwebstartGzip = Boolean(true)true
	
	override def => BasicWebstartProject.this.TaskpackageAction = super.=> BasicWebstartProject.this.TaskpackageAction (BasicWebstartProject.this.Task)BasicWebstartProject.this.Task&& (sbt.WebstartOptions)BasicWebstartProject.this.TaskwebstartTask(sbt.BasicWebstartProjectthis)
}
/** Defines default paths for a webstart project.  It directly extends WebstartOptions to make
* it easy to implement and override webstart options in the common case of one webstartTask per
* project.*/
trait trait WebstartPaths extends java.lang.Object with sbt.BasicProjectPaths with sbt.WebstartOptions with ScalaObjectWebstartPaths extends sbt.BasicProjectPathsBasicProjectPaths with sbt.WebstartOptionsWebstartOptions
{
	def => sbt.PathwebstartOutputDirectory = => sbt.PathoutputPath (String)sbt.Path/ => java.lang.StringwebstartDirectoryName
	def => sbt.PathwebstartMainJar = => sbt.PathoutputPath (String)sbt.Path/ => java.lang.StringdefaultJarName
	
	def => sbt.PathwebstartLibDirectory = => sbt.PathwebstartOutputDirectory (String)sbt.Path/ => java.lang.StringwebstartLibName
	def => sbt.PathjnlpFile = => sbt.PathwebstartOutputDirectory (String)sbt.Path/ => java.lang.StringjnlpFileName
	def => Option[sbt.Path]webstartZip: Option[sbt.Path]Option[Path] = (sbt.Path)Some[sbt.Path]Some(=> sbt.PathoutputPath (String)sbt.Path/ => java.lang.StringwebstartZipName)
	def => sbt.PathjnlpPath = => sbt.PathmainSourcePath (String)sbt.Path/ => java.lang.StringDefaultJnlpName
	def => sbt.PathjnlpResourcesPath = => sbt.PathjnlpPath (String)sbt.Path/ object sbt.BasicProjectPathsBasicProjectPaths.=> java.lang.StringDefaultResourcesDirectoryName
	
	def => java.lang.StringjnlpFileName = => java.lang.StringDefaultJnlpFileName
	def => java.lang.StringwebstartLibName = => java.lang.StringDefaultWebstartLibName
	def => java.lang.StringwebstartDirectoryName = => java.lang.StringDefaultWebstartDirectoryName
	def => java.lang.StringwebstartZipName = => java.lang.StringdefaultJarBaseName (Any)java.lang.String+ java.lang.String(".zip")".zip"
	
	val java.lang.StringDefaultWebstartDirectoryName = java.lang.String("webstart")"webstart"
	val java.lang.StringDefaultJnlpName = java.lang.String("jnlp")"jnlp"
	def => java.lang.StringDefaultJnlpFileName = => java.lang.StringdefaultJarBaseName (Any)java.lang.String+ java.lang.String(".jnlp")".jnlp"
	val java.lang.StringDefaultWebstartLibName = java.lang.String("lib")"lib"
}