Package com.axelor.gradle.tasks
Class GenerateCode
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.axelor.gradle.tasks.GenerateCode
- 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>
public class GenerateCode
extends org.gradle.api.DefaultTask
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate()Executes the code generation task.Retrieves the input directory used for the code generation process.static FilegetInputMainDir(org.gradle.api.Project project) Retrieves the directory containing the main domain models for the given project.static FilegetInputTestDir(org.gradle.api.Project project) Retrieves the directory containing the test domain models for the given project.Retrieves a list of lookup files that are used during the code generation process.static FilegetMainJavaOutputDir(org.gradle.api.Project project) Retrieves the output directory of the main domain models for the given project.static FilegetMainResourceOutputDir(org.gradle.api.Project project) Retrieves the output directory of the main resources for the given project.Retrieves a list of output directories for the code generation process.static FilegetTestJavaOutputDir(org.gradle.api.Project project) Retrieves the output directory of the test domain models for the given project.Indicates whether test domain models should be used in the code generation process.voidsetUseTestSources(Boolean useTestSources) Sets whether test domain models should be used in the code generation process.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, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, 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, getConvention, notCompatibleWithConfigurationCache
-
Field Details
-
MAIN_TASK_NAME
- See Also:
-
TEST_TASK_NAME
- See Also:
-
TASK_DESCRIPTION
- See Also:
-
TASK_GROUP
- See Also:
-
-
Constructor Details
-
GenerateCode
public GenerateCode()
-
-
Method Details
-
getUseTestSources
Indicates whether test domain models should be used in the code generation process.- Returns:
- true if test domain models should be generated
-
setUseTestSources
Sets whether test domain models should be used in the code generation process.- Parameters:
useTestSources- true if test domain models should be generated
-
getInputMainDir
Retrieves the directory containing the main domain models for the given project.- Parameters:
project- the project- Returns:
- the directory containing the main domain models as a
File
-
getInputTestDir
Retrieves the directory containing the test domain models for the given project.- Parameters:
project- the project- Returns:
- the directory containing the test domain models as a
File
-
getMainJavaOutputDir
Retrieves the output directory of the main domain models for the given project.- Parameters:
project- the project- Returns:
- the output directory of the main domain models as a
File
-
getTestJavaOutputDir
Retrieves the output directory of the test domain models for the given project.- Parameters:
project- the project- Returns:
- the output directory of the test domain models as a
File
-
getMainResourceOutputDir
Retrieves the output directory of the main resources for the given project.- Parameters:
project- the project- Returns:
- the output directory of the main resources as a
File
-
getLookupFiles
Retrieves a list of lookup files that are used during the code generation process. For test, an empty list is returned as it is not allowed to enhance test domain models from other modules or current project main domain models; otherwise, it collects the output directory of the main domain models for all axelor projects associated with the current project.Important: Gradle uses this method for incremental builds and configuration cache. It is not explicitly used in the code.
- Returns:
- a list of
Fileobjects representing the lookup files
-
getInputDirectory
Retrieves the input directory used for the code generation process.Important: Gradle uses this method for incremental builds and configuration cache. It is not explicitly used in the code.
- Returns:
- a
Fileobject representing the input directory
-
getOutputDirectories
Retrieves a list of output directories for the code generation process.Important: Gradle uses this method for incremental builds and configuration cache. It is not explicitly used in the code.
- Returns:
- a list of
Fileobjects representing the output directories
-
generate
Executes the code generation task.- Throws:
IOException- if an error occurs during file I/O operations
-