Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Provide own script when using plugin application in Gradle 1.0

Tags:

gradle

I build my project using Gradle 1.0 and I want to use the application plugin to create an application distribution package.

Instead of the generated start scripts I want to provide my own.

How can I skip the CreateStartScripts task?

like image 713
KrzyH Avatar asked Jun 18 '12 15:06

KrzyH


1 Answers

It appears to be hard-coded, so I am guessing there is no easy way to override it. Maybe hacking the read-only startScripts.outputs property will work.

Either way, I would recommend you just create your own archive task. Here is one that does pretty much exactly what distZip does, but without the startScripts (borrowed from ApplicationPlugin.groovy).

task myDist(type: Zip){
  def baseDir = { archiveName - ".zip" }
  into(baseDir){
    from(project.file("src/dist"))
    into("lib") {
        from(jar)
        from(project.configurations.runtime)
    }
  }
}
like image 76
rodion Avatar answered Sep 28 '22 07:09

rodion