plugins {
  id 'application'
  id 'com.github.johnrengelman.shadow' version '1.2.1'
}

mainClassName = 'com.airbnb.plog.server.PlogServer'

distTar.enabled = false
distZip.enabled = false

dependencies {
  // Base functionality
  compile project(':plog-client')
  compile project(':plog-server')

  // Utilities
  compile project(':plog-replay')
  compile project(':plog-stress')

  // Sinks
  compile project(':plog-console')
  compile project(':plog-kafka')

  // We love logback at Airbnb. Kill log4j.
  compile 'ch.qos.logback:logback-classic:1.1.2'
  compile 'org.slf4j:log4j-over-slf4j:1.7.10'

  // performance improvements for netty
  compile 'org.javassist:javassist:3.19.0-GA'

  // Snappy for Kafka
  compile 'org.xerial.snappy:snappy-java:1.1.1.6'
}

jar {
  manifest {
    attributes 'Main-Class': 'com.airbnb.plog.server.PlogServer',
        'Plog-Version': version
  }
}

shadowJar {
  dependencies {
    exclude dependency('.*:lombok:.*')
    exclude dependency('.*:jsr305:.*')
  }
}

run {
  maxHeapSize = '128M'
  jvmArgs = [
      '-XX:+UseConcMarkSweepGC',
      '-XX:+AggressiveOpts',
      '-XX:+UseCompressedOops',
      '-XX:+UseFastEmptyMethods',
      '-XX:+UseFastAccessorMethods',
  ]
}
