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.

Change Android Vendor to ADAM in Gradle configuration

See original GitHub issue

I want to switch to ADAM Vendor using the Gradle configurationo but I can’t achieve it due to this error:

Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'com' for extension 'marathon' of type com.malinskiy.marathon.MarathonExtension.

How can I import the vendor into the Marathon config? What am I missing?

My files:

root/settings.gradle

pluginManagement {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://dl.bintray.com/qameta/maven' }
        gradlePluginPortal()
    }
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == "marathon") {
                useModule("com.malinskiy.marathon:marathon-gradle-plugin:0.6.0")
            }
        }
    }
}

[...]

root/build.gradle

buildscript {
    repositories {
        [...]
    }
    dependencies {
        classpath "com.malinskiy.marathon:marathon-gradle-plugin:0.6.0"

        [...]        
    }
}

[...]

root/app/build.gradle

apply plugin: 'marathon'

marathon {

    vendor = com.malinskiy.marathon.android.VendorType.ADAM // <----

    [...]
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Malinskiycommented, Feb 3, 2021

@asos-jorgegonzalez glad you’ve found a way, but a small reminder that you don’t need to gradle’s internal object factory with reflection to instantiate classes in Groovy, simple new is enough:

marathon {
    screenRecordConfiguration = new ScreenRecordConfiguration(
        com.malinskiy.marathon.device.DeviceFeature.SCREENSHOT,
        new VideoConfiguration(
            false, //enabled
            1080, //width
            1920, //height
            2, //Bitrate in Mbps
            300, //Max duration in seconds
            TimeUnit.SECONDS
        ),
        new ScreenshotConfiguration(
            false, //enabled
            1080, //width
            1920, //height
            200 //Delay between taking screenshots
        )
    )
}

https://github.com/Malinskiy/marathon/blob/test/440/sample/android-app/app/build.gradle#L34

Cheers

1reaction
Malinskiycommented, Feb 2, 2021

I’ve tried to reproduce your problem and failed. https://github.com/Malinskiy/marathon/tree/test/440

This correctly recognizes the adam module and executes the tests: https://github.com/Malinskiy/marathon/blob/test/440/sample/android-app/app/build.gradle#L28

I’m not sure where you are applying the plugin, but it definitely shouldn’t be the root gradle. Wherever you apply the application/library android plugin - the marathon apply block should be also there.

Also you don’t need

        classpath "com.malinskiy.marathon:base:0.6.0"
        classpath "com.malinskiy.marathon:core:0.6.0"

This should be picked up by gradle automatically

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure your build
Each build configuration can define its own set of code and resources while reusing the parts common to all versions of your app....
Read more >
marathon/build.gradle.kts at develop
Cross-platform test runner written for Android and iOS projects - marathon/build.gradle.kts at ... import com.malinskiy.marathon.config.vendor.android.
Read more >
Android - Marathon
To indicate to CLI that you're using a vendor config for android you have to specify the type in the root of the...
Read more >
Gradle
Gradle is a build automation tool for multi-language software development. It controls the development process in the tasks of compilation and packaging to ......
Read more >
Understanding resource conflicts in Android
In our app module we need to be able to resolve a unique resource for the combination of type, name and device configuration....
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