IDEA-174209 - Support custom dockerfile names

- Docker deployment sources now singletons,
- both source and config now needed to specify deployment
This commit is contained in:
Michael Golubev
2017-08-28 00:42:41 +02:00
parent 197d305150
commit 46a3c9c8fb
2 changed files with 31 additions and 4 deletions
@@ -40,7 +40,19 @@ public abstract class DeploymentConfigurator<D extends DeploymentConfiguration,
/**
* @see LocatableConfiguration#isGeneratedName()
*/
public boolean isGeneratedConfigurationName(@NotNull String name, @NotNull DeploymentSource deploymentSource) {
public boolean isGeneratedConfigurationName(@NotNull String name,
@NotNull DeploymentSource deploymentSource,
@NotNull D deploymentConfiguration) {
return isGeneratedConfigurationName(name, deploymentSource);
}
/**
* @see LocatableConfiguration#isGeneratedName()
* @deprecated Since 2017.3, subclasses should directly override {@link
* #isGeneratedConfigurationName(String, DeploymentSource, DeploymentConfiguration)}
*/
@Deprecated
protected boolean isGeneratedConfigurationName(@NotNull String name, @NotNull DeploymentSource deploymentSource) {
return false;
}
@@ -48,7 +60,18 @@ public abstract class DeploymentConfigurator<D extends DeploymentConfiguration,
* @see LocatableConfiguration#suggestedName()
*/
@Nullable
public String suggestConfigurationName(@NotNull DeploymentSource deploymentSource) {
public String suggestConfigurationName(@NotNull DeploymentSource deploymentSource, @NotNull D deploymentConfiguration) {
return suggestConfigurationName(deploymentSource);
}
/**
* @see LocatableConfiguration#suggestedName()
* @deprecated Since 2017.3, subclasses should directly override {@link
* {@link #suggestConfigurationName(DeploymentSource, DeploymentConfiguration)}
*/
@Deprecated
@Nullable
protected String suggestConfigurationName(@NotNull DeploymentSource deploymentSource) {
return null;
}
}
@@ -162,13 +162,17 @@ public class DeployToServerRunConfiguration<S extends ServerConfiguration, D ext
@Override
public boolean isGeneratedName() {
return getDeploymentSource() != null && getDeploymentConfigurator().isGeneratedConfigurationName(getName(), getDeploymentSource());
return getDeploymentSource() != null && getDeploymentConfiguration() != null &&
getDeploymentConfigurator().isGeneratedConfigurationName(getName(), getDeploymentSource(), getDeploymentConfiguration());
}
@Nullable
@Override
public String suggestedName() {
return getDeploymentSource() == null ? null : getDeploymentConfigurator().suggestConfigurationName(getDeploymentSource());
if (getDeploymentSource() == null || getDeploymentConfiguration() == null) {
return null;
}
return getDeploymentConfigurator().suggestConfigurationName(getDeploymentSource(), getDeploymentConfiguration());
}
@Override