plugins {
	id 'java'
}

repositories {
	mavenLocal()
	maven {
		url = 'https://repo.runelite.net'
		content {
			includeGroupByRegex("net\\.runelite.*")
		}
	}
	mavenCentral()
}

// Pin a concrete release, not a dynamic version: the deps lockfile is a FOD,
// and net.runelite SNAPSHOTs get pruned from repo.runelite.net (404 on refetch).
def runeLiteVersion = '1.12.35'
def pluginMainClass = 'rs.m7.runelitemcp.RuneLiteMcpPluginTest'

dependencies {
	compileOnly group: 'net.runelite', name: 'client', version: runeLiteVersion

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

	testImplementation 'junit:junit:4.13.2'
	testImplementation group: 'net.runelite', name: 'client', version: runeLiteVersion
	testImplementation group: 'net.runelite', name: 'jshell', version: runeLiteVersion
}

group = 'rs.m7'
version = '0.1.0'

tasks.withType(JavaCompile).configureEach {
	options.encoding = 'UTF-8'
	options.release.set(11)
}

tasks.register('run', JavaExec) {
	classpath = sourceSets.test.runtimeClasspath
	mainClass = pluginMainClass

	jvmArgs "-ea"
	args "--developer-mode", "--debug"
}
