-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Common & environment plugins extracted
- Loading branch information
Krystian Panek
committed
Jan 28, 2020
1 parent
8c0387c
commit 64ff140
Showing
208 changed files
with
548 additions
and
6,928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 3 additions & 42 deletions
45
src/main/kotlin/com/cognifide/gradle/aem/AemDefaultTask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,14 @@ | ||
package com.cognifide.gradle.aem | ||
|
||
import org.gradle.api.DefaultTask | ||
import org.gradle.api.execution.TaskExecutionGraph | ||
import com.cognifide.gradle.common.CommonDefaultTask | ||
import org.gradle.api.tasks.Internal | ||
|
||
open class AemDefaultTask : DefaultTask(), AemTask { | ||
open class AemDefaultTask : CommonDefaultTask(), AemTask { | ||
|
||
@Internal | ||
final override val aem = AemExtension.of(project) | ||
|
||
private var doProjectEvaluated: () -> Unit = {} | ||
|
||
private var doProjectsEvaluated: () -> Unit = {} | ||
|
||
private var doTaskGraphReady: (TaskExecutionGraph) -> Unit = {} | ||
final override val aem = project.aem | ||
|
||
init { | ||
group = AemTask.GROUP | ||
} | ||
|
||
override fun projectEvaluated() { | ||
doProjectEvaluated() | ||
} | ||
|
||
fun projectEvaluated(callback: () -> Unit) { | ||
this.doProjectEvaluated = callback | ||
} | ||
|
||
override fun projectsEvaluated() { | ||
doProjectsEvaluated() | ||
} | ||
|
||
fun projectsEvaluated(callback: () -> Unit) { | ||
this.doProjectsEvaluated = callback | ||
} | ||
|
||
override fun taskGraphReady(graph: TaskExecutionGraph) { | ||
doTaskGraphReady(graph) | ||
} | ||
|
||
fun taskGraphReady(callback: (TaskExecutionGraph) -> Unit) { | ||
this.doTaskGraphReady = callback | ||
} | ||
|
||
fun checkForce() { | ||
taskGraphReady { graph -> | ||
if (graph.hasTask(this)) { | ||
aem.prop.checkForce(this) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.