|
|
|
|
@ -80,7 +80,11 @@ final class IncOptions(
|
|
|
|
|
* Once Scala compiler sources are refactored to work well with name hashing algorithm this option will be
|
|
|
|
|
* deleted immediately.
|
|
|
|
|
*/
|
|
|
|
|
val antStyle: Boolean) extends Product with Serializable {
|
|
|
|
|
val antStyle: Boolean,
|
|
|
|
|
/**
|
|
|
|
|
* Include synthetic methods into the dependency tracking by name hashing.
|
|
|
|
|
*/
|
|
|
|
|
val includeSynthToNameHashing: Boolean) extends Product with Serializable {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Secondary constructor introduced to make IncOptions to be binary compatible with version that didn't have
|
|
|
|
|
@ -90,59 +94,72 @@ final class IncOptions(
|
|
|
|
|
apiDiffContextSize: Int, apiDumpDirectory: Option[java.io.File], newClassfileManager: () => ClassfileManager) = {
|
|
|
|
|
this(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, IncOptions.recompileOnMacroDefDefault, IncOptions.nameHashingDefault,
|
|
|
|
|
IncOptions.antStyleDefault)
|
|
|
|
|
IncOptions.antStyleDefault, IncOptions.includeSynthToNameHashingDefault)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def this(transitiveStep: Int, recompileAllFraction: Double, relationsDebug: Boolean, apiDebug: Boolean,
|
|
|
|
|
apiDiffContextSize: Int, apiDumpDirectory: Option[java.io.File], newClassfileManager: () => ClassfileManager,
|
|
|
|
|
recompileOnMacroDef: Boolean, nameHashing: Boolean, antStyle: Boolean) = {
|
|
|
|
|
this(transitiveStep, recompileAllFraction, relationsDebug, apiDebug,
|
|
|
|
|
apiDiffContextSize, apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing,
|
|
|
|
|
antStyle, IncOptions.includeSynthToNameHashingDefault)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
assert(!(antStyle && nameHashing), "Name hashing and Ant-style cannot be enabled at the same time.")
|
|
|
|
|
|
|
|
|
|
def withTransitiveStep(transitiveStep: Int): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withRecompileAllFraction(recompileAllFraction: Double): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withRelationsDebug(relationsDebug: Boolean): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withApiDebug(apiDebug: Boolean): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withApiDiffContextSize(apiDiffContextSize: Int): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withApiDumpDirectory(apiDumpDirectory: Option[File]): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withNewClassfileManager(newClassfileManager: () => ClassfileManager): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withRecompileOnMacroDef(recompileOnMacroDef: Boolean): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withNameHashing(nameHashing: Boolean): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withIncludeSynthToNameHashing(includeSynthToNameHashing: Boolean): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
def withAntStyle(antStyle: Boolean): IncOptions = {
|
|
|
|
|
new IncOptions(transitiveStep, recompileAllFraction, relationsDebug, apiDebug, apiDiffContextSize,
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle)
|
|
|
|
|
apiDumpDirectory, newClassfileManager, recompileOnMacroDef, nameHashing, antStyle, includeSynthToNameHashing)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//- EXPANDED CASE CLASS METHOD BEGIN -//
|
|
|
|
|
@ -219,6 +236,8 @@ object IncOptions extends Serializable {
|
|
|
|
|
private val recompileOnMacroDefDefault: Boolean = true
|
|
|
|
|
private[sbt] val nameHashingDefault: Boolean = true
|
|
|
|
|
private val antStyleDefault: Boolean = false
|
|
|
|
|
// This should default to false
|
|
|
|
|
private[sbt] val includeSynthToNameHashingDefault = java.lang.Boolean.getBoolean("sbt.inc.include_synth")
|
|
|
|
|
val Default = IncOptions(
|
|
|
|
|
// 1. recompile changed sources
|
|
|
|
|
// 2(3). recompile direct dependencies and transitive public inheritance dependencies of sources with API changes in 1(2).
|
|
|
|
|
|