50 Commits

Author SHA1 Message Date
Alexey Tsvetkov
fb441e505d Intellij compatibility fixes (#2733)
* Set 2022.1.1 as base IJ version

Stable AS is based on 2022.1.1 now,
so we can drop supporting 2021.3

* Update IDE plugin target bytecode version to 11

When 2022.1 is used as a base for IDE plugin,
inline functions from the platform
& the bundled Kotlin plugin cannot be used
unless target bytecode version is set to 11.

* Update Intellij SDK Gradle plugin

* Check editor is not disposed before showing preview toolbar

#2663

* Add preview caret listener only to main editor
2023-02-13 18:47:13 +01:00
Alexey Tsvetkov
08c93ce740 Redo: set until-build to undefined value (#2658)
Previously we unset until-build in DSL.
However, Intellij SDK Gradle plugin DSL
does not support setting only since-build,
while omitting until-build.

So we effectively made the plugin
compatible with a single version of Intellij.

This change fixes that by disabling patching
since-build/until-build from DSL and setting
since-build version directly in plugin.xml
2023-01-23 16:14:24 +01:00
Alexey Tsvetkov
153bf10c56 Revert "Do not render preview if protocol between IJ & Gradle does not match (#2556)"
This reverts commit 15aa81c851.
2022-12-13 07:28:27 +01:00
Alexey Tsvetkov
15aa81c851 Do not render preview if protocol between IJ & Gradle does not match (#2556) 2022-12-13 07:22:46 +01:00
Alexey Tsvetkov
d11cda865d Fix deprecated Intellij API usages (#2554)
* Update Intellij Gradle plugin

* Drop support for Intellij < 2021.3

The latest stable Android Studio (Dolphin) is based on 2021.3,
so we can drop support for older versions.

* Remove usages of deprecated Intellij APIs

* Remove upper Intellij version limit
2022-12-12 23:48:47 +01:00
Alexey Tsvetkov
382ad5b78f Test Gradle plugin on relevant PRs (#2509)
* Update Gradle used in tooling subprojects

* Update Kotlin in Compose Gradle plugin

* Decrease verbosity of Gradle plugin tests

* Disable mac sign test

* Add workflow to test Gradle plugin

* Fix custom jdk tests on Linux

* Make Compose Gradle plugin build compatible with Configuration cache

* Print tests summary

* Remove unused code

* Refactor tests configuration

* Turn off parallel execution

* Try adding windows runner

* Turn off fail fast

* Fix Windows test issues

#2368

* Adjust default proguard rules

The following rule is needed to fix tests on Windows:
```
-dontwarn org.graalvm.compiler.core.aarch64.AArch64NodeMatchRules_MatchStatementSet*
```

Other rules are just to make builds less noisy.
Kotlin's `*.internal` packages often contain
bytecode, which triggers ProGuard's notes.
However, these notes are not actionable for
most users, so we can ignore notes by default.

#2393
2022-11-30 14:37:05 +01:00
Igor Demin
98b16c53ef Fix idea plugin compatability (#2318)
IDEA doesn't provide backward compatibility policy, and breaking changes can happen in any version, without prior deprecation:

https://plugins.jetbrains.com/docs/intellij/api-changes-list.html

~~Because of that, we can't remove `plugin.until.build`, and have to build Compose plugin for each new version of IDEA separately~~ (see Update)

~~Update 1:
I removed plugin.until.build anyway. In most cases there won't be a broken plugin. And if it will be broken, we will know it during IDEA EAP. Considering this, better when users don't wait the new version, and use already available one.~~

Update 2:
If we omit plugin.until.build, then it has default value +8. Returned, but made the default value big enough.

What we should do after that commit, is make sure, that we don't forget to check this compatibility. And ship a new stable version for every new stable IDEA.

The ideal way is to run `runPluginVerifier` on CI for the latest version, which will fail the build, if our plugin isn't compatible.

But for some reason, there is no EAP for IDEA 2022.3 here:
https://jb.gg/intellij-platform-builds-list
2022-10-11 06:06:11 +03:00
Alexey Tsvetkov
ca19308fda Allow IJ plugin to work with 2022.2 (#2162) 2022-07-04 17:28:29 +03:00
Alexey Tsvetkov
af92759a81 Update Intellij Gradle plugin (#2088)
Resolves #2070
2022-05-31 15:23:10 +03:00
Alexey Tsvetkov
362c61a38b Avoid interfering with Intellij Light Edit mode (#2027)
Resolves #1816
2022-04-21 19:35:26 +03:00
Alexey Tsvetkov
144738fa36 Switch Intellij plugin to blue community icon (#1825) 2022-02-11 11:19:56 +03:00
Alexey Tsvetkov
9350aee589 Mark Intellij plugin compatible with 2022.1 (#1824) 2022-02-11 11:19:45 +03:00
Alexey Tsvetkov
94866fc7c4 Fix Intellij plugin build 2022-02-10 12:37:43 +03:00
Alexey Tsvetkov
9331c66301 Improve reporting of preview errors (#1807)
Resolves #1686
2022-02-10 10:26:36 +03:00
Alexey Tsvetkov
8e335c9d21 Switch main components build to Gradle 7.3.3 (#1643)
Using one version of Gradle improves build
performance and dev experience by
reusing Gradle daemons, using less storage
& copying for Gradle cache, etc
2021-12-30 09:26:37 +03:00
Igor Demin
dbd0a21949 Modify replace.sh for replacing Compose version (#1511)
Remove:
```
__LATEST_COMPOSE_RELEASE_VERSION__
__KOTLIN_COMPOSE_VERSION__
System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION")
```

They pollute templates/examples.

Now, all paths where we need to change the version are hardcoded in the script.

Usage:
```
./replace.sh 1.0.0-rc6
```

This script is planned to run on CI

In the future I will add support for changing Kotlin version
2021-12-08 10:32:18 +03:00
Alexey Tsvetkov
9686eb2acd Improve handling of preview errors (#1502) 2021-11-29 20:13:05 +03:00
Alexey Tsvetkov
2a3027a5e7 Try to fix images with preview in tooling (#1458)
Maybe it will fix #1160
Fix for refactored Paragraph.getHorizontalPosition (#115)
2021-11-26 04:05:36 +03:00
Alexey Tsvetkov
588ad2c8c0 Fix build helpers publishing (#1416)
* Fix compatibility with Intellij 2021.3

Resolves #1373

* Use Java reflection

* Set Java source & target compatibility for build helpers

Otherwise, Gradle might set Gradle metadata attributes in such way,
that transitive dependencies of published modules are not resolved

* Configure shadow jar manually

Applying plugin configures additional publication,
so that both .jar and -shadow.jar are published,
and additional configurations are added to Gradle metadata.

To avoid unexpected metadata resolution results,
ShadowJar task is now configured manually

* Fix closeStagingRepo JSON request

* Update publishing build-helpers in compose
2021-11-18 13:00:54 +03:00
Nikolay Igotti
d499b350a2 Move to 1.0.0-alpha1 2021-08-04 09:41:56 +03:00
Alexey Tsvetkov
5d4a26b076 Fix preview floating panel compatibility with both 2020.3 and 2021.1 (#973) 2021-08-02 12:11:51 +03:00
Alexey Tsvetkov
227834f963 Allow preview to work without explicit dependency on compose.uiTooling (#972)
Add runtime-only module org.jetbrains.compose.ui:ui-tooling-desktop
to preview classpath in configureDesktopPreview task
2021-08-02 11:47:06 +03:00
Igor Demin
1786de28a7 Sync/2021 07 30 (#961) 2021-07-31 00:38:25 +03:00
Alexey Tsvetkov
d0f286dfb0 Rename default IDE plugin publishing channel (#952) 2021-07-29 16:44:52 +03:00
Alexey Tsvetkov
4945f450e1 Enable running preview for any Compose Desktop module (#951)
Previously preview only worked in projects,
that define compose.desktop.application {} DSL block

Resolves #908
2021-07-29 12:09:13 +03:00
Alexey Tsvetkov
a0a8a32302 Idea floating panel (#927)
* Implement floating editor toolbar for running preview

* Minor: remove accidentally committed debug logging
2021-07-22 19:51:52 +03:00
Alexey Tsvetkov
c271999ec8 Check preview RPC protocol version (#907)
Show notification, when preview client and server use different versions
of the protocol
2021-07-19 17:23:56 +03:00
Alexey Tsvetkov
f15f4236de Better preview progress indication (#901)
* Indicate preview progress with loading panel

* Avoid sending repeated preview requests
2021-07-19 14:44:24 +03:00
Alexey Tsvetkov
992268bccd Suppress naming style inspection for composable functions (#889)
This change suppresses a diagnostic,
which complaints, when a function starts
with an upper case letter
2021-07-16 17:23:52 +03:00
Alexey Tsvetkov
55b8faf0f5 Update Intellij Gradle plugin to 1.1.2 (#853) 2021-07-06 11:31:14 +03:00
Alexey Tsvetkov
6a3b834958 Preview toolwindow improvements (#854)
* Activate preview toolwindow on receiving preview configuration

* Don't show preview toolwindow until a preview is requested

* Add icon to preview toolwindow
2021-07-05 19:09:44 +03:00
Alexey Tsvetkov
c41d7157f5 Fix preview scaling (#852)
Resolves #837
2021-07-05 18:28:53 +03:00
Alexey Tsvetkov
45242dc54c Don't create repeated run configurations for preview (#851) 2021-07-05 17:32:18 +03:00
Alexey Tsvetkov
f1db4c759b Update compose in preview example (#842) 2021-07-02 00:51:49 +03:00
Alexey Tsvetkov
e96826c47c Use Gradle 7.1 for building Gradle and Intellij plugin (#836)
* Replace usage of 'de.fuerstenau.buildconfig'
with a custom replacement, because the plugin
does not support Gradle 7.0+ and
there has not been any commit activity in 5 years
(https://github.com/mfuerstenau/gradle-buildconfig-plugin);
* Update 'com.github.johnrengelman.shadow' to 7.0.0
2021-06-30 17:52:45 +03:00
Alexey Tsvetkov
2be46f961e Implement first version of non-interactive preview for desktop (#803)
Implement first version of non-interactive preview for desktop
2021-06-29 10:23:35 +03:00
Alexey Tsvetkov
047440e12a Allow using Intellij plugin with 2021.2 (#807) 2021-06-23 19:34:47 +03:00
Nikolay Igotti
bf4f7051a2 Move to Kotlin 1.5.10 and Compose 0.4.0-rc1 2021-05-28 14:28:15 +03:00
Nikolay Igotti
7bdb87f20b Move to Compose 0.4.0-build208 and Kotlin 1.5.0 2021-05-20 17:48:04 +03:00
Alexey Tsvetkov
8658e38132 Change IDE plugin name 2021-05-04 13:20:31 +03:00
Alexey Tsvetkov
de66648650 Adjust IDE plugin compatibility range 2021-05-04 13:20:31 +03:00
Alexey Tsvetkov
1f75845609 Add ability to run JS main from IDE (#623) 2021-05-03 19:04:35 +03:00
Alexey Tsvetkov
8c8b4147ab Update to 0.4.0-build182 and get rid of jcenter
The build `0.4.0-build182` upgrades
`kotlinx-collections-immutable` library
(which is used by the compose runtime) to 0.3.4,
which was published to maven central,
so most usages of sunsetting jcenter repo
can be removed now.

Resolves #557
2021-04-21 12:44:57 +03:00
Alexey Tsvetkov
c5b93e8e31 Prepare Intellij plugin for publishing 2021-04-15 07:52:44 +03:00
Nikolay Igotti
76e3f45f8b Move to Kotlin 1.4.32 and 0.4.0-build180 2021-04-12 12:26:03 +03:00
Nikolay Igotti
b962836203 Typo 2021-04-08 10:38:36 +03:00
Alexey Tsvetkov
2f0cd93e71 Specify Preview as entry point
So it's not marked as dead code by Intellij
2021-04-07 10:53:50 +03:00
Alexey Tsvetkov
82b87c7481 Update preview example 2021-04-06 10:52:37 +03:00
Alexey Tsvetkov
d3d0938eb6 Add preview project example 2021-04-05 20:04:32 +03:00
Alexey Tsvetkov
a3a17813e5 Introduce Idea preview plugin 2021-04-05 20:04:32 +03:00