plugins {
    id 'java-library'
}

archivesBaseName = "Mario Kart World Tracker"
version = '1.0.2'
var mainClassName = 'speiger.src.MarioKartWorldTracker'

repositories {
    mavenCentral()
}


sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = JavaLanguageVersion.of(21)

jar {
	manifest {
		attributes "Main-Class": mainClassName
	}
	from {
		duplicatesStrategy = DuplicatesStrategy.EXCLUDE
		configurations.runtimeClasspath.collect { zipTree(it) }	
	}
}

task baseJar(type: Jar) {
    from sourceSets.main.output
    archiveClassifier.set("slim")
    exclude('assets/images/images.zip')
    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
    manifest {
		attributes "Main-Class": mainClassName
	}
	from {
		duplicatesStrategy = DuplicatesStrategy.EXCLUDE
		configurations.runtimeClasspath.collect { zipTree(it) }	
	}
}

task run(type: JavaExec) {
	classpath = sourceSets.main.runtimeClasspath
	mainClass.set(mainClassName)
}


dependencies {
	implementation 'com.google.code.gson:gson:2.8.6'
	implementation 'org.jsoup:jsoup:1.19.1'
	implementation 'commons-codec:commons-codec:1.19.0'
}

artifacts {
    archives baseJar
}