Hi,

So, we're planning to have a bunch of 'jvm binaries' that can be built from 
various language source sets and other things. There will be a few different 
types of binaries, such as class directory binaries and jar binaries, possibly 
some others.

Something we need to sort out is how to structure the DSL for these executable 
things. The current plan is to have a single container that owns all of these 
jvm binaries, so you might declare something like this:

jvm {
    binaries {
        mainClasses(ClassesDirectoryBinary) {
            … some inputs and other configuration ...
        }
        mainJar(JarBinary) {
            … some inputs and other configuration …
        }
    }
}

There might be a similar container for native binaries:

native {
    binaries {
        windowsX86DebugShared(SharedLibraryBinary) {
            … some inputs and other configuration …
        }
        windowsX86DebugStatic(StaticLibraryBinary) {
            ...
        }
        windowsX86DebugExe(ExecutableBinary) {
            … 
        }
    }
}

Some questions:

* Is using a flat name the best way to identify these things? Once you add a 
few dimensions, the names start to get awkward. This is certainly can be the 
case for native binaries, and can also be the case for jvm binaries. For 
example, I might have (feature, binary type, groovy version, jvm version) as 
relevant dimensions for a Groovy library that targets multiple groovy versions 
and jvm versions.

* What do we do with specialised types of jvm binaries, that run on the jvm but 
which require a certain runtime and that are packaged in a certain way: a WAR 
or exploded J2EE web app or an OSGi bundle or Gradle plugin?

* Is the separation between jvm binaries and native binaries useful? Should 
there be a single `binaries` container? Or should it be finer-grained to 
include type, so that there is a `jvm.binaries.classes` and a 
`jvm.binaries.jar` container and a `native.binaries.staticLibs` container? Is 
the type of runtime actually less important than the type of thing, so that it 
should be `binaries.jvm` and `binaries.native`?

Very similar questions to source sets, re. how to arrange them and which 
dimension wins over the others and which need to be encoded in the name and 
which are encoded in the structure. Maybe we should rethink our container DSL a 
bit more deeply. The publications would also benefit from have a composite 
identifier (e.g. groupId, artifactId, version).


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to