Skip to content

Commit b531926

Browse files
committed
add documents for first release
1 parent fddfb5d commit b531926

3 files changed

Lines changed: 72 additions & 12 deletions

File tree

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2017 Jinzhou Zhang
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# CodeGenerator
2+
An idea-plugin for code generation, support template customization.
3+
4+
// TODO: add demo
5+
6+
As we know, Intellij had provided useful code generators such as constructors,
7+
getter/setters, equals, hashCode, overrides and delegates, etc. And Intellij
8+
allows us to apply customized velocity templates for each generator. But we
9+
cannot add our own generators.
10+
11+
Code Generator is here to help. Two types of generation are supported here
12+
- Members(fields/method) based templates, such as serializers, equals, etc.
13+
- Class based template, such as transformers, converters, etc. Normally new classes are created.
14+
15+
# Installation
16+
17+
1. Search `CodeGenerator` in Idea plugins
18+
2. Download zip from from [Releases](https://github.com/lotabout/CodeGenerator/releases)
19+
20+
To install a plugin from the disk in idea:
21+
22+
1. Open the `Settings/Preferences` dialog box and select `Plugins` on the left pane.
23+
2. On the right pane of the dialog, click the `Install plugin from disk` button.
24+
3. Select the location of the zip file, click OK to continue.
25+
4. Click `Apply` button of the Settings/Preferences dialog.
26+
5. Restart IntelliJ IDEA to activate.
27+
28+
# Usage
29+
30+
1. Go to the `Settings/Preferences > Other Settings > CodeGenerator` to
31+
create a new generator/template.
32+
2. Right click on your java file, Select `Generate > CodeGenerator > [name of
33+
your generator]` to run the generator.
34+
35+
According to the settings of your generator, there might be dialogs show up
36+
asking to select members or classes that's required by your generator.
37+
38+
# Thanks to
39+
- [CodeMaker](https://raw.githubusercontent.com/x-hansong/CodeMaker): where
40+
the idea and part of code comes from.
41+
- [generate-tostring](https://github.com/JetBrains/intellij-community/tree/master/plugins/generate-tostring):
42+
Offical toString generator. Part of the code comes from it.
43+

resources/META-INF/plugin.xml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
<idea-plugin>
22
<id>me.lotabout.codegenerator</id>
33
<name>CodeGenerator</name>
4-
<version>0.2</version>
5-
<vendor email="lotabout@gmail.com" url="https://lotabout.me">LotAbout</vendor>
4+
<version>1.0</version>
5+
<vendor email="lotabout@gmail.com" url="https://lotabout.me">Personal</vendor>
66

77
<description><![CDATA[
8-
Code Generator enables us to create customized velocity templates for code generation.
9-
Intellij had already support common generations like constructors, getters/setters, toString, etc.
10-
These templates however are limited, for example toString will allow us to generate `toString` method only.
11-
Code Generator want to generalize the ability to utilize velocity templates so that you can create whatever
12-
template you need.
13-
14-
Currently only Java files are supported.
15-
<em>most HTML tags may be used</em>
8+
<p>This plugin allows user to create customized velocity templates like <code>toString</code> or <code>builder</code></p>
9+
<p>As we know, Intellij had provided useful code generators such as constructors, getter/setters, equals, hashCode,
10+
overrides and delegates, etc. And Intellij allows us to apply customized velocity templates for each generator.
11+
But we cannot add our own generators.</p>
12+
<p>Code Generator is here to help. Two types of generation are supported here</p>
13+
<ul>
14+
<li>Members(fields/method) based templates, such as serializers, equals, etc.</li>
15+
<li>Class based template, such as transformers, converters, etc. Normally new classes are created.</li>
16+
</ul>
17+
<p>I've always hoped Intellij would support this by default, but for now we have an working alternative.</p>
18+
<p>See <a href="https://github.com/lotabout/CodeGenerator/blob/master/README.md">README</a> for more</p>
1619
]]></description>
1720

1821
<change-notes><![CDATA[
19-
Add change notes here.<br>
20-
<em>most HTML tags may be used</em>
22+
<ul>
23+
<li>version 1.0 <p>First release</p></li>
24+
</ul>
2125
]]>
2226
</change-notes>
2327

0 commit comments

Comments
 (0)