Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ public BaseImageParameters(ObjectFactory objectFactory) {
auth = objectFactory.newInstance(AuthParameters.class, "from.auth");
platforms = objectFactory.listProperty(PlatformParameters.class);
image = objectFactory.property(String.class);
platformParametersSpec =
objectFactory.newInstance(PlatformParametersSpec.class, objectFactory, platforms);
platformParametersSpec = objectFactory.newInstance(PlatformParametersSpec.class, platforms);

PlatformParameters amd64Linux = new PlatformParameters();
amd64Linux.setArchitecture("amd64");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@

import javax.inject.Inject;
import org.gradle.api.Action;
import org.gradle.api.Project;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.provider.ListProperty;

/** Allows to add {@link ExtensionParameters} objects to the list property of the same type. */
public class ExtensionParametersSpec {

private final Project project;
private final ObjectFactory objectFactory;
private final ListProperty<ExtensionParameters> pluginExtensions;

@Inject
public ExtensionParametersSpec(
Project project, ListProperty<ExtensionParameters> pluginExtensions) {
this.project = project;
ObjectFactory objectFactory, ListProperty<ExtensionParameters> pluginExtensions) {
this.objectFactory = objectFactory;
this.pluginExtensions = pluginExtensions;
}

Expand All @@ -40,7 +40,7 @@ public ExtensionParametersSpec(
* @param action closure representing an extension configuration
*/
public void pluginExtension(Action<? super ExtensionParameters> action) {
ExtensionParameters extension = project.getObjects().newInstance(ExtensionParameters.class);
ExtensionParameters extension = objectFactory.newInstance(ExtensionParameters.class);
action.execute(extension);
pluginExtensions.add(extension);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public JibExtension(Project project) {

pluginExtensions = objectFactory.listProperty(ExtensionParameters.class).empty();
extensionParametersSpec =
objectFactory.newInstance(ExtensionParametersSpec.class, project, pluginExtensions);
objectFactory.newInstance(ExtensionParametersSpec.class, pluginExtensions);
allowInsecureRegistries = objectFactory.property(Boolean.class);
containerizingMode = objectFactory.property(String.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public class PlatformParametersSpec {
@Inject
public PlatformParametersSpec(
ObjectFactory objectFactory, ListProperty<PlatformParameters> platforms) {
this.platforms = platforms;
this.objectFactory = objectFactory;
this.platforms = platforms;
}

/**
Expand Down