Skip to content

Commit 058a562

Browse files
author
Vitaliy Boyko
committed
Merge branch '1.0.0-develop' of https://github.com/magento/magento2-phpstorm-plugin into 58-block-generation
� Conflicts: � src/com/magento/idea/magento2plugin/magento/packages/Package.java
2 parents 5a49f00 + 0c3ff4f commit 058a562

File tree

26 files changed

+528
-136
lines changed

26 files changed

+528
-136
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.

resources/fileTemplates/internal/Magento Module Composer.json.ft

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
},
1010
#end
1111
#if (${LICENSE})
12-
${LICENSE},
12+
"license":
13+
${LICENSE}
14+
,
1315
#end
1416
"autoload": {
1517
"files": [

src/com/magento/idea/magento2plugin/actions/generation/data/ModuleComposerJsonData.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package com.magento.idea.magento2plugin.actions.generation.data;
66

77
import com.intellij.psi.PsiDirectory;
8+
import java.util.List;
89

910
public class ModuleComposerJsonData {
1011
private final String packageName;
@@ -13,21 +14,24 @@ public class ModuleComposerJsonData {
1314
private final String moduleDescription;
1415
private final String composerPackageName;
1516
private final String moduleVersion;
17+
private final List moduleLicense;
1618

1719
public ModuleComposerJsonData(
1820
String packageName,
1921
String moduleName,
2022
PsiDirectory baseDir,
2123
String moduleDescription,
2224
String composerPackageName,
23-
String moduleVersion
25+
String moduleVersion,
26+
List moduleLicense
2427
) {
2528
this.packageName = packageName;
2629
this.moduleName = moduleName;
2730
this.baseDir = baseDir;
2831
this.moduleDescription = moduleDescription;
2932
this.composerPackageName = composerPackageName;
3033
this.moduleVersion = moduleVersion;
34+
this.moduleLicense = moduleLicense;
3135
}
3236

3337
public String getPackageName() {
@@ -53,4 +57,8 @@ public String getComposerPackageName() {
5357
public String getModuleVersion() {
5458
return this.moduleVersion;
5559
}
60+
61+
public List getModuleLicense() {
62+
return this.moduleLicense;
63+
}
5664
}

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewMagentoModuleDialog.form

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
44
<margin top="10" left="10" bottom="10" right="10"/>
55
<constraints>
6-
<xy x="48" y="54" width="462" height="297"/>
6+
<xy x="48" y="54" width="462" height="431"/>
77
</constraints>
8-
<properties/>
8+
<properties>
9+
<preferredSize width="350" height="391"/>
10+
</properties>
911
<border type="none"/>
1012
<children>
1113
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
@@ -49,7 +51,7 @@
4951
</grid>
5052
</children>
5153
</grid>
52-
<grid id="e3588" layout-manager="GridLayoutManager" row-count="3" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
54+
<grid id="e3588" layout-manager="GridLayoutManager" row-count="5" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
5355
<margin top="0" left="0" bottom="0" right="0"/>
5456
<constraints>
5557
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -59,7 +61,7 @@
5961
<children>
6062
<component id="ad3ba" class="javax.swing.JTextField" binding="packageName" default-binding="true">
6163
<constraints>
62-
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
64+
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
6365
<preferred-size width="150" height="-1"/>
6466
</grid>
6567
</constraints>
@@ -78,7 +80,7 @@
7880
</component>
7981
<component id="e4858" class="javax.swing.JTextField" binding="moduleName">
8082
<constraints>
81-
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
83+
<grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
8284
<preferred-size width="150" height="-1"/>
8385
</grid>
8486
</constraints>
@@ -97,7 +99,7 @@
9799
</component>
98100
<component id="423dc" class="javax.swing.JTextField" binding="moduleVersion">
99101
<constraints>
100-
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
102+
<grid row="2" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
101103
<preferred-size width="150" height="-1"/>
102104
</grid>
103105
</constraints>
@@ -116,6 +118,47 @@
116118
<text value="Module Version"/>
117119
</properties>
118120
</component>
121+
<component id="c5925" class="javax.swing.JLabel" binding="moduleLicenseLabel">
122+
<constraints>
123+
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
124+
</constraints>
125+
<properties>
126+
<text value="License(s)"/>
127+
</properties>
128+
</component>
129+
<component id="26905" class="javax.swing.JTextField" binding="moduleLicenseCustom">
130+
<constraints>
131+
<grid row="4" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="8" fill="1" indent="0" use-parent-layout="false">
132+
<preferred-size width="150" height="-1"/>
133+
</grid>
134+
</constraints>
135+
<properties>
136+
<editable value="true"/>
137+
<enabled value="true"/>
138+
<toolTipText value="Module's Custom License"/>
139+
</properties>
140+
</component>
141+
<scrollpane id="a545e" binding="moduleLicenseScrollPanel">
142+
<constraints>
143+
<grid row="3" column="1" row-span="1" col-span="2" vsize-policy="6" hsize-policy="6" anchor="0" fill="3" indent="0" use-parent-layout="false">
144+
<preferred-size width="150" height="100"/>
145+
<maximum-size width="-1" height="100"/>
146+
</grid>
147+
</constraints>
148+
<properties>
149+
<enabled value="false"/>
150+
</properties>
151+
<border type="none"/>
152+
<children>
153+
<component id="8bae" class="javax.swing.JList" binding="moduleLicense">
154+
<constraints/>
155+
<properties>
156+
<model/>
157+
<toolTipText value="Module's Lincese"/>
158+
</properties>
159+
</component>
160+
</children>
161+
</scrollpane>
119162
</children>
120163
</grid>
121164
<component id="4c5ac" class="javax.swing.JTextArea" binding="moduleDescription">

0 commit comments

Comments
 (0)