buildscript {
	repositories {
		mavenCentral()
	}
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
    }
}

plugins {
	id 'java'
	id 'scala'
	id 'idea'
	id 'application'
}

version = '0.3.1'
mainClassName = 'net.abesto.duolingotoanki.Main'

// apply shadowjar plugin after setting mainClassName to work around https://github.com/johnrengelman/shadow/issues/336
apply plugin: 'com.github.johnrengelman.shadow'

ext {
	scalaMajorVersion = '2'
	scalaMinorVersion = '12'
	scalaPatchVersion = '6'
	scalaMajorMinorVersion = "${scalaMajorVersion}.${scalaMinorVersion}"
	scalaVersion = "${scalaMajorMinorVersion}.${scalaPatchVersion}"
}

repositories {
	mavenCentral()
}

dependencies {
	compile group: 'org.scala-lang', name: 'scala-library', version: scalaVersion
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
    compile group: 'net.databinder.dispatch', name: "dispatch-core_${scalaMajorMinorVersion}", version: '0.13.4'
    compile group: 'org.json4s', name: "json4s-native_${scalaMajorMinorVersion}", version: '3.5.4'
    compile group: 'org.scala-lang.modules', name: "scala-swing_${scalaMajorMinorVersion}", version: '2.0.3'

	testCompile group: 'junit', name: 'junit', version: '4.12'
}

processResources {
	expand projectVersion: project.version
}

shadowJar {
	archiveName = "DuolingoToAnki-${version}.jar"
}
