as35: Upgrade to AS 3.5 C10
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
|
||||
|
||||
cacheRedirectorEnabled=true
|
||||
|
||||
#buildSrc.kotlin.repo=https://jcenter.bintray.com
|
||||
#buildSrc.kotlin.version=1.1.50
|
||||
|
||||
intellijUltimateEnabled=false
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,13 @@
|
||||
org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m -Dfile.encoding=UTF-8
|
||||
|
||||
cacheRedirectorEnabled=true
|
||||
|
||||
kotlin.compiler.effectSystemEnabled=true
|
||||
kotlin.compiler.newInferenceEnabled=true
|
||||
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
||||
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
||||
#bootstrap.kotlin.version=1.1.50-dev-1451
|
||||
#signingRequired=true
|
||||
|
||||
intellijUltimateEnabled=false
|
||||
intellijEnforceCommunitySdk=true
|
||||
@@ -1,8 +1,8 @@
|
||||
versions.intellijSdk=183.4886.37
|
||||
versions.intellijSdk=191.5849.21
|
||||
versions.androidBuildTools=r23.0.1
|
||||
versions.idea.NodeJS=181.3494.12
|
||||
versions.androidStudioRelease=3.5.0.0
|
||||
versions.androidStudioBuild=183.5215047
|
||||
versions.androidStudioRelease=3.5.0.9
|
||||
versions.androidStudioBuild=191.5416148
|
||||
versions.jar.guava=25.1-jre
|
||||
versions.jar.groovy-all=2.4.15
|
||||
versions.jar.lombok-ast=0.2.3
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/*
|
||||
* 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.config
|
||||
|
||||
import org.jetbrains.jps.model.ex.JpsElementTypeBase
|
||||
import org.jetbrains.jps.model.java.JavaSourceRootProperties
|
||||
import org.jetbrains.jps.model.java.JavaSourceRootType
|
||||
import org.jetbrains.jps.model.java.JpsJavaExtensionService
|
||||
import org.jetbrains.jps.model.module.JpsModuleSourceRootType
|
||||
|
||||
sealed class KotlinSourceRootType(val isTest: Boolean) : JpsElementTypeBase<JavaSourceRootProperties>(), JpsModuleSourceRootType<JavaSourceRootProperties>, KotlinRootType {
|
||||
|
||||
|
||||
override fun createDefaultProperties() = JpsJavaExtensionService.getInstance().createSourceRootProperties("")
|
||||
|
||||
|
||||
override fun isTestRoot() = isTest
|
||||
|
||||
fun isForTests() = isTest
|
||||
|
||||
override fun equals(other: Any?) = if (super.equals(other)) true else isSameRootType(this, other)
|
||||
}
|
||||
|
||||
object SourceKotlinRootType : KotlinSourceRootType(false)
|
||||
|
||||
object TestSourceKotlinRootType : KotlinSourceRootType(true)
|
||||
|
||||
val ALL_KOTLIN_SOURCE_ROOT_TYPES = setOf(SourceKotlinRootType, TestSourceKotlinRootType)
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@file:Suppress("IncompatibleAPI")
|
||||
|
||||
package org.jetbrains.kotlin.idea.run
|
||||
|
||||
import com.intellij.execution.configurations.LocatableConfigurationBase
|
||||
import com.intellij.execution.configurations.ModuleBasedConfiguration
|
||||
import com.intellij.execution.configurations.RunConfigurationBase
|
||||
import org.jdom.Element
|
||||
|
||||
// Generalized in 183
|
||||
// BUNCH: 182
|
||||
typealias RunConfigurationBaseAny = RunConfigurationBase<*>
|
||||
|
||||
// Generalized in 183
|
||||
// BUNCH: 182
|
||||
typealias ModuleBasedConfigurationAny = ModuleBasedConfiguration<*, *>
|
||||
|
||||
// Generalized in 183
|
||||
// BUNCH: 182
|
||||
typealias LocatableConfigurationBaseAny = LocatableConfigurationBase<Any>
|
||||
|
||||
// Generalized in 183
|
||||
// BUNCH: 182
|
||||
typealias ModuleBasedConfigurationElement<T> = ModuleBasedConfiguration<T, Element>
|
||||
@@ -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>
|
||||
@@ -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="183.4886.37.35.5215047" until-build="183.*"/>
|
||||
<idea-version since-build="191.6014.8.35.5375575" until-build="191.*"/>
|
||||
|
||||
<depends>com.intellij.modules.platform</depends>
|
||||
<depends>com.intellij.modules.androidstudio</depends>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2000-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.highlighter.markers
|
||||
|
||||
import com.intellij.application.options.colors.ColorAndFontOptions
|
||||
import com.intellij.codeHighlighting.Pass
|
||||
import com.intellij.codeInsight.daemon.GutterIconNavigationHandler
|
||||
import com.intellij.codeInsight.daemon.LineMarkerInfo
|
||||
import com.intellij.icons.AllIcons
|
||||
import com.intellij.ide.DataManager
|
||||
import com.intellij.openapi.editor.markup.GutterIconRenderer
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.util.Function
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||
import org.jetbrains.kotlin.idea.core.toDescriptor
|
||||
import org.jetbrains.kotlin.idea.highlighter.dsl.DslHighlighterExtension
|
||||
import org.jetbrains.kotlin.idea.highlighter.dsl.isDslHighlightingMarker
|
||||
import org.jetbrains.kotlin.psi.KtClass
|
||||
import javax.swing.JComponent
|
||||
|
||||
private val navHandler = GutterIconNavigationHandler<PsiElement> { event, element ->
|
||||
val dataContext = (event.component as? JComponent)?.let { DataManager.getInstance().getDataContext(it) }
|
||||
?: return@GutterIconNavigationHandler
|
||||
val ktClass = element?.parent as? KtClass ?: return@GutterIconNavigationHandler
|
||||
val styleId = ktClass.styleIdForMarkerAnnotation() ?: return@GutterIconNavigationHandler
|
||||
ColorAndFontOptions.selectOrEditColor(dataContext, DslHighlighterExtension.styleOptionDisplayName(styleId), KotlinLanguage.NAME)
|
||||
}
|
||||
|
||||
private val toolTipHandler = Function<PsiElement, String> {
|
||||
"Marker annotation for DSL"
|
||||
}
|
||||
|
||||
fun collectHighlightingColorsMarkers(
|
||||
ktClass: KtClass,
|
||||
result: MutableCollection<LineMarkerInfo<*>>
|
||||
) {
|
||||
if (ktClass.styleIdForMarkerAnnotation() == null) return
|
||||
|
||||
val anchor = ktClass.nameIdentifier ?: return
|
||||
|
||||
result.add(
|
||||
LineMarkerInfo<PsiElement>(
|
||||
anchor,
|
||||
anchor.textRange,
|
||||
AllIcons.Gutter.Colors,
|
||||
Pass.LINE_MARKERS,
|
||||
toolTipHandler, navHandler,
|
||||
GutterIconRenderer.Alignment.RIGHT
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private fun KtClass.styleIdForMarkerAnnotation(): Int? {
|
||||
val classDescriptor = toDescriptor() as? ClassDescriptor ?: return null
|
||||
if (classDescriptor.kind != ClassKind.ANNOTATION_CLASS) return null
|
||||
if (!classDescriptor.isDslHighlightingMarker()) return null
|
||||
return DslHighlighterExtension.styleIdByMarkerAnnotation(classDescriptor)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright 2010-2019 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.reporter
|
||||
|
||||
import com.intellij.diagnostic.ITNReporter
|
||||
import com.intellij.openapi.diagnostic.IdeaLoggingEvent
|
||||
import com.intellij.openapi.diagnostic.SubmittedReportInfo
|
||||
import com.intellij.util.Consumer
|
||||
import java.awt.Component
|
||||
|
||||
abstract class ITNReporterCompat : ITNReporter() {
|
||||
final override fun submit(
|
||||
events: Array<IdeaLoggingEvent>,
|
||||
additionalInfo: String?,
|
||||
parentComponent: Component?,
|
||||
consumer: Consumer<SubmittedReportInfo>
|
||||
): Boolean {
|
||||
return submitCompat(events, additionalInfo, parentComponent, consumer)
|
||||
}
|
||||
|
||||
open fun submitCompat(
|
||||
events: Array<IdeaLoggingEvent>,
|
||||
additionalInfo: String?,
|
||||
parentComponent: Component?,
|
||||
consumer: Consumer<SubmittedReportInfo>
|
||||
): Boolean {
|
||||
@Suppress("IncompatibleAPI")
|
||||
return super.submit(events, additionalInfo, parentComponent, consumer)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright 2010-2019 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.ide.plugins.PluginManagerCore
|
||||
import com.intellij.ide.plugins.PluginNode
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import org.jetbrains.kotlin.idea.util.isDev
|
||||
import org.jetbrains.kotlin.idea.util.isEap
|
||||
import java.io.IOException
|
||||
import java.net.URL
|
||||
import java.util.*
|
||||
import javax.xml.bind.JAXBContext
|
||||
import javax.xml.bind.JAXBException
|
||||
import javax.xml.bind.annotation.*
|
||||
|
||||
class GooglePluginUpdateVerifier : PluginUpdateVerifier() {
|
||||
override val verifierName: String
|
||||
get() = "Android Studio"
|
||||
|
||||
// Verifies if a plugin can be installed in Android Studio 3.2+.
|
||||
// Currently used only by KotlinPluginUpdater.
|
||||
override fun verify(pluginDescriptor: IdeaPluginDescriptor): PluginVerifyResult? {
|
||||
if (pluginDescriptor.pluginId.idString != KOTLIN_PLUGIN_ID) {
|
||||
return null
|
||||
}
|
||||
|
||||
val version = pluginDescriptor.version
|
||||
if (isEap(version) || isDev(version)) {
|
||||
return PluginVerifyResult.accept()
|
||||
}
|
||||
|
||||
try {
|
||||
val url = URL(METADATA_FILE_URL)
|
||||
val stream = url.openStream()
|
||||
val context = JAXBContext.newInstance(PluginCompatibility::class.java)
|
||||
val unmarshaller = context.createUnmarshaller()
|
||||
val pluginCompatibility = unmarshaller.unmarshal(stream) as PluginCompatibility
|
||||
|
||||
val release = getRelease(pluginCompatibility)
|
||||
?: return PluginVerifyResult.decline("No verified versions for this build.")
|
||||
|
||||
return if (release.plugins().any { KOTLIN_PLUGIN_ID == it.id && version == it.version })
|
||||
PluginVerifyResult.accept()
|
||||
else
|
||||
PluginVerifyResult.decline("Version to be verified.")
|
||||
} catch (e: Exception) {
|
||||
LOG.info("Exception when verifying plugin ${pluginDescriptor.pluginId.idString} version $version", e)
|
||||
return when (e) {
|
||||
is IOException ->
|
||||
PluginVerifyResult.decline("unable to connect to compatibility verification repository")
|
||||
is JAXBException -> PluginVerifyResult.decline("unable to parse compatibility verification metadata")
|
||||
else -> PluginVerifyResult.decline("exception during verification ${e.message}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getRelease(pluginCompatibility: PluginCompatibility): StudioRelease? {
|
||||
for (studioRelease in pluginCompatibility.releases()) {
|
||||
if (buildInRange(studioRelease.name, studioRelease.sinceBuild, studioRelease.untilBuild)) {
|
||||
return studioRelease
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
private fun buildInRange(name: String?, sinceBuild: String?, untilBuild: String?): Boolean {
|
||||
val descriptor = PluginNode()
|
||||
descriptor.name = name
|
||||
descriptor.sinceBuild = sinceBuild
|
||||
descriptor.untilBuild = untilBuild
|
||||
return PluginManagerCore.isCompatible(descriptor)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val KOTLIN_PLUGIN_ID = "org.jetbrains.kotlin"
|
||||
private const val METADATA_FILE_URL = "https://dl.google.com/android/studio/plugins/compatibility.xml"
|
||||
|
||||
private val LOG = Logger.getInstance(GooglePluginUpdateVerifier::class.java)
|
||||
|
||||
private fun PluginCompatibility.releases() = studioRelease ?: emptyArray()
|
||||
private fun StudioRelease.plugins() = ideaPlugin ?: emptyArray()
|
||||
|
||||
@XmlRootElement(name = "plugin-compatibility")
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
class PluginCompatibility {
|
||||
@XmlElement(name = "studio-release")
|
||||
var studioRelease: Array<StudioRelease>? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return "PluginCompatibility(studioRelease=${Arrays.toString(studioRelease)})"
|
||||
}
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
class StudioRelease {
|
||||
@XmlAttribute(name = "until-build")
|
||||
var untilBuild: String? = null
|
||||
@XmlAttribute(name = "since-build")
|
||||
var sinceBuild: String? = null
|
||||
@XmlAttribute
|
||||
var name: String? = null
|
||||
@XmlAttribute
|
||||
var channel: String? = null
|
||||
|
||||
@XmlElement(name = "idea-plugin")
|
||||
var ideaPlugin: Array<IdeaPlugin>? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return "StudioRelease(" +
|
||||
"untilBuild=$untilBuild, name=$name, ideaPlugin=${Arrays.toString(ideaPlugin)}, " +
|
||||
"sinceBuild=$sinceBuild, channel=$channel" +
|
||||
")"
|
||||
}
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
class IdeaPlugin {
|
||||
@XmlAttribute
|
||||
var id: String? = null
|
||||
@XmlAttribute
|
||||
var sha256: String? = null
|
||||
@XmlAttribute
|
||||
var channel: String? = null
|
||||
@XmlAttribute
|
||||
var version: String? = null
|
||||
|
||||
@XmlElement(name = "idea-version")
|
||||
var ideaVersion: IdeaVersion? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return "IdeaPlugin(id=$id, sha256=$sha256, ideaVersion=$ideaVersion, channel=$channel, version=$version)"
|
||||
}
|
||||
}
|
||||
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
class IdeaVersion {
|
||||
@XmlAttribute(name = "until-build")
|
||||
var untilBuild: String? = null
|
||||
@XmlAttribute(name = "since-build")
|
||||
var sinceBuild: String? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return "IdeaVersion(untilBuild=$untilBuild, sinceBuild=$sinceBuild)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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,13 @@
|
||||
/*
|
||||
* 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.jps.build
|
||||
|
||||
import org.jetbrains.jps.incremental.CompileContext
|
||||
import org.jetbrains.jps.incremental.messages.CompilerMessage
|
||||
|
||||
fun jpsReportInternalBuilderError(context: CompileContext, error: Throwable) {
|
||||
KotlinBuilder.LOG.info(error)
|
||||
}
|
||||
Reference in New Issue
Block a user