forked from jhipster/jhipster-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates #1862
- Loading branch information
Showing
8 changed files
with
133 additions
and
8 deletions.
There are no files selected for viewing
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
24 changes: 24 additions & 0 deletions
24
...a/tech/jhipster/lite/generator/buildtool/gradle/application/GradleApplicationService.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,24 @@ | ||
package tech.jhipster.lite.generator.buildtool.gradle.application; | ||
|
||
import org.springframework.stereotype.Service; | ||
import tech.jhipster.lite.generator.buildtool.gradle.domain.GradleModuleFactory; | ||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
|
||
@Service | ||
public class GradleApplicationService { | ||
|
||
private final GradleModuleFactory factory; | ||
|
||
public GradleApplicationService() { | ||
factory = new GradleModuleFactory(); | ||
} | ||
|
||
public JHipsterModule buildGradleModule(JHipsterModuleProperties properties) { | ||
return factory.buildGradleModule(properties); | ||
} | ||
|
||
public JHipsterModule buildGradleWrapperModule(JHipsterModuleProperties properties) { | ||
return factory.buildGradleWrapperModule(properties); | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
...ter/lite/generator/buildtool/gradle/infrastructure/primary/GradleModuleConfiguration.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,41 @@ | ||
package tech.jhipster.lite.generator.buildtool.gradle.infrastructure.primary; | ||
|
||
import static tech.jhipster.lite.generator.JHLiteFeatureSlug.JAVA_BUILD_TOOL; | ||
import static tech.jhipster.lite.generator.JHLiteModuleSlug.GRADLE_JAVA; | ||
import static tech.jhipster.lite.generator.JHLiteModuleSlug.GRADLE_WRAPPER; | ||
import static tech.jhipster.lite.generator.JHLiteModuleSlug.INIT; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import tech.jhipster.lite.generator.buildtool.gradle.application.GradleApplicationService; | ||
import tech.jhipster.lite.module.domain.resource.JHipsterModuleOrganization; | ||
import tech.jhipster.lite.module.domain.resource.JHipsterModulePropertiesDefinition; | ||
import tech.jhipster.lite.module.domain.resource.JHipsterModuleResource; | ||
|
||
@Configuration | ||
class GradleModuleConfiguration { | ||
|
||
@Bean | ||
JHipsterModuleResource gradleModule(GradleApplicationService gradle) { | ||
return JHipsterModuleResource | ||
.builder() | ||
.slug(GRADLE_JAVA) | ||
.propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addProjectName().build()) | ||
.apiDoc("Build Tool", "Init Gradle project with kotlin dsl and wrapper") | ||
.organization(JHipsterModuleOrganization.builder().feature(JAVA_BUILD_TOOL).addDependency(INIT).build()) | ||
.tags("buildtool", "test") | ||
.factory(gradle::buildGradleModule); | ||
} | ||
|
||
@Bean | ||
JHipsterModuleResource gradleWrapperModule(GradleApplicationService gradle) { | ||
return JHipsterModuleResource | ||
.builder() | ||
.slug(GRADLE_WRAPPER) | ||
.withoutProperties() | ||
.apiDoc("Build Tool", "Add gradle wrapper") | ||
.standalone() | ||
.tags("buildtool", "test") | ||
.factory(gradle::buildGradleWrapperModule); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Feature: Gradle module | ||
|
||
Scenario: Should apply gradle init module | ||
When I apply "gradle-java" module to default project | ||
| packageName | tech.jhipster.chips | | ||
| baseName | jhipster | | ||
| projectName | Jhipster | | ||
Then I should have files in "." | ||
| build.gradle.kts | | ||
| settings.gradle.kts | | ||
| gradlew | | ||
| gradlew.bat | | ||
Then I should have files in "gradle/wrapper" | ||
| gradle-wrapper.jar | | ||
| gradle-wrapper.properties | | ||
|
||
Scenario: Should apply gradle wrapper module | ||
When I apply "gradle-wrapper" module to default project without parameters | ||
Then I should have files in "." | ||
| gradlew | | ||
| gradlew.bat | | ||
Then I should have files in "gradle/wrapper" | ||
| gradle-wrapper.jar | | ||
| gradle-wrapper.properties | |
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