Skip to content
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

build: use pluginVerifier for quality assurance #22

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/gradle-run/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
if: ${{ contains(inputs.steps, 'build') }}
shell: bash
run: |
./gradlew buildPlugin
./gradlew runPluginVerifier buildPlugin
ls -la build/distributions

- name: Test
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ tasks {
dependsOn 'copyLsp'
}

verifyPlugin {
dependsOn 'copyLsp'
}

test {
dependsOn 'copyLspToInstrumented'
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sap/cap/cds/intellij/FileType.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cap.cds.intellij;
package com.sap.cap.cds;

import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.util.NlsContexts;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sap/cap/cds/intellij/Icons.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cap.cds.intellij;
package com.sap.cap.cds;

import com.intellij.openapi.util.IconLoader;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sap/cap/cds/intellij/Language.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cap.cds.intellij;
package com.sap.cap.cds;

public class Language extends com.intellij.lang.Language {

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/sap/cap/cds/intellij/Plugin.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.sap.cap.cds.intellij;
package com.sap.cap.cds;

public class Plugin {

/* Overview of all relevant IDs, names, and labels for the plugin itself */

public static final String ID = "com.sap.cap.cds.intellij"; // Should not be changed. See plugin.xml
public static final String ID = "com.sap.cap.cds"; // Should not be changed. See plugin.xml

public static final String PACKAGE = "com.sap.cap.cds.intellij";
public static final String PACKAGE = "com.sap.cap.cds";

public static final String LABEL = "intellij-cds"; // Used for build subfolder and zip file

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.sap.cap.cds.intellij.lsp;
package com.sap.cap.cds.lsp;

import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.platform.lsp.api.ProjectWideLspServerDescriptor;
import com.intellij.platform.lsp.api.customization.LspFormattingSupport;
import com.sap.cap.cds.intellij.FileType;
import com.sap.cap.cds.FileType;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.sap.cap.cds.intellij.lsp;
package com.sap.cap.cds.lsp;

import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.platform.lsp.api.LspServer;
import com.intellij.platform.lsp.api.lsWidget.LspServerWidgetItem;
import com.sap.cap.cds.intellij.FileType;
import com.sap.cap.cds.intellij.Icons;
import com.sap.cap.cds.intellij.Language;
import com.sap.cap.cds.intellij.textmate.BundleManager;
import com.sap.cap.cds.FileType;
import com.sap.cap.cds.Icons;
import com.sap.cap.cds.Language;
import com.sap.cap.cds.textmate.BundleManager;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cap.cds.intellij.textmate;
package com.sap.cap.cds.textmate;

public class Bundle {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cap.cds.intellij.textmate;
package com.sap.cap.cds.textmate;


import com.intellij.ide.AppLifecycleListener;
Expand All @@ -8,9 +8,9 @@
import com.intellij.openapi.startup.ProjectActivity;
import com.intellij.openapi.startup.StartupActivity;
import com.intellij.util.PathUtil;
import com.sap.cap.cds.intellij.Language;
import com.sap.cap.cds.intellij.util.Logger;
import com.sap.cap.cds.intellij.Plugin;
import com.sap.cap.cds.Language;
import com.sap.cap.cds.util.Logger;
import com.sap.cap.cds.Plugin;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import org.jetbrains.annotations.NotNull;
Expand All @@ -22,8 +22,8 @@
import java.nio.file.Paths;
import java.util.List;

import static com.sap.cap.cds.intellij.util.StackUtil.getCaller;
import static com.sap.cap.cds.intellij.util.StackUtil.getMethod;
import static com.sap.cap.cds.util.StackUtil.getCaller;
import static com.sap.cap.cds.util.StackUtil.getMethod;

public class BundleManager implements AppLifecycleListener, /*obsolete*/ StartupActivity, /* replacement*/ ProjectActivity, DynamicPluginListener {

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/sap/cap/cds/intellij/util/Logger.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.sap.cap.cds.intellij.util;
package com.sap.cap.cds.util;

import com.sap.cap.cds.intellij.Plugin;
import com.sap.cap.cds.intellij.textmate.Bundle;
import com.sap.cap.cds.Plugin;
import com.sap.cap.cds.textmate.Bundle;

import static com.intellij.openapi.diagnostic.Logger.*;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sap/cap/cds/intellij/util/StackUtil.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.sap.cap.cds.intellij.util;
package com.sap.cap.cds.util;

public class StackUtil {
public static StackTraceElement getCaller(int depth) {
Expand Down
14 changes: 7 additions & 7 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<idea-plugin>
<id>com.sap.cap.cds.intellij</id>
<id>com.sap.cap.cds</id>
<name>CAP CDS Language Support</name>
<category>Custom Language</category>
<vendor url="https://sap.com">SAP SE</vendor>
Expand Down Expand Up @@ -27,34 +27,34 @@ The set of features will grow with future releases of the plugin, according to t
<extensions defaultExtensionNs="com.intellij">
<fileType
name="cds"
implementationClass="com.sap.cap.cds.intellij.FileType"
implementationClass="com.sap.cap.cds.FileType"
fieldName="INSTANCE"
language="cds"
extensions="cds"/>
<platform.lsp.serverSupportProvider implementation="com.sap.cap.cds.intellij.lsp.ServerSupportProvider"/>
<platform.lsp.serverSupportProvider implementation="com.sap.cap.cds.lsp.ServerSupportProvider"/>
</extensions>

<applicationListeners>
<listener
topic="com.intellij.ide.AppLifecycleListener"
class="com.sap.cap.cds.intellij.textmate.BundleManager"
class="com.sap.cap.cds.textmate.BundleManager"
activeInHeadlessMode="true" activeInTestMode="true"
/>
<listener
topic="com.intellij.openapi.startup.StartupActivity"
class="com.sap.cap.cds.intellij.textmate.BundleManager"
class="com.sap.cap.cds.textmate.BundleManager"
activeInHeadlessMode="true" activeInTestMode="true"
/>
<listener
topic="com.intellij.ide.plugins.DynamicPluginListener"
class="com.sap.cap.cds.intellij.textmate.BundleManager"
class="com.sap.cap.cds.textmate.BundleManager"
activeInHeadlessMode="true" activeInTestMode="true"
/>
</applicationListeners>
<projectListeners>
<listener
topic="com.intellij.openapi.startup.ProjectActivity"
class="com.sap.cap.cds.intellij.textmate.BundleManager"
class="com.sap.cap.cds.textmate.BundleManager"
activeInHeadlessMode="true" activeInTestMode="true"
/>
</projectListeners>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.sap.cap.cds.intellij;
package com.sap.cap.cds;

import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
import com.intellij.testFramework.fixtures.TempDirTestFixture;
import com.sap.cap.cds.intellij.lsp.ServerDescriptor;
import com.sap.cap.cds.lsp.ServerDescriptor;

import java.io.*;
import java.util.regex.Pattern;
Expand Down
Loading