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

Feature-Request: add composer task

ligi opened this issue · comments

commented

First of all thanks for this plugin!

What would be really great if this plugin creates one task that is just called "composer" - this way the CI does not need to know about the flavor being used and can just do "./gradlew composer"

I actually don't want to add this because I anticipate the utility to be quite low. In a default application project with default composer plugin options this would run a testDebugComposer as well as testReleaseComposer presumably both with the same set of tests which might serve to help verify something like a proguard configuration but not much else.

as is you can create a task in your own gradle file and have it depend on the composer tasks you want it to run which would give you the cleaner cli invocation.

You can create the task in your gradle file like this:

task composer(dependsOn: ['testDebugComposer']) //comma separated list of tasks

if you don't want to list them out you could use a tasks.all block which would be something like this:

task composer

tasks.all { task ->
    if (task.name.startsWith("test") && task.name.endsWith("Composer")) {
        tasks.findByName("composer").dependsOn(task)
    }
}

I am going to close it for now and urge people to leave use case stories for a task like this.

Ultimately I never end up using the master tasks from AGP (test, lint, check). They end up just duplicating work with minimal value return on time spent in all of the projects I have been involved in. I always use a dedicated CI flavor for CI so I can have different configuration values there. empty api keys or altered injection paths so ci runs don't attack 3rd party api's. ie) Intercom, launch darkly etc..