@Mojo(name="fetch",
defaultPhase=NONE)
public class FetchCrowdinMojo
extends AbstractCrowdinMojo
AbstractCrowdinMojo.downloadFolder.| Modifier and Type | Field and Description |
|---|---|
protected Integer |
buildTimeout
The number of seconds to wait for builds to complete
|
protected boolean |
exportApprovedOnly
Only texts that are both translated and approved will be included in the
exported translation files.
|
protected boolean |
skipUntranslatedFiles
Only translated files will be included in the exported translation files.
|
protected boolean |
skipUntranslatedStrings
Only translated strings will be included in the exported translation
files.
|
client, comment, crowdinServerId, disableBranches, downloadFolder, downloadFolderPath, gitBaseFolder, httpTimeout, lineSeparator, mavenSession, project, projectId, rootBranch, server, statusFiles, translationFileSets| Constructor and Description |
|---|
FetchCrowdinMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected BuildInfo |
buildTranslations(BranchInfo branch,
String token)
Requests a new build at Crowdin and returns the resulting
BuildInfo. |
void |
doExecute()
Performs the task of this
Mojo. |
protected void |
downloadStatusFile()
Downloads the translations status file to the intermediary
AbstractCrowdinMojo.downloadFolder. |
void |
execute() |
protected void |
initializeServer()
Initializes
AbstractCrowdinMojo.server by retrieving the appropriate Server
instance from the Maven settings and validating its settings. |
protected void |
setBuildTimeout(Integer buildTimeout)
Sets the
buildTimeout value. |
protected void |
setExportApprovedOnly(boolean value)
Sets the
exportApprovedOnly value. |
protected void |
setSkipUntranslatedFiles(boolean value)
Sets the
skipUntranslatedFiles value. |
protected void |
setSkipUntranslatedStrings(boolean value)
Sets the
skipUntranslatedStrings value. |
BuildInfo |
waitForBuild(BuildInfo build,
long pollIntervalMS,
long timeoutMS,
String token,
org.apache.maven.plugin.logging.Log logger)
Polls Crowdin for the status of the specified build until the build is
either completed or failed.
|
cleanDownloadFolder, createClient, getBranch, getBranch, getPluginVersion, initializeParameters, setClient, setComment, setCrowdinServerId, setDisableBranches, setDownloadFolder, setDownloadFolder, setGitBaseFolder, setHTTPTimeout, setLineSeparator, setProject, setProjectId, setRootBranch, setServer, setStatusFiles, setTranslationFileSets@Parameter(property="skipUntranslatedStrings",
defaultValue="true")
protected boolean skipUntranslatedStrings
Note: This parameter cannot be true if
skipUntranslatedFiles is true.
@Parameter(property="skipUntranslatedFiles",
defaultValue="false")
protected boolean skipUntranslatedFiles
Note: This parameter cannot be true if
skipUntranslatedStrings is true.
@Parameter(property="exportApprovedOnly",
defaultValue="false")
protected boolean exportApprovedOnly
@Parameter(property="buildTimeout",
defaultValue="60")
protected Integer buildTimeout
protected void setSkipUntranslatedStrings(boolean value)
skipUntranslatedStrings value.value - the value to set.protected void setSkipUntranslatedFiles(boolean value)
skipUntranslatedFiles value.value - the value to set.protected void setExportApprovedOnly(boolean value)
exportApprovedOnly value.value - the value to set.protected void setBuildTimeout(@Nonnull Integer buildTimeout)
buildTimeout value.buildTimeout - the build timeout in seconds to set.public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionpublic void doExecute()
throws org.apache.maven.plugin.MojoExecutionException
Mojo.org.apache.maven.plugin.MojoExecutionException - If an error occurs during the operation.@Nonnull protected BuildInfo buildTranslations(@Nullable BranchInfo branch, @Nonnull String token) throws org.apache.maven.plugin.MojoExecutionException
BuildInfo.branch - the BranchInfo if building for a branch.token - the API token.BuildInfo.org.apache.maven.plugin.MojoExecutionException - If the build fails for some reason.protected void downloadStatusFile()
throws org.apache.maven.plugin.MojoExecutionException
AbstractCrowdinMojo.downloadFolder.org.apache.maven.plugin.MojoExecutionException - If an error occurs during the operation.@Nonnull public BuildInfo waitForBuild(@Nonnull BuildInfo build, long pollIntervalMS, long timeoutMS, @Nonnull String token, @Nullable org.apache.maven.plugin.logging.Log logger) throws org.apache.maven.plugin.MojoExecutionException
build - the BuildInfo for the build to wait for.pollIntervalMS - the time in milliseconds between each poll.timeoutMS - the time in milliseconds before abandoning waiting and
declaring the build a failure.token - the API token.logger - the Log to log to.BuildInfo with containing the new build status.org.apache.maven.plugin.MojoExecutionException - If the polling fails or the timeout
expires.protected void initializeServer()
throws org.apache.maven.plugin.MojoExecutionException
AbstractCrowdinMojoAbstractCrowdinMojo.server by retrieving the appropriate Server
instance from the Maven settings and validating its settings.initializeServer in class AbstractCrowdinMojoorg.apache.maven.plugin.MojoExecutionException - If a required parameter is missing or the
specified crowdinServerId isn't configured.Copyright © 2024. All rights reserved.