Minor improvements to v4 api ToolchainsBuilder (#1234)

This commit is contained in:
Guillaume Nodet 2023-09-11 00:37:22 +02:00 committed by GitHub
parent 0ea8879eea
commit e2fc256118
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 1 deletions

View File

@ -19,7 +19,9 @@
package org.apache.maven.api.services;
import org.apache.maven.api.Service;
import org.apache.maven.api.Session;
import org.apache.maven.api.annotations.Experimental;
import org.apache.maven.api.annotations.Nonnull;
/**
* Builds the effective toolchains from a user toolchains file and/or a global toolchains file.
@ -28,11 +30,27 @@
public interface ToolchainsBuilder extends Service {
/**
* Builds the effective toolchains of the specified toolchains files.
* Builds the effective toolchains for the specified toolchains files.
*
* @param request the toolchains building request that holds the parameters, must not be {@code null}
* @return the result of the toolchains building, never {@code null}
* @throws ToolchainsBuilderException if the effective toolchains could not be built
*/
ToolchainsBuilderResult build(ToolchainsBuilderRequest request);
/**
* Builds the effective toolchains for the specified toolchains sources.
*
* @param session the {@link Session}, must not be {@code null}
* @param globalToolchainsSource The {@link Source} pointing to the global toolchains, must not be {@code null}
* @param userToolchainsSource The {@link Source} pointing to the user toolchains, must not be {@code null}
* @throws ToolchainsBuilderException if the project cannot be created
* @throws IllegalArgumentException if an argument is {@code null} or invalid
* @see #build(ToolchainsBuilderRequest)
*/
@Nonnull
default ToolchainsBuilderResult build(
@Nonnull Session session, @Nonnull Source globalToolchainsSource, @Nonnull Source userToolchainsSource) {
return build(ToolchainsBuilderRequest.build(session, globalToolchainsSource, userToolchainsSource));
}
}