-
Notifications
You must be signed in to change notification settings - Fork 45
Gradle plugin #77
Comments
We don't have engineering resources to work on something we don't use ourselves right now, so it'll be great to follow same pattern Spoon and Spoon Gradle Plugin maintained separately by the community. However we can participate in DSL design and refer to it from our README! |
So initially my thought is that I would start by just creating a task customTaskName(type: ComposerTask) {
apk 'app/build/outputs/apk/example-debug.apk'
test-apk 'build/outputs/apk/example-debug-androidTest.apk'
test-package 'com.example.test'
test-runner 'com.example.test.ExampleTestRunner'
shard true
output-directory 'artifacts/composer-output'
instrumentation-arguments key1: 'value1', key2: 'value2'
verbose-output false
} From there I would like to see a plugin that hooks into the AGP in order to automatically create and configure instances of composer tasks. apply plugin: 'composer'
composer {
variants "redDebug" // optional, include task for each variant if none specified here
instrumentation-arguments key1: 'value1', key2: 'value2' //optional args that apply to all created tasks
configs { //Named domain object container
redDebug {
apk 'app/build/outputs/apk/example-debug.apk' //optional override default inferred from AGP
test-apk 'build/outputs/apk/example-debug-androidTest.apk' //optional override default inferred from AGP
test-package 'com.example.test' //optional override default inferred from AGP
test-runner 'com.example.test.ExampleTestRunner' //optional override default inferred from AGP
shard true //optional
output-directory 'artifacts/composer-output' //optional override default inferred from AGP
instrumentation-arguments key1: 'value1', key2: 'value2' //optional args. probably main/only use case for these config dsl blocks
verbose-output false //optional
}
}
} Task name created would be something like more typical use case would look like: apply plugin: 'composer'
composer {
variants "redDebug"
configs {
redDebug {
instrumentation-arguments key1: 'value1', key2: 'value2'
}
}
} all around it should be a fairly simple project to put together since this repo has already done all the hard work. |
Plan looks pretty solid! One of the things that would be great to do is to map Composer options to the Gradle Plugin as close to their original names as possible, i.e. When/if you start the work, please leave a comment here with a link to the repo so we could follow progress, if you want you can add us: @yunikkk, @ming13 and me as code reviewers to the Pull Requests :) |
good catch on the |
starting to layout some code now: https://github.com/trevjonez/composer-gradle-plugin |
As I am finally getting some unit tests ran against my mavenLocal of #81 I am finding that you can not configure environment variables which is a limitation of the gradle test kit. Might I recommend/request allowing configuration of |
Just published an initial pre-release. |
Looks great! I like how you've organized the code and that it's not Groovy :) Also great that you're adding Composer to project dependencies so it'll be cached properly by Gradle. I guess we should start publishing non-fat jar for that btw? Currently Composer is shipped as |
You might do a different distribution so that gradle can do its magic like you are saying, but it would be nothing more than a cache optimization. If you go that route that is where you might considering making this project more library like with an extra wrapper that exposes it as a command line app? I already integrated the plugin into my work project which revealed a few bumps. After taking care of those I am already on My consumption of composer for that project is now reduced to basically apply plugin: 'composer'
composer {
instrumentationArgument('notAnnotation', 'com.xxx.yyy.ScreenshotTest')
} and I can just invoke Then I created a custom At some point I want to create a new system for screenshot tests. that facebook lib works but has some seriously rough edges and is basically unmaintained. Not to mention it looks like it was written by a non android/java person for android people to use. smells like a |
Any plans for a gradle plugin or would you be interested in discussing dsl design for one?
The text was updated successfully, but these errors were encountered: