mirai/tools/intellij-plugin/resources/fileTemplates/j2ee/Plugin main class Java.java.ft
Him188 41d0c16ad1
New Project Wizard (#320)
* Add project wizard

* Add OptionsStep

* Template application fundamentals

* Extract BuildSystemType from BuildSystemStep to top-level

* Complete templates

* Fix build

* Fix build

* Support Java and Groovy, fix strings in Kotlin templates

* Add template for gradle.properties

* Disable `depends on` field

* Fix Java template

* Fix build

* Update tools/compiler-annotations/src/CheckerConstants.kt

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>

* Update tools/intellij-plugin/src/creator/steps/ValidationUtil.kt

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>
2021-03-29 18:17:50 +08:00

27 lines
1.0 KiB
Plaintext

package $PACKAGE_NAME;
import net.mamoe.mirai.console.plugin.jvm.JavaPlugin;
import net.mamoe.mirai.console.plugin.jvm.JvmPluginDescriptionBuilder;
public final class ${CLASS_NAME} extends JavaPlugin {
public static final ${CLASS_NAME} INSTANCE = new ${CLASS_NAME}();
#set($HAS_DETAILS = ${PLUGIN_AUTHOR} != "" || ${PLUGIN_DEPENDS_ON} != "" || ${PLUGIN_INFO} != "" || ${PLUGIN_NAME} != "")
private ${CLASS_NAME}() {
#if($HAS_DETAILS == false)
super(new JvmPluginDescriptionBuilder("$PLUGIN_ID", "$PLUGIN_VERSION").build());#end
#if($HAS_DETAILS)
super(new JvmPluginDescriptionBuilder("$PLUGIN_ID", "$PLUGIN_VERSION")
#if($PLUGIN_NAME != "").name("$PLUGIN_NAME")
#end#if($PLUGIN_INFO != "").info("$PLUGIN_INFO")
#end#if($PLUGIN_AUTHOR != "").author("$PLUGIN_AUTHOR")
#end#if($PLUGIN_DEPENDS_ON != "").dependsOn("$PLUGIN_DEPENDS_ON")
#end
.build());#end
}
@Override
public void onEnable() {
getLogger().info("Plugin loaded!");
}
}