Skip to content

Commit 4a12c27

Browse files
committed
update to 1.1,
support for not generating Model interfaces and corresponding implementation classes from 1.1 onwards is more flexible.
1 parent 7e7b18e commit 4a12c27

File tree

15 files changed

+397
-276
lines changed

15 files changed

+397
-276
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Change Log
22

33

4+
## [v1.1](https://plugins.jetbrains.com/plugin/10907-mvpautocodeplus)(2018-9-11)
5+
6+
- Support for not generating Model interfaces and corresponding implementation classes , is more flexible.
7+
48
## [v1.0-183](https://plugins.jetbrains.com/plugin/10907-mvpautocodeplus)(2018-8-14)
59

610
- 添加IDEA 2018.2 和 AndroidStudio 3.3的支持.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ MvpAutoCodePlus
3232
- **使用 IDE 内置插件系统安装:**
3333
- <kbd>File</kbd> > <kbd>Preferences(Settings)</kbd> > <kbd>Plugins</kbd> > <kbd>Browse repositories...</kbd> > <kbd>搜索并找到"MvpAutoCodePlus"</kbd> > <kbd>Install Plugin</kbd>
3434

35-
3635
![install](./images/install1.png)
3736

3837
- **手动安装:**
38+
3939
- 下载[`最新发布的插件包`][latest-release] > <kbd>File</kbd> ><kbd>Preferences(Settings)</kbd> > <kbd>Plugins</kbd> > <kbd>Install plugin from disk...</kbd>
4040

4141
重启**IDE**.
@@ -75,6 +75,8 @@ MvpAutoCodePlus
7575

7676
- 选择View的实现方式,Activity或Fragment,如果配置了多个的话,可选择其中之一,不想生成的项去掉前面的复选框.如果没有输入P和M实现类的超类,那么生成的P和M的实现类只会实现对应的接口.
7777

78+
- 从1.1开始支持不生成Model接口和对应的实现类,更加灵活.
79+
7880
- 点击Ok,稍等一会儿,代码就生成了,生成的包结构如下:
7981

8082
![use2](./images/use2.png)

README_EN.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,10 @@ JetBrains IDEA/Android Studio MVP template code generation plug-in
6363
![use1](./images/use1.png)
6464

6565
- right click the target package to be generated,<kbd>New</kbd> > <kbd>Generate Mvp Code</kbd> (or select the package, press Alt+Insert). After generating the contract package, you can select the parent package of the contract package or contract.
66-
6766
- enter the code generated by the name, such as do the Login function, enter the Login and generate results is ILoginContract, LoginActivity, LoginPresenter, LoginModel
68-
6967
- choose the code implementation, Java or Kotlin
70-
7168
- select the implementation method of View,Activity or Fragment. If there are multiple configurations, select one of them, and remove the previous check box for the items you don't want to generate. If there are no superclasses of P and M implementation classes, the generated implementation classes of P and M will only implement the corresponding interface.
72-
69+
- Support for not generating Model interfaces and corresponding implementation classes from 1.1 onwards is more flexible.
7370
- click Ok, wait a moment, and the code is generated. The generated package structure is as follows:
7471

7572
![use2](./images/use2.png)

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
buildscript {
2-
ext.kotlin_version = '1.2.60'
2+
ext.kotlin_version = '1.2.61'
33

44
repositories {
5-
// maven { url "http://192.168.2.105:8908/repository/maven-public/" }
65
mavenCentral()
76
}
87
dependencies {
@@ -14,7 +13,7 @@ plugins {
1413
id 'org.jetbrains.intellij' version '0.3.4'
1514
}
1615

17-
version '1.0-183'
16+
version '1.1-182'
1817
group 'com.longforus'
1918

2019

@@ -32,7 +31,6 @@ sourceCompatibility = 1.8
3231
//}
3332

3433
repositories {
35-
// maven { url "http://192.168.2.105:8908/repository/maven-public/" }
3634
mavenCentral()
3735
}
3836

@@ -48,13 +46,15 @@ compileKotlin {
4846
compileTestKotlin {
4947
kotlinOptions.jvmTarget = "1.8"
5048
}
49+
50+
5151
intellij {
5252
version '2018.2'
53-
plugins 'org.jetbrains.kotlin:1.2.60-release-IJ2018.2-1' //here
53+
plugins 'org.jetbrains.kotlin:1.2.61-release-IJ2018.2-1' //here
5454
// version '2018.1'
55-
// plugins 'org.jetbrains.kotlin:1.2.51-release-IJ2018.1-1' //here
55+
// plugins 'org.jetbrains.kotlin:1.2.61-release-IJ2018.1-1' //here
5656
// version '2017.3'
57-
// plugins 'org.jetbrains.kotlin:1.2.50-release-IJ2017.3-1' //here
57+
// plugins 'org.jetbrains.kotlin:1.2.61-release-IJ2017.3-1' //here
5858
}
5959

6060
publishPlugin {

src/main/java/com/longforus/mvpautocodeplus/ui/ConfigForm.java

Lines changed: 172 additions & 157 deletions
Large diffs are not rendered by default.

src/main/java/com/longforus/mvpautocodeplus/ui/EnterKeywordDialog.form

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.longforus.mvpautocodeplus.ui.EnterKeywordDialog">
3-
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
3+
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="6" 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>
66
<xy x="48" y="54" width="586" height="396"/>
@@ -13,7 +13,7 @@
1313
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
1414
<margin top="0" left="0" bottom="0" right="0"/>
1515
<constraints>
16-
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
16+
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
1717
</constraints>
1818
<properties/>
1919
<border type="none"/>
@@ -54,7 +54,7 @@
5454
<grid id="e3588" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
5555
<margin top="0" left="0" bottom="0" right="0"/>
5656
<constraints>
57-
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
57+
<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"/>
5858
</constraints>
5959
<properties/>
6060
<border type="none"/>
@@ -82,7 +82,7 @@
8282
<grid id="682eb" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
8383
<margin top="0" left="0" bottom="0" right="0"/>
8484
<constraints>
85-
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
85+
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
8686
</constraints>
8787
<properties/>
8888
<border type="none" title="Implement code type:"/>
@@ -108,7 +108,7 @@
108108
</grid>
109109
<grid id="923c2" layout-manager="GridBagLayout">
110110
<constraints>
111-
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
111+
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
112112
</constraints>
113113
<properties/>
114114
<border type="none" title="Generate implement item:"/>
@@ -202,15 +202,15 @@
202202
</grid>
203203
<vspacer id="9b321">
204204
<constraints>
205-
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false">
205+
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false">
206206
<minimum-size width="-1" height="50"/>
207207
</grid>
208208
</constraints>
209209
</vspacer>
210210
<grid id="46bff" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
211211
<margin top="0" left="0" bottom="0" right="0"/>
212212
<constraints>
213-
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
213+
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
214214
</constraints>
215215
<properties>
216216
<toolTipText value="View implement type:"/>
@@ -236,6 +236,15 @@
236236
</component>
237237
</children>
238238
</grid>
239+
<component id="e6ef1" class="javax.swing.JCheckBox" binding="mcbModel">
240+
<constraints>
241+
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
242+
</constraints>
243+
<properties>
244+
<selected value="true"/>
245+
<text value="Generate IModel"/>
246+
</properties>
247+
</component>
239248
</children>
240249
</grid>
241250
<buttonGroups>

0 commit comments

Comments
 (0)