Yeah the Gradle API is provided by the Gradle runtime. We could, however,
build a Maven plugin inside a Gradle-based project. Only thing we'd lose is
the Maven plugin which processes the mojo annotations. But we could just do
it the old fashioned way.

Or a separate project, yeah.
On Jan 18, 2014 11:06 AM, "Logan Johnson" <notifications@github.com> wrote:

> In
> wire-maven-plugin/src/main/java/com/squareup/wire/maven/WireGenerateSourcesMojo.java:
>
> > +    project.addCompileSourceRoot(generatedSourceDirectory);
> > +
> > +    //TODO(shawn) only compile when things have changed.
> > +    compileProtos();
> > +  }
> > +
> > +  private void compileProtos() throws MojoExecutionException {
> > +    List<String> args = Lists.newLinkedList();
> > +    args.add("--proto_path=" + protoSourceDirectory);
> > +    args.add("--java_out=" + generatedSourceDirectory);
> > +    args.add(Joiner.on(" ").join(protoFiles));
> > +
> > +    getLog().info("Invoking wire compiler with options:");
> > +    getLog().info(args.toString());
> > +    try {
> > +      // TODO(shawn) we don't have a great programatic interface to the compiler.
>
> Why? v2 could still build a maven plugin, or we could split it into a
> separate repo if building it from gradle is too tricky. (Building a gradle
> plugin inside the maven project is already proving to be annoying, at best.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/square/wire/pull/92/files#r8988770>
> .
>