apply plugin: 'distribution'

dependencies {
  compile(project(':azkaban-web-server'))
  compile(project(':azkaban-exec-server'))

  runtime('org.slf4j:slf4j-log4j12:1.7.18')
  runtime('com.h2database:h2:1.4.193')
}

installDist.dependsOn ':azkaban-web-server:installDist'
distTar.dependsOn ':azkaban-web-server:installDist'
distZip.dependsOn ':azkaban-web-server:installDist'

distributions {
  main {
    contents {
      from('src/main/bash') {
        into 'bin'
        fileMode = 0755
      }
      from(project(':azkaban-common').files('src/main/bash')) {
        into 'bin'
        fileMode = 0755
      }
      from ('src/main/resources/conf') {
        into 'conf'
      }
      from ('src/main/resources/commonprivate.properties') {
        into 'plugins/jobtypes'
      }
      from(configurations.runtime) {
        into 'lib'
      }
      from(jar) {
        into 'lib'
      }
      from(project(':azkaban-sql').files('src/sql')) {
        into('sql')
      }
      // Get the files from sub-dir of distribution of another sub-project
      from(new File(tasks.getByPath(':azkaban-web-server:installDist').destinationDir, 'web')) {
        into 'web'
      }
    }
  }
}
