buildscript {
    repositories {
        maven {
            url uri('../../repo')
        }
        maven { url 'https://jitpack.io' }
    }
    dependencies{
        classpath 'com.github.122006.Zircon:gradle:master-SNAPSHOT'
    }
}

plugins {
    id 'java'
    id 'org.jetbrains.intellij.platform' version '2.6.0'
}
//apply plugin: 'zircon'

group 'com.by122006.zircon'
version '4.5'

compileJava {
    sourceCompatibility = JavaVersion.VERSION_11
    targetCompatibility = JavaVersion.VERSION_11
}

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(17)
    }
}
buildPlugin {
    buildSearchableOptions.enabled = false
}

repositories {
    maven {
        url uri('../../repo')
    }
    intellijPlatform {
        defaultRepositories()
    }
    maven { url 'https://jitpack.io' }
    maven { url 'https://maven.aliyun.com/repository/public/' }
    mavenCentral()

}

import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.models.ProductRelease

intellijPlatform {
    pluginVerification {
        ides {
            ide IntelliJPlatformType.IntellijIdeaCommunity, "2024.1"
            recommended()
            select {
                it.types = [IntelliJPlatformType.IntellijIdeaCommunity]
                it.channels = [ProductRelease.Channel.RELEASE]
                it.sinceBuild = '212'
                it.untilBuild = '251.*'
            }
        }
    }
}
patchPluginXml {
    sinceBuild = "212.*"
    untilBuild = "251.*"
}
dependencies {
    intellijPlatform {
//        intellijIdeaCommunity '2022.3'
        intellijIdeaCommunity '2024.1'
//        intellijIdeaCommunity '251.21418.62'
        bundledPlugin 'com.intellij.java'
        instrumentationTools()
    }
    annotationProcessor project(":javac")
    implementation project(":zircon")
    implementation project(":base")
    annotationProcessor "org.projectlombok:lombok:1.18.20"
    compileOnly 'org.projectlombok:lombok:1.18.20'
    implementation('com.github.122006:ExMethodUtil:1.1.8')
    testAnnotationProcessor project(":javac")
}
tasks.findByPath(':ijplugin:runIde').dependsOn(':buildClazzByJava17')
////IU-202.7319.50


tasks.withType(JavaCompile) {
    it.options.compilerArgs << "-Xplugin:ZrOptionalChain"
    it.options.compilerArgs << "-Xplugin:ZrExMethod"
    it.options.compilerArgs << "-Xplugin:ZrString"
    it.options.fork = true
}

