
    g	                         d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ ddl	m
Z
  G d	 d
e
j                        Z G d dej                        Z G d dej                        Zy)z"Classes related to build settings.    )absolute_import)division)print_function)unicode_literalsN)
dataobject)
exceptionsc                       e Zd ZdZy)InvalidLocationErrorzFile is in an invalid location.N)__name__
__module____qualname____doc__     /lib/googlecloudsdk/command_lib/code/builders.pyr
   r
      s    'r   r
   c                   &    e Zd ZdZdZd Zd Zd Zy)DockerfileBuilderz8Data for a request to build with an existing Dockerfile.)
dockerfilec                     t         j                  j                  t         j                  j                  || j                              S N)ospathabspathjoinr   selfcontexts     r   DockerfileAbsPathz#DockerfileBuilder.DockerfileAbsPath'   s(    77??277<<ABBr   c                 `    t         j                  j                  | j                  |      |      S r   )r   r   relpathr   r   s     r   DockerfileRelPathz#DockerfileBuilder.DockerfileRelPath*   s"    77??411':GDDr   c                     | j                  |      }t        j                  j                  ||g      |k7  rt	        dj                  ||            t        j                  j                  |      st	        |dz         y )NzInvalid Dockerfile path. Dockerfile must be located in the build context directory.
Dockerfile: {0}
Build Context Directory: {1}z does not exist.)r   r   r   commonprefixr
   formatexists)r   r   complete_paths      r   ValidatezDockerfileBuilder.Validate-   sx    **73M	wwWm45@ ) *0w)G	I I
 77>>-( 1C!CDD )r   N)r   r   r   r   NAMESr   r!   r'   r   r   r   r   r      s    @
 %CE	Er   r   c                       e Zd ZdZdZy)BuildpackBuilderzSettings for building with a buildpack.

    Attributes:
      builder: Name of the builder.
      trust: True if the lifecycle should trust this builder.
      devmode: Build with devmode.
  )buildertrustdevmodeN)r   r   r   r   r(   r   r   r   r*   r*   9   s     *%r   r*   )r   
__future__r   r   r   r   r   googlecloudsdk.command_lib.coder   googlecloudsdk.corer   Errorr
   
DataObjectr   r*   r   r   r   <module>r3      sW    ) &  % ' 	 6 *(:++ (E
-- E4	*z,, 	*r   