Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Feb 11, 2025
1 parent 2a96ccc commit 28e8223
Showing 1 changed file with 1 addition and 62 deletions.
63 changes: 1 addition & 62 deletions core/define/src/mill/define/Task.scala
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ object Target extends TaskBase {
inline rw: RW[T],
inline ctx: mill.define.Ctx
): Target[T] =
${ Internal.targetResultImpl[T]('{Result.Success(t)})('rw, 'ctx, 'this) }
${ Internal.targetResultImpl[T]('{ Result.Success(t) })('rw, 'ctx, 'this) }

implicit inline def apply[T](inline t: Result[T])(implicit
inline rw: RW[T],
Expand Down Expand Up @@ -376,26 +376,6 @@ object Target extends TaskBase {
)
}

def targetTaskImpl[T: Type](using
Quotes
)(t: Expr[Task[T]])(
rw: Expr[RW[T]],
ctx: Expr[mill.define.Ctx]
): Expr[Target[T]] = {
val taskIsPrivate = isPrivateTargetOption()

mill.define.internal.Cacher.impl0[Target[T]](
'{
new TargetImpl[T](
$t,
$ctx,
$rw,
$taskIsPrivate
)
}
)
}

def sourcesImpl1(using
Quotes
)(values: Expr[Seq[Result[os.Path]]])(
Expand Down Expand Up @@ -574,24 +554,6 @@ object Target extends TaskBase {
)
}

def commandFromTask[T: Type](using
Quotes
)(t: Expr[Task[T]])(
ctx: Expr[mill.define.Ctx],
w: Expr[W[T]]
): Expr[Command[T]] = {
val taskIsPrivate = isPrivateTargetOption()

'{
new Command[T](
$t,
$ctx,
$w,
$taskIsPrivate
)
}
}

def commandImpl[T: Type](using
Quotes
)(t: Expr[Result[T]])(
Expand Down Expand Up @@ -666,29 +628,6 @@ object Target extends TaskBase {
}
)
}

def persistentImpl[T: Type](using
Quotes
)(t: Expr[Result[T]])(
rw: Expr[RW[T]],
ctx: Expr[mill.define.Ctx],
caller: Expr[TraverseCtxHolder]
): Expr[PersistentImpl[T]] = {
val taskIsPrivate = isPrivateTargetOption()

val lhs = Applicative.impl[Task, Task, Result, T, mill.api.Ctx](traverseCtxExpr(caller), t)

mill.define.internal.Cacher.impl0[PersistentImpl[T]](
'{
new PersistentImpl[T](
$lhs,
$ctx,
$rw,
$taskIsPrivate
)
}
)
}
}

}
Expand Down

0 comments on commit 28e8223

Please sign in to comment.