Gradle plugin
Gradle plugin for copying dependencies and scanning single and multilevel Gradle projects (java)
The Quantum-Safe Explorer Gradle plugin is designed to facilitate dependency management and project scanning for Java applications. By integrating this plugin into a Groovy or Kotlin based Gradle project, developers can ensure that all necessary dependency files are automatically copied into the build folder during the Gradle build process. This functionality extends to submodules within multi-level projects, ensuring consistent dependency handling across the entire project structure.
The documentation provides a comprehensive guide for integrating and utilizing the IBM Quantum Safe Explorer Groovy or Kotlin based Gradle plugin within Java projects.
This document covers the following aspects:
* Single and multi-level project support: Detailed steps to configure the IBM Quantum Safe Explorer Gradle Plugin in single-module and multi-module Gradle projects. <br>
-
Dependency management: Automating the copying of required dependencies to the appropriate build directory within the project and its submodules.
-
Automated scanning for Java projects: Command-line arguments to start the IBM Quantum Safe Explorer scanning of the projects.
Click each link to know more:
- IBM Quantum Safe Explorer plugin in Groovy Gradle project
- IBM Quantum Safe Explorer plugin in Kotlin Gradle project
Steps to add and run the IBM Quantum Safe Explorer plugin in Groovy Gradle project
1. Single Groovy Gradle Project
Add addl_dependency property in the build.gradle to define any additional dependent libraries or any runtime libraries.
def additional_dependency = project.findProperty("addl_dependency") ?: ""
Add Gradle tasks in build.gradle
Any extra parameters that need to be added to the scan, such as Application Name or Filters, can be specified as command line parameters in the qsExplorerScan task > commandLine section in
the build.gradle file.
Command for dependency copy and project scan in a single Groovy Gradle project:
$gradle clean build copyDependencies qsExplorerScan -PcliDir=<Path-to-Cli> -Paddl_dependency=<Additional ClassPath or DependencyPath>
2. Multi-level Groovy Gradle project with submodules
Add addl_dependency property in build.gradle to define any additional dependent libraries or any runtime libraries.
def additional_dependency = project.findProperty("addl_dependency") ?: ""
copyDependencies.configure { mustRunAfter(':submodule:jar') }
The copyDependencies task is configured with mustRunAfter (': submodule:jar'), making it dependent on the submodule. The Gradle child projects must be built before copying the dependencies into the
parent project.
Add Gradle tasks in build.gradle
Any extra parameters that need to be added to the scan, such as Application, Name, or Filters, can be specified as command line parameters in the qsExplorerScan task > commandLine section in the build.gradle file.
Command for dependency copy and project scan in a Multi-level Groovy Gradle project:
$gradle clean build copyDependencies qsExplorerScan -PcliDir=<Path-to-Cli> -Paddl_dependency=<Additional ClassPath or DependencyPath>
Steps to add and run the IBM Quantum Safe Explorer plugin in Kotlin Gradle project
1. Single Kotlin Gradle project
Add addl_dependency property in the build.gradle.kts to define any additional dependent libraries or any runtime libraries.
val additionalDependency = project.findProperty("addl_dependency") ?: ""
Add Gradle tasks in build.gradle.kts
Any extra parameters that need to be added to the scan, such as Application, Name, or Filters, can be specified as command line parameters in the qsExplorerScan task > commandLine section in the build.gradle.kts file.
Command for dependency copy and project scan in a single Kotlin Gradle project
$gradle clean build copyDependencies qsExplorerScan -PcliDir=<Path-to-Cli> -Paddl_dependency =<Additional ClassPath or DependencyPath>
2. Multi-level Kotlin Gradle project with submodules
Add addl_dependency property in the build.gradle.kts to define any additional dependent libraries or any runtime libraries.
val additionalDependency = project.findProperty("addl_dependency") ?: ""
copyDependencies.configure { mustRunAfter(":submodule:jar") }
The copyDependencies task is configured with mustRunAfter (': submodule:jar'), making it dependent on the submodule. The Gradle child projects must be built before copying the dependencies into the
parent project.
Add Gradle tasks in build.gradle
Any extra parameters that need to be added to the scan, such as Application, Name, or Filters, can be specified as command line parameters in the qsExplorerScan task > commandLine section in the build.gradle file.
Command for dependency copy and project scan in a multi-level Kotlin Gradle project with submodules
$gradle clean build copyDependencies qsExplorerScan -PcliDir=<Path-to-Cli> -P addl_dependency =<Additional ClassPath or DependencyPath>
Note:
- The
cliDirproperty should point to the root directory of the IBM Quantum Safe CLI path. - The
addl_dependencyproperty is optional and can point to the additional class path or dependency path.