Skip to content

Commit ed2a70c

Browse files
authored
Merge pull request #1214 from bohdan-harniuk/1211-upgrade-intellij-plugin-to-1.5.2
1211: Changed configuration to update Intellij Plugin to the 1.5.2 ve…
2 parents 15b6613 + 223f4c6 commit ed2a70c

23 files changed

+111
-57
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
*.PDF diff=astextplain
1616
*.rtf diff=astextplain
1717
*.RTF diff=astextplain
18+
19+
*.ft text eol=lf

.github/workflows/gradle.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Grant execute permission for gradlew
3131
run: chmod +x gradlew
3232
- name: Run automated tests
33-
run: ./gradlew test -i --no-daemon
33+
run: ./gradlew test --no-daemon
3434

3535
build-windows:
3636
runs-on: windows-latest
@@ -54,7 +54,7 @@ jobs:
5454
- name: Grant execute permission for gradlew
5555
run: chmod +x gradlew
5656
- name: Run automated tests
57-
run: ./gradlew test -i --no-daemon
57+
run: ./gradlew test --no-daemon
5858

5959
build-macos:
6060
runs-on: macos-latest
@@ -78,7 +78,7 @@ jobs:
7878
- name: Grant execute permission for gradlew
7979
run: chmod +x gradlew
8080
- name: Run automated tests
81-
run: ./gradlew test -i --no-daemon
81+
run: ./gradlew test --no-daemon
8282

8383
static-tests:
8484
runs-on: ubuntu-latest
@@ -104,11 +104,11 @@ jobs:
104104
- id: file_changes
105105
uses: trilom/file-changes-action@v1.2.4
106106
- name: Run Code Style Check
107-
run: ./gradlew checkstyleCI -i --no-daemon
107+
run: ./gradlew checkstyleCI --no-daemon
108108
env:
109109
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}
110110
ACTIONS_STEP_DEBUG: true
111111
- name: Run PMD Quality Check
112-
run: ./gradlew pmdCI -i --no-daemon
112+
run: ./gradlew pmdCI --no-daemon
113113
env:
114114
MODIFIED_FILES: ${{ steps.file_changes.outputs.files}}

build.gradle

+23-9
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
*/
55

66
plugins {
7-
id 'org.jetbrains.intellij' version '1.1.4'
7+
id 'org.jetbrains.intellij' version '1.11.0'
88
id 'checkstyle'
99
id 'pmd'
10-
id 'org.jetbrains.changelog' version '1.2.1'
10+
id 'org.jetbrains.changelog' version '2.0.0'
1111
}
1212

1313
repositories {
@@ -23,8 +23,8 @@ apply plugin: 'idea'
2323
apply plugin: 'groovy'
2424
apply plugin: 'org.jetbrains.changelog'
2525

26-
def phpPluginVersion = System.getProperty("phpPluginVersion", "212.5080.55")
27-
def ideaVersion = System.getProperty("ideaVersion", "2021.2.1")
26+
def phpPluginVersion = System.getProperty("phpPluginVersion", "222.3739.45")
27+
def ideaVersion = System.getProperty("ideaVersion", "2022.2.1")
2828
def javaVersion = 11
2929

3030
sourceCompatibility = javaVersion
@@ -41,7 +41,7 @@ intellij {
4141
'properties',
4242
'CSS',
4343
'JavaScriptLanguage',
44-
'com.intellij.lang.jsgraphql:3.1.2',
44+
'com.intellij.lang.jsgraphql:3.2.1',
4545
'platform-images',
4646
'copyright'
4747
]
@@ -105,12 +105,26 @@ idea {
105105
}
106106

107107
dependencies {
108-
testImplementation 'junit:junit:4.13'
109-
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
108+
implementation(
109+
"org.junit.jupiter:junit-jupiter:5.8.2",
110+
"com.googlecode.json-simple:json-simple:1.1.1"
111+
)
112+
testRuntimeOnly('org.junit.vintage:junit-vintage-engine:5.9.0')
113+
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.9.0")
114+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.00")
110115
}
111116

112117
test {
113-
useJUnit()
114-
118+
useJUnitPlatform {
119+
includeEngines("junit-vintage")
120+
}
121+
dependsOn cleanTest
122+
testLogging.showStandardStreams = true
123+
testLogging {
124+
lifecycle {
125+
events "skipped", "failed", "standard_error", "standard_out"
126+
exceptionFormat "short"
127+
}
128+
}
115129
maxHeapSize = '1G'
116130
}

resources/META-INF/plugin.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</change-notes>
2525

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

2929
<!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
3030
on how to target different products -->

src/com/magento/idea/magento2plugin/generation/php/MagentoTemplatesFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import com.intellij.ide.util.projectWizard.WizardContext;
99
import com.intellij.platform.ProjectTemplate;
1010
import com.intellij.platform.ProjectTemplatesFactory;
11-
import com.jetbrains.php.config.generation.PhpEmptyTemplatesFactory;
11+
import com.jetbrains.php.config.generation.PhpEmptyProjectGenerator;
1212
import icons.PhpIcons;
1313
import javax.swing.Icon;
1414
import org.jetbrains.annotations.NotNull;
@@ -18,7 +18,7 @@ public class MagentoTemplatesFactory extends ProjectTemplatesFactory {
1818

1919
@NotNull
2020
public String[] getGroups() {
21-
return new String[]{PhpEmptyTemplatesFactory.PHP_PROJECT_TEMPLATE_GROUP};
21+
return new String[]{PhpEmptyProjectGenerator.PHP_PROJECT_TEMPLATE_GROUP};
2222
}
2323

2424
public Icon getGroupIcon(final String group) {

testData/actions/generation/generator/DeleteEntityGenerator/generateDeleteEntityFile/Delete.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function execute()
5858
try {
5959
$this->deleteByIdCommand->execute($entityId);
6060
$this->messageManager->addSuccessMessage(__('You have successfully deleted Company entity'));
61-
} catch (CouldNotDeleteException | NoSuchEntityException $exception) {
61+
} catch (CouldNotDeleteException|NoSuchEntityException $exception) {
6262
$this->messageManager->addErrorMessage($exception->getMessage());
6363
}
6464

testData/actions/generation/generator/WebApiInterfaceGenerator/withObjectTypesAndPhpDocComments/SimpleServiceTwoInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function execute(SimpleModelTwo $simpleModelTwo, ?string $param2 = null):
2222

2323
/**
2424
* TODO: need to describe this method.
25-
*
25+
* @return void
2626
*/
2727
public function fetch(): void;
2828
}

testData/actions/generation/generator/WebApiInterfaceGenerator/withPrimitiveTypes/SimpleServiceInterface.php

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ interface SimpleServiceInterface
1313
* TODO: need to describe this method.
1414
* @param int $param1
1515
* @param string $param2
16+
* @return void
1617
*/
1718
public function execute(int $param1, string $param2);
1819
}

tests/com/magento/idea/magento2plugin/BaseProjectTestCase.java

+26-11
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22
* Copyright © Magento, Inc. All rights reserved.
33
* See COPYING.txt for license details.
44
*/
5+
56
package com.magento.idea.magento2plugin;
67

78
import com.intellij.openapi.util.text.StringUtil;
9+
import com.intellij.testFramework.PlatformTestUtil;
810
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
911
import com.magento.idea.magento2plugin.indexes.IndexManager;
10-
import com.magento.idea.magento2plugin.project.Settings;
1112
import com.magento.idea.magento2plugin.magento.packages.File;
13+
import com.magento.idea.magento2plugin.project.Settings;
1214

1315
/**
14-
* Configure test environment with Magento 2 project
16+
* Configure test environment with Magento 2 project.
1517
*/
16-
abstract public class BaseProjectTestCase extends BasePlatformTestCase {
17-
private static final String testDataProjectPath = "testData" + File.separator + "project";
18-
private static final String testDataProjectDirectory = "magento2";
18+
public abstract class BaseProjectTestCase extends BasePlatformTestCase {
19+
private static final String testDataProjectPath = "testData" //NOPMD
20+
+ File.separator
21+
+ "project";
22+
23+
private static final String testDataProjectDirectory = "magento2"; //NOPMD
1924

2025
@Override
21-
protected void setUp() throws Exception {
26+
public void setUp() throws Exception {
2227
super.setUp();
2328
copyMagento2ToTestProject();
2429
enablePluginAndReindex();
@@ -39,27 +44,37 @@ protected String getTestDataPath() {
3944
}
4045

4146
protected void enablePluginAndReindex() {
42-
Settings settings = Settings.getInstance(myFixture.getProject());
47+
final Settings settings = Settings.getInstance(myFixture.getProject());
4348
settings.magentoPath = "/src";
4449
settings.pluginEnabled = true;
4550
settings.mftfSupportEnabled = true;
4651
IndexManager.manualReindex();
52+
PlatformTestUtil.dispatchAllEventsInIdeEventQueue();
4753
}
4854

4955
protected void disablePluginAndReindex() {
50-
Settings settings = Settings.getInstance(myFixture.getProject());
56+
final Settings settings = Settings.getInstance(myFixture.getProject());
5157
settings.pluginEnabled = false;
5258
IndexManager.manualReindex();
59+
PlatformTestUtil.dispatchAllEventsInIdeEventQueue();
5360
}
5461

5562
protected void disableMftfSupportAndReindex() {
56-
Settings settings = Settings.getInstance(myFixture.getProject());
63+
final Settings settings = Settings.getInstance(myFixture.getProject());
5764
settings.mftfSupportEnabled = false;
5865
IndexManager.manualReindex();
66+
PlatformTestUtil.dispatchAllEventsInIdeEventQueue();
5967
}
6068

61-
protected String prepareFixturePath(String fileName, String fixturesFolderPath) {
62-
return fixturesFolderPath + getClass().getSimpleName().replace("Test", "") + File.separator + name() + File.separator + fileName;
69+
protected String prepareFixturePath(
70+
final String fileName,
71+
final String fixturesFolderPath
72+
) {
73+
return fixturesFolderPath + getClass().getSimpleName().replace("Test", "")
74+
+ File.separator
75+
+ name()
76+
+ File.separator
77+
+ fileName;
6378
}
6479

6580
private String name() {

tests/com/magento/idea/magento2plugin/actions/generation/generator/BaseGeneratorTestCase.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public abstract class BaseGeneratorTestCase extends BaseProjectTestCase {
2323

2424
@Override
2525
@Before
26-
protected void setUp() throws Exception {
26+
public void setUp() throws Exception {
2727
super.setUp();
2828
myFixture.setTestDataPath(TEST_DATA_FOLDER_PATH);
2929
// Reset changed default code style settings to the previous default settings.
@@ -32,7 +32,7 @@ protected void setUp() throws Exception {
3232

3333
@Override
3434
@After
35-
protected void tearDown() throws Exception {
35+
public void tearDown() throws Exception {
3636
super.tearDown();
3737
LightPlatformTestCase.closeAndDeleteProject();
3838
}

tests/com/magento/idea/magento2plugin/actions/generation/generator/DeleteEntityCommandGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class DeleteEntityCommandGeneratorTest extends BaseGeneratorTestCase {
2323
private static final String ACL = "Foo_Bar::book_management";
2424

2525
@Override
26-
protected void setUp() throws Exception {
26+
public void setUp() throws Exception {
2727
super.setUp();
2828
final EntityCreatorContext context = new EntityCreatorContext();
2929
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);

tests/com/magento/idea/magento2plugin/actions/generation/generator/DeleteEntityGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class DeleteEntityGeneratorTest extends BaseGeneratorTestCase {
2222
"/src/app/code/Foo/Bar/Controller/Adminhtml/" + ENTITY_NAME;
2323

2424
@Override
25-
protected void setUp() throws Exception {
25+
public void setUp() throws Exception {
2626
super.setUp();
2727
final EntityCreatorContext context = new EntityCreatorContext();
2828
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);

tests/com/magento/idea/magento2plugin/actions/generation/generator/FormButtonBlockGeneratorTest.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.magento.idea.magento2plugin.actions.generation.data.UiComponentFormButtonData;
1212
import com.magento.idea.magento2plugin.actions.generation.generator.util.NamespaceBuilder;
1313
import com.magento.idea.magento2plugin.actions.generation.util.GenerationContextRegistry;
14+
import org.junit.Before;
1415

1516
public class FormButtonBlockGeneratorTest extends BaseGeneratorTestCase {
1617

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

2728
@Override
28-
protected void setUp() throws Exception {
29+
@Before
30+
public void setUp() throws Exception {
2931
super.setUp();
3032
final EntityCreatorContext context = new EntityCreatorContext();
3133
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);

tests/com/magento/idea/magento2plugin/actions/generation/generator/FormGenericButtonBlockGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class FormGenericButtonBlockGeneratorTest extends BaseGeneratorTestCase {
2020
= "src/app/code/Foo/Bar/Block/Form/" + ENTITY_NAME;
2121

2222
@Override
23-
protected void setUp() throws Exception {
23+
public void setUp() throws Exception {
2424
super.setUp();
2525
final EntityCreatorContext context = new EntityCreatorContext();
2626
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);

tests/com/magento/idea/magento2plugin/actions/generation/generator/GridActionColumnFileGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class GridActionColumnFileGeneratorTest extends BaseGeneratorTestCase {
2020
private static final String ENTITY_DTO_TYPE = "Foo\\Bar\\Model\\Data\\BookData";
2121

2222
@Override
23-
protected void setUp() throws Exception {
23+
public void setUp() throws Exception {
2424
super.setUp();
2525
final EntityCreatorContext context = new EntityCreatorContext();
2626
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);

tests/com/magento/idea/magento2plugin/actions/generation/generator/ModuleResourceModelGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class ModuleResourceModelGeneratorTest extends BaseGeneratorTestCase {
1818
private static final String ENTITY_DTO_TYPE = "Foo\\Bar\\Model\\Data\\EntityData";
1919

2020
@Override
21-
protected void setUp() throws Exception {
21+
public void setUp() throws Exception {
2222
super.setUp();
2323
final EntityCreatorContext context = new EntityCreatorContext();
2424
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);

tests/com/magento/idea/magento2plugin/actions/generation/generator/UiComponentGridDataProviderGeneratorTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class UiComponentGridDataProviderGeneratorTest extends BaseGeneratorTestC
2626
private static final String ACL = "Foo_Bar::book_management";
2727

2828
@Override
29-
protected void setUp() throws Exception {
29+
public void setUp() throws Exception {
3030
super.setUp();
3131
final EntityCreatorContext context = new EntityCreatorContext();
3232
context.putUserData(EntityCreatorContext.DTO_TYPE, ENTITY_DTO_TYPE);

tests/com/magento/idea/magento2plugin/completion/BaseCompletionTestCase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public abstract class BaseCompletionTestCase extends BaseProjectTestCase {
1616
= "testData" + File.separator + "completion" + File.separator;
1717

1818
@Override
19-
protected void setUp() throws Exception {
19+
public void setUp() throws Exception {
2020
super.setUp();
2121
myFixture.setTestDataPath(testDataFolderPath);
2222
}

tests/com/magento/idea/magento2plugin/inspections/graphqls/InspectionGraphqlsFixtureTestCase.java

+10-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@
88
import com.magento.idea.magento2plugin.inspections.BaseInspectionsTestCase;
99
import com.magento.idea.magento2plugin.magento.packages.File;
1010

11-
abstract public class InspectionGraphqlsFixtureTestCase extends BaseInspectionsTestCase {
11+
public abstract class InspectionGraphqlsFixtureTestCase extends BaseInspectionsTestCase {
1212

13-
private static final String testDataFolderPath = "testData" + File.separator + "inspections" + File.separator;
14-
private static final String fixturesFolderPath = "graphqls" + File.separator;
13+
private static final String testDataFolderPath = "testData" //NOPMD
14+
+ File.separator
15+
+ "inspections"
16+
+ File.separator;
17+
18+
private static final String fixturesFolderPath = "graphqls" //NOPMD
19+
+ File.separator;
1520

1621
@Override
17-
protected void setUp() throws Exception {
22+
public void setUp() throws Exception {
1823
super.setUp();
1924
myFixture.setTestDataPath(testDataFolderPath);
2025
}
@@ -24,7 +29,7 @@ protected boolean isWriteActionRequired() {
2429
return false;
2530
}
2631

27-
protected String getFixturePath(String fileName) {
32+
protected String getFixturePath(final String fileName) {
2833
return prepareFixturePath(fileName, fixturesFolderPath);
2934
}
3035
}

0 commit comments

Comments
 (0)