Skip to content

Commit 99c5cc7

Browse files
author
dengzi
committed
update readme, add screenshot, add file template
1 parent 1a4078c commit 99c5cc7

8 files changed

Lines changed: 64 additions & 17 deletions

File tree

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
1-
# AucFrameGenerator
2-
一个 AS 插件用于快速创建 AucFrame 结构的目录
1+
# Generate Module From Template
2+
3+
<b>Create a directory structure from a highly customizable template</b><br>
4+
<br>
5+
Using this plugin, help you create directories and files from customizable template<br>
6+
<br>
7+
<b>Feature</b><br>
8+
1. custom directory structure<br>
9+
2. support placeholders, and replace it when you create module.<br>
10+
3. create file from template<br>
11+
4. support file template variables<br>
12+
13+
<b>Usage</b><br>
14+
1. Configure template in plugin settings: <b>File > Settings > Tools > Module Template Settings</b><br>
15+
2. Create directories from the 'Structure' tab, click the right mouse button to operate the file tree.<br>
16+
3. FileTree can use placeholders, the placeholder should like this -> <b>${YOUR_PLACEHOLDER_HERE}</b>.<br>
17+
4. The 'File Template' tab lists which template the specified file uses, you can also use placeholders for FileName field.<br>
18+
5. The 'Placeholder' tab's table defines placeholders for replacing filenames and file templates<br>
19+
20+
<b>Screenshot</b><br>
21+
<br>

resources/META-INF/plugin.xml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
<idea-plugin>
22
<id>com.dengzii.plugin.template</id>
3-
<name>Template Module Generator</name>
3+
<name>Generate Module From Template</name>
44
<version>1.1</version>
55
<vendor email="dengzii@foxmail.com" url="https://github.com/dengzii">dengzi</vendor>
66

77
<description><![CDATA[
8-
<b>Create a diverse directory structure from a highly customizable template</b><br>
9-
<br>
10-
Using this plugin, help you create directories and files from customizable template<br>
11-
<br>
12-
<b>Feature</b><br>
13-
1. custom directory structure<br>
14-
2. support placeholders, and replace it when you create module.<br>
15-
3. create file from template<br>
16-
4. support file template variables<br>
17-
<br>
8+
9+
<b>Create a directory structure from a highly customizable template</b><br>
10+
<br>
11+
Using this plugin, help you create directories and files from customizable template<br>
12+
<br>
13+
<b>Feature</b><br>
14+
1. custom directory structure<br>
15+
2. support placeholders, and replace it when you create module.<br>
16+
3. create file from template<br>
17+
4. support file template variables<br>
18+
19+
<b>Usage</b><br>
20+
1. Configure template in plugin settings: <b>File > Settings > Tools > Module Template Settings</b><br>
21+
2. Create directories from the 'Structure' tab, click the right mouse button to operate the file tree.<br>
22+
3. FileTree can use placeholders, the placeholder should like this -> <b>${YOUR_PLACEHOLDER_HERE}</b>.<br>
23+
4. The 'File Template' tab lists which template the specified file uses, you can also use placeholders for FileName field.<br>
24+
5. The 'Placeholder' tab's table defines placeholders for replacing filenames and file templates<br>
25+
26+
<b>Screenshot</b><br>
27+
<br>
1828
]]></description>
1929

2030
<change-notes><![CDATA[
@@ -37,7 +47,6 @@
3747
</extensions>
3848

3949
<actions>
40-
<!-- Add your actions here -->
4150
<action id="com.dengzii.plugin.template.gen" class="com.dengzii.plugin.template.CreateModuleAction"
4251
text="Create Module From Template"
4352
description="Create module from template">
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package ${PACKAGE_NAME};
2+
3+
import androidx.appcompat.app.AppCompatActivity;
4+
import androidx.annotation.Nullable;
5+
import android.os.Bundle;
6+
7+
public class MainActivity extends AppCompatActivity {
8+
9+
@Override
10+
protected void onCreate(@Nullable Bundle savedInstanceState) {
11+
super.onCreate(savedInstanceState);
12+
13+
}
14+
}

screenshot/main.png

20.5 KB
Loading

screenshot/preview.png

24.4 KB
Loading

screenshot/settings.png

57.9 KB
Loading

src/com/dengzii/plugin/template/template/AucTemplate.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ object AucTemplate {
4343
feature_name {
4444
module_name {
4545
app_name.java
46+
file("MainActivity.java")
4647
}
4748
}
4849
}

src/com/dengzii/plugin/template/template/Template.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.dengzii.plugin.template.model.FileTreeNode
66
* <pre>
77
* author : dengzi
88
* e-mail : denua@foxmail.com
9-
* github : https://github.com/MrDenua
9+
* github : https://github.com/dengzii
1010
* time : 2020/1/14
1111
* desc :
1212
* </pre>
@@ -37,8 +37,12 @@ object Template {
3737
}
3838

3939
val ANDROID_APP = FileTreeNode {
40-
placeholder("MODULE_NAME","app")
41-
placeholder("PACKAGE_NAME","com.example")
40+
placeholder("MODULE_NAME", "app")
41+
placeholder("PACKAGE_NAME", "com.example")
42+
43+
fileTemplate("MainActivity.java", "Template MainActivity.java")
44+
fileTemplate("AndroidManifest.xml", "Template AndroidManifest.xml")
45+
fileTemplate("build.gradle", "Template build.gradle")
4246

4347
module_name {
4448
src {

0 commit comments

Comments
 (0)