001/*
002 * Copyright 2012-2017 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.cli.compiler;
018
019import java.util.List;
020
021import org.springframework.boot.cli.compiler.grape.RepositoryConfiguration;
022
023/**
024 * Configuration for the {@link GroovyCompiler}.
025 *
026 * @author Phillip Webb
027 * @author Andy Wilkinson
028 */
029public interface GroovyCompilerConfiguration {
030
031        /**
032         * Constant to be used when there is no {@link #getClasspath() classpath}.
033         */
034        String[] DEFAULT_CLASSPATH = { "." };
035
036        /**
037         * Returns the scope in which the compiler operates.
038         * @return the scope of the compiler
039         */
040        GroovyCompilerScope getScope();
041
042        /**
043         * Returns if import declarations should be guessed.
044         * @return {@code true} if imports should be guessed, otherwise {@code false}
045         */
046        boolean isGuessImports();
047
048        /**
049         * Returns if jar dependencies should be guessed.
050         * @return {@code true} if dependencies should be guessed, otherwise {@code false}
051         */
052        boolean isGuessDependencies();
053
054        /**
055         * Returns true if auto-configuration transformations should be applied.
056         * @return {@code true} if auto-configuration transformations should be applied,
057         * otherwise {@code false}
058         */
059        boolean isAutoconfigure();
060
061        /**
062         * Returns the classpath for local resources.
063         * @return a path for local resources
064         */
065        String[] getClasspath();
066
067        /**
068         * Returns the configuration for the repositories that will be used by the compiler to
069         * resolve dependencies.
070         * @return the repository configurations
071         */
072        List<RepositoryConfiguration> getRepositoryConfiguration();
073
074        /**
075         * Returns if running in quiet mode.
076         * @return {@code true} if running in quiet mode
077         */
078        boolean isQuiet();
079
080}