Class TrainTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.patbaumgartner.optimizer.gradle.TrainTask
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.Named,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
@DisableCachingByDefault(because="Runs an external Spring Boot process whose output depends on the environment")
public abstract class TrainTask
extends org.gradle.api.DefaultTask
Gradle task that runs a Spring Boot application in training mode to detect
which auto-configurations are loaded.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.file.ConfigurableFileCollectionThe directories containing compiled class files to scan for the main class when neitherjarnormainClassis configured.abstract org.gradle.api.file.RegularFilePropertygetJar()The Spring Boot executable JAR to run.abstract org.gradle.api.provider.ListProperty<String> Additional JVM arguments for the training run.abstract org.gradle.api.provider.Property<String> The main class of the Spring Boot application.abstract org.gradle.api.file.DirectoryPropertyThe output directory for the generated properties file.abstract org.gradle.api.provider.Property<String> The name of the generated properties file.abstract org.gradle.api.provider.ListProperty<File> The classpath for running the application.abstract org.gradle.api.provider.Property<Integer> The training run timeout in seconds.voidtrain()Executes the training run.Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Constructor Details
-
TrainTask
public TrainTask()Creates a newTrainTask.
-
-
Method Details
-
getMainClass
The main class of the Spring Boot application.- Returns:
- the main class property
-
getJar
@InputFile @PathSensitive(NONE) @Optional public abstract org.gradle.api.file.RegularFileProperty getJar()The Spring Boot executable JAR to run.- Returns:
- the JAR file property
-
getRuntimeClasspath
@Classpath @Optional public abstract org.gradle.api.provider.ListProperty<File> getRuntimeClasspath()The classpath for running the application.- Returns:
- the runtime classpath list property
-
getClassesDirectories
@InputFiles @Classpath @Optional public abstract org.gradle.api.file.ConfigurableFileCollection getClassesDirectories()The directories containing compiled class files to scan for the main class when neitherjarnormainClassis configured.- Returns:
- the classes directories file collection
-
getJvmArguments
Additional JVM arguments for the training run.- Returns:
- the JVM arguments list property
-
getTimeoutSeconds
The training run timeout in seconds.- Returns:
- the timeout property
-
getOutputDirectory
@OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutputDirectory()The output directory for the generated properties file.- Returns:
- the output directory property
-
getOutputFile
The name of the generated properties file.- Returns:
- the output file name property
-
train
Executes the training run.- Throws:
IOException- if an I/O error occurs during process executionInterruptedException- if the training process is interrupted
-