Skip to content

Commit 62fa18c

Browse files
author
Vitaliy
authored
Merge branch '1.0.0-develop' into new-module-creation-add-license
2 parents 2a0f4d4 + 9dfde00 commit 62fa18c

File tree

12 files changed

+185
-99
lines changed

12 files changed

+185
-99
lines changed

.github/workflows/gradle.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Run automated tests
5+
6+
on:
7+
pull_request:
8+
branches: [ master, 1.0.0-develop ]
9+
10+
jobs:
11+
build-linux:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up JDK 1.8
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 1.8
21+
- name: Gradle wrapper
22+
run: gradle wrapper
23+
- name: Grant execute permission for gradlew
24+
run: chmod +x gradlew
25+
- name: Run automated tests
26+
run: ./gradlew test -i
27+
28+
build-windows:
29+
30+
runs-on: windows-latest
31+
32+
steps:
33+
- uses: actions/checkout@v2
34+
- name: Set up JDK 1.8
35+
uses: actions/setup-java@v1
36+
with:
37+
java-version: 1.8
38+
- name: Gradle wrapper
39+
run: gradle wrapper
40+
- name: Grant execute permission for gradlew
41+
run: chmod +x gradlew
42+
- name: Run automated tests
43+
run: ./gradlew test -i
44+
45+
build-macos:
46+
47+
runs-on: macos-latest
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Set up JDK 1.8
52+
uses: actions/setup-java@v1
53+
with:
54+
java-version: 1.8
55+
- name: Gradle wrapper
56+
run: gradle wrapper
57+
- name: Grant execute permission for gradlew
58+
run: chmod +x gradlew
59+
- name: Run automated tests
60+
run: ./gradlew test -i

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ out
5050
.idea-sandbox
5151
build
5252
gradle
53+
gradlew
54+
gradlew.bat

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
This is a plugin for Magento 2 development in the PhpStorm IDE. It is available via the [JetBrains Plugin Repository](https://plugins.jetbrains.com/plugin/8024)
88
## Installation
99

10-
1. Go to Settings / Preferences in the PhpStorm IDE
11-
2. Navigate to "Plugins"
12-
3. Click the "Browse repositories..." button and search for "Magento PhpStorm"
10+
1. Go to `Settings > Preferences` in the PhpStorm IDE
11+
2. Navigate to `Plugins`
12+
3. Click the `Browse repositories...` button and search for "Magento PhpStorm"
1313
4. Install the plugin and restart PhpStorm
14-
5. Go to Settings / Preferences / Languages & Frameworks / PHP / Magento in the PhpStorm IDE
15-
6. Check "Enable" and "OK" button.
14+
5. Go to `Settings > Preferences > Languages & Frameworks > PHP > Magento` in the PhpStorm IDE
15+
6. Check `Enable` and `OK` button.
1616

1717
## Works with
1818
* PhpStorm >= 2019.3.3
@@ -21,20 +21,38 @@ This is a plugin for Magento 2 development in the PhpStorm IDE. It is available
2121
## Features
2222

2323
* Configuration smart completion and references for XML/JavaScript files
24-
* "Navigate to configuration" reference in scope of class/interface
25-
* "Go to plugin" reference in scope of class/interface and method
26-
* "Navigate to Web API configuration" reference in scope of class/interface and method
24+
* `Navigate to configuration` reference in scope of class/interface
25+
* `Go to plugin` reference in scope of class/interface and method
26+
* `Navigate to Web API configuration` reference in scope of class/interface and method
2727
* Plugin class methods generation
2828
* Plugin declaration inspection
29-
* RequireJs reference navigation and completion
29+
* RequireJS reference navigation and completion
3030
* MFTF reference navigation and completion
3131
* GraphQL navigation line markers
3232
* Code generation
3333
* Inspections for XML configuration
3434

35+
## Setting up development environment
36+
37+
1. Check out this repository
38+
1. Open a folder with the project in the IntelliJ Ultimate using the `open` action button.
39+
1. Make sure that you on the latest develop branch (e.g `1.0.0-develop`)
40+
1. Right-click on the `build.gradle` file, choose "Import Gradle project"
41+
1. When the Gradle sections appeared in the right bar, navigate there and right-click `magento-2-php-storm-plguin > Tasks -> Intellij -> runIde`
42+
1. Click `Run "magento-2-php-storm-plugin"` to run the plugin. You should see a new instance of IntelliJ launched with the plugin installed. Make sure the plugin is enabled in IntelliJ settings and indexing is finished. Plugin features should be accessible at this point.
43+
44+
## How to contribute
45+
1) Start with looking into [Community Backlog](https://github.com/magento/magento2-phpstorm-plugin/projects/2). Any ticket in `Ready for Development` and `Good First Issue` columns are a good candidates to start.
46+
2) Didn't satisfy your requirements? [Create a new issue](https://github.com/magento/magento2-phpstorm-plugin/issues/new). It can be for example:
47+
- **Bug report** - Found a bug in the code? Let us know!
48+
- **Enhancement** - Know how to improve existing functionality? Open an issue describe how to enhance the plugin.
49+
- **New feature proposal** - Know how to make a killer feature? Do not hesitate to submit your proposal.
50+
3) The issue will appear in the `Ready for Grooming` column of the [Community Backlog](https://github.com/magento/magento2-phpstorm-plugin/projects/2). Once it will be discussed and approved the issue will be ready for development.
51+
52+
### <img src="https://upload.wikimedia.org/wikipedia/commons/7/76/Slack_Icon.png" width="20"> Join [#phpstorm-plugin](https://magentocommeng.slack.com/archives/C010C2LUCEA) Slack channel for more details.
53+
54+
3555
## License
3656
Each Magento source file included in this distribution is licensed under OSL-3.0 license.
3757

3858
Please see [LICENSE.txt](https://github.com/magento/magento2-phpstorm-plugin/blob/master/LICENSE.txt) for the full text of the [Open Software License v. 3.0 (OSL-3.0)](http://opensource.org/licenses/osl-3.0.php).
39-
40-
### <img src="https://upload.wikimedia.org/wikipedia/commons/7/76/Slack_Icon.png" width="20"> Join [#phpstorm-plugin](https://magentocommeng.slack.com/archives/C010C2LUCEA) channel for more details.

build.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ intellij {
3333
}
3434

3535
sourceSets {
36-
main.java.srcDirs = ['src']
37-
main.resources.srcDirs = ['resources']
36+
main {
37+
java.srcDirs 'src'
38+
resources.srcDir 'resources'
39+
}
40+
test {
41+
java.srcDir 'tests'
42+
resources.srcDir 'testData'
43+
}
3844
}

gradlew

Whitespace-only changes.

gradlew.bat

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/com/magento/idea/magento2plugin/inspections/xml/CacheableFalseInDefaultLayoutInspection.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,21 @@
1515
import org.jetbrains.annotations.NotNull;
1616

1717
public class CacheableFalseInDefaultLayoutInspection extends XmlSuppressableInspectionTool {
18+
public static final String CacheDisableProblemDescription = "Cacheable false attribute on the default layout will disable cache site-wide";
19+
1820
@NotNull
1921
@Override
2022
public PsiElementVisitor buildVisitor(final @NotNull ProblemsHolder holder, final boolean isOnTheFly) {
2123
return new XmlElementVisitor() {
22-
private static final String CacheDisableProblemDescription = "Cacheable false attribute on the default layout will disable cache site-wide";
2324
@Override
2425
public void visitXmlAttribute(XmlAttribute attribute) {
2526
String fileName = holder.getFile().getName();
2627
if (!fileName.equals(LayoutXml.DefaultFileName)) return;
2728
final String text = attribute.getValue();
2829
final String attributeName = attribute.getName();
2930
if (!attributeName.equals(LayoutXml.CacheableAttributeName)) return;
30-
if (!attribute.getParent().getName().equals(LayoutXml.BlockAttributeTagName)) return;
31+
if (!attribute.getParent().getName().equals(LayoutXml.BlockAttributeTagName)
32+
&& !attribute.getParent().getName().equals(LayoutXml.ReferenceBlockAttributeTagName)) return;
3133
if (text == null) return;
3234
if (text.equals(LayoutXml.CacheableAttributeFalseValue)) {
3335
holder.registerProblem(attribute, CacheDisableProblemDescription,

src/com/magento/idea/magento2plugin/magento/files/LayoutXml.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ public class LayoutXml {
99
public static String CacheableAttributeName = "cacheable";
1010
public static String CacheableAttributeFalseValue = "false";
1111
public static String BlockAttributeTagName = "block";
12+
public static String ReferenceBlockAttributeTagName = "referenceBlock";
1213
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/*
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page>
9+
<body>
10+
<referenceBlock name="footer_links" <warning descr="Cacheable false attribute on the default layout will disable cache site-wide">cacheable="false"</warning>/>
11+
</body>
12+
</page>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/*
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page>
9+
<body>
10+
<referenceBlock name="footer_links" cacheable="false" />
11+
</body>
12+
</page>

0 commit comments

Comments
 (0)