![JAR search and dependency download from the Maven repository](/logo.png)
org.akhikhl.gretty.AppAfterIntegrationTestTask.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gretty Show documentation
Show all versions of gretty Show documentation
Advanced gradle plugin for running web-apps on jetty and tomcat
/*
* Gretty
*
* Copyright (C) 2013-2015 Andrey Hihlovskiy and contributors.
*
* See the file "LICENSE" for copying and usage permission.
* See the file "CONTRIBUTORS" for complete list of contributors.
*/
package org.akhikhl.gretty
import org.gradle.api.tasks.TaskAction
import org.slf4j.Logger
import org.slf4j.LoggerFactory
/**
*
* @author akhikhl
*/
class AppAfterIntegrationTestTask extends AppStopTask {
private static final Logger log = LoggerFactory.getLogger(AppAfterIntegrationTestTask)
private String integrationTestTask_
private boolean integrationTestTaskAssigned
@TaskAction
void action() {
super.action()
if(project.ext.has('grettyLaunchThread') && project.ext.grettyLaunchThread != null) {
project.ext.grettyLaunchThread.join()
project.ext.grettyLaunchThread = null
project.ext.grettyLauncher.afterLaunch()
project.ext.grettyLauncher.dispose()
project.ext.grettyLauncher = null
}
System.out.println 'Server stopped.'
}
String getIntegrationTestTask() {
integrationTestTask_ ?: project.gretty.integrationTestTask
}
boolean getIntegrationTestTaskAssigned() {
integrationTestTaskAssigned
}
void integrationTestTask(String integrationTestTask) {
if(integrationTestTaskAssigned) {
log.warn '{}.integrationTestTask is already set to "{}", so "{}" is ignored', name, getIntegrationTestTask(), integrationTestTask
return
}
integrationTestTask_ = integrationTestTask
def thisTask = this
project.tasks.all { t ->
if(t.name == thisTask.integrationTestTask)
t.finalizedBy thisTask
}
integrationTestTaskAssigned = true
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy