MiSikora / laboratory

Feature flags for multi-module Kotlin Android projects
https://mehow.io/laboratory/
Apache License 2.0
82 stars 3 forks source link

Can't generate feature flags with Kotlin 1.7.20 #284

Closed vudzkostek closed 2 years ago

vudzkostek commented 2 years ago

After upgrading kotlin in project to version 1.7.20, when trying to assemble module with feature flags, we get:

Cause 1: java.lang.IllegalArgumentException: Did not find Kotlin source set
        at io.mehow.laboratory.gradle.SourceSetContributionKt.contributeToKotlin(SourceSetContribution.kt:61)
        at io.mehow.laboratory.gradle.SourceSetContributionKt.contributeToSourceSets(SourceSetContribution.kt:23)
        at io.mehow.laboratory.gradle.LaboratoryPlugin.addSourceSets(LaboratoryPlugin.kt:154)
        at io.mehow.laboratory.gradle.LaboratoryPlugin.registerFeaturesTask$lambda-11(LaboratoryPlugin.kt:74)
        at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)

Module does not have kotlin/java code, only build.gradle with feature flags declaration:

apply plugin: 'kotlin'
apply plugin: 'io.mehow.laboratory'

laboratory {
    packageName = "eu.some.package"

    featureFactory {
        packageName = "eu.some.package"
        isPublic = true
    }

    feature("SomeFlag") {
        description = "Some description"

        withDefaultOption("Disabled")
        withOption("Enabled")

        withDefaultSource("Remote")
    }
}
MiSikora commented 2 years ago

Thanks for the report. Looks like the same issue as this one. I can work on it probably sometime next week unless you feel like making a PR.

vudzkostek commented 2 years ago

This should probably be reopened as after "fix" generated code is no longer being compiled

MiSikora commented 2 years ago

Oh ok, I'll take into this a look some time soon.