You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Kenneth Knowles <kl...@google.com> on 2018/06/18 16:31:26 UTC

Moving Gradle build logic from build_rules.gradle to buildSrc

Hi all,

**If you are actively working on build_rules.gradle then I want to
coordinate with you**

*If you are not interested in Gradle build configs, you can stop reading*

I've hit some issues with dependency handling in build_rules.gradle that I
think are best resolved by migrating it from being a "script plugin" [1] to
a "binary plugin" [2].

Concretely, instead of this file layout and invocation:

    build_rules.gradle
    apply from: project(":")

it is a (hopefully simple) migration to this one:

    buildSrc/.../BeamModule.groovy  # same logical content as
build_rules.gradle
    apply plugin: org.apache.beam.gradle.BeamModule

This sort of migration seems to be the expected/recommended thing to do
when a script plugin "grows up". And it isn't actually more work - the
contents of the file remain nearly identical (slightly more clear,
actually). So, first I want to just migrate from one to the other to
resolve my dependency issues. Then it probably makes sense to convert each
"nature" to a plugin, and perhaps more. It opens up a lot of cleaner
engineering around this growing pile of functionality.

Kenn

[1]
https://docs.gradle.org/current/userguide/plugins.html#sec:script_plugins
[2]
https://docs.gradle.org/current/userguide/plugins.html#sec:binary_plugins

Re: Moving Gradle build logic from build_rules.gradle to buildSrc

Posted by Kenneth Knowles <kl...@google.com>.
OK, this is done and on master. It was, indeed, a near-noop in terms of the
groovy code. The contents of build_rules.gradle have been removed. So if
you had a change in progress, you should see a conflict. I would be happy
to help you in this case.

Kenn

On Mon, Jun 18, 2018 at 9:31 AM Kenneth Knowles <kl...@google.com> wrote:

> Hi all,
>
> **If you are actively working on build_rules.gradle then I want to
> coordinate with you**
>
> *If you are not interested in Gradle build configs, you can stop reading*
>
> I've hit some issues with dependency handling in build_rules.gradle that I
> think are best resolved by migrating it from being a "script plugin" [1] to
> a "binary plugin" [2].
>
> Concretely, instead of this file layout and invocation:
>
>     build_rules.gradle
>     apply from: project(":")
>
> it is a (hopefully simple) migration to this one:
>
>     buildSrc/.../BeamModule.groovy  # same logical content as
> build_rules.gradle
>     apply plugin: org.apache.beam.gradle.BeamModule
>
> This sort of migration seems to be the expected/recommended thing to do
> when a script plugin "grows up". And it isn't actually more work - the
> contents of the file remain nearly identical (slightly more clear,
> actually). So, first I want to just migrate from one to the other to
> resolve my dependency issues. Then it probably makes sense to convert each
> "nature" to a plugin, and perhaps more. It opens up a lot of cleaner
> engineering around this growing pile of functionality.
>
> Kenn
>
> [1]
> https://docs.gradle.org/current/userguide/plugins.html#sec:script_plugins
> [2]
> https://docs.gradle.org/current/userguide/plugins.html#sec:binary_plugins
>