Class BuildTarTask

  • All Implemented Interfaces:
    JibTask, java.lang.Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

    public class BuildTarTask
    extends org.gradle.api.DefaultTask
    implements JibTask
    Builds a container image to a tarball.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gradle.api.Task

        org.gradle.api.Task.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 
      Constructor Description
      BuildTarTask()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void buildTar()
      Task Action, builds an image to tar file.
      org.gradle.api.file.FileCollection getInputFiles()
      Returns a collection of all the files that jib includes in the image.
      JibExtension getJib()
      This will call the property "jib" so that it is the same name as the extension.
      java.lang.String getOutputFile()
      The output file to check for task up-to-date.
      BuildTarTask setJibExtension​(JibExtension jibExtension)
      Sets the task's JibExtension.
      void setTargetImage​(java.lang.String targetImage)
      The target image can be overridden with the --image command line option.
      • 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, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
      • Methods inherited from class org.gradle.api.internal.AbstractTask

        appendParallelSafeAction, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjects, setLoggerMessageRewriter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Comparable

        compareTo
      • Methods inherited from interface org.gradle.api.plugins.ExtensionAware

        getExtensions
      • Methods inherited from interface org.gradle.api.Task

        configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getFinalizedBy, getGroup, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getPath, getProject, getShouldRunAfter, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
    • Constructor Detail

      • BuildTarTask

        public BuildTarTask()
    • Method Detail

      • getJib

        @Nullable
        public JibExtension getJib()
        This will call the property "jib" so that it is the same name as the extension. This way, the user would see error messages for missing configuration with the prefix jib..
        Returns:
        the JibExtension.
      • setTargetImage

        public void setTargetImage​(java.lang.String targetImage)
        The target image can be overridden with the --image command line option.
        Parameters:
        targetImage - the name of the 'to' image.
      • getInputFiles

        @InputFiles
        public org.gradle.api.file.FileCollection getInputFiles()
        Returns a collection of all the files that jib includes in the image. Only used to calculate UP-TO-DATE.
        Returns:
        a list of paths of input files
      • getOutputFile

        @OutputFile
        public java.lang.String getOutputFile()
        The output file to check for task up-to-date.
        Returns:
        the output path
      • buildTar

        public void buildTar()
                      throws com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException,
                             java.io.IOException,
                             com.google.cloud.tools.jib.api.CacheDirectoryCreationException,
                             com.google.cloud.tools.jib.plugins.common.MainClassInferenceException,
                             com.google.cloud.tools.jib.plugins.common.globalconfig.InvalidGlobalConfigException
        Task Action, builds an image to tar file.
        Throws:
        java.io.IOException - if an error occurs creating the jib runner
        com.google.cloud.tools.jib.plugins.common.BuildStepsExecutionException - if an error occurs while executing build steps
        com.google.cloud.tools.jib.api.CacheDirectoryCreationException - if a new cache directory could not be created
        com.google.cloud.tools.jib.plugins.common.MainClassInferenceException - if a main class could not be found
        com.google.cloud.tools.jib.plugins.common.globalconfig.InvalidGlobalConfigException - if the global config file is invalid