<commit_before>/* sbt -- Simple Build Tool
 * Copyright 2008, 2009 <NAME>, <NAME>, <NAME>
 */
package sbt

import FileUtilities._
import java.io.File
import java.util.jar.{Attributes, Manifest}
import scala.collection.mutable.ListBuffer

trait Cleanable extends Project
{
	trait CleanOption extends ActionOption
	case class ClearAnalysis(analysis: TaskAnalysis[_, _, _]) extends CleanOption
	case class Preserve(paths: PathFinder) extends CleanOption

	def cleanTask(paths: PathFinder, options: CleanOption*): Task =
		cleanTask(paths, options)
	def cleanTask(paths: PathFinder, options: => Seq[CleanOption]): Task =
		task
		{
			val cleanOptions = options
			val preservePaths = for(Preserve(preservePaths) <- cleanOptions; toPreserve <- preservePaths.get) yield toPreserve
			Control.thread(FileUtilities.preserve(preservePaths, log))
			{ preserved =>
				val pathClean = FileUtilities.clean(paths.get, log)
				for(ClearAnalysis(analysis) <- cleanOptions)
				{
					analysis.clear()
					analysis.save()
				}
				val restored = preserved.restore(log)
				pathClean orElse restored
			}
		}
	
	lazy val cleanPlugins = cleanTask(info.pluginsOutputPath +++ info.pluginsManagedSourcePath +++ info.pluginsManagedDependencyPath)
}
trait SimpleScalaProject extends ExecProject with Cleanable
{
	def errorTask(message: String) = task{ Some(message) }

	case class CompileOption(val asString: String) extends ActionOption
	case class JavaCompileOption(val asString: String) extends ActionOption

	def compileOptions(asString: String*): Seq[CompileOption] = asString.map(CompileOption.apply)

	val Deprecation = CompileOption(CompileOptions.Deprecation)<commit_msg>added convenience method: javaCompileOptions(options: String*): Seq[JavaCompileOption]<commit_after>/* sbt -- Simple Build Tool
 * Copyright 2008, 2009 <NAME>, <NAME>, <NAME>
 */
package sbt

import FileUtilities._
import java.io.File
import java.util.jar.{Attributes, Manifest}
import scala.collection.mutable.ListBuffer

trait Cleanable extends Project
{
	trait CleanOption extends ActionOption
	case class ClearAnalysis(analysis: TaskAnalysis[_, _, _]) extends CleanOption
	case class Preserve(paths: PathFinder) extends CleanOption

	def cleanTask(paths: PathFinder, options: CleanOption*): Task =
		cleanTask(paths, options)
	def cleanTask(paths: PathFinder, options: => Seq[CleanOption]): Task =
		task
		{
			val cleanOptions = options
			val preservePaths = for(Preserve(preservePaths) <- cleanOptions; toPreserve <- preservePaths.get) yield toPreserve
			Control.thread(FileUtilities.preserve(preservePaths, log))
			{ preserved =>
				val pathClean = FileUtilities.clean(paths.get, log)
				for(ClearAnalysis(analysis) <- cleanOptions)
				{
					analysis.clear()
					analysis.save()
				}
				val restored = preserved.restore(log)
				pathClean orElse restored
			}
		}
	
	lazy val cleanPlugins = cleanTask(info.pluginsOutputPath +++ info.pluginsManagedSourcePath +++ info.pluginsManagedDependencyPath)
}
trait SimpleScalaProject extends ExecProject with Cleanable
{
	def errorTask(message: String) = task{ Some(message) }

	case class CompileOption(val asString: String) extends ActionOption
	case class JavaCompileOption(val asString: String) extends ActionOption

	def compileOptions(asString: String*): Seq[CompileOption] = asString.map(CompileOption.apply)
	def javaCompileOptions(asString: String*): Seq[JavaCompileOption] = asString.map(JavaCompileOption.apply)

	val Deprecation = CompileOption(CompileOptions.Deprecation)
{'fraction_non_alphanumeric': 0.09531963470319635, 'fraction_numerical': 0.0045662100456621, 'mean_word_length': 5.478743068391867, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4727554', 'n_tokens_mistral': 1112, 'n_tokens_neox': 991, 'n_words': 257}