plugins {
	id "org.jetbrains.intellij" version "1.16.0"
	id "org.jetbrains.kotlin.jvm" version "1.6.21"
	id "java"
}

repositories {
	mavenCentral()
}

sourceSets {
	main {
		java.srcDir "./src"
		kotlin.srcDir "./src"
		resources.srcDir "./resources"
	}
}

compileKotlin {
	kotlinOptions {
        jvmTarget = "11"
        apiVersion = "1.6"
		languageVersion = "1.6"
		// Compiler flag to allow building against pre-released versions of Kotlin
		// because IJ EAP can be built using pre-released Kotlin but it's still worth doing to check API compatibility
		freeCompilerArgs = ["-Xskip-metadata-version-check"]
	}
}

intellij {
	// To find available IDE versions see https://www.jetbrains.com/intellij-repository/releases
    version = System.getenv().getOrDefault("IJ_VERSION",
        "212.4746.92" // with kotlin 1.5.10 support
        // "LATEST-EAP-SNAPSHOT"
    )
	setPluginName("friday-mario")
	plugins = ["java"]
	downloadSources = true
	sameSinceUntilBuild = false
	updateSinceUntilBuild = false // Disable patching plugin.xml because "until" version is too restrictive (it's better to keep it open-ended).
}
buildSearchableOptions.enabled = false // Disable because it takes a long time and the plugin doesn't need it

