Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install this plugin on latest clion #10

Open
ghost opened this issue Aug 3, 2021 · 11 comments
Open

Cannot install this plugin on latest clion #10

ghost opened this issue Aug 3, 2021 · 11 comments

Comments

@ghost
Copy link

ghost commented Aug 3, 2021

I'm unable to install this plugin on latest clion: https://youtrack.jetbrains.com/issue/CPP-26061

This issue appears only for org4idea plugin.

@freeseacher
Copy link

got the same, in logs i've found
2021-08-07 10:56:44,772 [ 32697] INFO - lij.ide.plugins.DynamicPlugins - Plugin Org4Idea is not unload-safe because of extension to non-dynamic EP com.intellij.fileTypeFactory

@mrkeuz
Copy link

mrkeuz commented Oct 24, 2021

Same in latest PyCharm 2021.2.3 CE. With same error in logs. Any workaround?

@huhuang03
Copy link

huhuang03 commented Oct 25, 2021

you can try this #11 . Run ./gradlew buildPlugin in env JAVA_HOME to java11 version.

Or, you can use https://github.com/huhuang03/org4idea/releases/tag/for_java11 the release I build on my pc.

and install plugin as a zip.

@mrkeuz
Copy link

mrkeuz commented Nov 1, 2021

@huhuang03 hi, thanks for your work, installed from https://github.com/huhuang03/org4idea/releases/tag/for_java11

But have several issues during build from sources:

  1. It needs chmod +x gradlew (this need commit for convenient use)

  2. After, chmod, If I do ./gradlew:

    $   ./gradlew 
    Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain

    Seems gradlew wrapper not properly configured. You need add org4idea/gradle/wrapper/gradle-wrapper.jar to repository. gradlew uses this jar if gradle not installed in system.

  3. But even I use installed correct version gradle and java in system I cannot build plugin. I got:

    $  gradle buildPlugin                                         
    
    To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/7.2/userguide/gradle_daemon.html#sec:disabling_the_daemon.
    Daemon will be stopped at the end of the build 
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file './org4idea/build.gradle' line: 8
    
    * What went wrong:
    Plugin [id: 'org.jetbrains.intellij', version: '1.2.0'] was not found in any of the following sources:
    
    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.intellij:org.jetbrains.intellij.gradle.plugin:1.2.0')
      Searched in the following repositories:
        Gradle Central Plugin Repository
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 4s

    When I added gradle/wrapper/gradle-wrapper.jar file the build start successfully

  4. Another issue, plugin cannot build without jetbrains_token property. It would be good to replace:
    token = 'jetbrains_token' ?: "" (build.gradle:27)
    to
    token = project.findProperty('jetbrains_token') ?: ""
    for ability build plugin without set any extra variables.

In finally I was able to build the plugin by himself successfully.
Hope this help improve you PR. I will help to test changes if you provide some fixes.

Anyway thanks for help, I've installed plugin from zip archive.
Seem works as expected.

@skuro
Copy link
Owner

skuro commented Nov 1, 2021

I'm also looking at the PR, the above should indeed work but I'm looking at a different angle: rather than manually adding the wrapper JAR I'd leave the task to gradle itself. Here's what works:

  • set an environment variable to ORG_GRADLE_PROJECT_jetbrains_token to anything, empty string should suffice
  • run gradle wrapper to both update the wrapper as well as downloading the required supporting files

After doing that, ./gradlew buildPlugin should build successfully

@mrkeuz
Copy link

mrkeuz commented Nov 1, 2021

Yes, it works as you described, but in any case, ./gradlew script especially intended to run gradle-wrapper.jar downloader for gradle on machines where gradle not installed at all. So strictly speaking ./gradlew in repo without gradle-wrapper.jar does not make sense at all (as it describe in tutorial).

Last argument is it's great to have a repeatable build on any machine regardless of the environment. I would also add JVM version check as I got an unobvious error when trying to build a project on JVM 8.

The decision is always yours. But it's always great when a project is being built by one command.
With no additional steps required. I'm NOT writing for criticism - just want to improve the build process a little.

@skuro
Copy link
Owner

skuro commented Nov 1, 2021

it's all appreciated, thanks. I'm a bit far away from gradle / java these days so it's all very welcome input

@huhuang03
Copy link

huhuang03 commented Nov 2, 2021

@mrkeuz . Thanks for your guide, I have update the PR.

But the java toolchain seems not work

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(11)
    }
}

Still get the error:

              - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8

@mrkeuz
Copy link

mrkeuz commented Nov 2, 2021

@huhuang03 great, thanks for changes! I also finally way to check java version. I've sent changes to you java11 branch (#1)

UPD: Nope, hurried, not working yet. Will try to fix.

@mrkeuz
Copy link

mrkeuz commented Nov 2, 2021

@huhuang03 found the trick for check java version (see #2)

@huhuang03
Copy link

@mrkeuz Thank you. I have merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants