mirror of
https://github.com/mamoe/mirai.git
synced 2025-04-24 20:43:33 +08:00
[idea] feat: generate gradle-wrapper.properties and src/test directory (#2622)
feat: generate gradle-wrapper.properties and src/test directory
This commit is contained in:
parent
30b3472460
commit
f28a1a0f0d
mirai-console/tools/intellij-plugin
resources/fileTemplates/code
src
@ -0,0 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
@ -0,0 +1,14 @@
|
||||
<!--
|
||||
~ Copyright 2019-2023 Mamoe Technologies and contributors.
|
||||
~
|
||||
~ 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
||||
~ Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
||||
~
|
||||
~ https://github.com/mamoe/mirai/blob/dev/LICENSE
|
||||
-->
|
||||
|
||||
<html>
|
||||
<body>
|
||||
<p>This is a built-in file template used to create a new gradle-wrapper.properties for Mirai Console Plugin projects.</p>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 Mamoe Technologies and contributors.
|
||||
* Copyright 2019-2023 Mamoe Technologies and contributors.
|
||||
*
|
||||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
||||
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
||||
@ -26,6 +26,7 @@ object FT { // file template
|
||||
const val SettingsGradleKts = "Plugin settings.gradle.kts"
|
||||
const val SettingsGradle = "Plugin settings.gradle"
|
||||
|
||||
const val GradleWrapperProperties = "Gradle gradle-wrapper.properties"
|
||||
const val GradleProperties = "Gradle gradle.properties"
|
||||
|
||||
const val PluginMainKt = "Plugin main class Kotlin.kt"
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 Mamoe Technologies and contributors.
|
||||
* Copyright 2019-2023 Mamoe Technologies and contributors.
|
||||
*
|
||||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
||||
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
||||
@ -23,6 +23,7 @@ class FileTemplateRegistrar : com.intellij.ide.fileTemplates.FileTemplateGroupDe
|
||||
addTemplate(FileTemplateDescriptor(FT.PluginMainJava))
|
||||
addTemplate(FileTemplateDescriptor(FT.PluginMainService))
|
||||
|
||||
addTemplate(FileTemplateDescriptor(FT.GradleWrapperProperties))
|
||||
addTemplate(FileTemplateDescriptor(FT.GradleProperties))
|
||||
|
||||
addTemplate(FileTemplateDescriptor(FT.SettingsGradleKts))
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 Mamoe Technologies and contributors.
|
||||
* Copyright 2019-2023 Mamoe Technologies and contributors.
|
||||
*
|
||||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
||||
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
||||
@ -108,6 +108,10 @@ class MiraiModuleBuilder : StarterModuleBuilder() {
|
||||
val model = starterContext.getUserData(MIRAI_PROJECT_MODEL_KEY)!!
|
||||
|
||||
val standardAssetsProvider = StandardAssetsProvider()
|
||||
assets.add(GeneratorTemplateFile(
|
||||
standardAssetsProvider.gradleWrapperPropertiesLocation,
|
||||
ftManager.getCodeTemplate(FT.GradleWrapperProperties)
|
||||
))
|
||||
assets.addAll(standardAssetsProvider.getGradlewAssets())
|
||||
|
||||
model.buildSystemType.createBuildSystem(model)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2022 Mamoe Technologies and contributors.
|
||||
* Copyright 2019-2023 Mamoe Technologies and contributors.
|
||||
*
|
||||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
|
||||
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
|
||||
@ -39,6 +39,9 @@ sealed class GradleProjectCreator(
|
||||
collect(GeneratorEmptyDirectory("src/main/${model.languageType.sourceSetDirName}"))
|
||||
collect(GeneratorEmptyDirectory("src/main/resources"))
|
||||
|
||||
collect(GeneratorEmptyDirectory("src/test/${model.languageType.sourceSetDirName}"))
|
||||
collect(GeneratorEmptyDirectory("src/test/resources"))
|
||||
|
||||
collect(GeneratorTemplateFile(model.languageType.pluginMainClassFile(this)))
|
||||
|
||||
collect(GeneratorTemplateFile(".gitignore", getTemplate(FT.Gitignore)))
|
||||
|
Loading…
Reference in New Issue
Block a user