-
-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b698153
commit 0079c8d
Showing
6 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
...va/tech/jhipster/lite/generator/language/kotlin/application/KotlinApplicationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package tech.jhipster.lite.generator.language.kotlin.application; | ||
|
||
import org.springframework.stereotype.Service; | ||
import tech.jhipster.lite.generator.language.kotlin.domain.KotlinModuleFactory; | ||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
|
||
@Service | ||
public class KotlinApplicationService { | ||
|
||
private final KotlinModuleFactory factory; | ||
|
||
public KotlinApplicationService() { | ||
factory = new KotlinModuleFactory(); | ||
} | ||
|
||
public JHipsterModule buildKotlinLanguageModule(JHipsterModuleProperties properties) { | ||
return factory.buildKotlinLanguageModule(properties); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/tech/jhipster/lite/generator/language/kotlin/domain/KotlinModuleFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package tech.jhipster.lite.generator.language.kotlin.domain; | ||
|
||
import static tech.jhipster.lite.module.domain.JHipsterModule.moduleBuilder; | ||
|
||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.gradleplugin.GradleCorePlugin; | ||
import tech.jhipster.lite.module.domain.gradleplugin.GradlePluginId; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
import tech.jhipster.lite.shared.error.domain.Assert; | ||
|
||
public class KotlinModuleFactory { | ||
|
||
public JHipsterModule buildKotlinLanguageModule(JHipsterModuleProperties properties) { | ||
Assert.notNull("properties", properties); | ||
|
||
//@formatter:off | ||
return moduleBuilder(properties) | ||
.gitIgnore() | ||
.comment("Kotlin Language") | ||
.and() | ||
.gradlePlugins() | ||
.plugin(kotlinPluginManagement()) | ||
.and() | ||
.build(); | ||
//@formatter:on | ||
} | ||
|
||
private GradleCorePlugin kotlinPluginManagement() { | ||
return GradleCorePlugin.builder().id(new GradlePluginId("kotlin(\"jvm\") version \"1.9.25\"")).build(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ster/lite/generator/language/kotlin/infrastructure/primary/KotlinModuleConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package tech.jhipster.lite.generator.language.kotlin.infrastructure.primary; | ||
|
||
import static tech.jhipster.lite.shared.slug.domain.JHLiteFeatureSlug.EXTRA_LANGUAGE; | ||
import static tech.jhipster.lite.shared.slug.domain.JHLiteModuleSlug.GRADLE_JAVA; | ||
import static tech.jhipster.lite.shared.slug.domain.JHLiteModuleSlug.GRADLE_KOTLIN; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import tech.jhipster.lite.generator.language.kotlin.application.KotlinApplicationService; | ||
import tech.jhipster.lite.module.domain.resource.JHipsterModuleOrganization; | ||
import tech.jhipster.lite.module.domain.resource.JHipsterModuleResource; | ||
|
||
@Configuration | ||
public class KotlinModuleConfiguration { | ||
|
||
@Bean | ||
JHipsterModuleResource gradleKotlinLanguageModule(KotlinApplicationService gradle) { | ||
return JHipsterModuleResource.builder() | ||
.slug(GRADLE_KOTLIN) | ||
.withoutProperties() | ||
.apiDoc("Extra Language", "Add Kotlin Language Supports") | ||
.organization(JHipsterModuleOrganization.builder().feature(EXTRA_LANGUAGE).addDependency(GRADLE_JAVA).build()) | ||
.tags("buildtool", "test") | ||
.factory(gradle::buildKotlinLanguageModule); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
src/main/java/tech/jhipster/lite/generator/language/kotlin/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package tech.jhipster.lite.generator.language.kotlin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters