repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
  antlr "org.antlr:antlr4:$antlr_version"
  compile "org.antlr:antlr4-runtime:$antlr_version"
  compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
  compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
  compile 'com.fifesoft:rsyntaxtextarea:2.5.8'
  compile 'com.fifesoft:autocomplete:2.5.8'
  compile project(':kanvas-core')
  testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
  testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
  testCompile 'junit:junit:4.12'
}

generateGrammarSource {
    maxHeapSize = "64m"
    arguments += ['-package', 'me.tomassetti.antlr']
    outputDirectory = new File("generated-src/antlr/main/me/tomassetti/antlr".toString())
}
compileJava.dependsOn generateGrammarSource
compileKotlin.dependsOn generateGrammarSource
sourceSets {
    generated {
        java.srcDir 'generated-src/antlr/main/'
    }
}
compileJava.source sourceSets.generated.java, sourceSets.main.java

clean{
    delete "generated-src"
}

idea {
    module {
        sourceDirs += file("generated-src/antlr/main")
    }
}

sourceSets {
    main {
        java {
            srcDirs 'generated-src/antlr/main'
        }
        kotlin {
            srcDirs 'src/main/kotlin'
        }
    }
}

