Convert generators to intellij plugin, clean up dependencies

This commit is contained in:
Ilya Chernikov
2017-11-03 12:14:19 +01:00
committed by Vyacheslav Gerasimov
parent 0d264793ce
commit 9b51a547d8
3 changed files with 24 additions and 25 deletions
+11 -15
View File
@@ -1,6 +1,10 @@
apply { plugin("kotlin") } apply { plugin("kotlin") }
configureIntellijPlugin {
setExtraDependencies("jps-build-test")
}
dependencies { dependencies {
compile(protobufFull()) compile(protobufFull())
compile(project(":idea")) compile(project(":idea"))
@@ -36,26 +40,18 @@ dependencies {
compile(projectTests(":plugins:uast-kotlin")) compile(projectTests(":plugins:uast-kotlin"))
compile(projectTests(":js:js.tests")) compile(projectTests(":js:js.tests"))
compile(projectTests(":generators:test-generator")) compile(projectTests(":generators:test-generator"))
compile(ideaSdkDeps("jps-build-test", subdir = "jps/test"))
compileOnly(project(":kotlin-reflect-api")) compileOnly(project(":kotlin-reflect-api"))
testCompile(project(":idea:idea-test-framework")) { isTransitive = false } testCompile(project(":idea:idea-test-framework")) { isTransitive = false }
testCompile(project(":compiler:incremental-compilation-impl")) testCompile(project(":compiler:incremental-compilation-impl"))
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(ideaSdkDeps("openapi", "idea"))
testRuntime(projectDist(":kotlin-reflect")) testRuntime(projectDist(":kotlin-reflect"))
testRuntime(ideaSdkDeps("*.jar")) }
testRuntime(ideaPluginDeps("idea-junit", "resources_en", plugin = "junit"))
testRuntime(ideaPluginDeps("IntelliLang", plugin = "IntelliLang")) afterEvaluate {
testRuntime(ideaPluginDeps("jcommander", "testng", "testng-plugin", "resources_en", plugin = "testng")) dependencies {
testRuntime(ideaPluginDeps("copyright", plugin = "copyright")) compile(intellijExtra("jps-build-test"))
testRuntime(ideaPluginDeps("properties", "resources_en", plugin = "properties")) testRuntime(intellij { include("idea_rt.jar") })
testRuntime(ideaPluginDeps("java-i18n", plugin = "java-i18n")) }
testRuntime(ideaPluginDeps("*.jar", plugin = "gradle"))
testRuntime(ideaPluginDeps("*.jar", plugin = "Groovy"))
testRuntime(ideaPluginDeps("coverage", "jacocoant", plugin = "coverage"))
testRuntime(ideaPluginDeps("java-decompiler", plugin = "java-decompiler"))
testRuntime(ideaPluginDeps("*.jar", plugin = "maven"))
testRuntime(ideaPluginDeps("*.jar", plugin = "android"))
} }
sourceSets { sourceSets {
@@ -16,14 +16,10 @@
package org.jetbrains.kotlin.generators.mockJDK; package org.jetbrains.kotlin.generators.mockJDK;
import com.google.common.collect.Sets;
import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.io.FileUtil;
import java.io.*; import java.io.*;
import java.util.Arrays; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
import java.util.jar.JarOutputStream; import java.util.jar.JarOutputStream;
@@ -296,7 +292,7 @@ public class GenerateMockJdk {
JarFile sourceJar = new JarFile(source); JarFile sourceJar = new JarFile(source);
JarOutputStream targetJar = new JarOutputStream(new FileOutputStream(target)); JarOutputStream targetJar = new JarOutputStream(new FileOutputStream(target));
Set<String> foundEntries = Sets.newHashSet(); Set<String> foundEntries = new HashSet<>();
List<JarEntry> sourceList = Collections.list(sourceJar.entries()); List<JarEntry> sourceList = Collections.list(sourceJar.entries());
for (JarEntry entry : sourceList) { for (JarEntry entry : sourceList) {
@@ -313,7 +309,7 @@ public class GenerateMockJdk {
sourceJar.close(); sourceJar.close();
if (assertAllFound) { if (assertAllFound) {
Set<String> notFound = Sets.newHashSet(entryNamesToInclude); Set<String> notFound = new HashSet<>(entryNamesToInclude);
notFound.removeAll(foundEntries); notFound.removeAll(foundEntries);
if (!notFound.isEmpty()) { if (!notFound.isEmpty()) {
System.err.println("Not found:"); System.err.println("Not found:");
@@ -326,7 +322,7 @@ public class GenerateMockJdk {
} }
private static Set<String> getSourceFileEntries() { private static Set<String> getSourceFileEntries() {
Set<String> entrySet = Sets.newHashSet(); Set<String> entrySet = new HashSet<>();
for (String entry : ENTRIES) { for (String entry : ENTRIES) {
String javaFile = // "src/" + (in jdk 1.7 under Mac there is no src folder in src.zip) String javaFile = // "src/" + (in jdk 1.7 under Mac there is no src folder in src.zip)
entry.replaceAll(".class$", ".java"); entry.replaceAll(".class$", ".java");
@@ -336,7 +332,7 @@ public class GenerateMockJdk {
} }
private static Set<String> getClassFileEntries() { private static Set<String> getClassFileEntries() {
return Sets.newHashSet(Arrays.asList(ENTRIES)); return new HashSet<>(Arrays.asList(ENTRIES));
} }
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
+8 -1
View File
@@ -3,12 +3,19 @@ apply { plugin("kotlin") }
jvmTarget = "1.6" jvmTarget = "1.6"
configureIntellijPlugin()
dependencies { dependencies {
testCompile(project(":core:util.runtime")) testCompile(project(":core:util.runtime"))
testCompile(projectTests(":compiler:tests-common")) testCompile(projectTests(":compiler:tests-common"))
testCompile(projectDist(":kotlin-stdlib")) testCompile(projectDist(":kotlin-stdlib"))
testCompile(commonDep("junit:junit")) testCompile(commonDep("junit:junit"))
testCompile(ideaSdkDeps("util")) }
afterEvaluate {
dependencies {
compile(intellij { include("util.jar") })
}
} }
sourceSets { sourceSets {