plugins {
	id 'java'
	//id "com.github.johnrengelman.shadow" version "5.2.0"
}

repositories {
	mavenLocal()
	maven {
		url = 'https://repo.runelite.net'
	}
	mavenCentral()
}

def runeLiteVersion = 'latest.release'
// Test latest RL master
// - Pull and build latest RL master
// - Comment out line above and link snapshot version here.
//       Version is in runelite-client/target/client-<VERSION>-SNAPSHOT.jar
// - Update implementation files line below with absolute path to jar
//       runelite-client/target/client-<VERSION>-SNAPSHOT.jar
//def runeLiteVersion = '1.11.4-SNAPSHOT'

dependencies {
    // Use this to test local master from RL
    //implementation files('D:/Repos/runelite/runelite-client/target/client-1.11.4-SNAPSHOT.jar')
    compileOnly group: 'net.runelite', name:'client', version: runeLiteVersion

	compileOnly 'org.projectlombok:lombok:1.18.20'
	annotationProcessor 'org.projectlombok:lombok:1.18.20'

	testImplementation 'junit:junit:4.12'
	testImplementation group: 'net.runelite', name:'client', version: runeLiteVersion
	testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.23.4'
	testImplementation group: 'com.google.inject.extensions', name: 'guice-testlib', version: '4.1.0', {
		exclude group: 'com.google.inject', module: 'guice'
	}
}

group = 'inventorysetups'
version = 'v1.22.0'
sourceCompatibility = '1.8'

tasks.withType(JavaCompile) {
	options.encoding = 'UTF-8'
}

task createProperties(dependsOn: processResources) {
	doLast {
		new File("$buildDir/resources/main/invsetups_version.txt").text = "version=$project.version"
	}
}

classes {
	dependsOn createProperties
}
// To create a shadow jar, run `gradlew shadowJar`
// Output will be in build/libs
// Run it with `java -jar -ea <name>.jar`
//shadowJar {
//	from sourceSets.test.output
//	configurations = [project.configurations.testRuntimeClasspath]
//	manifest {
//		attributes "Main-Class": "inventorysetups.InventorySetupsPluginTest"
//	}
//}
