gradleApi() in 4.0-rc-2


(Daniel Forslund) #1

Hi,

We have a a custom gradle-plugin built in Scala, which we wanted to update to 4.0-rc-2 but we’ve run into an issue with the gradleApi.

When depending on gradleApi() in our plugin, from what can be told in Intellij, it appears to be using jar-files from 3.5-rc-2 (located in ~/.gradle/caches/3.5-rc-2/generated-gradle-jars). Of course, we’ve tried clearing all caches making sure it’s all empty.

Are we doing any obvious mistakes, or has anyone seen anything similar?

Best Regards,
Daniel


(Benjamin Muschko) #2

I tried to reproduce the issue you are reporting. However, I couldn’t. Here’s what I did:

  • Create a new project Scala-based project. Add the gradleApi() dependency.
apply plugin: 'scala'

dependencies {
    compile gradleApi()
}
  • Create 3.5-rc2 wrapper: gradle wrapper --gradle-version=3.5-rc-2
  • Open project in IntelliJ with File > Open > Point to project directory. Select to use the provided Gradle Wrapper. External Libraries contains the 3.5-rc2 Gradle API dependency.
  • Create 4.0-rc2 wrapper: ./gradlew wrapper --gradle-version=4.0-rc-2
  • Switch to IntelliJ again. Select “Auto-import” (pop-up) for the project to ensure that IntelliJ picks up all changes based on what you have in the Gradle project.
  • IntelliJ automatically updates the right dependencies to 4.0-rc2 Gradle API dependency in External Libraries.

It’s important to enable auto-import. Anything else you are doing differently? I am using 2017.1.3.


(Daniel Forslund) #3

Thanks for your quick reply!

After creating the 4.0-rc2 wrapper, I’m still only seeing the 3.5-rc-2-jars in External Libraries (with auto-import enabled).

I’ll try to reproduce it in a new, empty project later tonight and will get back to you!

I’m using 2017.2 EAP.


(Benjamin Muschko) #4

Thanks, you might definitely want to try a final version of IntelliJ instead of an EAP.