-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IDEA 2022.x support #1097
IDEA 2022.x support #1097
Changes from all commits
358a9ea
08f7a43
08da757
e684ae9
33c9a32
3fb7964
a7b612c
a1f1b9b
b0756df
01e5c79
fda6ca6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,12 @@ | |
|
||
plugins { | ||
id 'de.undercouch.download' version '3.3.0' | ||
id 'org.jetbrains.intellij' version '0.4.9' | ||
id "org.jetbrains.grammarkit" version "2020.3.2" | ||
id 'org.jetbrains.intellij' version '1.10.1' | ||
id "org.jetbrains.grammarkit" version "2022.3" | ||
id "com.asarkar.gradle.build-time-tracker" version "2.0.4" | ||
} | ||
|
||
import org.jetbrains.intellij.DependenciesUtils | ||
import org.jetbrains.grammarkit.tasks.* | ||
|
||
if (!project.hasProperty('targetVersion')) { | ||
|
@@ -97,25 +98,27 @@ allprojects { | |
type = 'IU' | ||
version = "IU-${ideaVersion}" | ||
pluginName = "intellij-haxe-${ideaVersion}" | ||
ideaDependencyCachePath "${ideaBaseDir}" | ||
ideaDependencyCachePath = "${ideaBaseDir}" | ||
// Specify the sandbox so that Gradle doesn't try to make it relative to each sub-project. | ||
sandboxDirectory "${project.rootDir}/build/idea-sandbox" | ||
sandboxDir = "${project.rootDir}/build/idea-sandbox" | ||
// Don't let gradle fill in since/until, we fill them via patchCustomTags using the properties file. | ||
updateSinceUntilBuild false | ||
updateSinceUntilBuild = false | ||
|
||
// Include the "java" built-in plugin for 2019.2 and later builds. | ||
if (requiresJavaPlugin) { | ||
System.println("Including java plugin for version >= 2019.2") | ||
plugins += 'java' // 2019.2 + only. Causes build errors on earlier versions. | ||
plugins.add('java') // 2019.2 + only. Causes build errors on earlier versions. | ||
} | ||
// Flex support was unbundled for version 2020.2. | ||
if (requiresFlexPlugin) { | ||
System.println("Including Flex plugin for version >= 2020.2") | ||
String versionWithMajor = ideaVersion.substring(0, 6); | ||
switch (versionWithMajor) { | ||
case "2020.2" : plugins += 'com.intellij.flex:202.6397.59'; break | ||
case "2020.3" : plugins += 'com.intellij.flex:203.5981.155'; break | ||
case "2021.1" : plugins += 'com.intellij.flex:211.6693.111'; break | ||
case "2020.2" : plugins.add('com.intellij.flex:202.6397.59'); break | ||
case "2020.3" : plugins.add('com.intellij.flex:203.5981.155'); break | ||
case "2021.1" : plugins.add('com.intellij.flex:211.6693.111'); break | ||
case "2022.3" : plugins.add('com.intellij.flex:223.7571.4'); break | ||
case "2022.3.3" : plugins.add('com.intellij.flex:223.8617.9'); break | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tested specifically on |
||
} | ||
|
||
} | ||
|
@@ -152,14 +155,15 @@ idea.module { generatedSourceDirs += file('gen') } | |
|
||
|
||
dependencies { | ||
implementation 'ch.qos.reload4j:reload4j:1.2.25' | ||
|
||
compile files('gen') { | ||
implementation files('gen') { | ||
builtBy 'generateSources' | ||
} | ||
|
||
compile project(':common') | ||
compile project(':jps-plugin') | ||
compile project(':hxcpp-debugger-protocol') | ||
implementation project(':common') | ||
implementation project(':jps-plugin') | ||
implementation project(':hxcpp-debugger-protocol') | ||
|
||
String flexPluginDir = "${ideaTargetDir}" | ||
if (requiresFlexPlugin) { | ||
|
@@ -181,15 +185,15 @@ dependencies { | |
|
||
testCompileOnly files(flexShared) | ||
testCompileOnly files(flexSupport) | ||
testCompileOnly files("${ideaTargetDir}/lib/ openapi.jar") | ||
testCompileOnly files("${ideaTargetDir}/lib/openapi.jar") | ||
testCompileOnly files("${ideaTargetDir}/lib/util.jar") | ||
|
||
} | ||
|
||
afterEvaluate { | ||
dependencies { | ||
if (requiresJavaPlugin) { | ||
compile intellijPlugin('java') { include("${ideaTargetDir}/plugins/java/lib/jps-builders.jar") } | ||
implementation DependenciesUtils.intellijPlugin(project, 'java') { include("${ideaTargetDir}/plugins/java/lib/jps-builders.jar") } | ||
} | ||
} | ||
} | ||
|
@@ -201,7 +205,7 @@ runIde { | |
Properties props = System.getProperties() | ||
for (String pname : props.propertyNames()) { | ||
for (String prefix : prefixesToInclude) { | ||
if (pname.startsWith(prefix)) { | ||
if (pname.startsWith(prefix) && pname != 'idea.home.path') { | ||
String pval = props.get(pname) | ||
if (pval.contains(" ") && !pval.startsWith("'")) { | ||
// Strings containing spaces require quoting. | ||
|
@@ -241,10 +245,14 @@ processResources { | |
} | ||
|
||
patchPluginXml { | ||
def props = findSdkValuesAndProperties(file("${ideaTargetDir}/build.txt")) | ||
sinceBuild = props.getProperty("plugin.installable.since") | ||
untilBuild = props.getProperty("plugin.installable.until") | ||
|
||
pluginXmlFiles = [ | ||
'src/META-INF/plugin.xml', | ||
'src/META-INF/debugger-support.xml', | ||
'src/META-INF/flex-debugger-support.xml' | ||
file('src/META-INF/plugin.xml'), | ||
file('src/META-INF/debugger-support.xml'), | ||
file('src/META-INF/flex-debugger-support.xml') | ||
] | ||
} | ||
|
||
|
@@ -320,13 +328,13 @@ task cleanGenerated(type: Delete, group: 'generate') { | |
task generateHaxeParser(dependsOn: ':setupTools', type: JavaExec, group: 'generate') { | ||
workingDir = "${toolDir}" | ||
main '-jar' | ||
args = ['grammar-kit.jar', "${generatedSrcDir}", "${grammarHaxe}"] | ||
args = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED', '--add-opens=java.base/java.util=ALL-UNNAMED', '--add-opens=java.base/java.lang=ALL-UNNAMED', 'grammar-kit.jar', "${generatedSrcDir}", "${grammarHaxe}"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these and next jvmArgs are added as reflection is restricted on newer JREs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@rosingrind beware that GrammarKit has a Gradle plugin now, exposing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. totally understandable, however the next step you should consider to perform transition to newer versions - dropping There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rosingrind interesting. I wasn't aware of this, and I see it's a long standing issue too. Good catch, thanks! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i have wanted to upgrade grammar-kit and use the plugin but the reason why we stuck with the old version was because newer versions would output different code on different operating systems. but this could have been solved by now, so we could test the plugin and se how it goes |
||
|
||
inputs.file "${grammarHaxe}" | ||
outputs.upToDateWhen { file("${generatedSrcDir}/com/intellij/plugins/haxe/lang").exists() } | ||
} | ||
|
||
task generateHaxeLexer(group: 'generate', dependsOn:'generateHaxeParser', type: GenerateLexer) { | ||
task generateHaxeLexer(group: 'generate', dependsOn:'generateHaxeParser', type: GenerateLexerTask) { | ||
source = "${haxeFlex}" | ||
targetDir = "${generatedSrcDir}/com/intellij/plugins/haxe/lang/lexer" | ||
targetClass = "com.intellij.plugins.haxe.lang.lexer._HaxeLexer" | ||
|
@@ -335,7 +343,7 @@ task generateHaxeLexer(group: 'generate', dependsOn:'generateHaxeParser', type: | |
outputs.upToDateWhen { file("${generatedSrcDir}/com/intellij/plugins/haxe/lang/lexer/_HaxeLexer.java").exists() } | ||
|
||
} | ||
task generateHxmlLexer(group: 'generate', dependsOn:'generateHxmlParser', type: GenerateLexer) { | ||
task generateHxmlLexer(group: 'generate', dependsOn:'generateHxmlParser', type: GenerateLexerTask) { | ||
source = "${hxmlFlex}" | ||
targetDir = "${generatedSrcDir}/com/intellij/plugins/haxe/hxml/lexer" | ||
targetClass = "com.intellij.plugins.haxe.hxml.lexer.HXMLLexer" | ||
|
@@ -344,7 +352,7 @@ task generateHxmlLexer(group: 'generate', dependsOn:'generateHxmlParser', type: | |
outputs.upToDateWhen { file("${generatedSrcDir}/com/intellij/plugins/haxe/hxml/lexer/HXMLLexer.java").exists() } | ||
|
||
} | ||
task generateMetadataLexer(group: 'generate', dependsOn:'generateMetadataParser', type: GenerateLexer) { | ||
task generateMetadataLexer(group: 'generate', dependsOn:'generateMetadataParser', type: GenerateLexerTask) { | ||
source = "${metadataFlex}" | ||
targetDir = "${generatedSrcDir}/com/intellij/plugins/haxe/metadata/lexer" | ||
targetClass = "com.intellij.plugins.haxe.metadata.lexer.MetadataLexer" | ||
|
@@ -359,7 +367,7 @@ task generateMetadataLexer(group: 'generate', dependsOn:'generateMetadataParser' | |
task generateHxmlParser(dependsOn: ':setupTools', type: JavaExec, group: 'generate') { | ||
workingDir = "${toolDir}" | ||
main '-jar' | ||
args = ['grammar-kit.jar', "${generatedSrcDir}", "${grammarHxml}"] | ||
args = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED', '--add-opens=java.base/java.util=ALL-UNNAMED', '--add-opens=java.base/java.lang=ALL-UNNAMED', 'grammar-kit.jar', "${generatedSrcDir}", "${grammarHxml}"] | ||
|
||
inputs.file "${grammarHxml}" | ||
outputs.upToDateWhen { file("${generatedSrcDir}/com/intellij/plugins/haxe/hxml").exists() } | ||
|
@@ -368,7 +376,7 @@ task generateHxmlParser(dependsOn: ':setupTools', type: JavaExec, group: 'genera | |
task generateMetadataParser(dependsOn: ':setupTools', type: JavaExec, group: 'generate') { | ||
workingDir = "${toolDir}" | ||
main '-jar' | ||
args = ['grammar-kit.jar', "${generatedSrcDir}", "${grammarMetadata}"] | ||
args = ['--add-opens=java.base/java.lang.reflect=ALL-UNNAMED', '--add-opens=java.base/java.util=ALL-UNNAMED', '--add-opens=java.base/java.lang=ALL-UNNAMED', 'grammar-kit.jar', "${generatedSrcDir}", "${grammarMetadata}"] | ||
|
||
inputs.file "${grammarMetadata}" | ||
outputs.upToDateWhen { file("${generatedSrcDir}/com/intellij/plugins/haxe/metadata").exists() } | ||
|
@@ -430,6 +438,7 @@ Properties findSdkValuesAndProperties(File buildFile) { | |
// Lookup table for properties files. Add new versions here. | ||
def propertiesFile = "" | ||
switch (Integer.valueOf(codeLine, 10)) { | ||
case 223: propertiesFile = "idea_v22.properties"; break | ||
case 211: propertiesFile = "idea_v21.properties"; break | ||
case 203: propertiesFile = "idea_v20.3.properties"; break | ||
case 202: propertiesFile = "idea_v20.properties"; break | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# | ||
# Copyright 2023 rosingrind | ||
# | ||
|
||
# | ||
# Properties for building against IDEA version 2022. | ||
# | ||
|
||
# Target version of IDEA that we typically build for. | ||
# This is appended to the name of the intellij-haxe-XXX jar file. | ||
idea.version=2022 | ||
|
||
# Human-readable versions of IDEA that this build is compatible with. | ||
plugin.compatibility.description=IDEA 2022.x | ||
|
||
# ################################################### | ||
# IDEA build IDs that are compatible with this plugin. | ||
# ################################################### | ||
# | ||
# IDEA builds prior to this one will not install this plugin. | ||
# | ||
plugin.installable.since=223 | ||
# | ||
# IDEA builds after this one will not install this plugin. | ||
# | ||
plugin.installable.until=223.* | ||
|
||
|
||
# ################################################### | ||
# Java compatibility. | ||
# ################################################### | ||
plugin.java.source.compatibility=17 | ||
plugin.java.target.compatibility=17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested specifically on
2022.3
, not compatible with2022.3.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its about time we drop support for older versions if they are holding us back due to API changes etc. but perhaps a do a release for all older versions before we move on. it would be nice if we could follow the latest version so people can upgrade their IDEs