Skip to content

Commit

Permalink
Fixes compilation and running from within VS Code (#1902)
Browse files Browse the repository at this point in the history
- added missing package to StripeRequestTest
- increased the language server per-thread stack size (Xss) to 8m so lombok can run
- added eclipse access rule for com.sun.net.httpserver.* so the langauge server does not report them as errors to the debugger
  • Loading branch information
jar-stripe authored Oct 23, 2024
1 parent 87f69c4 commit 3058258
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
},
"java.configuration.updateBuildConfiguration": "automatic",
// LSP was ooming and it recommended this change
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable",
// (jar) added -Xss8m so lombok would run without stack overflowing
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable -Xss8m",
"java.test.config": {
"vmargs": [ "-Dstripe.disallowGlobalResponseGetterFallback=true"]

}
},
}
20 changes: 20 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,23 @@ jacoco
// test code instrumentation for Java 18
toolVersion = "0.8.8"
}


// Used when developing in vscode-java; some of our examples use
// com.sun.net.httpserver. This is safe to do because the JDK
// team has committed to ensuring jdk.httpserver is exported.
// See https://openjdk.org/jeps/403, "Exported com.sun APIs"
import org.gradle.plugins.ide.eclipse.model.AccessRule

apply plugin: 'eclipse'

eclipse {
classpath {
file {
whenMerged {
def jre = entries.find { it.path.contains 'org.eclipse.jdt.launching.JRE_CONTAINER' }
jre.accessRules.add(new AccessRule('0', 'com/sun/net/httpserver/**'))
}
}
}
}

0 comments on commit 3058258

Please sign in to comment.