All Downloads are FREE. Search and download functionalities are using the official Maven repository.

name.remal.gradle_plugins.idea_settings.IdeaRunConfigurationsSettings Maven / Gradle / Ivy

The newest version!
package name.remal.gradle_plugins.idea_settings;

import static name.remal.gradle_plugins.toolkit.PropertiesConventionUtils.setPropertyConvention;

import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import lombok.Getter;
import lombok.Setter;
import org.gradle.api.Action;
import org.gradle.api.JavaVersion;
import org.gradle.api.Project;

@Getter
@Setter
public class IdeaRunConfigurationsSettings {

    private final IdeaJavaAppRunConfigurationsSettings javaApplication;

    public void javaApplication(Action action) {
        action.execute(javaApplication);
    }

    @Getter
    @Setter
    public static class IdeaJavaAppRunConfigurationsSettings {

        private JavaVersion javaVersion = JavaVersion.current();

        private List jvmParameters = new ArrayList<>();

        private Boolean shortenCommandLine;

    }

    @Inject
    public IdeaRunConfigurationsSettings(Project project) {
        this.javaApplication = project.getObjects().newInstance(IdeaJavaAppRunConfigurationsSettings.class);

        setPropertyConvention(
            this.javaApplication,
            "shortenCommandLine",
            it -> it.getJavaVersion().isJava9Compatible()
        );
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy