Skip to content

1211: Changed configuration to update Intellij Plugin to the 1.5.2 ve… #1214

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

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: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

*.ft text eol=lf
10 changes: 5 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run automated tests
run: ./gradlew test -i --no-daemon
run: ./gradlew test --no-daemon

build-windows:
runs-on: windows-latest
Expand All @@ -54,7 +54,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run automated tests
run: ./gradlew test -i --no-daemon
run: ./gradlew test --no-daemon

build-macos:
runs-on: macos-latest
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run automated tests
run: ./gradlew test -i --no-daemon
run: ./gradlew test --no-daemon

static-tests:
runs-on: ubuntu-latest
Expand All @@ -104,11 +104,11 @@ jobs:
- id: file_changes
uses: trilom/file-changes-action@v1.2.4
- name: Run Code Style Check
run: ./gradlew checkstyleCI -i --no-daemon
run: ./gradlew checkstyleCI --no-daemon
env:
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}
ACTIONS_STEP_DEBUG: true
- name: Run PMD Quality Check
run: ./gradlew pmdCI -i --no-daemon
run: ./gradlew pmdCI --no-daemon
env:
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}
32 changes: 23 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
*/

plugins {
id 'org.jetbrains.intellij' version '1.1.4'
id 'org.jetbrains.intellij' version '1.11.0'
id 'checkstyle'
id 'pmd'
id 'org.jetbrains.changelog' version '1.2.1'
id 'org.jetbrains.changelog' version '2.0.0'
}

repositories {
Expand All @@ -23,8 +23,8 @@ apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'org.jetbrains.changelog'

def phpPluginVersion = System.getProperty("phpPluginVersion", "212.5080.55")
def ideaVersion = System.getProperty("ideaVersion", "2021.2.1")
def phpPluginVersion = System.getProperty("phpPluginVersion", "222.3739.45")
def ideaVersion = System.getProperty("ideaVersion", "2022.2.1")
def javaVersion = 11

sourceCompatibility = javaVersion
Expand All @@ -41,7 +41,7 @@ intellij {
'properties',
'CSS',
'JavaScriptLanguage',
'com.intellij.lang.jsgraphql:3.1.2',
'com.intellij.lang.jsgraphql:3.2.1',
'platform-images',
'copyright'
]
Expand Down Expand Up @@ -105,12 +105,26 @@ idea {
}

dependencies {
testImplementation 'junit:junit:4.13'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation(
"org.junit.jupiter:junit-jupiter:5.8.2",
"com.googlecode.json-simple:json-simple:1.1.1"
)
testRuntimeOnly('org.junit.vintage:junit-vintage-engine:5.9.0')
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.9.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.00")
}

test {
useJUnit()

useJUnitPlatform {
includeEngines("junit-vintage")
}
dependsOn cleanTest
testLogging.showStandardStreams = true
testLogging {
lifecycle {
events "skipped", "failed", "standard_error", "standard_out"
exceptionFormat "short"
}
}
maxHeapSize = '1G'
}
2 changes: 1 addition & 1 deletion resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</change-notes>

<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="212.5080.55"/>
<idea-version since-build="222.3739.54"/>

<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
on how to target different products -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.intellij.ide.util.projectWizard.WizardContext;
import com.intellij.platform.ProjectTemplate;
import com.intellij.platform.ProjectTemplatesFactory;
import com.jetbrains.php.config.generation.PhpEmptyTemplatesFactory;
import com.jetbrains.php.config.generation.PhpEmptyProjectGenerator;
import icons.PhpIcons;
import javax.swing.Icon;
import org.jetbrains.annotations.NotNull;
Expand All @@ -18,7 +18,7 @@ public class MagentoTemplatesFactory extends ProjectTemplatesFactory {

@NotNull
public String[] getGroups() {
return new String[]{PhpEmptyTemplatesFactory.PHP_PROJECT_TEMPLATE_GROUP};
return new String[]{PhpEmptyProjectGenerator.PHP_PROJECT_TEMPLATE_GROUP};
}

public Icon getGroupIcon(final String group) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function execute()
try {
$this->deleteByIdCommand->execute($entityId);
$this->messageManager->addSuccessMessage(__('You have successfully deleted Company entity'));
} catch (CouldNotDeleteException | NoSuchEntityException $exception) {
} catch (CouldNotDeleteException|NoSuchEntityException $exception) {
$this->messageManager->addErrorMessage($exception->getMessage());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function execute(SimpleModelTwo $simpleModelTwo, ?string $param2 = null):

/**
* TODO: need to describe this method.
*
* @return void
*/
public function fetch(): void;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ interface SimpleServiceInterface
* TODO: need to describe this method.
* @param int $param1
* @param string $param2
* @return void
*/
public function execute(int $param1, string $param2);
}
37 changes: 26 additions & 11 deletions tests/com/magento/idea/magento2plugin/BaseProjectTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,28 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
import com.magento.idea.magento2plugin.indexes.IndexManager;
import com.magento.idea.magento2plugin.project.Settings;
import com.magento.idea.magento2plugin.magento.packages.File;
import com.magento.idea.magento2plugin.project.Settings;

/**
* Configure test environment with Magento 2 project
* Configure test environment with Magento 2 project.
*/
abstract public class BaseProjectTestCase extends BasePlatformTestCase {
private static final String testDataProjectPath = "testData" + File.separator + "project";
private static final String testDataProjectDirectory = "magento2";
public abstract class BaseProjectTestCase extends BasePlatformTestCase {
private static final String testDataProjectPath = "testData" //NOPMD
+ File.separator
+ "project";

private static final String testDataProjectDirectory = "magento2"; //NOPMD

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
copyMagento2ToTestProject();
enablePluginAndReindex();
Expand All @@ -39,27 +44,37 @@ protected String getTestDataPath() {
}

protected void enablePluginAndReindex() {
Settings settings = Settings.getInstance(myFixture.getProject());
final Settings settings = Settings.getInstance(myFixture.getProject());
settings.magentoPath = "/src";
settings.pluginEnabled = true;
settings.mftfSupportEnabled = true;
IndexManager.manualReindex();
PlatformTestUtil.dispatchAllEventsInIdeEventQueue();
}

protected void disablePluginAndReindex() {
Settings settings = Settings.getInstance(myFixture.getProject());
final Settings settings = Settings.getInstance(myFixture.getProject());
settings.pluginEnabled = false;
IndexManager.manualReindex();
PlatformTestUtil.dispatchAllEventsInIdeEventQueue();
}

protected void disableMftfSupportAndReindex() {
Settings settings = Settings.getInstance(myFixture.getProject());
final Settings settings = Settings.getInstance(myFixture.getProject());
settings.mftfSupportEnabled = false;
IndexManager.manualReindex();
PlatformTestUtil.dispatchAllEventsInIdeEventQueue();
}

protected String prepareFixturePath(String fileName, String fixturesFolderPath) {
return fixturesFolderPath + getClass().getSimpleName().replace("Test", "") + File.separator + name() + File.separator + fileName;
protected String prepareFixturePath(
final String fileName,
final String fixturesFolderPath
) {
return fixturesFolderPath + getClass().getSimpleName().replace("Test", "")
+ File.separator
+ name()
+ File.separator
+ fileName;
}

private String name() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class BaseGeneratorTestCase extends BaseProjectTestCase {

@Override
@Before
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
myFixture.setTestDataPath(TEST_DATA_FOLDER_PATH);
// Reset changed default code style settings to the previous default settings.
Expand All @@ -32,7 +32,7 @@ protected void setUp() throws Exception {

@Override
@After
protected void tearDown() throws Exception {
public void tearDown() throws Exception {
super.tearDown();
LightPlatformTestCase.closeAndDeleteProject();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class DeleteEntityCommandGeneratorTest extends BaseGeneratorTestCase {
private static final String ACL = "Foo_Bar::book_management";

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
final EntityCreatorContext context = new EntityCreatorContext();
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class DeleteEntityGeneratorTest extends BaseGeneratorTestCase {
"/src/app/code/Foo/Bar/Controller/Adminhtml/" + ENTITY_NAME;

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
final EntityCreatorContext context = new EntityCreatorContext();
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.magento.idea.magento2plugin.actions.generation.data.UiComponentFormButtonData;
import com.magento.idea.magento2plugin.actions.generation.generator.util.NamespaceBuilder;
import com.magento.idea.magento2plugin.actions.generation.util.GenerationContextRegistry;
import org.junit.Before;

public class FormButtonBlockGeneratorTest extends BaseGeneratorTestCase {

Expand All @@ -25,7 +26,8 @@ public class FormButtonBlockGeneratorTest extends BaseGeneratorTestCase {
= "src/app/code/Foo/Bar/Block/Form/" + ENTITY_NAME;

@Override
protected void setUp() throws Exception {
@Before
public void setUp() throws Exception {
super.setUp();
final EntityCreatorContext context = new EntityCreatorContext();
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class FormGenericButtonBlockGeneratorTest extends BaseGeneratorTestCase {
= "src/app/code/Foo/Bar/Block/Form/" + ENTITY_NAME;

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
final EntityCreatorContext context = new EntityCreatorContext();
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class GridActionColumnFileGeneratorTest extends BaseGeneratorTestCase {
private static final String ENTITY_DTO_TYPE = "Foo\\Bar\\Model\\Data\\BookData";

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
final EntityCreatorContext context = new EntityCreatorContext();
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class ModuleResourceModelGeneratorTest extends BaseGeneratorTestCase {
private static final String ENTITY_DTO_TYPE = "Foo\\Bar\\Model\\Data\\EntityData";

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
final EntityCreatorContext context = new EntityCreatorContext();
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class UiComponentGridDataProviderGeneratorTest extends BaseGeneratorTestC
private static final String ACL = "Foo_Bar::book_management";

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
final EntityCreatorContext context = new EntityCreatorContext();
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class BaseCompletionTestCase extends BaseProjectTestCase {
= "testData" + File.separator + "completion" + File.separator;

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
myFixture.setTestDataPath(testDataFolderPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
import com.magento.idea.magento2plugin.inspections.BaseInspectionsTestCase;
import com.magento.idea.magento2plugin.magento.packages.File;

abstract public class InspectionGraphqlsFixtureTestCase extends BaseInspectionsTestCase {
public abstract class InspectionGraphqlsFixtureTestCase extends BaseInspectionsTestCase {

private static final String testDataFolderPath = "testData" + File.separator + "inspections" + File.separator;
private static final String fixturesFolderPath = "graphqls" + File.separator;
private static final String testDataFolderPath = "testData" //NOPMD
+ File.separator
+ "inspections"
+ File.separator;

private static final String fixturesFolderPath = "graphqls" //NOPMD
+ File.separator;

@Override
protected void setUp() throws Exception {
public void setUp() throws Exception {
super.setUp();
myFixture.setTestDataPath(testDataFolderPath);
}
Expand All @@ -24,7 +29,7 @@ protected boolean isWriteActionRequired() {
return false;
}

protected String getFixturePath(String fileName) {
protected String getFixturePath(final String fileName) {
return prepareFixturePath(fileName, fixturesFolderPath);
}
}
Loading