-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2316 from DamnClin/gitpod-module
Migrate gitpod to module
- Loading branch information
Showing
15 changed files
with
86 additions
and
240 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
15 changes: 8 additions & 7 deletions
15
.../java/tech/jhipster/lite/generator/setup/gitpod/application/GitpodApplicationService.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 |
---|---|---|
@@ -1,19 +1,20 @@ | ||
package tech.jhipster.lite.generator.setup.gitpod.application; | ||
|
||
import org.springframework.stereotype.Service; | ||
import tech.jhipster.lite.generator.project.domain.Project; | ||
import tech.jhipster.lite.generator.setup.gitpod.domain.GitpodService; | ||
import tech.jhipster.lite.generator.setup.gitpod.domain.GitpodModuleFactory; | ||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
|
||
@Service | ||
public class GitpodApplicationService { | ||
|
||
private final GitpodService gitpodService; | ||
private final GitpodModuleFactory factory; | ||
|
||
public GitpodApplicationService(GitpodService gitpodService) { | ||
this.gitpodService = gitpodService; | ||
public GitpodApplicationService() { | ||
factory = new GitpodModuleFactory(); | ||
} | ||
|
||
public void init(Project project) { | ||
gitpodService.init(project); | ||
public JHipsterModule buildModule(JHipsterModuleProperties properties) { | ||
return factory.buildModule(properties); | ||
} | ||
} |
30 changes: 0 additions & 30 deletions
30
src/main/java/tech/jhipster/lite/generator/setup/gitpod/domain/GitpodDomainService.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/main/java/tech/jhipster/lite/generator/setup/gitpod/domain/GitpodModuleFactory.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,25 @@ | ||
package tech.jhipster.lite.generator.setup.gitpod.domain; | ||
|
||
import static tech.jhipster.lite.module.domain.JHipsterModule.*; | ||
|
||
import tech.jhipster.lite.error.domain.Assert; | ||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
|
||
public class GitpodModuleFactory { | ||
|
||
public JHipsterModule buildModule(JHipsterModuleProperties properties) { | ||
Assert.notNull("properties", properties); | ||
|
||
//@formatter:off | ||
return moduleBuilder(properties) | ||
.files() | ||
.batch(from("setup/gitpod"), to(".")) | ||
.file(".gitpod.yml") | ||
.file(".gitpod.Dockerfile") | ||
.and() | ||
.and() | ||
.build(); | ||
//@formatter:on | ||
} | ||
} |
7 changes: 0 additions & 7 deletions
7
src/main/java/tech/jhipster/lite/generator/setup/gitpod/domain/GitpodService.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...h/jhipster/lite/generator/setup/gitpod/infrastructure/config/GitpodBeanConfiguration.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
...hipster/lite/generator/setup/gitpod/infrastructure/primary/GitpodModuleConfiguration.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,22 @@ | ||
package tech.jhipster.lite.generator.setup.gitpod.infrastructure.primary; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import tech.jhipster.lite.generator.setup.gitpod.application.GitpodApplicationService; | ||
import tech.jhipster.lite.module.infrastructure.primary.JHipsterModuleApiDoc; | ||
import tech.jhipster.lite.module.infrastructure.primary.JHipsterModuleResource; | ||
|
||
@Configuration | ||
class GitpodModuleConfiguration { | ||
|
||
@Bean | ||
JHipsterModuleResource gitpodModule(GitpodApplicationService gitPods) { | ||
return JHipsterModuleResource | ||
.builder() | ||
.legacyUrl("/api/developer-tools/gitpod") | ||
.slug("gitpod") | ||
.withoutProperties() | ||
.apiDoc(new JHipsterModuleApiDoc("Gitpod", "Init Gitpod configuration files")) | ||
.factory(gitPods::buildModule); | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
...tech/jhipster/lite/generator/setup/gitpod/infrastructure/primary/rest/GitpodResource.java
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
Feature: Gitpod | ||
|
||
Scenario: Should apply gitpod module | ||
When I apply "gitpod" module to default project without properties | ||
Then I should have files in "." | ||
| .gitpod.yml | |
26 changes: 0 additions & 26 deletions
26
...ava/tech/jhipster/lite/generator/setup/gitpod/application/GitpodApplicationServiceIT.java
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/test/java/tech/jhipster/lite/generator/setup/gitpod/application/GitpodAssertFiles.java
This file was deleted.
Oops, something went wrong.
34 changes: 0 additions & 34 deletions
34
src/test/java/tech/jhipster/lite/generator/setup/gitpod/domain/GitpodDomainServiceTest.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/test/java/tech/jhipster/lite/generator/setup/gitpod/domain/GitpodModuleFactoryTest.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,25 @@ | ||
package tech.jhipster.lite.generator.setup.gitpod.domain; | ||
|
||
import static tech.jhipster.lite.module.infrastructure.secondary.JHipsterModulesAssertions.*; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import tech.jhipster.lite.UnitTest; | ||
import tech.jhipster.lite.common.domain.FileUtils; | ||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.JHipsterModulesFixture; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
|
||
@UnitTest | ||
class GitpodModuleFactoryTest { | ||
|
||
private static final GitpodModuleFactory factory = new GitpodModuleFactory(); | ||
|
||
@Test | ||
void shouldBuildModule() { | ||
JHipsterModuleProperties properties = JHipsterModulesFixture.propertiesBuilder(FileUtils.tmpDirForTest()).build(); | ||
|
||
JHipsterModule module = factory.buildModule(properties); | ||
|
||
assertThatModule(module).createFiles(".gitpod.yml", ".gitpod.Dockerfile"); | ||
} | ||
} |
21 changes: 0 additions & 21 deletions
21
...jhipster/lite/generator/setup/gitpod/infrastructure/config/GitpodBeanConfigurationIT.java
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
...ch/jhipster/lite/generator/setup/gitpod/infrastructure/primary/rest/GitpodResourceIT.java
This file was deleted.
Oops, something went wrong.