加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.52 KB
一键复制 编辑 原始数据 按行查看 历史
opendsl 提交于 2021-01-14 23:28 . 升级到5.2.2
//
plugins {
id "org.jetbrains.intellij" version "$ijpVersion"
id "org.jetbrains.grammarkit" version "$grammarKitVersion"
}
group 'lang.plugin.idea'
version "$pluginVersion"
apply plugin: 'java'
//def sinceBuildVersion = "${sinceBuildVersion}"
//def untilBuildVersion = "${untilBuildVersion}"
repositories {
mavenLocal()
maven {
url "http://maven.aliyun.com/nexus/content/groups/public"
}
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'com.googlecode.aviator', name: 'aviator', version: aviatorVersion
}
sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir 'src/main/gen-bnf'
srcDir 'src/main/gen-flex'
}
resources {
srcDir 'src/main/resources'
}
}
test {
java {
srcDir 'src/test/java'
}
resources {
srcDir 'src/test/resources'
}
}
}
apply plugin: 'idea'
// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
version ideaVersion
plugins = ['java']
updateSinceUntilBuild = true
}
apply plugin: 'org.jetbrains.grammarkit'
// import is optional to make task creation easier
import org.jetbrains.grammarkit.tasks.*
grammarKit {
// version of IntelliJ patched JFlex (see bintray link below), Default is 1.7.0-1
jflexRelease = '1.7.0-1'
// tag or short commit hash of Grammar-Kit to use (see link below). Default is 2020.1
grammarKitRelease = '2020.1'
}
task generateJflex(type: GenerateLexer) {
// source flex file
source = "src/main/my/grammar/_MyLanguageLexer.flex"
// target directory for lexer
targetDir = "src/main/gen-flex/my/lang/parser"
// target classname, target file will be targetDir/targetClass.java
targetClass = "_MyLanguageLexer"
// optional, path to the task-specific skeleton file. Default: none
skeleton = 'src/main/my/flex/idea-flex.skeleton'
// if set, plugin will remove a lexer output file before generating new one. Default: false
purgeOldFiles = true
}
task generateBnf(type: GenerateParser) {
// source bnf file
source = "src/main/my/grammar/my.bnf"
// optional, task-specific root for the generated files. Default: none
targetRoot = 'src/main/gen-bnf'
// path to a parser file, relative to the targetRoot
pathToParser = 'my/lang/parser/MyLanguageParser.java'
// path to a directory with generated psi files, relative to the targetRoot
pathToPsiRoot = 'my/lang/psi'
// if set, plugin will remove a parser output file and psi output directory before generating new ones. Default: false
purgeOldFiles = true
}
task generateLangAndRunIde() {
dependsOn generateBnf, generateJflex, runIde
}
task myBuildPlugin {
dependsOn build, buildSearchableOptions, buildPlugin
}
//apply plugin: 'java'
task myRun(type: JavaExec, dependsOn: 'classes') {
classpath sourceSets.main.runtimeClasspath
main = "my.lang.action.RunCodeAction"
args "arg1"
}
patchPluginXml {
sinceBuild "${sinceBuildVersion}"
untilBuild "${untilBuildVersion}"
changeNotes """
<br/>
AviatorScript update list:<br/>
<br/>
<ul>
<li>5.2.2, Fixed Expression#getVariableNames() returns wrong result, added Feature.StaticMethods, Feature.StaticFields etc.</li>
<li>5.2.1, Fixed memory leak in reflector, supports calling static method directly etc.</li>
<li>5.2.0, supports overload function, variadic function,use statement and more sequence/math functions.</li>
<li>5.1.4, fixed compiling string interpolation lexeme without caching(may cause FGC) etc.</li>
<li>5.1.3, supports exponent operator ** and EnvProcessor hooks etc.</li>
<li>5.1.2, don't override __exp__ to user passed-in env.</li>
<li>5.1.1, fixed == and != operator working with variable syntax sugar such as a.b.c may return wrong result, it's recommended to upgrade.</li>
</ul>
<br/>
AviatorScript IDEA plugin update list:<br/>
<br/>
<ul>
<li>5.2.2-2021.01.14, update AviatorScript to 5.2.2</li>
<li>203-5.2.1-2020.12.19, support IDEA-202.3 and update AviatorScript to 5.2.1</li>
<li>5.2.0-2020.11.20, update AviatorScript to 5.2.0</li>
<li>2020.11.07, support AviatorScript comment</li>
<li>2020.11.03, support AviatorScript highlight, grammar check and execute</li>
</ul>
"""
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化