Hagu icon indicating copy to clipboard operation
Hagu copied to clipboard

Compatibility with Gradle 7.x

Open Cliabhach opened this issue 3 years ago • 0 comments

Expected behaviour

Building a multiplatform gradle module with Gradle 7.2 and the Hagu plugin should not bring up any errors.

Actual behaviour

Executing a gradle build (in my case, ./gradlew assemble) causes the following message to appear:

A problem was found with the configuration of task ':library:buildHagu' (type 'HaguTask').
  - In plugin 'com.karumi.hagu' type 'com.karumi.hagu.plugin.HaguTask' property 'generatedSourceOutput' is annotated with @PathSensitive but that is not allowed for 'OutputDirectory' properties.

Steps to reproduce

Include the following in the top-level settings.gradle file:

pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (it.requested.id.id == 'com.karumi.hagu') {
                useModule('com.karumi.hagu:gradle-plugin:0.1.2')
            }
        }
    }
    repositories {
        gradlePluginPortal()
        mavenCentral()
    }
}

Include this in the top-level build.gradle file:

plugins {
    id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}

Prepend this to the multiplatform module's build.gradle file:

plugins {
    id 'org.jetbrains.kotlin.multiplatform'
    id 'com.karumi.hagu'
}

Version of the library

0.1.2

Additional thoughts

I admit that I'm not entirely sure of what the right approach is here. Perhaps it makes sense to remove the PathSensitive annotation? Or maybe I need to fix something in my project configuration.

Cliabhach avatar Jan 26 '22 04:01 Cliabhach