Comments (26)
Done (currently under JetBrains review)
from ktfmt.
Sorry it's such a mess, I haven't yet figured out how to release the plugin properly, and haven't had the cycles to integrate-test the plugin with multiple IntelliJ versions.
I guess that's too new for 193?
All is well. I think I understand the
sinceBuild
now. Probably doesn't become available until 203*. Not sure if it's needed really. I would be interested in the side effects of removing.
I'm thinking we remove sinceBuild
and it would resolve this issue. I can download AS tonight and build it.
from ktfmt.
After checking this post I think we need to use:
intellij {
version = "2019.3.4"
}
patchPluginXml {
sinceBuild("193")
untilBuild("")
}
from ktfmt.
I tried making the plugin work with AS 4.0.1., which is v193, and unfortunately there's too many things to change to make it work.
I uploaded a version of the plugin to JetBrains that runs on v201 and up (Android 4.1, IntelliJ 2020.1 and later) and uses ktfmt 0.19.
If you can't upgrade to Android 4.1, I suggest using the Spotless intergration.
Supporting AS 4.0 is probably a non-trivial amount of work at this point. If anyone's interesting in picking it up, I suggest looking at google-java-format's plugin code at their v1.7 tag.
I'll close this Issue for now, unless anyone thinks it's worth keeping open for documentation purposes?
from ktfmt.
Ok, so that works:
AS doesn't show Choose Runtime in its Plugin Marketplace. I was able to download it, install it from disk, and point it at a JetBrains JDK 11.
I'll put it in the release notes, and ask JetBrains to release the update.
tl;dr - the ktfmt plugin works with v201+, which includes Android Studio 4.1.1, as long as it's running under JDK 11.
This is a limitation coming from google-java-format. We can fix GJF to use JDK 8 again.
from ktfmt.
@cgrushko Okay, I'll see what I can do here.
Just want to mention that Android Studio 4.0.2 (Stable) is version 193.* & we just got a new stable 4.1 update which is version 201.* and the AS 4.2 in the canary branch is 202.*
So I think Android developers won't get version 203 until 2021 Q2. So we need to make this plugin compatible with current AS release.
from ktfmt.
Definitely the case. Thanks for the report @TheSomeshKumar. I'll carve in some time tonight.
from ktfmt.
On macOS -> Runtime version: 11.0.8+10
from ktfmt.
Is this still an issue?
Since it's over 2 years old I'm closing it, but please do reopen in case it is still an issue
from ktfmt.
I believe AS 4.0.1
is build 193.6626763
, which should've been covered in the current plugin version 2020.2
(202.7660.17
).
That being said #62, may resolve this issue. Could use some testing around it. They don't have a value for AS in https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties, so could be somewhat manual test.
from ktfmt.
I'll publish a new plugin shortly.
from ktfmt.
@cgrushko Any update on this... I still can't see any plugin on their marketplace.
Android Studio 4.0.2
Build #AI-193.6911.18.40.6821437
from ktfmt.
@somesh-basicx the latest version (1.1.0.18) shows it's compatible with "Android Studio — build 203.4203 — 203.*"
(https://plugins.jetbrains.com/plugin/14912-ktfmt/versions)
I guess that's too new for 193?
Sorry it's such a mess, I haven't yet figured out how to release the plugin properly, and haven't had the cycles to integrate-test the plugin with multiple IntelliJ versions.
Would you be willing to try to build a local copy after playing with the build settings and finding what's needed for AS 4.0.2?
from ktfmt.
Any update on this?
I am having a problem installing it on AS 4.1.1.
from ktfmt.
@cgrushko Using Android Studio 4.1.1 (Build #AI-201.8743.12.41.6953283) but still can't find ktfmt plugin in the plugin marketplace of Studio 😟
from ktfmt.
@TheSomeshKumar the update is stuck in review - they say there's a problem with the compatibility settings and I'm following up with them.
Meanwhile, try downloading from https://plugins.jetbrains.com/plugin/download?rel=true&updateId=106669 (that's the zip file I uploaded to them) and installing from disk.
Alternatively, clone the repo and run ./gradlew buildPlugin
inside the ktfmt_idea_plugin subdirectory. Then, find the resulting .zip file in the build/ subdirectory and install it from disk.
from ktfmt.
@cgrushko Thanks for sharing the plugin. After loading the plugin from disk Android Studio doesn't show me any settings to enable the ktfmt plugin anywhere but when I installed the same zip file in the IntelliJ 2020.3 it is showing me appropriate settings.
from ktfmt.
Ugh,
com.intellij.diagnostic.PluginException: While loading class com.facebook.ktfmt.intellij.KtfmtConfigurable: com/facebook/ktfmt/intellij/KtfmtConfigurable has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 [Plugin: com.facebook.ktfmt_idea_plugin] [Plugin: com.facebook.ktfmt_idea_plugin]
This means that ktfmt_idea_plugin was compiled with Java 11 but AS 4.1.1's JRE is Java 8.
We're using 11 because we depend on google-java-format 1.8 which requires Java 11.
Interestingly, the google-java-format has the same problem: it fails to load with the same error.
I'm not sure what to do at this point. I think it might be worth for someone to rewrite the plugin from scratch, possibly in another repo.
from ktfmt.
I think 4.2 stable will be released in 2021 Q1 (February = 6 months since 4.1.0), maybe just wait for it.
from ktfmt.
I found google-java-format's parallel issue: google/google-java-format#536
from ktfmt.
Have you tried this? google/google-java-format#536 (comment)
If it works the current plugin state should work with that workaround
from ktfmt.
Android Studio 4.2 Beta 2 is now available and there will be a Release Candidate sooner than we think... Usually, most android developers update Android Studio as soon as it is available so I don't think supporting version 4.1 is worth the time & efforts.
from ktfmt.
from ktfmt.
@cgrushko but I am using ktfmt with AS 4.2 beta with no problems, so it should be using Java 11 I think
from ktfmt.
from ktfmt.
Android Studio 4.2 will use Java 11 https://developer.android.com/studio/preview/features/#optimizing_gradle_builds_for_jdk_11
from ktfmt.
Related Issues (20)
- Feature request: GraalVM artifacts HOT 2
- add trailing comma support to other non-google styles HOT 11
- Indentation level should be a command-line argument HOT 2
- Android Studio / IDEA plugin yields different results than running ktfmt HOT 11
- Treat trailing Elvis operator as part of a call chain HOT 2
- Adding target jar to releases HOT 2
- Weird lambda formatting when wrapping long line HOT 3
- Intellij Plugin set to Google (internal) always removes trailing commas HOT 1
- Lambdas following a statement can be treated as lambda arguments, breaking syntax HOT 1
- No artifacts were released for v0.48 and v0.49 HOT 4
- Trailing comma gets removed if there is only one parameter and it is formatted to be on its own line HOT 2
- ktfmt doesn't seem to work in IJ 2024.1.1 HOT 7
- Is ktfmt used on itself? HOT 5
- Misspelled flags in CLI can cause user data loss HOT 1
- How can I config Intellij plugin? HOT 2
- error: did not generate token "context" HOT 3
- Google style with trailing comma does not use maxWidth correctly HOT 2
- Nested function calls with named parameters is incredibly difficult to read and results in unnecessary nesting HOT 8
- ktfmt 0.51 incompatible with Spotless Gradle plugin HOT 2
- Consider providing a binary jar HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ktfmt.