在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):johnrengelman/gradle-processes开源软件地址(OpenSource Url):https://github.com/johnrengelman/gradle-processes开源编程语言(OpenSource Language):Groovy 80.0%开源软件介绍(OpenSource Introduction):gradle-processesGradle Processes Plugin - Create and manage forked processes. This Gradle plugin provides the capability to create forked processes from a Gradle build. It's primary goal is to bolster the built in capabilities of Gradle which allow for processing forking only in a synchronous manner. Compatibility NotesThis updated version of the plugin is tested against Gradle versions 4.5 onwards (final versions only). Due to internal gradle API changes (some of which this plugin uses) you have to use the older version 0.3.0 of the plugin on gradle version < 4.5! How To UseStarting from gradle 4.5: Apply the plugin to your Gradle build: plugins {
id 'com.github.johnrengelman.processes' // TODO add version
} If using a version prior to gradle 4.5: Apply the plugin to your Gradle build: plugins {
id "com.github.johnrengelman.processes" version "0.3.0"
} CapabilitiesProcess Forking
Process Joiningproject.procs.waitForFinish(handle) Handling Multiple ProcessesProcessHandle handle = project.procs.javafork { ... }
ProcessHandle handle2 = project.procs.javafork { ... }
project.procs.waitForFinish([handle, handle2]) Forking Taskstask fork(type: Fork) {
// Configure the same as the Exec task
}
task javafork(type: JavaFork) {
// Configure the same as the JavaExec task
} Accessing a Forked Tasks Processtask fork(type: Fork) {
// Configure task
}
task waitForFork() << {
fork.processHandle.waitForFinish()
} Using the forked tasks can allow for starting/stopping processes for things like test infrastructure. task startServer(type: Fork) {
// Start some external service
}
task stopServer << {
startServer.processHandle.abort()
}
test.dependsOn startServer
test.finalizedBy stopServer Building the pluginThis should build everything and run the tests: ./gradlew build |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论