Custom plugin and task based command line parameters.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Custom plugin and task based command line parameters.

Xavier Ducrohet
Is it possible for a custom plugin to create new command line arguments? Something similar to --all on 'tasks'.

I'd like those arguments to be either specific to custom tasks or project wide.
Reply | Threaded
Open this post in threaded view
|

Re: Custom plugin and task based command line parameters.

Luke Daley-2

On 9 Jan 2014, at 6:13 pm, Xavier Ducrohet <[hidden email]> wrote:

> Is it possible for a custom plugin to create new command line arguments? Something similar to --all on 'tasks'.
>
> I'd like those arguments to be either specific to custom tasks or project wide.

There's an internal mechanism for task level that we could look at promoting:

https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/groovy/org/gradle/api/internal/tasks/options/Option.java
https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/groovy/org/gradle/api/tasks/testing/Test.java#L684

I'm not sure of anything for global switches or anything in the works. What's your use case here?

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Custom plugin and task based command line parameters.

Xavier Ducrohet
For the project wide thing, we have a case where we enable a certain build mechanism to speed up further incremental build but this makes the first build quite a bit slower, so we want to easily disable it for CI builds that will always be clean build anyway.

There's a DSL element to enable/disable this mechanism, but injecting a value to set this from the command line is just awkward, so I wanted to see if I could just have my plugin create a --disable-foo option to the command line which would be nicer.



On Thu, Jan 9, 2014 at 12:20 PM, Luke Daley <[hidden email]> wrote:

On 9 Jan 2014, at 6:13 pm, Xavier Ducrohet <[hidden email]> wrote:

> Is it possible for a custom plugin to create new command line arguments? Something similar to --all on 'tasks'.
>
> I'd like those arguments to be either specific to custom tasks or project wide.

There's an internal mechanism for task level that we could look at promoting:

https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/groovy/org/gradle/api/internal/tasks/options/Option.java
https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/groovy/org/gradle/api/tasks/testing/Test.java#L684

I'm not sure of anything for global switches or anything in the works. What's your use case here?

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Custom plugin and task based command line parameters.

Xavier Ducrohet
oh and for the task based one, I think it would be good to have this as public API (in some form). We use a custom test runner to run Android tests on device and we'd like to provide options there too.


On Thu, Jan 9, 2014 at 12:26 PM, Xavier Ducrohet <[hidden email]> wrote:
For the project wide thing, we have a case where we enable a certain build mechanism to speed up further incremental build but this makes the first build quite a bit slower, so we want to easily disable it for CI builds that will always be clean build anyway.

There's a DSL element to enable/disable this mechanism, but injecting a value to set this from the command line is just awkward, so I wanted to see if I could just have my plugin create a --disable-foo option to the command line which would be nicer.



On Thu, Jan 9, 2014 at 12:20 PM, Luke Daley <[hidden email]> wrote:

On 9 Jan 2014, at 6:13 pm, Xavier Ducrohet <[hidden email]> wrote:

> Is it possible for a custom plugin to create new command line arguments? Something similar to --all on 'tasks'.
>
> I'd like those arguments to be either specific to custom tasks or project wide.

There's an internal mechanism for task level that we could look at promoting:

https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/groovy/org/gradle/api/internal/tasks/options/Option.java
https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/groovy/org/gradle/api/tasks/testing/Test.java#L684

I'm not sure of anything for global switches or anything in the works. What's your use case here?

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Custom plugin and task based command line parameters.

johnrengelman
Is there something preventing you from using a project property?

Then you would set '-PbuildIncremental=true' on the command line.

-- 
John Engelman

On Thursday, January 9, 2014 at 12:31 PM, Xavier Ducrohet [via Gradle] wrote:

oh and for the task based one, I think it would be good to have this as public API (in some form). We use a custom test runner to run Android tests on device and we'd like to provide options there too.


On Thu, Jan 9, 2014 at 12:26 PM, Xavier Ducrohet <[hidden email]> wrote:
For the project wide thing, we have a case where we enable a certain build mechanism to speed up further incremental build but this makes the first build quite a bit slower, so we want to easily disable it for CI builds that will always be clean build anyway.

There's a DSL element to enable/disable this mechanism, but injecting a value to set this from the command line is just awkward, so I wanted to see if I could just have my plugin create a --disable-foo option to the command line which would be nicer.



On Thu, Jan 9, 2014 at 12:20 PM, Luke Daley <[hidden email]> wrote:

On 9 Jan 2014, at 6:13 pm, Xavier Ducrohet <[hidden email]> wrote:

> Is it possible for a custom plugin to create new command line arguments? Something similar to --all on 'tasks'.
>
> I'd like those arguments to be either specific to custom tasks or project wide.

There's an internal mechanism for task level that we could look at promoting:

https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/groovy/org/gradle/api/internal/tasks/options/Option.java
https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/groovy/org/gradle/api/tasks/testing/Test.java#L684

I'm not sure of anything for global switches or anything in the works. What's your use case here?

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email







If you reply to this email, your message will be added to the discussion below:
http://gradle.1045684.n5.nabble.com/Custom-plugin-and-task-based-command-line-parameters-tp5712192p5712195.html
To start a new topic under gradle-dev, email [hidden email]
To unsubscribe from gradle-dev, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Custom plugin and task based command line parameters.

Xavier Ducrohet
It's possible but it seems less elegant than a custom command line arg. Also discoverability is an issue.


On Thu, Jan 9, 2014 at 12:43 PM, johnrengelman <[hidden email]> wrote:
Is there something preventing you from using a project property?

Then you would set '-PbuildIncremental=true' on the command line.

-- 
John Engelman

On Thursday, January 9, 2014 at 12:31 PM, Xavier Ducrohet [via Gradle] wrote:

oh and for the task based one, I think it would be good to have this as public API (in some form). We use a custom test runner to run Android tests on device and we'd like to provide options there too.


On Thu, Jan 9, 2014 at 12:26 PM, Xavier Ducrohet <[hidden email]> wrote:
For the project wide thing, we have a case where we enable a certain build mechanism to speed up further incremental build but this makes the first build quite a bit slower, so we want to easily disable it for CI builds that will always be clean build anyway.

There's a DSL element to enable/disable this mechanism, but injecting a value to set this from the command line is just awkward, so I wanted to see if I could just have my plugin create a --disable-foo option to the command line which would be nicer.



On Thu, Jan 9, 2014 at 12:20 PM, Luke Daley <[hidden email]> wrote:


On 9 Jan 2014, at 6:13 pm, Xavier Ducrohet <[hidden email]> wrote:

> Is it possible for a custom plugin to create new command line arguments? Something similar to --all on 'tasks'.
>
> I'd like those arguments to be either specific to custom tasks or project wide.

There's an internal mechanism for task level that we could look at promoting:

https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/groovy/org/gradle/api/internal/tasks/options/Option.java
https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/groovy/org/gradle/api/tasks/testing/Test.java#L684

I'm not sure of anything for global switches or anything in the works. What's your use case here?

--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email







If you reply to this email, your message will be added to the discussion below:
http://gradle.1045684.n5.nabble.com/Custom-plugin-and-task-based-command-line-parameters-tp5712192p5712195.html
To start a new topic under gradle-dev, email [hidden email]
To unsubscribe from gradle-dev, click here.
NAML



View this message in context: Re: Custom plugin and task based command line parameters.
Sent from the gradle-dev mailing list archive at Nabble.com.