代码拉取完成,页面将自动刷新
//
//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>
//
// """
//}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。