JD-180 support Kotlin for library template

This commit is contained in:
ElenaKushchenko 2021-04-02 14:34:46 +03:00
parent 089125cd75
commit b0a7fbb740
2 changed files with 41 additions and 1 deletions

View File

@ -17,6 +17,13 @@ module.exports = {
name: 'description',
message: 'Введите описание вашей либы (maven.description):'
},
{
type: 'list',
name: 'language',
choices: ['Java', 'Kotlin'],
default: 'Java',
message: 'Выберите язык:'
},
{
type: 'input',
name: 'path',
@ -62,4 +69,4 @@ module.exports = {
templateFile: 'plop-templates/library/library-pom.xml'
}
]
};
};

View File

@ -19,6 +19,10 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
{{#if_eq language 'Kotlin'}}
<kotlin.version>1.4.31</kotlin.version>
{{/if_eq}}
</properties>
<dependencyManagement>
@ -31,4 +35,33 @@
</dependencies>
</dependencyManagement>
<dependencies>
{{#if_eq language 'Kotlin'}}
<!--kotlin-->
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
{{/if_eq}}
</dependencies>
<build>
<sourceDirectory>${project.basedir}/src/main/{{lowerCase language}}</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/{{lowerCase language}}</testSourceDirectory>
{{#if_eq language 'Kotlin'}}
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
</plugin>
</plugins>
{{/if_eq}}
</build>
</project>