apply plugin: 'java'
apply plugin: 'eclipse'

tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
    options.compilerArgs << "-Xlint:deprecation"
}

eclipse {
	classpath {
		downloadJavadoc = true
		downloadSources = true
	}
}
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
repositories {
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven {
        url = "https://maven.speiger.com/repository/main"
    }
}

task srcJar(type: Jar) {
    from sourceSets.main.allSource
    classifier = 'sources'
   	from {
  	configurations.compile.collect { 
  		it.isDirectory() ? it : zipTree(it)
  	}
  }
}

artifacts {
    archives srcJar
}

jar{
  from {
  	configurations.compile.collect { 
  		it.isDirectory() ? it : zipTree(it)
  	}
  }
}

dependencies {
	//LWJGL 3
	compile platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
	
	compile "org.lwjgl:lwjgl"
	compile "org.lwjgl:lwjgl-glfw"
	compile "org.lwjgl:lwjgl-jemalloc"
	compile "org.lwjgl:lwjgl-openal"
	compile "org.lwjgl:lwjgl-opengl"
	compile "org.lwjgl:lwjgl-stb"
	compile "org.lwjgl:lwjgl-nfd"
	compile "org.lwjgl:lwjgl::$lwjglNatives"
	compile "org.lwjgl:lwjgl-glfw::$lwjglNatives"
	compile "org.lwjgl:lwjgl-jemalloc::$lwjglNatives"
	compile "org.lwjgl:lwjgl-openal::$lwjglNatives"
	compile "org.lwjgl:lwjgl-opengl::$lwjglNatives"
	compile "org.lwjgl:lwjgl-stb::$lwjglNatives"
	compile "org.lwjgl:lwjgl-nfd::$lwjglNatives"
	
	//Gson
	compile 'com.google.code.gson:gson:2.8.6'
	
	//Primitive Collections
	compile 'de.speiger:Primitive-Collections:0.4.5'
}