diff options
author | Daniel Below <daniel.below@tum.de> | 2021-06-02 22:58:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 22:58:41 +0200 |
commit | b4ebb47ac25e8afe8d77bb617372f6ec13bdb783 (patch) | |
tree | dc9829f9674c62c61734554615793b67c8f99bd6 /lib/compilers/java.js | |
parent | ba2b7c89cb3cba8da9b462199ded435d4d78d63f (diff) | |
download | compiler-explorer-b4ebb47ac25e8afe8d77bb617372f6ec13bdb783.tar.gz compiler-explorer-b4ebb47ac25e8afe8d77bb617372f6ec13bdb783.zip |
Add Kotlin/JVM support (#2637)
* Add Kotlin/JVM support
* Update CONTRIBUTORS.md
* Use kotlinc-jvm instead of kotlinc
* Fix alphabetical ordering
* Filter kotlin compiler arguments
Extract user options filtering for java into a separate function to
handle filtering options with extra arguments.
Filter kotlin compiler options: -d, -jdk-home, -kotlin-home, -script, -progressive
* Filter -Xjavac user options
Filter any option that starts with '-Xjavac', as it could be used to pass unwanted options through kotlinc to javac.
* Fix year in copyright
Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
* Add kotlin.amazon.properties
* Add JAVA_HOME to kotlin default exec options
Query per-compiler property 'java_home' and set environment
* Add java_home to kotlin properties
Co-authored-by: Daniel Below <daniel.below@jetbrains.com>
Co-authored-by: Rubén Rincón Blanco <ruben@rinconblanco.es>
Diffstat (limited to 'lib/compilers/java.js')
-rw-r--r-- | lib/compilers/java.js | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/compilers/java.js b/lib/compilers/java.js index 677eeb323..c61cc8f65 100644 --- a/lib/compilers/java.js +++ b/lib/compilers/java.js @@ -111,22 +111,10 @@ export class JavaCompiler extends BaseCompiler { return path.join(dirPath, `${path.basename(this.compileFilename, this.lang.extensions[0])}.class`); } - filterUserOptions(userOptions) { + filterUserOptionsWithArg(userOptions, oneArgForbiddenList) { const filteredOptions = []; let toSkip = 0; - const oneArgForbiddenList = new Set([ - // -d directory - // Sets the destination directory for class files. - '-d', - // -s directory - // Specifies the directory used to place the generated source files. - '-s', - // --source-path path or -sourcepath path - // Specifies where to find input source files. - '--source-path', '-sourcepath', - ]); - for (const userOption of userOptions) { if (toSkip > 0) { toSkip--; @@ -143,6 +131,22 @@ export class JavaCompiler extends BaseCompiler { return filteredOptions; } + filterUserOptions(userOptions) { + const oneArgForbiddenList = new Set([ + // -d directory + // Sets the destination directory for class files. + '-d', + // -s directory + // Specifies the directory used to place the generated source files. + '-s', + // --source-path path or -sourcepath path + // Specifies where to find input source files. + '--source-path', '-sourcepath', + ]); + + return this.filterUserOptionsWithArg(userOptions, oneArgForbiddenList); + } + processAsm(result) { // Handle "error" documents. if (!result.asm.includes('\n') && result.asm[0] === '<') { |