当前位置:   article > 正文

IDEA插件开发-设置启动沙盒IDEA的运行内存_org.jetbrains.changelog

org.jetbrains.changelog

idea插件开发时启动的idea内存太小了,在沙盒中用大项目调试的时候512的运行内存简直难受

1.找到 build.gradle.kts 文件(这个文件名不一定是kts的后缀,我是直接下载的官网插件模板)

在末尾处写 runIde 来追加运行idea的参数

  1. runIde {
  2. jvmArgs("-Xmx4096m","-XX:ReservedCodeCacheSize=512m","-Xms128m")
  3. }

我的整个 build.gradle.kts 的内容如下

  1. import org.jetbrains.changelog.markdownToHTML
  2. import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
  3. fun properties(key: String) = project.findProperty(key).toString()
  4. plugins {
  5. // Java support
  6. id("java")
  7. // Kotlin support
  8. id("org.jetbrains.kotlin.jvm") version "1.6.10"
  9. // Gradle IntelliJ Plugin
  10. id("org.jetbrains.intellij") version "1.4.0"
  11. // Gradle Changelog Plugin
  12. id("org.jetbrains.changelog") version "1.3.1"
  13. // Gradle Qodana Plugin
  14. id("org.jetbrains.qodana") version "0.1.13"
  15. }
  16. group = properties("pluginGroup")
  17. version = properties("pluginVersion")
  18. // Configure project's dependencies
  19. repositories {
  20. //棣栧厛鍘绘湰鍦颁粨搴撴壘
  21. mavenLocal()
  22. //鐒跺悗鍘婚樋閲屼粨搴撴壘
  23. // build.gradle:
  24. // maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
  25. // build.gradle.kts:
  26. maven { url = uri("https://repo.spring.io/release") }
  27. maven {
  28. isAllowInsecureProtocol = true
  29. setUrl("http://maven.aliyun.com/nexus/content/groups/public/")
  30. }
  31. maven {
  32. isAllowInsecureProtocol = true
  33. url = uri("https://maven.aliyun.com/repository/public") }
  34. maven {
  35. isAllowInsecureProtocol = true
  36. url = uri("https://maven.aliyun.com/repository/google") }
  37. maven {
  38. isAllowInsecureProtocol = true
  39. url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
  40. maven {
  41. isAllowInsecureProtocol = true
  42. url = uri("https://maven.aliyun.com/repository/spring-plugin") }
  43. maven {
  44. isAllowInsecureProtocol = true
  45. url = uri("https://maven.aliyun.com/repository/apache-snapshots") }
  46. maven {
  47. isAllowInsecureProtocol = true
  48. url = uri("http://oss.jfrog.org/artifactory/oss-snapshot-local/") }
  49. google()
  50. jcenter()
  51. //鏈€鍚庝粠maven涓ぎ浠撳簱鎵?
  52. mavenCentral()
  53. }
  54. // Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
  55. intellij {
  56. pluginName.set(properties("pluginName"))
  57. version.set(properties("platformVersion"))
  58. type.set(properties("platformType"))
  59. // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
  60. plugins.set(properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty))
  61. }
  62. dependencies {
  63. implementation("cn.hutool:hutool-core:5.7.16")
  64. }
  65. // Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
  66. changelog {
  67. version.set(properties("pluginVersion"))
  68. groups.set(emptyList())
  69. }
  70. // Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
  71. qodana {
  72. cachePath.set(projectDir.resolve(".qodana").canonicalPath)
  73. reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath)
  74. saveReport.set(true)
  75. showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
  76. }
  77. tasks {
  78. // Set the JVM compatibility versions
  79. properties("javaVersion").let {
  80. withType<JavaCompile> {
  81. sourceCompatibility = it
  82. targetCompatibility = it
  83. }
  84. withType<KotlinCompile> {
  85. kotlinOptions.jvmTarget = it
  86. }
  87. }
  88. wrapper {
  89. gradleVersion = properties("gradleVersion")
  90. }
  91. patchPluginXml {
  92. version.set(properties("pluginVersion"))
  93. sinceBuild.set(properties("pluginSinceBuild"))
  94. untilBuild.set(properties("pluginUntilBuild"))
  95. // Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
  96. pluginDescription.set(
  97. projectDir.resolve("README.md").readText().lines().run {
  98. val start = "<!-- Plugin description -->"
  99. val end = "<!-- Plugin description end -->"
  100. if (!containsAll(listOf(start, end))) {
  101. throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
  102. }
  103. subList(indexOf(start) + 1, indexOf(end))
  104. }.joinToString("\n").run { markdownToHTML(this) }
  105. )
  106. // Get the latest available change notes from the changelog file
  107. changeNotes.set(provider {
  108. changelog.run {
  109. getOrNull(properties("pluginVersion")) ?: getLatest()
  110. }.toHTML()
  111. })
  112. }
  113. // Configure UI tests plugin
  114. // Read more: https://github.com/JetBrains/intellij-ui-test-robot
  115. runIdeForUiTests {
  116. systemProperty("robot-server.port", "8082")
  117. systemProperty("ide.mac.message.dialogs.as.sheets", "false")
  118. systemProperty("jb.privacy.policy.text", "<!--999.999-->")
  119. systemProperty("jb.consents.confirmation.enabled", "false")
  120. }
  121. signPlugin {
  122. certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
  123. privateKey.set(System.getenv("PRIVATE_KEY"))
  124. password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
  125. }
  126. publishPlugin {
  127. dependsOn("patchChangelog")
  128. token.set(System.getenv("PUBLISH_TOKEN"))
  129. // pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
  130. // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
  131. // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
  132. channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
  133. }
  134. runIde {
  135. jvmArgs("-Xmx4096m","-XX:ReservedCodeCacheSize=512m","-Xms128m")
  136. }
  137. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/112131?site
推荐阅读
相关标签
  

闽ICP备14008679号