12 Star 67 Fork 13

opendsl/aviatorscript-ideaplugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build-221.gradle 5.83 KB
一键复制 编辑 原始数据 按行查看 历史
opendsl 提交于 2023-08-24 12:47 . 支持版本221
//
//lintOptions {
// abortOnError false
//}
plugins {
id "org.jetbrains.intellij" version "$ijpVersion"
id "org.jetbrains.grammarkit" version "$grammarKitVersion"
}
//compileOptions {
// sourceCompatibility JavaVersion.VERSION_11
// targetCompatibility JavaVersion.VERSION_11
//}
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 {
implementation 'org.jetbrains:annotations:24.0.0'
implementation 'com.googlecode.aviator:aviator:5.3.3'
// testCompile group: 'junit', name: 'junit', version: '4.12'
// compile group: 'com.googlecode.aviator', name: 'aviator', version: aviatorVersion
// compile group: 'org.jetbrains', name: 'annotations', version: '24.0.0'
}
processResources {
include('**')
setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
}
sourceSets {
main {
java {
srcDir 'src/main/gen'
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 = false
}
//plugins {
// id "org.jetbrains.grammarkit" version "2022.3.1"
//}
// import is optional to make task creation easier
import org.jetbrains.grammarkit.tasks.*
//https://github.com/JetBrains/gradle-grammar-kit-plugin
grammarKit {
// version of IntelliJ patched JFlex (see bintray link below), Default is 1.7.0-1
// https://github.com/JetBrains/intellij-deps-jflex/releases
jflexRelease = '1.9.0'
// tag or short commit hash of Grammar-Kit to use (see link below). Default is 2020.1
grammarKitRelease = '2022.3.1'
intellijRelease = "2023.1"
}
//dependencies {
// implementation 'org.jetbrains:annotations:24.0.0'
//// testCompile group: 'junit', name: 'junit', version: '4.12'
// compile group: 'com.googlecode.aviator', name: 'aviator', version: aviatorVersion
//}
// 文档:https://plugins.jetbrains.com/docs/intellij/tools-gradle-grammar-kit-plugin.html#tasks
task generateBnf() {
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.set(new File('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 generateJflex() {
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 buildPlugin
//}
//apply plugin: 'java'
task myRun(type: JavaExec, dependsOn: 'classes') {
classpath sourceSets.main.runtimeClasspath
mainClass = "my.lang.action.RunCodeAction"
args "arg1"
}
//patchPluginXml {
// sinceBuild "${sinceBuildVersion}"
// untilBuild "${untilBuildVersion}"
//
// changeNotes """
// <br/>
//
// AviatorScript update list:<br/>
// <br/>
//
// <ul>
// <li>5.3.3-2023.03.20, update AviatorScript to 5.3.3</li>
// <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.3.3-2023.03.20, update AviatorScript to 5.3.3</li>
// <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>
//
// """
//}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/imflyfish/aviatorscript-ideaplugin.git
git@gitee.com:imflyfish/aviatorscript-ideaplugin.git
imflyfish
aviatorscript-ideaplugin
aviatorscript-ideaplugin
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385