St.Antario
St.Antario

Reputation: 27375

Understanding gradle distribution

In a chapter 7.3.4 of Gradle documentation said about distribution:

We also add a distribution, that gets shipped to the client:

There is also provided a source code:

task dist(type: Zip) {
    dependsOn spiJar
    from 'src/dist'
    into('libs') {
        from spiJar.archivePath
        from configurations.runtime
    }
}

artifacts {
   archives dist
}

So I'm trying to add it in my build script but it doesn't work of the reason:

A problem occurred evaluating project ':MP'. Could not find property 'spiJar' on task ':MP:dist'.

Could you explain in a nutshell where it'd be really helpful to use distribution?

Upvotes: 1

Views: 294

Answers (1)

Peter Niederwieser
Peter Niederwieser

Reputation: 123900

This particular sample demonstrates how a standalone Java application could be shipped as a Zip file. To run the sample, you'll have to get its full source code, which is included in the samples dir of the gradle-all download.

Upvotes: 1

Related Questions