Interface extracted from KotlinModuleScriptGenerator

This commit is contained in:
Andrey Breslav
2013-04-26 18:12:04 +04:00
parent 7deec28b9c
commit abd162d466
4 changed files with 59 additions and 17 deletions
@@ -0,0 +1,43 @@
/*
* Copyright 2010-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet.compiler.runner;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.Collection;
import java.util.List;
import java.util.Set;
public interface KotlinModuleDescriptionGenerator {
CharSequence generateModuleScript(
String moduleName,
DependencyProvider dependencyProvider,
List<File> sourceFiles,
boolean tests,
Set<File> directoriesToFilterOut
);
public interface DependencyProvider {
void processClassPath(@NotNull DependencyProcessor processor);
}
public interface DependencyProcessor {
void processClassPathSection(@NotNull String sectionDescription, @NotNull Collection<File> files);
void processAnnotationRoots(@NotNull List<File> files);
}
}
@@ -25,22 +25,20 @@ import java.util.Set;
import static com.intellij.openapi.util.io.FileUtil.toSystemIndependentName;
public class KotlinModuleScriptGenerator {
public class KotlinModuleScriptGenerator implements KotlinModuleDescriptionGenerator {
public interface DependencyProvider {
void processClassPath(@NotNull DependencyProcessor processor);
}
public static final KotlinModuleScriptGenerator INSTANCE = new KotlinModuleScriptGenerator();
public interface DependencyProcessor {
void processClassPathSection(@NotNull String sectionDescription, @NotNull Collection<File> files);
void processAnnotationRoots(@NotNull List<File> files);
}
private KotlinModuleScriptGenerator() {}
public static CharSequence generateModuleScript(String moduleName,
@Override
public CharSequence generateModuleScript(
String moduleName,
DependencyProvider dependencyProvider,
List<File> sourceFiles,
boolean tests,
final Set<File> directoriesToFilterOut) {
final Set<File> directoriesToFilterOut
) {
final StringBuilder script = new StringBuilder();
if (tests) {