Class BuildFile

java.lang.Object
io.quarkus.devtools.project.buildfile.BuildFile
All Implemented Interfaces:
ExtensionManager
Direct Known Subclasses:
AbstractGroovyGradleBuildFile, MavenBuildFile, MavenProjectBuildFile

public abstract class BuildFile extends Object implements ExtensionManager
  • Constructor Details

    • BuildFile

      public BuildFile(Path projectDirPath, io.quarkus.registry.catalog.ExtensionCatalog catalog)
  • Method Details

    • install

      public final ExtensionManager.InstallResult install(Collection<io.quarkus.maven.dependency.ArtifactCoords> coords) throws IOException
      Description copied from interface: ExtensionManager
      This is going to install/add all the specified extensions to the project build file(s).
         - Extensions which are already installed will ALWAYS be skipped whatever the specified version
         - The provided version will be used if it wasn't already installed
       
      Specified by:
      install in interface ExtensionManager
      Parameters:
      coords - the list of ArtifactCoords for the extensions to install
      Returns:
      the ExtensionManager.InstallResult
      Throws:
      IOException - if a problem occurs while reading/writing the project build file(s)
    • install

      Description copied from interface: ExtensionManager
      This is going to install/add all the specified extensions to the project build file(s).
         - If the project Quarkus platform bom is not defined, an IllegalStateException will be thrown
         - Extensions which are already installed will ALWAYS be skipped whatever the specified version
         - The provided version will be used if wasn't already installed
       
      Specified by:
      install in interface ExtensionManager
      Parameters:
      plan - the list of ArtifactCoords for the extensions to install
      Returns:
      the ExtensionManager.InstallResult
      Throws:
      IOException - if a problem occurs while reading/writing the project build file(s)
    • getInstalled

      public final Collection<io.quarkus.maven.dependency.ArtifactCoords> getInstalled() throws IOException
      Description copied from interface: ExtensionManager
      Read the build file(s) to get the list of installed extensions in this Quarkus project.
      Specified by:
      getInstalled in interface ExtensionManager
      Returns:
      The list of ArtifactCoords installed in the project build file(s).
      Throws:
      IOException - if a problem occurs while reading the project build file(s)
    • uninstall

      public final ExtensionManager.UninstallResult uninstall(Collection<io.quarkus.maven.dependency.ArtifactKey> keys) throws IOException
      Description copied from interface: ExtensionManager
      This is going to uninstall/remove all the specified extensions from the project build file(s). This is ignoring the version
      Specified by:
      uninstall in interface ExtensionManager
      Parameters:
      keys - the set of ArtifactKey for the extensions to uninstall
      Returns:
      the ExtensionManager.InstallResult
      Throws:
      IOException - if a problem occurs while reading/writing the project build file(s)
    • importBom

      protected abstract boolean importBom(io.quarkus.maven.dependency.ArtifactCoords coords)
    • addDependency

      protected abstract boolean addDependency(io.quarkus.maven.dependency.ArtifactCoords coords, boolean managed)
    • removeDependency

      protected abstract void removeDependency(io.quarkus.maven.dependency.ArtifactKey key) throws IOException
      Throws:
      IOException
    • getDependencies

      protected abstract List<io.quarkus.maven.dependency.ArtifactCoords> getDependencies() throws IOException
      Throws:
      IOException
    • writeToDisk

      protected abstract void writeToDisk() throws IOException
      Throws:
      IOException
    • getProperty

      protected abstract String getProperty(String propertyName) throws IOException
      Throws:
      IOException
    • refreshData

      protected abstract void refreshData()
    • getProjectDirPath

      protected Path getProjectDirPath()
    • hasProjectFile

      protected boolean hasProjectFile(String fileName) throws IOException
      Throws:
      IOException
    • readProjectFile

      protected byte[] readProjectFile(String fileName) throws IOException
      Throws:
      IOException
    • writeToProjectFile

      protected void writeToProjectFile(String fileName, byte[] content) throws IOException
      Throws:
      IOException
    • writeToProjectFile

      protected void writeToProjectFile(String fileName, String content) throws IOException
      Throws:
      IOException
    • isDefinedInRegistry

      public static boolean isDefinedInRegistry(Collection<io.quarkus.registry.catalog.Extension> registry, io.quarkus.maven.dependency.ArtifactKey key)