Sources from mavenLocal not found

Answered

Hi,

I've been working with the OPENRNDR Kotlin-based framework for over a year now and there's one thing I still struggle with.

I work with 3 gradle based repos:

  • openrndr (the core)
  • orx (extensions adding functionality, depends on openrndr)
  • openrndr-template (where I write my programs, depends on openrndr and orx)

I build the first two by running

./gradlew publishToMavenLocal -Prelease.version=0.4.0-SNAPSHOT

The issue: when I'm in openrndr-template and I control-click any methods provided by openrndr or orx, the decompiled version is shown. Then I need to click "Choose Sources...", wait for indexing, close the window, and ctrl+click again to see the sources. Periodically (maybe after rebuilding openrndr or orx, not sure) I need to repeat the process, as if it forgets where the sources were.

If I look inside ~/.m2/repository/org/openrndr/... the openrndr-???-0.4.0-SNAPSHOT-sources.jar files are there alright.

Why is Idea not finding these sources in mavenLocal? Is there any way to specify those local sources? Maybe in Idea or Gradle?

0
5 comments

Does it help to add 

apply plugin: 'idea'
idea {
module {
downloadSources = true
}
}

into the Gradle build scrip?

0

Thank you Andrey. I tried that yesterday but it did not seem to have an effect. Well, it did trigger downloading tons of packages, but the ctrl+click behaviour seemed unchanged, even after restarting Idea.

0

It could be related to the artifact layout that you deploy. Is it possible to have a complete project to reproduce - it would be very helpful! If not, can you provide a sample artifact and the build Gradle file that has the dependency on in? So that we would reproduce it here?

For uploading you can use https://uploads.jetbrains.com or any file sharing service. Thanks.

0

This is how to set it up:

mkdir /tmp/test
cd /tmp/test

git clone https://github.com/openrndr/openrndr.git
cd /tmp/test/openrndr
./
gradlew publishToMavenLocal -Prelease.version=0.4.0-SNAPSHOT #takes 100 seconds on my pc

git clone https://github.com/openrndr/orx.git
cd /tmp/test/orx
./gradlew publishToMavenLocal -Prelease.version=0.4.0-SNAPSHOT #takes 110 seconds on my pc

git clone https://github.com/openrndr/openrndr-template.git
  • open /tmp/test/openrndr-template in Idea
  • edit build.gradle.kts, set lines 81 and 84 to true to use the snapshot version
  • load gradle changes
  • open src/main/kotlin/TemplateProgram.kt in Idea
  • wait for indexing
  • ctrl+click on `loadImage`, `loadFont` or `drawer.circle`
  • the source code should be shown, not the decompiled version

As long as I don't enable the snapshot version in build.gradle.kts it works as expected (shows source code). But with snapshot enabled it decompiles instead.

0

Thank you! It appears to be a known issue: IDEA-252320. Please vote and follow it for updates.

0

Please sign in to leave a comment.