Package jetbrains.buildServer.tools
Interface ServerToolProvider
-
- All Superinterfaces:
TeamCityExtension
- All Known Implementing Classes:
CustomArchiveServerToolProvider
,DirectoryServerToolProvider
,ServerToolProviderAdapter
@UserImplemented(adapterClass=ServerToolProviderAdapter.class) public interface ServerToolProvider extends TeamCityExtension
Represents the provider of tools. This interface is intended to be implemented by TeamCity plugins using tools like Maven, NuGet, etc.In general the plugin implementing this interface is responsible to:
- get available tool versions;
- fetch tool package of given version;
- unpack fetched tool package, form required tool directory layout;
- Author:
- Evgeniy Koshkin (evgeniy.koshkin@jetbrains.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description File
fetchToolPackage(ToolVersion toolVersion, File targetDirectory)
Fetch tool package version to the targetDirectory.Collection<? extends ToolVersion>
getAvailableToolVersions()
Collection<InstalledToolVersion>
getBundledToolVersions()
Get collection of bundled tool versions which are included into the TeamCity distribution.String
getDefaultBundledVersionId()
Get id of bundled version which should be used as default if default version is not specified explicitly.Collection<? extends ToolVersion>
getDownloadableBundledToolVersions()
Get a collection of bundled tool versions which are NOT included into the TeamCity disctibution and downloaded and installed after the first TeamCity server startup.ToolType
getType()
String
normalizeToolPackageName(String toolPackageName)
GetPackageVersionResult
tryGetPackageVersion(File toolPackage)
Retrieve tool version if given package has valid tool package format.void
unpackToolPackage(File toolPackage, File targetDirectory)
Unpack valid tool package to the target directory.
-
-
-
Method Detail
-
getType
@NotNull ToolType getType()
-
getAvailableToolVersions
@NotNull Collection<? extends ToolVersion> getAvailableToolVersions()
-
tryGetPackageVersion
@NotNull GetPackageVersionResult tryGetPackageVersion(@NotNull File toolPackage)
Retrieve tool version if given package has valid tool package format.- Parameters:
toolPackage
- Package to inspect.- Returns:
- Version of the tool or
GetPackageVersionResult.error(String)
if package format is unknown / invalid.
-
fetchToolPackage
@NotNull File fetchToolPackage(@NotNull ToolVersion toolVersion, @NotNull File targetDirectory) throws ToolException
Fetch tool package version to the targetDirectory.- Returns:
- Path to the fetched file.
- Throws:
ToolException
- if error occurs
-
unpackToolPackage
void unpackToolPackage(@NotNull File toolPackage, @NotNull File targetDirectory) throws ToolException
Unpack valid tool package to the target directory. Form directory layout to use later on the agent.- Parameters:
toolPackage
- file with the tool packagetargetDirectory
- existing empty directory- Throws:
ToolException
- if error occurs
-
getBundledToolVersions
@NotNull Collection<InstalledToolVersion> getBundledToolVersions()
Get collection of bundled tool versions which are included into the TeamCity distribution.Note that some bundled tools are downloaded by TeamCity after the server startup. The list of such tools can be obtained via {@link this#getDownloadableBundledToolVersions()}
- Returns:
- Collection of bundled tool versions that are included into the TeamCity distribution.
-
getDownloadableBundledToolVersions
@NotNull Collection<? extends ToolVersion> getDownloadableBundledToolVersions()
Get a collection of bundled tool versions which are NOT included into the TeamCity disctibution and downloaded and installed after the first TeamCity server startup.Important: the implementations should ensure that no network requests or any other IO or CPU intensive operations are made. These versions should be cached and returned instantly.
- Returns:
- A collection of downloadable bundled tool versions wich are not included into the TeamCity distribution.
-
getDefaultBundledVersionId
@Nullable String getDefaultBundledVersionId()
Get id of bundled version which should be used as default if default version is not specified explicitly.- Returns:
- Default version id from set of bundled versions if exists or Null to use latest bundled version.
-
-