2 months agoAndroid: update test data (fix failing tests after THashMap->HashMap migration) 203.1774 pycharm/203.1774.6
Andrei Kuznetsov [Tue, 28 Jul 2020 18:09:47 +0000 (21:09 +0300)]
Android: update test data (fix failing tests after THashMap->HashMap migration)

Note that default code style in IDEA does not specify order on `xmlns:` attributes. It only says that the order does not change during formatting, and it should be placed before any other attribute.

GitOrigin-RevId: cf03b356eb391bb89104b30168792fd70aa9a67a

2 months agoIDEA-231267: Android: use Project JDK as Gradle JVM, and keep JDK in range [8..11]
Andrei Kuznetsov [Mon, 27 Jul 2020 21:52:15 +0000 (00:52 +0300)]
IDEA-231267: Android: use Project JDK as Gradle JVM, and keep JDK in range [8..11]

Don't explicitly specify Gradle JVM when creating project - leave default value (project JDK) and set desired JDK as project JDK. Desired JDK is obtained from IdeSdks.getJdk which provides surely compatible JDK (or null if no such JDK in the project table).

IdeSdks.isJdkCompatible now does not return JDK newer than 11, because Android projects use Gradle 6.1.1 which is not compatible with JDK 14, and the largest LTS supported JDK which works fine with android tools is 11 (newer versions are not heavily tested as of now).

GitOrigin-RevId: a40a83cf923a7a7f7109615d78c79f7024c9f40e

2 months agoIDEA-231267: Android: Deduplicate code (Jdks.isApplicableJdk/IdeSdks.isJdkCompatible...
Andrei Kuznetsov [Mon, 27 Jul 2020 12:59:17 +0000 (15:59 +0300)]
IDEA-231267: Android: Deduplicate code (Jdks.isApplicableJdk/IdeSdks.isJdkCompatible). Prefer IdeSdks.isJdkCompatible

`Jdks.isApplicableJdk` and `IdeSdks.isJdkCompatible` are doing the same thing. Just keep one of them - `IdeSdks.isJdkCompatible`.
Note that LangualeLevel in `Jdks.isApplicableJdk(Sdk, LangualeLevel)` was only used to compare it with `Sdk.getJavaSdkVersion.getMaxLanguageLevel`, so it is safe to replace it with `JavaSdkVersion` (JDK of version X supports some language levels up to X inclusive).

Additional efforts might be needed to not suggest SDKs which minLanguageLevel is larger than required LanguageLevel Y. The following commit will partially fix this by limiting upper JDK version.

GitOrigin-RevId: d74d0d82874938d68315ca687a109bf53cc4cb05

2 months agoIDEA-231267: Android: Deduplicate code (`Jdks.chooseOrCreateJavaSdk`/`IdeSdks.getJdk...
Andrei Kuznetsov [Sun, 26 Jul 2020 21:32:57 +0000 (00:32 +0300)]
IDEA-231267: Android: Deduplicate code (`Jdks.chooseOrCreateJavaSdk`/`IdeSdks.getJdk()`). Prefer IdeSdks.getJdk()

`Jdks.chooseOrCreateJavaSdk` and `IdeSdks.getJdk()` are doing the same thing. Just keep one of them - `IdeSdks.getJdk()`.
Note that it is not possible to pass instance of IdeSdks to AndroidSdks constructor, because instance of AndroidSdks should be passed to IdeSdks constructor. Break the cycle: AndroidSdks will invoke IdeSdks.getInstance().getJdk() as needed

GitOrigin-RevId: b59ad7e09e255604f955beb84c00da689736b4dd

2 months agoIDEA-231267: Android: Deduplicate code (`getJdk`/`getJdkPath` methods behavior made...
Andrei Kuznetsov [Sat, 25 Jul 2020 21:50:10 +0000 (00:50 +0300)]
IDEA-231267: Android: Deduplicate code (`getJdk`/`getJdkPath` methods behavior made more aligned with each other)

Extract code which supposed to do the same things from `getJdk` and `getJdkPath` into new methods: `getExistingJdk` and `createNewJdk`. Now invariant `getJdk().getHomePath() == getJdkPath()` should hold in all the cases, except the situation when `getJdk().getHomePath() == null` for any reason, or `STUDIO_GRADLE_JDK` env variable is set (`getJdk()` does not handle `STUDIO_GRADLE_JDK`, only `getJdkPath()` is aware about this variable).

GitOrigin-RevId: 95d97d16a83979043ab93469b6f26836c95d2919

2 months ago[android tests] don't register Android SDK twice in AndroidManifestDomTest
Nikolay Chashnikov [Tue, 28 Jul 2020 17:49:57 +0000 (20:49 +0300)]
[android tests] don't register Android SDK twice in AndroidManifestDomTest

Android SDK is registered in Sdks.createLatestAndroidSdk, and if we register it in the test we'll get two identical instances in ProjectJdkTable. And during tearDown when removeJdk was called for a first time, it disposed ProjectJdkImpl instance and fired jdkRemoved event, and RootIndex tries to rebuild itself and accessed content of disposed ProjectJdkImpl instance (because the second instance is still present in ProjectJdkTable).

GitOrigin-RevId: bfe741569dfaa2a54c6d6680f93c268d39d2c264

3 months agofix test data
Vladimir Krivosheev [Sat, 25 Jul 2020 15:47:57 +0000 (17:47 +0200)]
fix test data

GitOrigin-RevId: 59f93e623e7b61aaaa8500838cecd4d3d2f18479

3 months agoi18n in Kotlin: kotlin parameter nls context annotations
Dmitry.Krasilschikov [Thu, 23 Jul 2020 16:51:51 +0000 (19:51 +0300)]
i18n in Kotlin: kotlin parameter nls context annotations

Mostly needed "Hard Coded String" inspection to work for kotlin API annotation in java

GitOrigin-RevId: ccd6b67eb5a72b4366a46bb0acbebc690c166bc5

3 months agoprefer jdk collections (ArrayDeque)
Vladimir Krivosheev [Thu, 23 Jul 2020 08:47:05 +0000 (10:47 +0200)]
prefer jdk collections (ArrayDeque)

GitOrigin-RevId: 34712845c5a5fd7c16e8e22c3ef0463cf6c03485

3 months agoIDEA-246228: Gradle JVM setting is ignored in a project with Android modules
Andrei Kuznetsov [Wed, 22 Jul 2020 20:47:07 +0000 (23:47 +0300)]
IDEA-246228: Gradle JVM setting is ignored in a project with Android modules

There is no need to invoke `operation.setJavaHome` explicitly. It is set in `org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.prepare(...)` few lines above

GitOrigin-RevId: 2995001785a981686f6323507da3bcbd1ddbe03f

3 months agoarchive file systems: cleanup disk access with checkCanceled, use it for content...
Peter Gromov [Wed, 22 Jul 2020 15:00:15 +0000 (17:00 +0200)]
archive file systems: cleanup disk access with checkCanceled, use it for content loading as well (EA-216314, EA-230422)

GitOrigin-RevId: 19f9906ee03c4d91952c6baad2a72470ca4130e7

3 months agoIDEA-246228: Gradle JVM setting is ignored in a project with Android modules
Andrei Kuznetsov [Tue, 21 Jul 2020 22:29:28 +0000 (01:29 +0300)]
IDEA-246228: Gradle JVM setting is ignored in a project with Android modules

GitOrigin-RevId: 165dcf62502ed181b67869d12a09615df12fcbb6

3 months agomark not null parameters @NotNull to fix yellow code
Alexey Kudravtsev [Thu, 16 Jul 2020 15:16:11 +0000 (18:16 +0300)]
mark not null parameters @NotNull to fix yellow code

GitOrigin-RevId: fe7b53cfa26ab7cc3a9fa4928680a08c1e57bf44

3 months agoavoid passing null argument to the @NotNull parameter
Alexey Kudravtsev [Thu, 16 Jul 2020 15:11:50 +0000 (18:11 +0300)]
avoid passing null argument to the @NotNull parameter

GitOrigin-RevId: bc585519d113bcafb3cc99ea7678dc5cde521d51

3 months agoDialogSaver - accept Path in addition to VirtualFile
Vladimir Krivosheev [Sun, 19 Jul 2020 10:44:07 +0000 (12:44 +0200)]
DialogSaver - accept Path in addition to VirtualFile

GitOrigin-RevId: 399d7997fee98e76062142b2984e1b3e963d84e2

3 months agoremove usages of isMacOSLion / isMacOSMountainLion because IJ Platform requires at...
Vladimir Krivosheev [Fri, 17 Jul 2020 07:52:53 +0000 (09:52 +0200)]
remove usages of isMacOSLion / isMacOSMountainLion because IJ Platform requires at least macOS 10.13

GitOrigin-RevId: c3d148fb6b0c0130a3220ffbc720de3f01d295d5

3 months agoBomb slow muted failing tests in IDEA to speed up test suite
Andrei Kuznetsov [Fri, 17 Jul 2020 08:29:44 +0000 (11:29 +0300)]
Bomb slow muted failing tests in IDEA to speed up test suite

This commit is to experiment with Android test suite performance. Most like it will not speed up anything. Gradle test cases are slow because of indexing. But in fact, sync tests do not need any indexes to complete. Mechanics is as follows: test case imports project from gradle. During import new modules are created. When a module is committed, it triggers "roots changed" event. This triggers indexing. Normally indexing is happening in parallel background thread, but there is a check in `com.intellij.openapi.project.DumbServiceImpl.isSynchronousTaskExecution` which detects unit-test mode, and starts execution in EDT. So test case have to wait few more minutes. Subsequent runs are much faster when indexes are warmed up.

GitOrigin-RevId: 0d183a3cc65b3e2583d440483e89f73e060af56c

3 months agoAnnotate bundle methods as Nls
Tagir Valeev [Fri, 17 Jul 2020 07:44:54 +0000 (14:44 +0700)]
Annotate bundle methods as Nls

GitOrigin-RevId: db851b498d99f538e1f747faa4fb4d954848982f

3 months agoMaintenanceActivity should be dumb-aware activity
Vladimir Krivosheev [Thu, 16 Jul 2020 17:03:14 +0000 (19:03 +0200)]
MaintenanceActivity should be dumb-aware activity

GitOrigin-RevId: 919dc1f8ff16743f522ce594e5853215b9173690

3 months agoAvoid using StdFileTypes
Tagir Valeev [Fri, 17 Jul 2020 03:35:55 +0000 (10:35 +0700)]
Avoid using StdFileTypes

GitOrigin-RevId: 1e9ad9fd34c5cc06d145e061da515fb7a29a07a7

3 months agodon't use createLazyKey for JavaPsiFacade
Vladimir Krivosheev [Tue, 14 Jul 2020 12:54:05 +0000 (14:54 +0200)]
don't use createLazyKey for JavaPsiFacade

GitOrigin-RevId: bc282038ba5264b228904fa98c7727a733ee2502

3 months agoIDEA-245480: Safe fix for "Can't start Java application in debug using gradle" when...
Andrei Kuznetsov [Tue, 14 Jul 2020 12:58:40 +0000 (15:58 +0300)]
IDEA-245480: Safe fix for "Can't start Java application in debug using gradle" when android module added to the project

GitOrigin-RevId: 7b4fb57442b8985d66f99b24ad9b41d0972bae9a

3 months agoFix failing StudioHelpManagerImplTest, and make some of these tests useful in IDEA...
Andrei Kuznetsov [Mon, 13 Jul 2020 18:18:10 +0000 (21:18 +0300)]
Fix failing StudioHelpManagerImplTest, and make some of these tests useful in IDEA (not only in Studio)

GitOrigin-RevId: f78427243319030520e114953bbfc4da88099259

3 months agoHeavyPlatformTestCase - do not create project file explicitly
Vladimir Krivosheev [Mon, 6 Jul 2020 13:41:08 +0000 (15:41 +0200)]
HeavyPlatformTestCase - do not create project file explicitly

GitOrigin-RevId: ff63aa57752fdf5303122ca5c6355a0eff722d70

3 months agoRe-use android-studio help topics is IDEA
Andrei Kuznetsov [Mon, 13 Jul 2020 16:01:48 +0000 (19:01 +0300)]
Re-use android-studio help topics is IDEA

From now on F1 in android tool-windows in IDEA will land a user to website, just like it happens in AndroidStudio.

GitOrigin-RevId: 3d8b0ef4f0cd71824d656664793e287c49757c8a

3 months agorefactor IdentifierHighlighterPassFactory.doWithHighlightingEnabled to prepare moving...
Alexey Kudravtsev [Sat, 11 Jul 2020 16:56:13 +0000 (19:56 +0300)]
refactor IdentifierHighlighterPassFactory.doWithHighlightingEnabled to prepare moving identifier highlighting out of a highlighting pass

GitOrigin-RevId: fee9ed0e4cf10d4ade320358c58ebd1ad3d8e403

3 months agoIDEA-243771: Android project tooltip in the New Project wizard is too long. Make...
Andrei Kuznetsov [Fri, 10 Jul 2020 21:11:13 +0000 (00:11 +0300)]
IDEA-243771: Android project tooltip in the New Project wizard is too long. Make it multiline.

GitOrigin-RevId: 46d6478f374548e004b075b492724cc06d0a0736

3 months agoAndroid: don't move actions programmatically. Use declarative approach.
Andrei Kuznetsov [Fri, 10 Jul 2020 18:08:58 +0000 (21:08 +0300)]
Android: don't move actions programmatically. Use declarative approach.

This will help IDE to initialize components (e.g. actions) lazily => improve startup time.

GitOrigin-RevId: 5dbc9283ca68fe57f8396285c68a41c7c31fde5b

3 months agoIDEA-245623: restore missing Android action group (AndroidToolsGroup)
Andrei Kuznetsov [Fri, 10 Jul 2020 17:39:54 +0000 (20:39 +0300)]
IDEA-245623: restore missing Android action group (AndroidToolsGroup)

LintBundle accidentally overrides AndroidBundle. Android's plugin.xml includes android-plugin.xml and lint-plugin.xml. Both declare `<resource-bundle>`, but inclusion of lint-plugin.xml appears later in the text, so LintBundle wins, and warning is displayed in IDEA logs. As a result, some messages were not found, action groups didn't have titles. Action groups with no title didn't appear in UI therefore AVD Manager action completely disappears from IDEA.

GitOrigin-RevId: 75ec2f9428580121e9f7cb5930631098a1f847b9

3 months agoIDEA-245510: Android: default values are not valid in New Project/Module wizard ...
Andrei Kuznetsov [Thu, 9 Jul 2020 10:40:22 +0000 (13:40 +0300)]
IDEA-245510: Android: default values are not valid in New Project/Module wizard (Chinese Simplified)

Don't translate module names into Chinese. The result is that package (application ID) contains non-ascii characters, which do not pass validation.

GitOrigin-RevId: 10ed0323a7322040b00e0eff2051ef7be3c5d062

3 months agoPsiModificationTrackerImpl.incCounter: require write access for IDEA-245099, deprecat...
Peter Gromov [Tue, 7 Jul 2020 09:48:53 +0000 (11:48 +0200)]
PsiModificationTrackerImpl.incCounter: require write access for IDEA-245099, deprecate, migrate usages to dropPsiCaches

GitOrigin-RevId: 4c300f05fd3b314fefa48f8244a74f28398c7dec

3 months ago[project model] mark Module::getModuleFile and related methods as internal and get...
Nikolay Chashnikov [Tue, 7 Jul 2020 09:02:26 +0000 (12:02 +0300)]
[project model] mark Module::getModuleFile and related methods as internal and get rid of some of their usages

This also introduces ModuleUtil.suggestBaseDirectory method which may be used instead of Module::getModuleFile in many cases.

GitOrigin-RevId: f5cbedece34ca7185383a24905385fc13ba809b0

3 months agoIDEA-170707: Android: lint running on java file in JAR module does not properly recog...
Andrei Kuznetsov [Mon, 6 Jul 2020 21:10:22 +0000 (00:10 +0300)]
IDEA-170707: Android: lint running on java file in JAR module does not properly recognize desugaring option of the main project

Which results in false positive on Java API (e.g. streams) when `coreLibraryDesugaringEnabled=true`

GitOrigin-RevId: be72d914e648b8b72a364e9b88d3756f2e98e208

3 months agoFix Android Plugin description
Andrei Kuznetsov [Mon, 6 Jul 2020 21:05:06 +0000 (00:05 +0300)]
Fix Android Plugin description

Which appears in plugin manager as "IDE support for running Android Lint..." (from lint-plugin.xml) instead of "Supports the development of Android applications..." (from plugin.xml), because plugin.xml includes lint-plugin.xml which has <description> tag.

GitOrigin-RevId: 4ca6452e40007f121e1305f5f04e520da723b9ec

3 months agoIDEA-245273: Remove hard-coded product name from Android Gradle proxy settings dialog
Andrei Kuznetsov [Mon, 6 Jul 2020 18:20:16 +0000 (21:20 +0300)]
IDEA-245273: Remove hard-coded product name from Android Gradle proxy settings dialog

GitOrigin-RevId: 6f8b900a6154c134cff4f02b5ec1f199af13dd66

3 months agoAndroid: Perf: don't iterate all modules to find a module with android facet
Andrei Kuznetsov [Fri, 3 Jul 2020 19:53:27 +0000 (22:53 +0300)]
Android: Perf: don't iterate all modules to find a module with android facet

GitOrigin-RevId: 12ad4589b39f76d7526198fc926b62ff4e3763f8

3 months agoIDEA-242843: Android XML code style should not be applied to non-android projects
Andrei Kuznetsov [Thu, 2 Jul 2020 22:23:30 +0000 (01:23 +0300)]
IDEA-242843: Android XML code style should not be applied to non-android projects

Originally Android XML formatter (AndroidXmlFormattingModelBuilder) was checking the presence of AndroidFacet. Due to some race conditions between the formatting of generated files and gradle-import (Bug: http://b/37631553) this check was removed on 18.05.2017 (Change-Id: Id7730f17567b2e3749933ef9db4040fe9c6a244d). Currently IDEA 2020.2 neither 2020.3 do not show any race conditions: AndroidFacet is timely added, formatting works as expected, and gradle build file does not show any popup suggesting to re-sync the project.

This commit restores check for presence of AndroidFacet in AndroidXmlFormattingModelBuilder.

GitOrigin-RevId: e7d68f404cd1543c8b96acaaa9cf6b86d0c68b6d

3 months agoIDEA-223524 BatchUpdateListener - only for project- and module- level components
Vladimir Krivosheev [Mon, 6 Jul 2020 13:03:33 +0000 (15:03 +0200)]
IDEA-223524 BatchUpdateListener - only for project- and module- level components

GitOrigin-RevId: 780def210128417892c842ff971a7acd808fb490

3 months agoIDEA-239645 i18n for Android DeviceFileExplorerConfigurable
Dmitry.Krasilschikov [Wed, 1 Jul 2020 16:23:50 +0000 (19:23 +0300)]
IDEA-239645 i18n for Android DeviceFileExplorerConfigurable

GitOrigin-RevId: 0e964529f8dc155f6a22ecccaf767c4fe4981496

3 months agocleanup - use AppExecutorUtil.getAppExecutorService() directly
Vladimir Krivosheev [Sat, 4 Jul 2020 15:34:33 +0000 (17:34 +0200)]
cleanup - use AppExecutorUtil.getAppExecutorService() directly

GitOrigin-RevId: f327995c44a5fed451c9f1dfde971a3eabfaa481

3 months agoIDEA-223524 don't preload project converters, create only if needed, remove outdated...
Vladimir Krivosheev [Sat, 4 Jul 2020 12:03:27 +0000 (14:03 +0200)]
IDEA-223524 don't preload project converters, create only if needed, remove outdated converters (8 years is enough to convert old projects)

GitOrigin-RevId: 3d133efd059574d4b27ee68b9b2bec6d08a456fc

3 months agoIDEA-223524 read project file content only if needed on conversion check, remove...
Vladimir Krivosheev [Thu, 2 Jul 2020 17:27:13 +0000 (19:27 +0200)]
IDEA-223524 read project file content only if needed on conversion check, remove AndroidProguardOptionsConverterProvider — 7 years is enough time to convert old projects

GitOrigin-RevId: ed28e66716ed5c89ed0d5fe965e6f59ec7a4d64f

3 months agostate storage manager macro value as path instead of string
Vladimir Krivosheev [Wed, 1 Jul 2020 12:37:56 +0000 (14:37 +0200)]
state storage manager macro value as path instead of string

GitOrigin-RevId: 6ab1192ec2cc53ff8db64e9fd1b9001a0141c39a

3 months agopass toolWindowManager to toolWindowsRegistered
Vladimir Krivosheev [Mon, 29 Jun 2020 13:46:20 +0000 (15:46 +0200)]
pass toolWindowManager to toolWindowsRegistered

GitOrigin-RevId: bd58d53655be253dfc87b79fcc2fae64a599eea4

3 months agoUsefulTestCase: Replace invokeTestRunnable() with runTestRunnable()
Eldar Abusalimov [Thu, 2 Jul 2020 02:37:29 +0000 (05:37 +0300)]
UsefulTestCase: Replace invokeTestRunnable() with runTestRunnable()

GitOrigin-RevId: 0900f73aa838cbf3c4b5c577cab97285ea4cea3c

3 months agoUsefulTestCase: Make invokeTestRunnable() take ThrowableRunnable
Eldar Abusalimov [Thu, 2 Jul 2020 02:00:03 +0000 (05:00 +0300)]
UsefulTestCase: Make invokeTestRunnable() take ThrowableRunnable

GitOrigin-RevId: f929b8cc7d7b10e60f627c67731ea9c627f0bbb4

3 months agoRemove @Before/@After annotations from JUnit3 setUp()/tearDown()
Eldar Abusalimov [Wed, 1 Jul 2020 14:24:23 +0000 (17:24 +0300)]
Remove @Before/@After annotations from JUnit3 setUp()/tearDown()

Also rename genuine JUnit4 setUp()/tearDown() annotated with
@Before/@After to before()/after() to avoid confusion.

GitOrigin-RevId: fb1b058a19e3bef910554c60b80211d48e33b8c1

3 months agoHeavyPlatformTestCase: Reuse our JUnit4 getRunBareTestRule()
Eldar Abusalimov [Wed, 1 Jul 2020 13:05:33 +0000 (16:05 +0300)]
HeavyPlatformTestCase: Reuse our JUnit4 getRunBareTestRule()

All its inheritors are now JUnit4-compatible.

GitOrigin-RevId: 8327de3af57b0cd63804326e45e54e5a69ec94e4

3 months agoEdtTestUtil: Properly declare exception thrown by runInEdtXxx() methods
Eldar Abusalimov [Tue, 30 Jun 2020 01:39:41 +0000 (04:39 +0300)]
EdtTestUtil: Properly declare exception thrown by runInEdtXxx() methods

GitOrigin-RevId: e0cd075cbc80ffbb1456ac480ce35d4113dc711f

3 months agoEdtTestUtil: Replace usages of ThrowableRunnable with { ... } lambdas
Eldar Abusalimov [Mon, 29 Jun 2020 19:49:32 +0000 (22:49 +0300)]
EdtTestUtil: Replace usages of ThrowableRunnable with { ... } lambdas

GitOrigin-RevId: 7fefb1c0302b3eec8e9396b3000fe2d21fa03cd8

3 months agoPlatformTestUtil: Make dispatchAllEventsInIdeEventQueue() throw unchecked
Eldar Abusalimov [Mon, 29 Jun 2020 16:28:09 +0000 (19:28 +0300)]
PlatformTestUtil: Make dispatchAllEventsInIdeEventQueue() throw unchecked

GitOrigin-RevId: 91d3845da156926be8255c9bf139ecf91dfb2165

3 months agoIDEA-243103: Android: Fix "Cannot create Project ... because container is already...
Andrei Kuznetsov [Tue, 30 Jun 2020 21:01:16 +0000 (00:01 +0300)]
IDEA-243103: Android: Fix "Cannot create Project ... because container is already disposed" at .AndroidProjectViewPane

Project might have been disposed while the task was waiting for execution

Allow `isProcessingChanges.set(false)` to execute (which might accidentally fire in light tests where the project is shared, and can "undispose" between tests)

GitOrigin-RevId: c3ea8280c53f286f90587d48c1b91922739b7e29

3 months agoIDEA-243103: Android: Fix "Cannot create Project ... because container is already...
Andrei Kuznetsov [Tue, 30 Jun 2020 20:36:52 +0000 (23:36 +0300)]
IDEA-243103: Android: Fix "Cannot create Project ... because container is already disposed" at .AndroidProjectViewPane

Project might have been disposed while the task was waiting for execution

GitOrigin-RevId: 587648b6037548451978c14bfe8c992df3fc4c92

3 months agoIDEA-244722,IDEA-202110: let bundled plugins (e.g. android plugin) declare custom...
Andrei Kuznetsov [Tue, 30 Jun 2020 15:50:21 +0000 (18:50 +0300)]
IDEA-244722,IDEA-202110: let bundled plugins (e.g. android plugin) declare custom version

It is important that android plugin version is not lost at least for two reasons:
1. This version (major+minor) is used by android-gradle-plugin, so the plugin can detect that it is invoked by version of IDE that won't be able to parse gradle model (see IDEA-244722)
2. It is not clear for users how to map IDEA version to android studio version (see IDEA-202110)

This change allows AndroidPlugin to specify its version as (where the first 3 digits are to identify android-support [studio] version)

GitOrigin-RevId: babad3e266837b5ba3599248366fddce5309f055

3 months agoIDEA-244744,IDEA-244767: missing libraries in Android JPS build 203.671 pycharm/203.671.6
Andrei Kuznetsov [Mon, 29 Jun 2020 13:37:21 +0000 (16:37 +0300)]
IDEA-244744,IDEA-244767: missing libraries in Android JPS build

`<compileServer.plugin classpath="..."` expects that all the jars are listed relative to plugin's `lib` dir. Use AndroidBuildProcessParametersProvider for libraries provided by the platform (i.e. not by the plugin) in order to avoid unsafe paths like "../../lib/javaee.jar"

GitOrigin-RevId: 365a107b0b6149d30ff40f726b7893f59387b242

3 months agonotnull
Alexey Kudravtsev [Mon, 29 Jun 2020 11:21:02 +0000 (14:21 +0300)]

GitOrigin-RevId: ff7eeb0872b7a437f03238ab9bf85ffc664ac0b4

3 months agoAndroid: resolve FIXMEs
Andrei Kuznetsov [Sun, 28 Jun 2020 21:08:58 +0000 (00:08 +0300)]
Android: resolve FIXMEs

GitOrigin-RevId: 9f72c6adc954e1e98a8926066e187fdde5d8412e

3 months agoIDEA-238129: Android: don't generate empty and They are light...
Andrei Kuznetsov [Sun, 28 Jun 2020 20:28:29 +0000 (23:28 +0300)]
IDEA-238129: Android: don't generate empty and They are light classes and don't need any stubs.

In addition, generated stubs may interfere with light classes, and resources resolution stops working (in kotlin).

GitOrigin-RevId: f52006d290d1dd9b296d870ff11fbdd17566aaae

3 months agoIDEA-241862: Android JPS build (i.e. non-gradle) is not compatible with Java 11
Andrei Kuznetsov [Sat, 27 Jun 2020 22:02:26 +0000 (01:02 +0300)]
IDEA-241862: Android JPS build (i.e. non-gradle) is not compatible with Java 11

Get rid of deprecated `` (which uses `sun.misc.BASE64Encoder`), and re-write code to use apkzlib instead.

GitOrigin-RevId: 6a21f4817c7d099b76a6e0c2b5224bb60766efa5

3 months agoIDEA-241731: Don't JBUI.scale DEFAULT_VALUE(=-1) neither Short.MAX_VALUE (`IllegalArg...
Andrei Kuznetsov [Fri, 26 Jun 2020 19:52:43 +0000 (22:52 +0300)]
IDEA-241731: Don't JBUI.scale DEFAULT_VALUE(=-1) neither Short.MAX_VALUE (`IllegalArgumentException: Invalid size`)

GitOrigin-RevId: 6ebafad94c59eed45b3782f086485b64138072f2

3 months agoIDEA-243649: Android: Add test for compile server classpath (aka `Cannot add 'sdk...
Andrei Kuznetsov [Fri, 26 Jun 2020 11:25:09 +0000 (14:25 +0300)]
IDEA-243649: Android: Add test for compile server classpath (aka `Cannot add 'sdk-common-x.y.z.jar`)

`java.lang.Throwable: Cannot add 'sdk-common- at building a newly created project by enabled Android plugin `

GitOrigin-RevId: bf089ccb6da504e884087d7e2c0b9743c737f078

3 months agofix NL android tests
Vladimir Krivosheev [Fri, 26 Jun 2020 14:33:56 +0000 (16:33 +0200)]
fix NL android tests

GitOrigin-RevId: 610d79ebda1bfc27ea15dfe3ba119b11c0c67ce5

3 months agocleanup (final)
Vladimir Krivosheev [Fri, 26 Jun 2020 08:39:01 +0000 (10:39 +0200)]
cleanup (final)

GitOrigin-RevId: 93607e195763f2acf29ee0d7a280d7e07e8d2f14

4 months agoIDEA-CR-1935: IDEA-243995: enable `AndroidGradleJavaProjectModelModifier` to use...
Andrei Kuznetsov [Thu, 25 Jun 2020 07:45:04 +0000 (10:45 +0300)]
IDEA-CR-1935: IDEA-243995: enable `AndroidGradleJavaProjectModelModifier` to use IdeaGradleSync when no android modules exist

... as a desired side effect: IdeaGradleSync will be used when no Android SDK is configured in IDEA at all

GitOrigin-RevId: 2c1b8a0e87c6c7faf54ee16415a5db35780deb31

4 months agoprefer JDK collections
Vladimir Krivosheev [Thu, 25 Jun 2020 10:05:59 +0000 (12:05 +0200)]
prefer JDK collections

GitOrigin-RevId: 0868bbef60ebdd27fb2d3fc87b3b41aa3b0aa986

4 months agoTestProjectManager - call app level UndoManager.dropHistoryInTests on project close...
Vladimir Krivosheev [Tue, 23 Jun 2020 15:30:53 +0000 (17:30 +0200)]
TestProjectManager - call app level UndoManager.dropHistoryInTests on project close to ensure that no mem leaks due to undo/redo stack

GitOrigin-RevId: 9126393a893a8b2b0e9e8436e9cde65e508dcf37

4 months ago[android] omitting unneeded app lifecycle listeners
Roman Shevchenko [Mon, 22 Jun 2020 19:28:51 +0000 (21:28 +0200)]
[android] omitting unneeded app lifecycle listeners

The platform collects early notifications and displays them as soon as the UI becomes ready.

GitOrigin-RevId: e3c8506f4f97627d0ce0ce6444966cec710f9d3c

4 months agoAndroid: Compose: Change local inspections registration (code->xml)
Andrei Kuznetsov [Mon, 22 Jun 2020 15:08:48 +0000 (18:08 +0300)]
Android: Compose: Change local inspections registration (code->xml)

GitOrigin-RevId: ef0410a3440360dbbec09da434cbe2f303dc8d63

4 months agoAndroid: Compose: Add missing inspection descriptions
Andrei Kuznetsov [Mon, 22 Jun 2020 15:07:08 +0000 (18:07 +0300)]
Android: Compose: Add missing inspection descriptions

GitOrigin-RevId: 09413409f13008bcb916f035bb5905d3cd940665

4 months agointellij.lint ->
Tagir Valeev [Mon, 22 Jun 2020 11:25:00 +0000 (18:25 +0700)]
intellij.lint ->

GitOrigin-RevId: cd20d6dc184a8e7b947a7279ffef516d640a8217

4 months agonotnull
Alexey Kudravtsev [Sat, 20 Jun 2020 11:41:10 +0000 (14:41 +0300)]

GitOrigin-RevId: 03154675b133c8465de06179e6e582301e509525

4 months agoextract TestProjectManager, track opened projects in unit test mode for ProjectRule
Vladimir Krivosheev [Sun, 21 Jun 2020 07:16:58 +0000 (09:16 +0200)]
extract TestProjectManager, track opened projects in unit test mode for ProjectRule

GitOrigin-RevId: c38ac6d7650e168840711489c3a8854440aa9962

4 months agoIDEA-238770: make android profiler toolwindow available on start, but with no stripe...
Andrei Kuznetsov [Sat, 20 Jun 2020 23:47:09 +0000 (02:47 +0300)]
IDEA-238770: make android profiler toolwindow available on start, but with no stripe button

GitOrigin-RevId: c4999333d3f08a00267d58fd1a59805851b76ccf

4 months agoIDEA-CR-63906 prefer findFileByNioFile, remove not applicable @SystemDependent annotation
Vladimir Krivosheev [Sat, 20 Jun 2020 18:09:32 +0000 (20:09 +0200)]
IDEA-CR-63906 prefer findFileByNioFile, remove not applicable @SystemDependent annotation

GitOrigin-RevId: e7891758bd35a5733099500c3371f04a92b4f986

4 months agofix dispose check in android
Vladimir Krivosheev [Fri, 19 Jun 2020 20:08:28 +0000 (22:08 +0200)]
fix dispose check in android

GitOrigin-RevId: c2d5a488443407fe249b8b4bde4fb65cedd51942

4 months agoIDEA-CR-63832: IDEA-243825 migrate usages to "notificationAllowlist"
Anastasia Ivanova [Thu, 18 Jun 2020 05:37:35 +0000 (12:37 +0700)]
IDEA-CR-63832: IDEA-243825 migrate usages to "notificationAllowlist"

GitOrigin-RevId: 17268c6bd8df7c4e6d7a9733ee68ffff8e169dc9

4 months agoencapsulate myFilesToDelete — reduce direct access
Vladimir Krivosheev [Thu, 18 Jun 2020 12:46:55 +0000 (14:46 +0200)]
encapsulate myFilesToDelete — reduce direct access

GitOrigin-RevId: 02b21ecdc5b3a0cfbe5ab3688d3f6142734602b9

4 months agoProjectTopics.MODULES broadcast direction changed to NONE — mostly all clients alread...
Vladimir Krivosheev [Thu, 18 Jun 2020 08:04:39 +0000 (10:04 +0200)]
ProjectTopics.MODULES broadcast direction changed to NONE — mostly all clients already subscribes to project message bus and not on module

GitOrigin-RevId: ffe95fda1dfb04520d7f8181aed5b50d3529940a

4 months agocleanup
Vladimir Krivosheev [Thu, 18 Jun 2020 07:35:39 +0000 (09:35 +0200)]

GitOrigin-RevId: 7908df7629cfe67403f0e7551e6dd199c0633007

4 months agoAppInspectionToolWindowFactory should use new API `isApplicable` instead of deprecate...
Vladimir Krivosheev [Thu, 18 Jun 2020 07:34:59 +0000 (09:34 +0200)]
AppInspectionToolWindowFactory should use new API `isApplicable` instead of deprecated `conditionClass`

GitOrigin-RevId: 9f62b40be4c5a1a57524d257c38a305373967528

4 months agoAndroid: remove usages of deprecated JBProgressBar
Andrei Kuznetsov [Wed, 17 Jun 2020 18:27:24 +0000 (21:27 +0300)]
Android: remove usages of deprecated JBProgressBar

GitOrigin-RevId: 2226b61df634073babceec7f00f8b6e761ec0b92

4 months agoIDEA-243819: Android: only suggest recommended settings for android-gradle project...
Andrei Kuznetsov [Wed, 17 Jun 2020 16:46:17 +0000 (19:46 +0300)]
IDEA-243819: Android: only suggest recommended settings for android-gradle project if the project contains android

GitOrigin-RevId: 986c907aa02b3db851720232ae9bb86d682b4c8a

4 months agoIDEA-243819: Android: make shared (AS/IJ) labels IDE-neutral.
Andrei Kuznetsov [Wed, 17 Jun 2020 13:09:49 +0000 (16:09 +0300)]
IDEA-243819: Android: make shared (AS/IJ) labels IDE-neutral.

GitOrigin-RevId: 17abc1591d2bbc4e9db9985cfb0c8e55d776e2f7

4 months ago[android] Remove the blank line from `.iml`
Mikhail Mazurkevich [Wed, 17 Jun 2020 14:22:58 +0000 (17:22 +0300)]
[android] Remove the blank line from `.iml`

GitOrigin-RevId: a0488c2cf9c847874ac0603f333d4aae90ab5ca9

4 months agoAndroid: add missing life templates (new entries added by deprecated unused AndroidLi...
Andrei Kuznetsov [Tue, 16 Jun 2020 19:49:23 +0000 (22:49 +0300)]
Android: add missing life templates (new entries added by deprecated unused AndroidLiveTemplatesProvider)

GitOrigin-RevId: 93c9fabe450e15fb01b361ee7b58810d18e10191

4 months ago[IntelliJ project configuration] explicitly set language level to 1.8 for modules...
Nikolay Chashnikov [Tue, 16 Jun 2020 10:01:30 +0000 (13:01 +0300)]
[IntelliJ project configuration] explicitly set language level to 1.8 for modules which are included in build process

We need this to ensure that build process can be started under JDK 8 after we migrate IDE modules to JDK 11 (IDEA-243693).

GitOrigin-RevId: ef971ba29e74cde144754052e82831e9eb4bde07

4 months ago[android] migrate to java 11: add casts to raw types to workaround changes in generic...
Nikolay Chashnikov [Tue, 16 Jun 2020 08:28:52 +0000 (11:28 +0300)]
[android] migrate to java 11: add casts to raw types to workaround changes in generic signatures of some swing methods

DefaultTableModel::getDataVector was generified in Java 11 so we need to add explicit cast to raw types to makes usages of this method compilable.

GitOrigin-RevId: 71a113bb64a81409c7fb3b3f7b77966f0220e6bb

4 months ago[android] migration to Java 11: add explicit dependency on jaxb-api
Nikolay Chashnikov [Tue, 16 Jun 2020 08:26:25 +0000 (11:26 +0300)]
[android] migration to Java 11: add explicit dependency on jaxb-api

Classes from javax.xml.bind were removed from JDK in Java 11 so we need to have the library in compilation classpath. jaxb-api and jaxb-runtime are included into distribution of all IntelliJ-based IDEs anyway.

GitOrigin-RevId: 5fe541f9a05c7343d83c05717fbc5279ea6541b8

4 months agoAndroid: add missing jars (fix wrong jar names) to JPS process classpath
Andrei Kuznetsov [Tue, 16 Jun 2020 08:33:19 +0000 (11:33 +0300)]
Android: add missing jars (fix wrong jar names) to JPS process classpath

GitOrigin-RevId: 393f570c830ab48b35a285654ea711607b47a2b2

4 months agoAndroid: Delete redundant `plugin.xml` in android test sources
Andrei Kuznetsov [Mon, 15 Jun 2020 21:01:18 +0000 (00:01 +0300)]
Android: Delete redundant `plugin.xml` in android test sources

GitOrigin-RevId: a3229e54080e871ed911bc22d85dc333ba3e2a01

4 months agoAndroid Tests: Fix leaking TransportService
Andrei Kuznetsov [Mon, 15 Jun 2020 20:33:22 +0000 (23:33 +0300)]
Android Tests: Fix leaking TransportService

GitOrigin-RevId: 3a7e1c341935cfdd9ec7e15ca48a54d36068850b

4 months ago[merge-as-4.0] Fix IDEA project structure to follow naming conventions covered by...
Andrei Kuznetsov [Mon, 15 Jun 2020 18:10:04 +0000 (21:10 +0300)]
[merge-as-4.0] Fix IDEA project structure to follow naming conventions covered by tests

GitOrigin-RevId: d7798dcee51f542a4e4a459838075f698d26058e

4 months agoMerge android-plugin 4.0 into IJ master
Andrei Kuznetsov [Mon, 15 Jun 2020 17:17:19 +0000 (20:17 +0300)]
Merge android-plugin 4.0 into IJ master

GitOrigin-RevId: 344852620898a7eaef64c357d37b4c9f2b04a2b8

4 months ago[merge-as-4.0] Fix missing toolbar in layout-editor
Andrei Kuznetsov [Mon, 15 Jun 2020 16:48:32 +0000 (19:48 +0300)]
[merge-as-4.0] Fix missing toolbar in layout-editor

GitOrigin-RevId: 735c082953a1232866fb86510db5e0e9a4b4a1d7

4 months ago[merge-as-4.0] Fix Application instance corruption in Android tests
Andrei Kuznetsov [Mon, 15 Jun 2020 14:59:01 +0000 (17:59 +0300)]
[merge-as-4.0] Fix Application instance corruption in Android tests

Don't mock Application. AbstractDeployTask#NOTIFICATION_GROUP either needs a valid Application instance to initialize the field, or null Application. Dumb Application mock fails at `com.intellij.notification.NotificationGroup.<init>(NotificationGroup.kt:41)` with NPE.

Also note that rootDisposable should not be shared between tests: new instance should be created each time in `setup` method.

GitOrigin-RevId: 5b18e86961ce911087c403af210db62633655d74

4 months ago[merge-as-4.0] Fix component registration in Android tests
Andrei Kuznetsov [Mon, 15 Jun 2020 13:06:34 +0000 (16:06 +0300)]
[merge-as-4.0] Fix component registration in Android tests

GitOrigin-RevId: 8a779ec94b3b2d2ebe38d0e852ed33721b15ba32

4 months ago[merge-as-4.0] Handle qualified vs non-qualified module names in android tests
Andrei Kuznetsov [Mon, 15 Jun 2020 13:05:28 +0000 (16:05 +0300)]
[merge-as-4.0] Handle qualified vs non-qualified module names in android tests

IDEA traditionally uses qualified module names in gradle projects. AS - non qualified. Tests should be able to handle both modes. This is achieved by name transformer which checks GradleProjectProperties and transforms qualified names into simple names if needed.

GitOrigin-RevId: cd228d0d2b1f975ac7a50eb0cc85f238f8c478f8

4 months ago[merge-as-4.0] Don't use precompiled.9.png in IDEA
Andrei Kuznetsov [Mon, 15 Jun 2020 12:52:33 +0000 (15:52 +0300)]
[merge-as-4.0] Don't use precompiled.9.png in IDEA

`framework_res.jar` contains both `.9.png` and `.compiled.9.png` resources, and `.compiled.9.png` are used when `CompatibilityRenderTarget` is in use. This will fail if rendering is delegated to the `layoutlib-standard`, which does not support `.compiled.9.png`.

IDEA only uses layoutlib-standard. Hardcoded `false` should be revisited.

GitOrigin-RevId: 3d7964eedc060f9b2a4732ac12c2f96c3a6b04e4

4 months agonotnull
Alexey Kudravtsev [Mon, 15 Jun 2020 10:03:57 +0000 (13:03 +0300)]

GitOrigin-RevId: 299cec2ee841cb4a0620df242bb5760275d4d1aa

4 months ago[merge-as-4.0] Fix NPE caused by incorrect mock setup in ModelBuilder fixture
Andrei Kuznetsov [Sun, 14 Jun 2020 23:12:05 +0000 (02:12 +0300)]
[merge-as-4.0] Fix NPE caused by incorrect mock setup in ModelBuilder fixture

GitOrigin-RevId: 8cc00346fb9fd2fc39a8555ab705ec61afaeb5a4