trevjonez / composer-gradle-plugin

Gradle task type and plugin for interacting with https://github.com/gojuno/composer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use apk / testApk properties

dkostyrev opened this issue · comments

Before to updating on Composer Gradle plugin 0.13 I had the following configuration in my build.gradle file:

composer {
  configs {
    debug {
      apk file("build/outputs/apk/debug/app-debug.apk")
    }
  }
}

Composer Gradle plugin 0.13 has changed apk and testApk properties type to RegularFileProperty. I have updated my configuration following way:

composer {
  configs {
    debug {
      apk project.layout.projectDirectory.file("build/outputs/apk/debug/app-debug.apk")
    }
  }
}

But when I try to execute testDebugComposer task I get the following output:

Could not determine the dependencies of task ':app:testDebugComposer'.
> Cannot convert <SOME_PATH>/build/outputs/apk/debug/app-debug.apk to a task.
  The following types/formats are supported:
    - A String or CharSequence task name or path
    - A Task instance
    - A TaskReference instance
    - A Buildable instance
    - A TaskDependency instance
    - A Provider that represents a task output
    - A Provider instance that returns any of these types
    - A Closure instance that returns any of these types
    - A Callable instance that returns any of these types
    - An Iterable, Collection, Map or array instance that contains any of these types

I believe this happens because of this line where RegularFileProperty is passed to dependsOn function. Same applies for testApk and extraApk properties.

Composer Gradle plugin version: 0.13
Gradle version: 5.6.2

give this a try:

apk provider { file("build/outputs/apk/debug/app-debug.apk") }

edit:
The api's were converted rely more heavily on the default configuration behavior of gradle as well as try to use all the provider api's so that task configuration stays lazy. Ends up being super important since composer tasks typically happen towards the end of a long chain of tasks and forcing configuration for that chain can be fairly expensive.

I did, unfortunately this does not work:

apk provider { layout.projectDirectory.file("build/outputs/apk/debug/app-debug.apk") }
Cannot convert <SOME_PATH>/build/outputs/apk/debug/app-debug.apk to a task.
  The following types/formats are supported:
    - A String or CharSequence task name or path
    - A Task instance
    - A TaskReference instance
    - A Buildable instance
    - A TaskDependency instance
    - A Provider that represents a task output
    - A Provider instance that returns any of these types
    - A Closure instance that returns any of these types
    - A Callable instance that returns any of these types
    - An Iterable, Collection, Map or array instance that contains any of these types

0.13.1 should be available via the plugin portal now. let me know how it goes. hopefully no one was relying on that behavior. not sure anymore why I had it in there initially, smells like auto task wireup via providers wasn't working as expected.

Thanks for your prompt response!

I believe you still need to tag commit with 0.13.1 version.

right you are good catch. I better go make more coffee, Monday coming in fast.