Skip to content

Commit

Permalink
Common & environment plugins extracted
Browse files Browse the repository at this point in the history
  • Loading branch information
Krystian Panek committed Jan 28, 2020
1 parent 8c0387c commit 64ff140
Show file tree
Hide file tree
Showing 208 changed files with 548 additions and 6,928 deletions.
40 changes: 14 additions & 26 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,31 @@ description = "Gradle AEM Plugin"
defaultTasks("build", "publishToMavenLocal")

repositories {
mavenLocal()
jcenter()
}

dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.3.61"))

implementation(gradleApi())
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2")
implementation("org.apache.commons:commons-lang3:3.9")
implementation("org.apache.commons:commons-text:1.8")
implementation("commons-io:commons-io:2.6")
implementation("commons-validator:commons-validator:1.6")
// implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.3.61"))
// implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// implementation("org.jetbrains.kotlin:kotlin-stdlib")
// implementation("org.jetbrains.kotlin:kotlin-reflect")

implementation("com.cognifide.gradle:common-plugin:1.0.0")

implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.10.1")
implementation("com.jayway.jsonpath:json-path:2.4.0")
implementation("org.jsoup:jsoup:1.12.1")
implementation("org.buildobjects:jproc:2.2.3")
implementation("org.reflections:reflections:0.9.9")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.2")
implementation("org.apache.commons:commons-lang3:3.9")
implementation("org.apache.jackrabbit.vault:vault-cli:3.4.0")
implementation("org.jsoup:jsoup:1.12.1")
implementation("org.samba.jcifs:jcifs:1.3.18-kohsuke-1")
implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:4.2.0")
implementation("biz.aQute.bnd:biz.aQute.bnd.gradle:5.0.0")
implementation("org.zeroturnaround:zt-zip:1.13")
implementation("net.lingala.zip4j:zip4j:1.3.3")
implementation("org.apache.sshd:sshd-sftp:2.3.0")
implementation("org.apache.httpcomponents:httpclient:4.5.10")
implementation("org.apache.httpcomponents:httpmime:4.5.10")
implementation("org.osgi:org.osgi.core:6.0.0")
implementation("io.pebbletemplates:pebble:3.1.2")
implementation("com.dorkbox:Notify:3.7")
implementation("com.jayway.jsonpath:json-path:2.4.0")
implementation("org.buildobjects:jproc:2.2.3")
implementation("net.adamcin.oakpal:oakpal-core:1.5.1")

testImplementation("org.junit.jupiter:junit-jupiter:5.5.2")
Expand Down Expand Up @@ -206,12 +200,6 @@ gradlePlugin {
displayName = "AEM Instance Plugin"
description = "Provides tasks for working with native local AEM instances."
}
create("environment") {
id = "com.cognifide.aem.environment"
implementationClass = "com.cognifide.gradle.aem.environment.EnvironmentPlugin"
displayName = "AEM Environment Plugin"
description = "Provides tasks for working with virtualized AEM environment."
}
}
}

Expand Down
45 changes: 3 additions & 42 deletions src/main/kotlin/com/cognifide/gradle/aem/AemDefaultTask.kt
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)
}
}
}
}
Loading

0 comments on commit 64ff140

Please sign in to comment.