question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot configure retryStrategy and batchingStrategy using Gradle

See original GitHub issue

Describe the bug I am trying to override default retryStrategy and batchingStrategy using Gradle plugin with:

marathon {
    retryStrategy {
        fixedQuota {
            retryPerTestQuota = 3
            totalAllowedRetryQuota = 30
        }
    }
    batchingStrategy {
        fixedSize {
            size = 10
        }
    }
}

but running task ./gradlew app:marathonContractBackendDebug fails with:

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not set unknown property 'retryPerTestQuota' for object of type com.malinskiy.marathon.gradle.RetryStrategyConfiguration.

To Reproduce Steps to reproduce the behaviour:

  1. Try to override retryStrategy and batchingStrategy using Gradle plugin

Expected behavior We should be able to override those values according to readme.

This bug is introduced in 0.7.1 release

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Malinskiycommented, Apr 6, 2022

I’m trying to figure out if this can be fixed. Will report back as soon as I know if this can be fixed. If not - will revert to the old closure signature

0reactions
Malinskiycommented, Apr 11, 2022

So it turns out it’s not possible to use a unified interface for the plugin’s configuration for both Kotlin and Groovy: Kotlin uses the @HasImplicitReceiver annotation which is picked up by the SAM conversion plugin for kotlin compiler. This code is transformed into a lambda with actual receiver in kotlin while grovvy will always transform the lambda into a lambda with a parameter. Here is an example in the official Java plugin as a reference: https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/java/org/gradle/api/plugins/JavaPluginConvention.java#L128 where you can clearly see that it’s fine to have two of the signatures around for kts/groovy. I’ll introduce the helpers for the Groovy back as a result of this investigation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

custom gradle plugin causes: Cannot configure the 'publishing ...
PS: I tried doing nothing in the custom plugin (i.e., simply return from apply method), but it still gives same error. gradle ·...
Read more >
Marathon - GitHub Pages
Configuration for gradle plugin is done via gradle only. It doesn't support the CLI's marathonfile. Here is an example of gradle config using...
Read more >
Declaring Capabilities of a Library - Gradle User Manual
For example, a library may include several features in a single artifact. ... Could not resolve all files for configuration ':compileClasspath'.
Read more >
Gradle | IntelliJ IDEA Documentation - JetBrains
You can also create a Gradle project and store it in the WSL environment or open it from the WSL file system. For...
Read more >
Working with the Gradle registry - GitHub Docs
You can configure Gradle to publish packages to the GitHub Packages Gradle registry ... Also, accounts using legacy per-repository plans cannot access the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found