From b469ec58e97051764bd09aee74e0f65a8fec44eb Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 4 Nov 2020 11:51:40 -0500 Subject: [PATCH] Generate native binary Use GraalVM's `native-image` feature to generate a executable. To test, install GraalVM and the native-image tool, then set JAVA_HOME to the GraalVM installation. Run `./mvnw package -Dnative -DskipTests` in order to generate an executable under `org.eclipse.lemminx/target`. Includes a GitHub Action in order to run builds of the binary on PRs for testing purposes. Adopted from [PR 673](https://github.com/eclipse/lemminx/pull/673) A part of #314. Signed-off-by: David Thompson --- .github/workflows/native-image.yaml | 42 + Jenkinsfile | 10 +- README.md | 33 +- org.eclipse.lemminx/pom.xml | 51 +- .../src/main/resources/META-INF/extra.json | 4 + .../META-INF/native-image/jni-config.json | 2 + .../META-INF/native-image/proxy-config.json | 3 + .../META-INF/native-image/reflect-config.json | 1582 +++++++++++++++++ .../native-image/resource-config.json | 66 + 9 files changed, 1785 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/native-image.yaml create mode 100644 org.eclipse.lemminx/src/main/resources/META-INF/extra.json create mode 100644 org.eclipse.lemminx/src/main/resources/META-INF/native-image/jni-config.json create mode 100644 org.eclipse.lemminx/src/main/resources/META-INF/native-image/proxy-config.json create mode 100644 org.eclipse.lemminx/src/main/resources/META-INF/native-image/reflect-config.json create mode 100644 org.eclipse.lemminx/src/main/resources/META-INF/native-image/resource-config.json diff --git a/.github/workflows/native-image.yaml b/.github/workflows/native-image.yaml new file mode 100644 index 000000000..83dcc60bb --- /dev/null +++ b/.github/workflows/native-image.yaml @@ -0,0 +1,42 @@ +name: native-image +on: [push, pull_request] +jobs: + build-binary-unix: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [macos-latest, ubuntu-latest] + include: + - os: macos-latest + label: 'darwin' + - os: ubuntu-latest + label: 'linux' + steps: + - uses: actions/checkout@v2 + - uses: DeLaGuardo/setup-graalvm@8bbfe44ef9c6f5c07e5af036a1bffd561c037d18 + with: + graalvm-version: '20.2.0.java8' + - run: ./mvnw package -Dnative -DskipTests $([ $(uname -s) = Linux ] && echo "-Dgraalvm.static=--static") -Dcbi.jarsigner.skip=true + - run: mv org.eclipse.lemminx/target/lemminx-* lemminx-$(git rev-parse --short "$GITHUB_SHA")-${{ matrix.label }} + - uses: actions/upload-artifact@v2 + with: + name: lemminx-${{ matrix.label }} + path: lemminx-*-${{ matrix.label }} + if-no-files-found: error + build-binary-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: ilammy/msvc-dev-cmd@v1.4.1 + - uses: DeLaGuardo/setup-graalvm@8bbfe44ef9c6f5c07e5af036a1bffd561c037d18 + with: + graalvm-version: '20.2.0.java11' + - run: Invoke-Expression -Command "$Env:JAVA_HOME/bin/gu install native-image" + - run: .\mvnw.cmd package -Dnative -DskipTests -D cbi.jarsigner.skip=true + - run: mv org.eclipse.lemminx\target\lemminx-*.exe lemminx-$(git rev-parse --short "$Env:GITHUB_SHA")-win32.exe + - uses: actions/upload-artifact@v2 + with: + name: lemminx-win32 + path: lemminx-*-win32.exe + if-no-files-found: error diff --git a/Jenkinsfile b/Jenkinsfile index e03d0294c..7708e60d1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,11 +9,11 @@ pipeline{ } stages{ stage("Maven Build"){ - steps { - withMaven { - sh './mvnw clean verify -B -Pci,generate-p2 -Dcbi.jarsigner.skip=false' - } + steps { + withMaven { + sh './mvnw clean verify -B -Pci,generate-p2 -Dcbi.jarsigner.skip=false' } + } } stage('Deploy to downloads.eclipse.org') { when { @@ -42,4 +42,4 @@ pipeline{ } } } -} \ No newline at end of file +} diff --git a/README.md b/README.md index 09c5d1002..e82b32b22 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,35 @@ this.forward(clientConnection, serverConnection) socket.connect(socketPort) ``` +Generating a native binary: +--------------------------------- +To generate a native binary: +- [Install GraalVM 20.2.0](https://www.graalvm.org/docs/getting-started/#install-graalvm) +- In a terminal, run `gu install native-image` +- Execute a Maven build that sets the flag `native`: `./mvnw clean package -Dnative -DskipTests` + - On Linux, compile with `./mvnw clean package -Dnative -DskipTests -Dgraalvm.static=--static` + in order to support distributions that don't use `glibc`, such as Alpine Linux +- It will generate a native binary in `org.eclipse.lemminx/target/lemminx-{os.name}-{architecture}-{version}` + +OS specific instructions: +- __Linux__: + - Make sure that you have installed the static versions of the C++ standard library + - For instance, on Fedora Linux, install `glibc-static`, `libstdc++-static`, and `zlib-static` +- __Windows__: + - When installing native-image, please note that `gu` is an existing alias in PowerShell. + Remove the alias with `Remote-Item alias:gu -Force`, refer to `gu` with the absolute path, or use `gu` under `cmd.exe`. + - Make sure to run the Maven wrapper in the "Native Tools Command Prompt". + This command prompt can be obtained through installing the Windows SDK or Visual Studio, as + mentioned in the [GraalVM installation instructions](https://www.graalvm.org/docs/getting-started-with-graalvm/windows/). + +`native-image` Development Instructions: +- Reflection: + - If you need to use reflection to access a private field/method, simply register the field/methods that you access in `reflect-config.json` + - If you need to parse some JSON using Gson, make sure to register the fields and methods of the class that you are parsing into in `reflect-config.json` + - This needs to be done recursively, for all classes that it has member variables of, including `enum`s + - Settings are all deserialized, so whenever a setting is added, make sure to register the classes + - Manually test the binary and check the logs for reflection errors/NPEs + Maven coordinates: ------------------ @@ -119,8 +148,8 @@ Here are some clients consuming this XML Language Server: * [Spring Tools 4](https://github.com/spring-projects/sts4) - re-using the XML parser for Spring-specific analysis and content-assist * Vim/Neovim with [coc-xml](https://github.com/fannheyward/coc-xml) * Emacs with [lsp-mode](https://github.com/emacs-lsp/lsp-mode) - - + + Extensions ---------- diff --git a/org.eclipse.lemminx/pom.xml b/org.eclipse.lemminx/pom.xml index e28860e1c..f9300af58 100644 --- a/org.eclipse.lemminx/pom.xml +++ b/org.eclipse.lemminx/pom.xml @@ -11,6 +11,8 @@ yyyyMMdd-HHmm ${maven.build.timestamp} true + 20.2.0 + @@ -126,6 +128,54 @@ + + native + + + native + true + + + + + + kr.motd.maven + os-maven-plugin + 1.6.1 + + + initialize + + detect + + + + + + org.graalvm.nativeimage + native-image-maven-plugin + ${graalvm.version} + + + + native-image + + package + + + + false + lemminx-${os.detected.classifier}-${project.version} + + --no-fallback + -H:EnableURLProtocols=https,http + ${graalvm.static} + + + + + + generate-p2 @@ -217,5 +267,4 @@ test - \ No newline at end of file diff --git a/org.eclipse.lemminx/src/main/resources/META-INF/extra.json b/org.eclipse.lemminx/src/main/resources/META-INF/extra.json new file mode 100644 index 000000000..233d2cc69 --- /dev/null +++ b/org.eclipse.lemminx/src/main/resources/META-INF/extra.json @@ -0,0 +1,4 @@ +{ + "name":"org.eclipse.lemminx.services.extensions.IXMLExtension", + "allDeclaredMethods":true +}, \ No newline at end of file diff --git a/org.eclipse.lemminx/src/main/resources/META-INF/native-image/jni-config.json b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/jni-config.json new file mode 100644 index 000000000..0d4f101c7 --- /dev/null +++ b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/jni-config.json @@ -0,0 +1,2 @@ +[ +] diff --git a/org.eclipse.lemminx/src/main/resources/META-INF/native-image/proxy-config.json b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/proxy-config.json new file mode 100644 index 000000000..6c0bdcc2a --- /dev/null +++ b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/proxy-config.json @@ -0,0 +1,3 @@ +[ + ["org.eclipse.lemminx.customservice.XMLLanguageClientAPI","org.eclipse.lsp4j.jsonrpc.Endpoint"] +] diff --git a/org.eclipse.lemminx/src/main/resources/META-INF/native-image/reflect-config.json b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/reflect-config.json new file mode 100644 index 000000000..5e0636049 --- /dev/null +++ b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/reflect-config.json @@ -0,0 +1,1582 @@ +[ + { + "name": "com.overzealous.remark.Remark", + "fields": [{ + "name": "cleaner" + }] + }, + { + "name": "java.lang.Object", + "allDeclaredMethods": true + }, + { + "name": "java.lang.String[]" + }, + { + "name": "java.util.ArrayList", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.apache.xerces.impl.dv.ObjectFactory" + }, + { + "name": "org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.apache.xerces.impl.dv.xs.ExtendedSchemaDVFactoryImpl", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.apache.xerces.impl.xs.SchemaGrammar", + "fields": [{ + "name": "fComplexTypeDecls" + }, { + "name": "fCTLocators" + }] + }, + { + "name": "org.apache.xerces.impl.xs.XMLSchemaValidator", + "fields": [{ + "name": "fSchemaLoader" + }] + }, + { + "name": "org.apache.xerces.impl.xs.XMLSchemaLoader", + "fields": [{ + "name": "fSchemaHandler" + }] + }, + { + "name": "org.apache.xerces.impl.xs.traversers.XSDHandler", + "fields": [{ + "name": "fSchemaParser" + }, { + "name": "fLocalElementDecl" + }, { + "name": "fParticle" + }] + }, + { + "name": "org.apache.xerces.impl.xs.XSLoaderImpl", + "fields": [{ + "name": "fSchemaLoader" + }] + }, + { + "name": "org.apache.xerces.parsers.ObjectFactory" + }, + { + "name": "org.apache.xerces.parsers.XIncludeAwareParserConfiguration", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.apache.xml.resolver.readers.OASISXMLCatalogReader", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.XMLLanguageServer", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.XMLTextDocumentService", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.XMLWorkspaceService", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.services.extensions.IXMLExtension", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.client.CodeLensKindCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.client.ExtendedClientCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.client.ExtendedCodeLensCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.commons.ParentProcessWatcher$ProcessLanguageServer", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.commons.snippets.Snippet", + "allDeclaredMethods": true, + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lemminx.services.snippets.XMLSnippetRegistryLoader" + }, + { + "name": "org.apache.xerces.impl.dtd.XMLDTDValidator", + "fields": [{ + "name": "fRootElement" + }] + }, + { + "name": "org.eclipse.lemminx.customservice.ActionableNotification", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.customservice.AutoCloseTagResponse", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lemminx.customservice.XMLLanguageClientAPI", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.customservice.XMLLanguageServerAPI", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.extensions.contentmodel.settings.ContentModelSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.extensions.contentmodel.settings.XMLSymbolsSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.extensions.contentmodel.settings.XMLFileAssociation", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.extensions.contentmodel.settings.XMLValidationSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.services.CompletionResponse", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.services.IXMLDocumentProvider", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lemminx.settings.AllXMLSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.InitializationOptionsSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.LogsSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.PathPatternMatcher", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lemminx.settings.ServerSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.XMLCodeLensSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.XMLCompletionSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.XMLFormattingOptions", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.XMLGeneralClientSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.XMLSymbolExpressionFilter", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.XMLSymbolFilter", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.XMLSymbolSettings", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.QuoteStyle", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lemminx.settings.SchemaDocumentationType", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lemminx.settings.XMLPreferences", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lemminx.settings.capabilities.InitializationOptionsExtendedClientCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CallHierarchyCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ClientCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeAction", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeActionCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeActionContext", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeActionKindCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeActionLiteralSupportCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeActionOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeActionParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeLensCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeLensOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CodeLensParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ColorProviderCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ColorProviderOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.Command", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionContext", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionItem", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionItemCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionItemKind", + "fields": [{ + "name": "Class" + }, + { + "name": "Color" + }, + { + "name": "Constant" + }, + { + "name": "Constructor" + }, + { + "name": "Enum" + }, + { + "name": "EnumMember" + }, + { + "name": "Event" + }, + { + "name": "Field" + }, + { + "name": "File" + }, + { + "name": "Folder" + }, + { + "name": "Function" + }, + { + "name": "Interface" + }, + { + "name": "Keyword" + }, + { + "name": "Method" + }, + { + "name": "Module" + }, + { + "name": "Operator" + }, + { + "name": "Property" + }, + { + "name": "Reference" + }, + { + "name": "Snippet" + }, + { + "name": "Struct" + }, + { + "name": "Text" + }, + { + "name": "TypeParameter" + }, + { + "name": "Unit" + }, + { + "name": "Value" + }, + { + "name": "Variable" + }, + { + "name": "value" + } + ] + }, + { + "name": "org.eclipse.lsp4j.CompletionItemKindCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionItemTag", + "fields": [{ + "name": "Deprecated" + }, + { + "name": "value" + } + ] + }, + { + "name": "org.eclipse.lsp4j.CompletionItemTagSupportCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionList", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lsp4j.CompletionOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CompletionTriggerKind", + "fields": [{ + "name": "value" + }] + }, + { + "name": "org.eclipse.lsp4j.CreateFile", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.CreateFileOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DeclarationCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DefinitionCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DefinitionParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DeleteFile", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DeleteFileOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.Diagnostic", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DiagnosticRelatedInformation", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DiagnosticSeverity", + "fields": [{ + "name": "value" + }] + }, + { + "name": "org.eclipse.lsp4j.DiagnosticTag", + "fields": [{ + "name": "value" + }, { + "name": "Unnecessary" + }, { + "name": "Deprecated" + }] + }, + { + "name": "org.eclipse.lsp4j.DiagnosticsTagSupport", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidChangeConfigurationCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidChangeConfigurationParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidChangeTextDocumentParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidChangeWatchedFilesCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidChangeWatchedFilesParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidChangeWatchedFilesRegistrationOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidCloseTextDocumentParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidOpenTextDocumentParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DidSaveTextDocumentParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentFilter", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentFormattingParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentHighlight", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentHighlightCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentHighlightKind", + "fields": [{ + "name": "value" + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentHighlightParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentLink", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentLinkCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentLinkOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentLinkParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentOnTypeFormattingOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentSymbol", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentSymbol", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentSymbolCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DocumentSymbolParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.DynamicRegistrationCapabilities", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lsp4j.ExecuteCommandCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ExecuteCommandOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.FileSystemWatcher", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.FoldingRange", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.FoldingRangeCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.FoldingRangeProviderOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.FoldingRangeRequestParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.FormattingCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.FormattingOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.HoverCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.HoverParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ImplementationCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.InitializeResult", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.InitializedParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.InsertTextFormat", + "fields": [{ + "name": "value" + }] + }, + { + "name": "org.eclipse.lsp4j.Location", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.LocationLink", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.MarkupContent", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.MessageParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.MessageType", + "fields": [{ + "name": "value" + }] + }, + { + "name": "org.eclipse.lsp4j.OnTypeFormattingCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ParameterInformationCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.Position", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.PublishDiagnosticsCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.PublishDiagnosticsParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.Range", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.RangeFormattingCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ReferencesCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.Registration", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.RegistrationParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.RenameCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.RenameFile", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.RenameFileOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.RenameOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ResourceChange", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ResourceOperation", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lsp4j.SaveOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SelectionRangeCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SemanticHighlightingCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SemanticHighlightingServerCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ServerCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.ServerInfo", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SignatureHelpCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SignatureHelpOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SignatureInformationCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.StaticRegistrationOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SymbolCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SymbolKind", + "fields": [{ + "name": "value" + }] + }, + { + "name": "org.eclipse.lsp4j.SymbolKindCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SymbolInformation", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.SynchronizationCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextDocumentClientCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextDocumentContentChangeEvent", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextDocumentEdit", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextDocumentIdentifier", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextDocumentItem", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextDocumentPositionParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextDocumentRegistrationOptions", + "allDeclaredFields": true + }, + { + "name": "org.eclipse.lsp4j.TextDocumentSyncOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TextEdit", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TypeDefinitionCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TypeDefinitionParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.TypeHierarchyCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.WorkspaceClientCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.WorkspaceEdit", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.WorkspaceEditCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.WorkspaceFolder", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.WorkspaceFoldersOptions", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.WorkspaceServerCapabilities", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.CodeActionResponseAdapter", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.DocumentChangeListAdapter", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.DocumentSymbolResponseAdapter", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.HoverTypeAdapter$Factory", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.InitializeParamsTypeAdapter$Factory", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.LocationLinkListAdapter", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.PrepareRenameResponseAdapter", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.ResourceChangeListAdapter", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.ResourceOperationTypeAdapter", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.SymbolInformationTypeAdapter$Factory", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.adapters.VersionedTextDocumentIdentifierTypeAdapter$Factory", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.jsonrpc.json.adapters.JsonElementTypeAdapter$Factory", + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.jsonrpc.messages.CancelParams", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.jsonrpc.messages.ResponseError", + "allDeclaredFields": true, + "methods": [{ + "name": "", + "parameterTypes": [] + }] + }, + { + "name": "org.eclipse.lsp4j.services.LanguageClient", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lsp4j.services.LanguageServer", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lsp4j.services.TextDocumentService", + "allDeclaredMethods": true + }, + { + "name": "org.eclipse.lsp4j.services.WorkspaceService", + "allDeclaredMethods": true + }, + { + "name": "org.jsoup.safety.Cleaner", + "fields": [{ + "name": "whitelist" + }] + }, + { + "name": "sun.misc.Unsafe", + "fields": [{ + "name": "theUnsafe" + }], + "methods": [{ + "name": "allocateInstance", + "parameterTypes": ["java.lang.Class"] + }] + } +] diff --git a/org.eclipse.lemminx/src/main/resources/META-INF/native-image/resource-config.json b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/resource-config.json new file mode 100644 index 000000000..9eba16ea8 --- /dev/null +++ b/org.eclipse.lemminx/src/main/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,66 @@ +{ + "resources": [ + { + "pattern": "\\QMETA-INF/services/javax.xml.parsers.SAXParserFactory\\E" + }, + { + "pattern": "\\QMETA-INF/services/org.eclipse.lemminx.services.extensions.IXMLExtension\\E" + }, + { + "pattern": "\\Qorg/apache/xml/resolver/etc/catalog.dtd\\E" + }, + { + "pattern": "\\Qorg/apache/xml/resolver/etc/catalog.rng\\E" + }, + { + "pattern": "\\Qorg/apache/xml/resolver/etc/catalog.xsd\\E" + }, + { + "pattern": "\\Qorg/apache/xml/resolver/etc/xcatalog.dtd\\E" + }, + { + "pattern": "\\Qorg/jsoup/nodes/entities-base.properties\\E" + }, + { + "pattern": "\\Qorg/jsoup/nodes/entities-full.properties\\E" + }, + { + "pattern": "\\Qschemas/xsd/XMLSchema.dtd\\E" + }, + { + "pattern": "\\Qschemas/xsd/XMLSchema.xsd\\E" + }, + { + "pattern": "\\Qschemas/xsd/datatypes.dtd\\E" + }, + { + "pattern": "\\Qschemas/xsd/xml.xsd\\E" + }, + { + "pattern": "org/eclipse/lemminx/services/snippets/[^/]+\\.json$" + } + ], + "bundles": [ + { + "name": "XMLSchemaMessagesReformatted" + }, + { + "name": "org.apache.xerces.impl.msg.XMLMessages" + }, + { + "name": "org.eclipse.lemminx.extensions.xerces.xmlmodel.msg.XMLMessages" + }, + { + "name": "org.apache.xerces.impl.msg.XMLSchemaMessages" + }, + { + "name": "org.apache.xerces.impl.xpath.regex.message" + }, + { + "name": "version" + }, + { + "name": "git" + } + ] +}