as33: Add AS 3.3 bunchset built with AS 3.3 C4
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
org.gradle.daemon=true
|
||||
org.gradle.parallel=false
|
||||
org.gradle.configureondemand=false
|
||||
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
|
||||
|
||||
#buildSrc.kotlin.repo=https://jcenter.bintray.com
|
||||
#buildSrc.kotlin.version=1.1.50
|
||||
|
||||
intellijUltimateEnabled=false
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { }
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
val builtinsSourceSet = sourceSets.create("builtins") {
|
||||
java.srcDir("builtins")
|
||||
}
|
||||
val builtinsCompile by configurations
|
||||
|
||||
dependencies {
|
||||
compile(projectTests(":compiler:cli"))
|
||||
compile(projectTests(":idea:idea-maven"))
|
||||
compile(projectTests(":j2k"))
|
||||
compile(projectTests(":idea:idea-android"))
|
||||
compile(projectTests(":jps-plugin"))
|
||||
compile(projectTests(":plugins:android-extensions-compiler"))
|
||||
compile(projectTests(":plugins:android-extensions-ide"))
|
||||
compile(projectTests(":plugins:android-extensions-jps"))
|
||||
compile(projectTests(":kotlin-annotation-processing"))
|
||||
compile(projectTests(":kotlin-allopen-compiler-plugin"))
|
||||
compile(projectTests(":kotlin-noarg-compiler-plugin"))
|
||||
compile(projectTests(":kotlin-sam-with-receiver-compiler-plugin"))
|
||||
compile(projectTests(":generators:test-generator"))
|
||||
// testCompileOnly(intellijDep("jps-build-test"))
|
||||
builtinsCompile("org.jetbrains.kotlin:kotlin-stdlib:$bootstrapKotlinVersion")
|
||||
testCompileOnly(project(":kotlin-reflect-api"))
|
||||
testCompile(builtinsSourceSet.output)
|
||||
testRuntime(intellijDep()) { includeJars("idea_rt") }
|
||||
testRuntime(projectDist(":kotlin-reflect"))
|
||||
}
|
||||
|
||||
|
||||
projectTest {
|
||||
workingDir = rootDir
|
||||
}
|
||||
|
||||
val generateTests by generator("org.jetbrains.kotlin.generators.tests.GenerateTestsKt")
|
||||
|
||||
val generateProtoBuf by generator("org.jetbrains.kotlin.generators.protobuf.GenerateProtoBufKt")
|
||||
val generateProtoBufCompare by generator("org.jetbrains.kotlin.generators.protobuf.GenerateProtoBufCompare")
|
||||
|
||||
val generateGradleOptions by generator("org.jetbrains.kotlin.generators.arguments.GenerateGradleOptionsKt")
|
||||
|
||||
val generateBuiltins by generator("org.jetbrains.kotlin.generators.builtins.generateBuiltIns.GenerateBuiltInsKt", builtinsSourceSet)
|
||||
|
||||
testsJar()
|
||||
@@ -67,7 +67,10 @@ import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralKotlinToKotlinCo
|
||||
import org.jetbrains.kotlin.idea.conversion.copy.AbstractLiteralTextToKotlinCopyPasteTest
|
||||
import org.jetbrains.kotlin.idea.conversion.copy.AbstractTextJavaToKotlinCopyPasteConversionTest
|
||||
import org.jetbrains.kotlin.idea.coverage.AbstractKotlinCoverageOutputFilesTest
|
||||
import org.jetbrains.kotlin.idea.debugger.*
|
||||
import org.jetbrains.kotlin.idea.debugger.AbstractBeforeExtractFunctionInsertionTest
|
||||
import org.jetbrains.kotlin.idea.debugger.AbstractKotlinSteppingTest
|
||||
import org.jetbrains.kotlin.idea.debugger.AbstractPositionManagerTest
|
||||
import org.jetbrains.kotlin.idea.debugger.AbstractSmartStepIntoTest
|
||||
import org.jetbrains.kotlin.idea.debugger.evaluate.*
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest
|
||||
import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest
|
||||
@@ -625,10 +628,6 @@ fun main(args: Array<String>) {
|
||||
model("debugger/tinyApp/src/evaluate/multipleBreakpoints", testMethod = "doMultipleBreakpointsTest")
|
||||
}
|
||||
|
||||
testClass<AbstractFileRankingTest> {
|
||||
model("debugger/fileRanking")
|
||||
}
|
||||
|
||||
testClass<AbstractStubBuilderTest> {
|
||||
model("stubs", extension = "kt")
|
||||
}
|
||||
@@ -921,7 +920,8 @@ fun main(args: Array<String>) {
|
||||
/* There is no jps in AS
|
||||
testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") {
|
||||
testClass<AbstractIncrementalJpsTest> {
|
||||
model("incremental/multiModule", extension = null, excludeParentDirs = true)
|
||||
model("incremental/multiModule/common", extension = null, excludeParentDirs = true)
|
||||
model("incremental/multiModule/jvm", extension = null, excludeParentDirs = true)
|
||||
model("incremental/pureKotlin", extension = null, recursive = false)
|
||||
model("incremental/withJava", extension = null, excludeParentDirs = true)
|
||||
model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true)
|
||||
@@ -930,6 +930,10 @@ fun main(args: Array<String>) {
|
||||
|
||||
actualizeMppJpsIncTestCaseDirs(testDataRoot, "incremental/multiplatform/multiModule")
|
||||
|
||||
testClass<AbstractIncrementalJsJpsTest> {
|
||||
model("incremental/multiModule/common", extension = null, excludeParentDirs = true)
|
||||
}
|
||||
|
||||
testClass<AbstractMultiplatformJpsTest> {
|
||||
model(
|
||||
"incremental/multiplatform/multiModule", extension = null, excludeParentDirs = true,
|
||||
@@ -1059,6 +1063,79 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
/*
|
||||
testGroup("plugins/android-extensions/android-extensions-idea/tests", "plugins/android-extensions/android-extensions-idea/testData") {
|
||||
testClass<AbstractAndroidCompletionTest> {
|
||||
model("android/completion", recursive = false, extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidGotoTest> {
|
||||
model("android/goto", recursive = false, extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidRenameTest> {
|
||||
model("android/rename", recursive = false, extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidLayoutRenameTest> {
|
||||
model("android/renameLayout", recursive = false, extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidFindUsagesTest> {
|
||||
model("android/findUsages", recursive = false, extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidUsageHighlightingTest> {
|
||||
model("android/usageHighlighting", recursive = false, extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidExtractionTest> {
|
||||
model("android/extraction", recursive = false, extension = null)
|
||||
}
|
||||
|
||||
testClass<AbstractParcelCheckerTest> {
|
||||
model("android/parcel/checker", excludeParentDirs = true)
|
||||
}
|
||||
|
||||
testClass<AbstractParcelQuickFixTest> {
|
||||
model("android/parcel/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile")
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("idea/idea-android/tests", "idea/testData") {
|
||||
testClass<AbstractConfigureProjectTest> {
|
||||
model("configuration/android-gradle", pattern = """(\w+)_before\.gradle$""", testMethod = "doTestAndroidGradle")
|
||||
model("configuration/android-gsk", pattern = """(\w+)_before\.gradle.kts$""", testMethod = "doTestAndroidGradle")
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidIntentionTest> {
|
||||
model("android/intention", pattern = "^([\\w\\-_]+)\\.kt$")
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidResourceIntentionTest> {
|
||||
model("android/resourceIntention", extension = "test", singleClass = true)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidQuickFixMultiFileTest> {
|
||||
model("android/quickfix", pattern = """^(\w+)\.((before\.Main\.\w+)|(test))$""", testMethod = "doTestWithExtraFile")
|
||||
}
|
||||
|
||||
testClass<AbstractKotlinLintTest> {
|
||||
model("android/lint", excludeParentDirs = true)
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidLintQuickfixTest> {
|
||||
model("android/lintQuickfix", pattern = "^([\\w\\-_]+)\\.kt$")
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidResourceFoldingTest> {
|
||||
model("android/folding")
|
||||
}
|
||||
|
||||
testClass<AbstractAndroidGutterIconTest> {
|
||||
model("android/gutterIcon")
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("plugins/android-extensions/android-extensions-jps/test", "plugins/android-extensions/android-extensions-jps/testData") {
|
||||
testClass<AbstractAndroidJpsTestCase> {
|
||||
model("android", recursive = false, extension = null)
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testRuntime(intellijDep())
|
||||
|
||||
compile(projectDist(":kotlin-stdlib-jre8"))
|
||||
compileOnly(project(":kotlin-reflect-api"))
|
||||
compile(project(":core:descriptors"))
|
||||
compile(project(":core:descriptors.jvm"))
|
||||
compile(project(":compiler:backend"))
|
||||
compile(project(":compiler:cli-common"))
|
||||
compile(project(":compiler:frontend"))
|
||||
compile(project(":compiler:frontend.java"))
|
||||
compile(project(":compiler:frontend.script"))
|
||||
compile(project(":js:js.frontend"))
|
||||
compile(project(":js:js.serializer"))
|
||||
compile(project(":compiler:light-classes"))
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":kotlin-build-common"))
|
||||
compile(project(":compiler:daemon-common"))
|
||||
compile(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
compile(project(":kotlin-compiler-runner")) { isTransitive = false }
|
||||
compile(project(":compiler:plugin-api"))
|
||||
compile(project(":eval4j"))
|
||||
compile(project(":j2k"))
|
||||
compile(project(":idea:formatter"))
|
||||
compile(project(":idea:idea-core"))
|
||||
compile(project(":idea:ide-common"))
|
||||
compile(project(":idea:idea-jps-common"))
|
||||
compile(project(":idea:kotlin-gradle-tooling"))
|
||||
compile(project(":plugins:uast-kotlin"))
|
||||
compile(project(":plugins:uast-kotlin-idea"))
|
||||
compile(project(":kotlin-script-util")) { isTransitive = false }
|
||||
|
||||
compile(commonDep("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
|
||||
compile(commonDep("org.jetbrains", "markdown"))
|
||||
|
||||
compileOnly(project(":kotlin-daemon-client"))
|
||||
|
||||
compileOnly(intellijDep())
|
||||
compileOnly(commonDep("com.google.code.findbugs", "jsr305"))
|
||||
compileOnly(intellijPluginDep("IntelliLang"))
|
||||
compileOnly(intellijPluginDep("copyright"))
|
||||
compileOnly(intellijPluginDep("properties"))
|
||||
compileOnly(intellijPluginDep("java-i18n"))
|
||||
|
||||
testCompile(project(":kotlin-test:kotlin-test-junit"))
|
||||
testCompile(projectTests(":compiler:tests-common"))
|
||||
testCompile(projectTests(":idea:idea-test-framework")) { isTransitive = false }
|
||||
testCompile(project(":idea:idea-jvm")) { isTransitive = false }
|
||||
testCompile(project(":idea:idea-gradle")) { isTransitive = false }
|
||||
testCompile(project(":idea:idea-maven")) { isTransitive = false }
|
||||
testCompile(commonDep("junit:junit"))
|
||||
|
||||
testRuntime(project(":plugins:kapt3-idea")) { isTransitive = false }
|
||||
testRuntime(projectDist(":kotlin-reflect"))
|
||||
testRuntime(projectDist(":kotlin-preloader"))
|
||||
|
||||
testCompile(project(":kotlin-sam-with-receiver-compiler-plugin")) { isTransitive = false }
|
||||
|
||||
testRuntime(project(":plugins:android-extensions-compiler"))
|
||||
testRuntime(project(":plugins:android-extensions-ide")) { isTransitive = false }
|
||||
testRuntime(project(":allopen-ide-plugin")) { isTransitive = false }
|
||||
testRuntime(project(":kotlin-allopen-compiler-plugin"))
|
||||
testRuntime(project(":noarg-ide-plugin")) { isTransitive = false }
|
||||
testRuntime(project(":kotlin-noarg-compiler-plugin"))
|
||||
testRuntime(project(":plugins:annotation-based-compiler-plugins-ide-support")) { isTransitive = false }
|
||||
testRuntime(project(":kotlin-scripting-idea")) { isTransitive = false }
|
||||
testRuntime(project(":kotlin-scripting-compiler"))
|
||||
testRuntime(project(":sam-with-receiver-ide-plugin")) { isTransitive = false }
|
||||
testRuntime(project(":idea:idea-android")) { isTransitive = false }
|
||||
testRuntime(project(":plugins:lint")) { isTransitive = false }
|
||||
testRuntime(project(":plugins:uast-kotlin"))
|
||||
|
||||
(rootProject.extra["compilerModules"] as Array<String>).forEach {
|
||||
testRuntime(project(it))
|
||||
}
|
||||
|
||||
testCompile(intellijPluginDep("IntelliLang"))
|
||||
testCompile(intellijPluginDep("copyright"))
|
||||
testCompile(intellijPluginDep("properties"))
|
||||
testCompile(intellijPluginDep("java-i18n"))
|
||||
testCompileOnly(intellijDep())
|
||||
testCompileOnly(commonDep("com.google.code.findbugs", "jsr305"))
|
||||
testCompileOnly(intellijPluginDep("gradle"))
|
||||
testCompileOnly(intellijPluginDep("Groovy"))
|
||||
//testCompileOnly(intellijPluginDep("maven"))
|
||||
|
||||
testRuntime(intellijPluginDep("junit"))
|
||||
testRuntime(intellijPluginDep("gradle"))
|
||||
testRuntime(intellijPluginDep("Groovy"))
|
||||
testRuntime(intellijPluginDep("coverage"))
|
||||
//testRuntime(intellijPluginDep("maven"))
|
||||
testRuntime(intellijPluginDep("android"))
|
||||
testRuntime(intellijPluginDep("smali"))
|
||||
testRuntime(intellijPluginDep("testng"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" {
|
||||
projectDefault()
|
||||
java.srcDirs(
|
||||
"idea-completion/src",
|
||||
"idea-live-templates/src",
|
||||
"idea-repl/src"
|
||||
)
|
||||
resources.srcDirs("idea-repl/src").apply { include("META-INF/**") }
|
||||
}
|
||||
"test" {
|
||||
projectDefault()
|
||||
java.srcDirs(
|
||||
"idea-completion/tests",
|
||||
"idea-live-templates/tests"
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val performanceTestCompile by configurations.creating {
|
||||
extendsFrom(configurations["testCompile"])
|
||||
}
|
||||
|
||||
val performanceTestRuntime by configurations.creating {
|
||||
extendsFrom(configurations["testRuntime"])
|
||||
}
|
||||
|
||||
val performanceTest by run {
|
||||
sourceSets.creating {
|
||||
compileClasspath += sourceSets["test"].output
|
||||
compileClasspath += sourceSets["main"].output
|
||||
runtimeClasspath += sourceSets["test"].output
|
||||
runtimeClasspath += sourceSets["main"].output
|
||||
java.srcDirs("performanceTests")
|
||||
}
|
||||
}
|
||||
|
||||
projectTest {
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
}
|
||||
|
||||
|
||||
projectTest(taskName = "performanceTest") {
|
||||
dependsOn(":dist")
|
||||
dependsOn(performanceTest.output)
|
||||
testClassesDirs = performanceTest.output.classesDirs
|
||||
classpath = performanceTest.runtimeClasspath
|
||||
workingDir = rootDir
|
||||
|
||||
jvmArgs?.removeAll { it.startsWith("-Xmx") }
|
||||
|
||||
maxHeapSize = "3g"
|
||||
jvmArgs("-XX:SoftRefLRUPolicyMSPerMB=50")
|
||||
jvmArgs(
|
||||
"-XX:ReservedCodeCacheSize=240m",
|
||||
"-XX:+UseCompressedOops",
|
||||
"-XX:+UseConcMarkSweepGC"
|
||||
)
|
||||
jvmArgs("-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder")
|
||||
|
||||
if (hasProperty("perf.flight.recorder.override")) {
|
||||
jvmArgs(property("perf.flight.recorder.override"))
|
||||
} else {
|
||||
val settings = if (hasProperty("perf.flight.recorder.settings")) ",settings=${property("perf.flight.recorder.settings")}" else ""
|
||||
jvmArgs("-XX:StartFlightRecording=delay=15m,duration=5h,filename=perf.jfr$settings")
|
||||
}
|
||||
|
||||
doFirst {
|
||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
||||
}
|
||||
}
|
||||
|
||||
testsJar {}
|
||||
|
||||
classesDirsArtifact()
|
||||
configureInstrumentation()
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testRuntime(intellijDep())
|
||||
|
||||
compileOnly(project(":idea"))
|
||||
compileOnly(project(":idea:idea-jvm"))
|
||||
compile(project(":idea:kotlin-gradle-tooling"))
|
||||
|
||||
compile(project(":compiler:frontend"))
|
||||
compile(project(":compiler:frontend.java"))
|
||||
compile(project(":compiler:frontend.script"))
|
||||
|
||||
compile(project(":js:js.frontend"))
|
||||
|
||||
compileOnly(intellijDep())
|
||||
compileOnly(intellijPluginDep("gradle"))
|
||||
compileOnly(intellijPluginDep("Groovy"))
|
||||
compileOnly(intellijPluginDep("junit"))
|
||||
|
||||
testCompile(projectTests(":idea"))
|
||||
testCompile(projectTests(":idea:idea-test-framework"))
|
||||
|
||||
testCompile(intellijPluginDep("gradle"))
|
||||
testCompileOnly(intellijPluginDep("Groovy"))
|
||||
testCompileOnly(intellijDep())
|
||||
|
||||
testRuntime(projectDist(":kotlin-reflect"))
|
||||
testRuntime(project(":idea:idea-jvm"))
|
||||
testRuntime(project(":idea:idea-android"))
|
||||
testRuntime(project(":plugins:kapt3-idea"))
|
||||
testRuntime(project(":plugins:android-extensions-ide"))
|
||||
testRuntime(project(":plugins:lint"))
|
||||
testRuntime(project(":sam-with-receiver-ide-plugin"))
|
||||
testRuntime(project(":allopen-ide-plugin"))
|
||||
testRuntime(project(":noarg-ide-plugin"))
|
||||
testRuntime(project(":kotlin-scripting-idea"))
|
||||
// TODO: the order of the plugins matters here, consider avoiding order-dependency
|
||||
testRuntime(intellijPluginDep("junit"))
|
||||
testRuntime(intellijPluginDep("testng"))
|
||||
testRuntime(intellijPluginDep("properties"))
|
||||
testRuntime(intellijPluginDep("gradle"))
|
||||
testRuntime(intellijPluginDep("Groovy"))
|
||||
testRuntime(intellijPluginDep("coverage"))
|
||||
//testRuntime(intellijPluginDep("maven"))
|
||||
testRuntime(intellijPluginDep("android"))
|
||||
testRuntime(intellijPluginDep("smali"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" {
|
||||
projectDefault()
|
||||
resources.srcDir("res").apply { include("**") }
|
||||
}
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
testsJar()
|
||||
|
||||
projectTest {
|
||||
workingDir = rootDir
|
||||
useAndroidSdk()
|
||||
}
|
||||
|
||||
configureInstrumentation()
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile(project(":core:util.runtime"))
|
||||
compile(project(":compiler:frontend"))
|
||||
compile(project(":compiler:frontend.java"))
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":compiler:cli-common"))
|
||||
compile(project(":kotlin-build-common"))
|
||||
|
||||
compile(project(":js:js.frontend"))
|
||||
|
||||
compile(project(":idea"))
|
||||
compile(project(":idea:idea-jvm"))
|
||||
compile(project(":idea:idea-jps-common"))
|
||||
|
||||
compileOnly(intellijDep())
|
||||
excludeInAndroidStudio(rootProject) { compileOnly(intellijPluginDep("maven")) }
|
||||
|
||||
testCompile(projectTests(":idea"))
|
||||
testCompile(projectTests(":compiler:tests-common"))
|
||||
testCompile(projectTests(":idea:idea-test-framework"))
|
||||
|
||||
testCompileOnly(intellijDep())
|
||||
//testCompileOnly(intellijPluginDep("maven"))
|
||||
|
||||
testRuntime(projectDist(":kotlin-reflect"))
|
||||
testRuntime(project(":idea:idea-jvm"))
|
||||
testRuntime(project(":idea:idea-android"))
|
||||
testRuntime(project(":plugins:android-extensions-ide"))
|
||||
testRuntime(project(":plugins:lint"))
|
||||
testRuntime(project(":sam-with-receiver-ide-plugin"))
|
||||
testRuntime(project(":allopen-ide-plugin"))
|
||||
testRuntime(project(":noarg-ide-plugin"))
|
||||
testRuntime(project(":kotlin-scripting-idea"))
|
||||
|
||||
testRuntime(intellijDep())
|
||||
// TODO: the order of the plugins matters here, consider avoiding order-dependency
|
||||
testRuntime(intellijPluginDep("junit"))
|
||||
testRuntime(intellijPluginDep("testng"))
|
||||
testRuntime(intellijPluginDep("properties"))
|
||||
testRuntime(intellijPluginDep("gradle"))
|
||||
testRuntime(intellijPluginDep("Groovy"))
|
||||
testRuntime(intellijPluginDep("coverage"))
|
||||
//testRuntime(intellijPluginDep("maven"))
|
||||
testRuntime(intellijPluginDep("android"))
|
||||
testRuntime(intellijPluginDep("smali"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { /*projectDefault()*/ }
|
||||
"test" { /*projectDefault()*/ }
|
||||
}
|
||||
|
||||
testsJar()
|
||||
|
||||
projectTest {
|
||||
workingDir = rootDir
|
||||
}
|
||||
|
||||
runtimeJar {
|
||||
archiveName = "maven-ide.jar"
|
||||
}
|
||||
|
||||
ideaPlugin()
|
||||
@@ -0,0 +1,5 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<externalAnnotator language="kotlin" implementationClass="org.jetbrains.android.inspections.lint.AndroidLintExternalAnnotator"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -0,0 +1,4 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="Git4Idea">
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -0,0 +1,80 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="org.jetbrains.plugins.gradle">
|
||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJavaFrameworkSupportProvider"/>
|
||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinJSFrameworkSupportProvider"/>
|
||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJavaFrameworkSupportProvider"/>
|
||||
<kotlinDslFrameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.KotlinDslGradleKotlinJSFrameworkSupportProvider"/>
|
||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinMPPCommonFrameworkSupportProvider"/>
|
||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinMPPJavaFrameworkSupportProvider"/>
|
||||
<frameworkSupport implementation="org.jetbrains.kotlin.idea.configuration.GradleKotlinMPPJSFrameworkSupportProvider"/>
|
||||
<pluginDescriptions implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradlePluginDescription"/>
|
||||
<projectResolve implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleProjectResolverExtension" order="first"/>
|
||||
<projectResolve implementation="org.jetbrains.kotlin.kapt.idea.KaptProjectResolverExtension" order="last"/>
|
||||
<projectResolve implementation="org.jetbrains.kotlin.allopen.ide.AllOpenProjectResolverExtension" order="last"/>
|
||||
<projectResolve implementation="org.jetbrains.kotlin.noarg.ide.NoArgProjectResolverExtension" order="last"/>
|
||||
<projectResolve implementation="org.jetbrains.kotlin.samWithReceiver.ide.SamWithReceiverProjectResolverExtension" order="last"/>
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<externalProjectDataService implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleSourceSetDataService"/>
|
||||
<externalProjectDataService implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleProjectDataService"/>
|
||||
<externalProjectDataService implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleLibraryDataService"/>
|
||||
<externalSystemTaskNotificationListener implementation="org.jetbrains.kotlin.idea.core.script.ReloadGradleTemplatesOnSync"/>
|
||||
|
||||
<localInspection
|
||||
implementationClass="org.jetbrains.kotlin.idea.inspections.gradle.DifferentKotlinGradleVersionInspection"
|
||||
displayName="Kotlin Gradle and IDE plugins versions are different"
|
||||
groupName="Kotlin"
|
||||
enabledByDefault="true"
|
||||
language="Groovy"
|
||||
hasStaticDescription="true"
|
||||
level="WARNING"/>
|
||||
|
||||
<localInspection
|
||||
implementationClass="org.jetbrains.kotlin.idea.inspections.gradle.DifferentStdlibGradleVersionInspection"
|
||||
displayName="Kotlin library and Gradle plugin versions are different"
|
||||
groupName="Kotlin"
|
||||
enabledByDefault="true"
|
||||
language="Groovy"
|
||||
hasStaticDescription="true"
|
||||
level="WARNING"/>
|
||||
|
||||
<localInspection
|
||||
implementationClass="org.jetbrains.kotlin.idea.inspections.gradle.DeprecatedGradleDependencyInspection"
|
||||
displayName="Deprecated library is used in Gradle"
|
||||
groupName="Kotlin"
|
||||
enabledByDefault="true"
|
||||
language="Groovy"
|
||||
hasStaticDescription="true"
|
||||
level="WARNING"/>
|
||||
|
||||
<localInspection
|
||||
implementationClass="org.jetbrains.kotlin.idea.inspections.gradle.GradleKotlinxCoroutinesDeprecationInspection"
|
||||
displayName="kotlinx.coroutines dependencies should be updated in Gradle for using with Kotlin 1.3+"
|
||||
groupPath="Kotlin,Migration"
|
||||
groupName="Gradle"
|
||||
enabledByDefault="true"
|
||||
language="Groovy"
|
||||
hasStaticDescription="true"
|
||||
level="ERROR"/>
|
||||
|
||||
<runConfigurationProducer implementation="org.jetbrains.kotlin.idea.run.KotlinTestClassGradleConfigurationProducer"/>
|
||||
<runConfigurationProducer implementation="org.jetbrains.kotlin.idea.run.KotlinTestMethodGradleConfigurationProducer"/>
|
||||
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="org.jetbrains.kotlin">
|
||||
<gradleProjectImportHandler implementation="org.jetbrains.kotlin.allopen.ide.AllOpenGradleProjectImportHandler"/>
|
||||
<gradleProjectImportHandler implementation="org.jetbrains.kotlin.scripting.idea.plugin.ScriptingGradleProjectImportHandler"/>
|
||||
<gradleProjectImportHandler implementation="org.jetbrains.kotlin.noarg.ide.NoArgGradleProjectImportHandler"/>
|
||||
<gradleProjectImportHandler implementation="org.jetbrains.kotlin.samWithReceiver.ide.SamWithReceiverGradleProjectImportHandler"/>
|
||||
|
||||
<projectConfigurator implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleModuleConfigurator"/>
|
||||
<projectConfigurator implementation="org.jetbrains.kotlin.idea.configuration.KotlinJsGradleModuleConfigurator"/>
|
||||
<gradleModelFacade implementation="org.jetbrains.kotlin.idea.inspections.gradle.DefaultGradleModelFacade"/>
|
||||
|
||||
<scriptDefinitionContributor implementation="org.jetbrains.kotlin.idea.core.script.GradleScriptDefinitionsContributor" order="first"/>
|
||||
|
||||
<moduleBuilder implementation="org.jetbrains.kotlin.idea.configuration.KotlinGradleMultiplatformModuleBuilder"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
||||
@@ -2920,7 +2920,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
level="INFORMATION"
|
||||
language="kotlin"
|
||||
/>
|
||||
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.NestedLambdaShadowedImplicitParameterInspection"
|
||||
displayName="Nested lambda has shadowed implicit parameter"
|
||||
groupPath="Kotlin"
|
||||
|
||||
@@ -13,7 +13,7 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<version>@snapshot@</version>
|
||||
<vendor url="http://www.jetbrains.com">JetBrains</vendor>
|
||||
|
||||
<idea-version since-build="181.4892.42.33" until-build="181.*"/>
|
||||
<idea-version since-build="182.2371" until-build="182.*"/>
|
||||
|
||||
<depends>com.intellij.modules.platform</depends>
|
||||
<depends>com.intellij.modules.androidstudio</depends>
|
||||
@@ -23,12 +23,12 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
|
||||
<depends optional="true" config-file="junit.xml">JUnit</depends>
|
||||
<depends optional="true" config-file="gradle.xml">org.jetbrains.plugins.gradle</depends>
|
||||
<depends optional="true" config-file="gradle-java.xml">org.jetbrains.plugins.gradle.java</depends>
|
||||
<depends optional="true" config-file="maven.xml">org.jetbrains.idea.maven</depends>
|
||||
<depends optional="true" config-file="testng-j.xml">TestNG-J</depends>
|
||||
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
|
||||
<depends optional="true" config-file="coverage.xml">Coverage</depends>
|
||||
<depends optional="true" config-file="i18n.xml">com.intellij.java-i18n</depends>
|
||||
<depends optional="true" config-file="injection.xml">org.intellij.intelliLang</depends>
|
||||
<depends optional="true" config-file="decompiler.xml">org.jetbrains.java.decompiler</depends>
|
||||
<depends optional="true" config-file="git4idea.xml">Git4Idea</depends>
|
||||
|
||||
@@ -37,6 +37,8 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<!-- CIDR-PLUGIN-PLACEHOLDER-START -->
|
||||
<depends>com.intellij.modules.java</depends>
|
||||
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
|
||||
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
|
||||
<depends optional="true" config-file="injection.xml">org.intellij.intelliLang</depends>
|
||||
<!-- CIDR-PLUGIN-PLACEHOLDER-END -->
|
||||
|
||||
<project-components>
|
||||
@@ -854,6 +856,8 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
|
||||
<project.converterProvider implementation="org.jetbrains.kotlin.idea.roots.KotlinNonJvmSourceRootConverterProvider"/>
|
||||
|
||||
<orderEnumerationHandlerFactory implementation="org.jetbrains.kotlin.idea.roots.KotlinNonJvmOrderEnumerationHandler$Factory"/>
|
||||
|
||||
<intentionAction>
|
||||
<className>org.jetbrains.kotlin.idea.intentions.FoldInitializerAndIfToElvisIntention</className>
|
||||
<category>Kotlin</category>
|
||||
@@ -3034,4 +3038,8 @@ The Kotlin plugin provides language support in IntelliJ IDEA and Android Studio.
|
||||
<pluginUpdateVerifier implementation="org.jetbrains.kotlin.idea.update.GooglePluginUpdateVerifier"/>
|
||||
</extensions>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij.jvm">
|
||||
<declarationSearcher language="kotlin" implementationClass="org.jetbrains.kotlin.idea.jvm.KotlinDeclarationSearcher"/>
|
||||
</extensions>
|
||||
|
||||
</idea-plugin>
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright 2010-2015 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.kotlin.idea.reporter
|
||||
|
||||
import com.intellij.diagnostic.ITNReporter
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.diagnostic.IdeaLoggingEvent
|
||||
import com.intellij.openapi.diagnostic.SubmittedReportInfo
|
||||
import com.intellij.openapi.ui.Messages
|
||||
import com.intellij.util.Consumer
|
||||
import org.jetbrains.kotlin.idea.KotlinPluginUpdater
|
||||
import org.jetbrains.kotlin.idea.KotlinPluginUtil
|
||||
import org.jetbrains.kotlin.idea.PluginUpdateStatus
|
||||
import java.awt.Component
|
||||
|
||||
/**
|
||||
* We need to wrap ITNReporter for force showing or errors from kotlin plugin even from released version of IDEA.
|
||||
*/
|
||||
class KotlinReportSubmitter : ITNReporter() {
|
||||
private var hasUpdate = false
|
||||
private var hasLatestVersion = false
|
||||
|
||||
override fun showErrorInRelease(event: IdeaLoggingEvent): Boolean {
|
||||
val notificationEnabled = "disabled" != System.getProperty("kotlin.fatal.error.notification", "enabled")
|
||||
return notificationEnabled && (!hasUpdate || ApplicationManager.getApplication().isInternal)
|
||||
}
|
||||
|
||||
override fun submit(events: Array<IdeaLoggingEvent>, additionalInfo: String?, parentComponent: Component?, consumer: Consumer<SubmittedReportInfo>): Boolean {
|
||||
if (hasUpdate) {
|
||||
if (ApplicationManager.getApplication().isInternal) {
|
||||
return super.submit(events, additionalInfo, parentComponent, consumer)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
if (hasLatestVersion) {
|
||||
return super.submit(events, additionalInfo, parentComponent, consumer)
|
||||
}
|
||||
|
||||
KotlinPluginUpdater.getInstance().runUpdateCheck { status ->
|
||||
if (status is PluginUpdateStatus.Update) {
|
||||
hasUpdate = true
|
||||
if (parentComponent != null) {
|
||||
|
||||
if (ApplicationManager.getApplication().isInternal) {
|
||||
super.submit(events, additionalInfo, parentComponent, consumer)
|
||||
}
|
||||
|
||||
val rc = Messages.showDialog(parentComponent,
|
||||
"You're running Kotlin plugin version ${KotlinPluginUtil.getPluginVersion()}, " +
|
||||
"while the latest version is ${status.pluginDescriptor.version}",
|
||||
"Update Kotlin Plugin",
|
||||
arrayOf("Update", "Ignore"),
|
||||
0, Messages.getInformationIcon())
|
||||
if (rc == 0) {
|
||||
KotlinPluginUpdater.getInstance().installPluginUpdate(status)
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
hasLatestVersion = true
|
||||
super.submit(events, additionalInfo, parentComponent, consumer)
|
||||
}
|
||||
false
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.update
|
||||
|
||||
import com.intellij.ide.plugins.IdeaPluginDescriptor
|
||||
import com.intellij.openapi.util.registry.Registry
|
||||
import org.jetbrains.kotlin.idea.PluginUpdateStatus
|
||||
|
||||
// Do an additional verification with PluginUpdateVerifier. Enabled only in AS 3.2+
|
||||
fun verify(updateStatus: PluginUpdateStatus.Update): PluginUpdateStatus {
|
||||
@Suppress("InvalidBundleOrProperty")
|
||||
val pluginVerifierEnabled = Registry.`is`("kotlin.plugin.update.verifier.enabled", true)
|
||||
if (!pluginVerifierEnabled) {
|
||||
return updateStatus
|
||||
}
|
||||
|
||||
val pluginDescriptor: IdeaPluginDescriptor = updateStatus.pluginDescriptor
|
||||
val pluginVerifiers = PluginUpdateVerifier.EP_NAME.extensions
|
||||
|
||||
for (pluginVerifier in pluginVerifiers) {
|
||||
val verifyResult = pluginVerifier.verify(pluginDescriptor) ?: continue
|
||||
if (!verifyResult.verified) {
|
||||
return PluginUpdateStatus.Unverified(
|
||||
pluginVerifier.verifierName,
|
||||
verifyResult.declineMessage,
|
||||
updateStatus
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return updateStatus
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testRuntime(intellijDep())
|
||||
|
||||
compile(projectDist(":kotlin-stdlib"))
|
||||
compile(project(":compiler:frontend"))
|
||||
compile(project(":compiler:frontend.java"))
|
||||
compile(project(":compiler:light-classes"))
|
||||
compile(project(":compiler:util"))
|
||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
|
||||
testCompile(project(":idea"))
|
||||
testCompile(projectTests(":idea:idea-test-framework"))
|
||||
testCompile(project(":compiler:light-classes"))
|
||||
testCompile(projectDist(":kotlin-test:kotlin-test-junit"))
|
||||
testCompile(commonDep("junit:junit"))
|
||||
testCompileOnly(intellijDep()) { includeJars("platform-api", "platform-impl") }
|
||||
|
||||
testRuntime(project(":plugins:kapt3-idea")) { isTransitive = false }
|
||||
testRuntime(project(":idea:idea-jvm"))
|
||||
testRuntime(project(":idea:idea-android"))
|
||||
testRuntime(project(":plugins:android-extensions-ide"))
|
||||
testRuntime(project(":sam-with-receiver-ide-plugin"))
|
||||
testRuntime(project(":allopen-ide-plugin"))
|
||||
testRuntime(project(":noarg-ide-plugin"))
|
||||
testRuntime(project(":kotlin-scripting-idea"))
|
||||
testRuntime(intellijPluginDep("properties"))
|
||||
testRuntime(intellijPluginDep("gradle"))
|
||||
testRuntime(intellijPluginDep("Groovy"))
|
||||
testRuntime(intellijPluginDep("coverage"))
|
||||
//testRuntime(intellijPluginDep("maven"))
|
||||
testRuntime(intellijPluginDep("android"))
|
||||
testRuntime(intellijPluginDep("smali"))
|
||||
testRuntime(intellijPluginDep("junit"))
|
||||
testRuntime(intellijPluginDep("testng"))
|
||||
testRuntime(intellijPluginDep("IntelliLang"))
|
||||
testRuntime(intellijPluginDep("testng"))
|
||||
testRuntime(intellijPluginDep("copyright"))
|
||||
testRuntime(intellijPluginDep("properties"))
|
||||
testRuntime(intellijPluginDep("java-i18n"))
|
||||
testRuntime(intellijPluginDep("java-decompiler"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
projectTest {
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
}
|
||||
|
||||
testsJar()
|
||||
|
||||
|
||||
val testForWebDemo by task<Test> {
|
||||
include("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
||||
classpath = testSourceSet.runtimeClasspath
|
||||
workingDir = rootDir
|
||||
}
|
||||
val cleanTestForWebDemo by tasks
|
||||
|
||||
val test: Test by tasks
|
||||
test.apply {
|
||||
exclude("**/*JavaToKotlinConverterForWebDemoTestGenerated*")
|
||||
dependsOn(testForWebDemo)
|
||||
}
|
||||
|
||||
val cleanTest by tasks
|
||||
cleanTest.dependsOn(cleanTestForWebDemo)
|
||||
|
||||
ideaPlugin()
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright 2010-2015 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.kotlin.j2k
|
||||
|
||||
import com.intellij.codeInsight.ContainerProvider
|
||||
import com.intellij.codeInsight.NullableNotNullManager
|
||||
import com.intellij.codeInsight.runner.JavaMainMethodProvider
|
||||
import com.intellij.core.CoreApplicationEnvironment
|
||||
import com.intellij.core.JavaCoreApplicationEnvironment
|
||||
import com.intellij.core.JavaCoreProjectEnvironment
|
||||
import com.intellij.lang.MetaLanguage
|
||||
import com.intellij.lang.jvm.facade.JvmElementProvider
|
||||
import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.extensions.ExtensionsArea
|
||||
import com.intellij.openapi.fileTypes.FileTypeExtensionPoint
|
||||
import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.util.io.FileUtil
|
||||
import com.intellij.psi.*
|
||||
import com.intellij.psi.augment.PsiAugmentProvider
|
||||
import com.intellij.psi.augment.TypeAnnotationModifier
|
||||
import com.intellij.psi.compiled.ClassFileDecompilers
|
||||
import com.intellij.psi.impl.JavaClassSupersImpl
|
||||
import com.intellij.psi.impl.PsiTreeChangePreprocessor
|
||||
import com.intellij.psi.meta.MetaDataContributor
|
||||
import com.intellij.psi.stubs.BinaryFileStubBuilders
|
||||
import com.intellij.psi.util.JavaClassSupers
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.File
|
||||
import java.net.URLClassLoader
|
||||
|
||||
abstract class AbstractJavaToKotlinConverterForWebDemoTest : TestCase() {
|
||||
val DISPOSABLE = Disposer.newDisposable()
|
||||
|
||||
fun doTest(javaPath: String) {
|
||||
try {
|
||||
val fileContents = FileUtil.loadFile(File(javaPath), true)
|
||||
val javaCoreEnvironment: JavaCoreProjectEnvironment = setUpJavaCoreEnvironment()
|
||||
translateToKotlin(fileContents, javaCoreEnvironment.project)
|
||||
}
|
||||
finally {
|
||||
Disposer.dispose(DISPOSABLE)
|
||||
}
|
||||
}
|
||||
|
||||
fun setUpJavaCoreEnvironment(): JavaCoreProjectEnvironment {
|
||||
Extensions.cleanRootArea(DISPOSABLE)
|
||||
val area = Extensions.getRootArea()
|
||||
|
||||
registerExtensionPoints(area)
|
||||
|
||||
val applicationEnvironment = JavaCoreApplicationEnvironment(DISPOSABLE)
|
||||
val javaCoreEnvironment = object : JavaCoreProjectEnvironment(DISPOSABLE, applicationEnvironment) {
|
||||
override fun preregisterServices() {
|
||||
val projectArea = Extensions.getArea(project)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(projectArea, PsiTreeChangePreprocessor.EP_NAME, PsiTreeChangePreprocessor::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(projectArea, PsiElementFinder.EP_NAME, PsiElementFinder::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(projectArea, JvmElementProvider.EP_NAME, JvmElementProvider::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
javaCoreEnvironment.project.registerService(NullableNotNullManager::class.java, object : NullableNotNullManager(javaCoreEnvironment.project) {
|
||||
override fun isNullable(owner: PsiModifierListOwner, checkBases: Boolean) = !isNotNull(owner, checkBases)
|
||||
override fun isNotNull(owner: PsiModifierListOwner, checkBases: Boolean) = true
|
||||
override fun hasHardcodedContracts(element: PsiElement): Boolean = false
|
||||
override fun getNullables() = emptyList<String>()
|
||||
override fun setNullables(vararg p0: String) = Unit
|
||||
override fun getNotNulls() = emptyList<String>()
|
||||
override fun setNotNulls(vararg p0: String) = Unit
|
||||
override fun getDefaultNullable() = ""
|
||||
override fun setDefaultNullable(defaultNullable: String) = Unit
|
||||
override fun getDefaultNotNull() = ""
|
||||
override fun setDefaultNotNull(p0: String) = Unit
|
||||
override fun getPredefinedNotNulls() = emptyList<String>()
|
||||
})
|
||||
|
||||
applicationEnvironment.application.registerService(JavaClassSupers::class.java, JavaClassSupersImpl::class.java)
|
||||
|
||||
for (root in PathUtil.getJdkClassesRootsFromCurrentJre()) {
|
||||
javaCoreEnvironment.addJarToClassPath(root)
|
||||
}
|
||||
val annotations: File? = findAnnotations()
|
||||
if (annotations != null && annotations.exists()) {
|
||||
javaCoreEnvironment.addJarToClassPath(annotations)
|
||||
}
|
||||
return javaCoreEnvironment
|
||||
}
|
||||
|
||||
private fun registerExtensionPoints(area: ExtensionsArea) {
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, BinaryFileStubBuilders.EP_NAME, FileTypeExtensionPoint::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, FileContextProvider.EP_NAME, FileContextProvider::class.java)
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, MetaDataContributor.EP_NAME, MetaDataContributor::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, PsiAugmentProvider.EP_NAME, PsiAugmentProvider::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider::class.java)
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, ContainerProvider.EP_NAME, ContainerProvider::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler::class.java)
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, TypeAnnotationModifier.EP_NAME, TypeAnnotationModifier::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, MetaLanguage.EP_NAME, MetaLanguage::class.java)
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, JavaModuleSystem.EP_NAME, JavaModuleSystem::class.java)
|
||||
}
|
||||
|
||||
fun findAnnotations(): File? {
|
||||
var classLoader = JavaToKotlinTranslator::class.java.classLoader
|
||||
while (classLoader != null) {
|
||||
val loader = classLoader
|
||||
if (loader is URLClassLoader) {
|
||||
for (url in loader.urLs) {
|
||||
if ("file" == url.protocol && url.file!!.endsWith("/annotations.jar")) {
|
||||
return File(url.file!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
classLoader = classLoader.parent
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
val compilerModules: Array<String> by rootProject.extra
|
||||
|
||||
dependencies {
|
||||
compile(project(":kotlin-build-common"))
|
||||
compile(project(":core:descriptors"))
|
||||
compile(project(":core:descriptors.jvm"))
|
||||
compile(project(":kotlin-compiler-runner"))
|
||||
compile(project(":compiler:daemon-common"))
|
||||
compile(projectRuntimeJar(":kotlin-daemon-client"))
|
||||
compile(project(":compiler:frontend.java"))
|
||||
compile(project(":js:js.frontend"))
|
||||
compile(projectRuntimeJar(":kotlin-preloader"))
|
||||
compile(project(":idea:idea-jps-common"))
|
||||
compileOnly(group = "org.jetbrains", name = "annotations", version = "13.0")
|
||||
compileOnly(intellijDep()) { includeJars("jdom", "trove4j", "jps-model", "openapi", "platform-api", "util", "asm-all") }
|
||||
compileOnly(intellijDep("jps-standalone")) { includeJars("jps-builders", "jps-builders-6") }
|
||||
testCompileOnly(project(":kotlin-reflect-api"))
|
||||
testCompile(project(":compiler:incremental-compilation-impl"))
|
||||
testCompile(projectTests(":compiler:tests-common"))
|
||||
testCompile(projectTests(":compiler:incremental-compilation-impl"))
|
||||
testCompile(commonDep("junit:junit"))
|
||||
testCompile(projectDist(":kotlin-test:kotlin-test-jvm"))
|
||||
testCompile(projectTests(":kotlin-build-common"))
|
||||
testCompileOnly(intellijDep("jps-standalone")) { includeJars("jps-builders", "jps-builders-6") }
|
||||
testCompileOnly(intellijDep()) { includeJars("openapi", "idea", "platform-api", "log4j") }
|
||||
testCompile(intellijDep("jps-build-test"))
|
||||
compilerModules.forEach {
|
||||
testRuntime(project(it))
|
||||
}
|
||||
testRuntime(intellijDep())
|
||||
testRuntime(projectDist(":kotlin-reflect"))
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {
|
||||
/*java.srcDirs("jps-tests/test"
|
||||
/*, "kannotator-jps-plugin-test/test"*/ // Obsolete
|
||||
)*/
|
||||
}
|
||||
}
|
||||
|
||||
projectTest {
|
||||
dependsOn(":kotlin-compiler:dist")
|
||||
workingDir = rootDir
|
||||
}
|
||||
|
||||
testsJar {}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.android.model.impl
|
||||
|
||||
import com.android.builder.model.SourceProvider
|
||||
import com.android.tools.idea.gradle.project.GradleProjectInfo
|
||||
import com.android.tools.idea.gradle.project.model.AndroidModuleModel
|
||||
import com.android.tools.idea.res.ResourceRepositoryManager
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import org.jetbrains.android.facet.AndroidFacet
|
||||
import org.jetbrains.kotlin.android.model.AndroidModuleInfoProvider
|
||||
import java.io.File
|
||||
|
||||
class AndroidModuleInfoProviderImpl(override val module: Module) : AndroidModuleInfoProvider {
|
||||
private val androidFacet: AndroidFacet?
|
||||
get() = AndroidFacet.getInstance(module)
|
||||
|
||||
private val androidModuleModel: AndroidModuleModel?
|
||||
get() = AndroidModuleModel.get(module)
|
||||
|
||||
override fun isAndroidModule() = androidFacet != null
|
||||
override fun isGradleModule() = GradleProjectInfo.getInstance(module.project).isBuildWithGradle
|
||||
|
||||
override fun getAllResourceDirectories(): List<VirtualFile> {
|
||||
return androidFacet?.allResourceDirectories ?: emptyList()
|
||||
}
|
||||
|
||||
override fun getApplicationPackage() = androidFacet?.manifest?.`package`?.toString()
|
||||
|
||||
override fun getMainSourceProvider(): AndroidModuleInfoProvider.SourceProviderMirror? {
|
||||
return androidFacet?.mainSourceProvider?.let(::SourceProviderMirrorImpl)
|
||||
}
|
||||
|
||||
override fun getApplicationResourceDirectories(createIfNecessary: Boolean): Collection<VirtualFile> {
|
||||
return ResourceRepositoryManager.getOrCreateInstance(module)?.getAppResources(createIfNecessary)?.resourceDirs ?: emptyList()
|
||||
}
|
||||
|
||||
override fun getAllSourceProviders(): List<AndroidModuleInfoProvider.SourceProviderMirror> {
|
||||
val androidModuleModel = this.androidModuleModel ?: return emptyList()
|
||||
return androidModuleModel.allSourceProviders.map(::SourceProviderMirrorImpl)
|
||||
}
|
||||
|
||||
override fun getActiveSourceProviders(): List<AndroidModuleInfoProvider.SourceProviderMirror> {
|
||||
val androidModuleModel = this.androidModuleModel ?: return emptyList()
|
||||
return androidModuleModel.activeSourceProviders.map(::SourceProviderMirrorImpl)
|
||||
}
|
||||
|
||||
override fun getFlavorSourceProviders(): List<AndroidModuleInfoProvider.SourceProviderMirror> {
|
||||
val androidModuleModel = this.androidModuleModel ?: return emptyList()
|
||||
|
||||
val getFlavorSourceProvidersMethod = try {
|
||||
AndroidFacet::class.java.getMethod("getFlavorSourceProviders")
|
||||
} catch (e: NoSuchMethodException) {
|
||||
null
|
||||
}
|
||||
|
||||
return if (getFlavorSourceProvidersMethod != null) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val sourceProviders = getFlavorSourceProvidersMethod.invoke(androidFacet) as? List<SourceProvider>
|
||||
sourceProviders?.map(::SourceProviderMirrorImpl) ?: emptyList()
|
||||
} else {
|
||||
androidModuleModel.flavorSourceProviders.map(::SourceProviderMirrorImpl)
|
||||
}
|
||||
}
|
||||
|
||||
private class SourceProviderMirrorImpl(val sourceProvider: SourceProvider) :
|
||||
AndroidModuleInfoProvider.SourceProviderMirror {
|
||||
override val name: String
|
||||
get() = sourceProvider.name
|
||||
|
||||
override val resDirectories: Collection<File>
|
||||
get() = sourceProvider.resDirectories
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ dependencies {
|
||||
compile(project(":compiler:util"))
|
||||
compile(project(":jps-plugin"))
|
||||
compile(project(":plugins:android-extensions-compiler"))
|
||||
compileOnly(intellijDep()) { includeJars("openapi", "jps-builders", "jps-model", "jdom") }
|
||||
compileOnly(intellijDep()) { includeJars("openapi", "platform-api", "jps-builders", "jps-model", "jdom") }
|
||||
compileOnly(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") }
|
||||
compile(intellijPluginDep("android")) { includeJars("jps/android-jps-plugin") }
|
||||
|
||||
|
||||
+12
-11
@@ -1,9 +1,8 @@
|
||||
|
||||
extra["versions.intellijSdk"] = "181.5281.24"
|
||||
extra["versions.intellijSdk"] = "182.2371.4"
|
||||
extra["versions.androidBuildTools"] = "r23.0.1"
|
||||
extra["versions.idea.NodeJS"] = "181.2784.17"
|
||||
extra["versions.androidStudioRelease"] = "3.3.0.2"
|
||||
extra["versions.androidStudioBuild"] = "181.4884283"
|
||||
extra["versions.idea.NodeJS"] = "181.3494.12"
|
||||
extra["versions.androidStudioRelease"] = "3.3.0.3"
|
||||
extra["versions.androidStudioBuild"] = "182.4902073"
|
||||
|
||||
val gradleJars = listOf(
|
||||
"gradle-api",
|
||||
@@ -31,7 +30,7 @@ val platform = androidStudioVersion?.let { "AS$it" } ?: platformBaseVersion
|
||||
when (platform) {
|
||||
"182" -> {
|
||||
extra["versions.jar.guava"] = "23.6-jre"
|
||||
extra["versions.jar.groovy-all"] = "2.4.12"
|
||||
extra["versions.jar.groovy-all"] = "2.4.15"
|
||||
extra["versions.jar.lombok-ast"] = "0.2.3"
|
||||
extra["versions.jar.swingx-core"] = "1.6.2-2"
|
||||
extra["versions.jar.kxml2"] = "2.3.0"
|
||||
@@ -118,18 +117,20 @@ when (platform) {
|
||||
extra["ignore.jar.lombok-ast"] = true
|
||||
}
|
||||
"AS33" -> {
|
||||
extra["versions.jar.guava"] = "21.0"
|
||||
extra["versions.jar.groovy-all"] = "2.4.12"
|
||||
extra["versions.jar.swingx-core"] = "1.6.2"
|
||||
extra["versions.jar.guava"] = "23.6-jre"
|
||||
extra["versions.jar.groovy-all"] = "2.4.15"
|
||||
extra["versions.jar.lombok-ast"] = "0.2.3"
|
||||
extra["versions.jar.swingx-core"] = "1.6.2-2"
|
||||
extra["versions.jar.kxml2"] = "2.3.0"
|
||||
extra["versions.jar.streamex"] = "0.6.5"
|
||||
extra["versions.jar.gson"] = "2.8.2"
|
||||
extra["versions.jar.gson"] = "2.8.4"
|
||||
extra["versions.jar.oro"] = "2.0.8"
|
||||
extra["versions.jar.snappy-in-java"] = "0.5.1"
|
||||
extra["versions.jar.picocontainer"] = "1.2"
|
||||
for (jar in gradleJars) {
|
||||
extra["versions.jar.$jar"] = "4.4"
|
||||
}
|
||||
|
||||
extra["ignore.jar.snappy-in-java"] = true
|
||||
extra["ignore.jar.common"] = true
|
||||
extra["ignore.jar.lombok-ast"] = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user