Skip to content

Commit

Permalink
Feature/mustache (#65)
Browse files Browse the repository at this point in the history
* start refactor using templates

* dirs creation using json template

* generate model using templates

* remove redundant dirs from json array

* refactor default task name

* extract base task methods to module builder, build azure pipeline with templates

* update usecase generation with template

* update usecase generation with template

* generate rest entrypoints with template

* generate rest entrypoints with template

* generate adapters and entrypoints using templates

* append dependencies to subproject, update yaml properties

* add some unit tests

* add some unit tests

* update version and readme

* update gitignore

* add new projec dependencies automatically to build.gradle, update h2 setup for jpa, generate generic driven adapter and entry point

* release new version with mustache templates

* add some test

* fix source compatibility

* fix source compatibility
  • Loading branch information
juancgalvis authored Jun 13, 2020
1 parent 317055e commit bee277d
Show file tree
Hide file tree
Showing 134 changed files with 2,704 additions and 3,400 deletions.
35 changes: 34 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -266,4 +266,37 @@ $RECYCLE.BIN/
*.lnk


# End of https://www.gitignore.io/api/java,maven,gradle,eclipse,intellij,netbeans
# End of https://www.gitignore.io/api/java,maven,gradle,eclipse,intellij,netbeans

# Created by https://www.toptal.com/developers/gitignore/api/macos
# Edit at https://www.toptal.com/developers/gitignore?templates=macos

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.toptal.com/developers/gitignore/api/macos
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To use the plugin you need Gradle version 5 or later, to start add the following

```groovy
plugins {
id "co.com.bancolombia.cleanArchitecture" version "1.5.5"
id "co.com.bancolombia.cleanArchitecture" version "1.6.0"
}
```

Expand Down Expand Up @@ -48,27 +48,29 @@ gradle gm --name [modelName]
gradle generateUseCase --name=[useCaseName]
gradle guc --name [useCaseName]
```
4 The ```generateDrivenAdapter | gda``` task will generate a class in Infrastructure layer, this task have one required parameter ```value```.
4 The ```generateDrivenAdapter | gda``` task will generate a class in Infrastructure layer, this task have one required parameter ```type```.
```sh
gradle generateDrivenAdapter --value=[referenceNumberDrivenAdapter]
gradle gda --value [referenceNumberDrivenAdapter]
gradle generateDrivenAdapter --type=[drivenAdapterType]
gradle gda --type [drivenAdapterType]
```

| Reference driven adapter value | Name |
| ------------------ | ------------ |
| 1|JPA Repository |
| 2|Mongo Repository |
| 3|Async Event Bus |
| GENERIC|Empty Driven Adapter |
| JPA|JPA Repository |
| MONGODB|Mongo Repository |
| ASYNCEVENTBUS|Async Event Bus |

5 The ```generateEntryPoint | gep``` task will generate a class in Infrastructure layer, this task have one required parameter ```value```.
5 The ```generateEntryPoint | gep``` task will generate a class in Infrastructure layer, this task have one required parameter ```type```.
```sh
gradle generateEntryPoint --value=referenceNumberEntryPoint
gradle gep --value referenceNumberEntryPoint
gradle generateEntryPoint --type=[entryPointType]
gradle gep --type [entryPointType]
```
| Reference entry point value | Name |
| ------------------ | ------------ |
| 1|API REST (Spring Boot Starter Web) |
| 2|API REST (Spring Boot Starter WebFlux) |
| GENERIC|Empty Entry Point |
| RESTMVC|API REST (Spring Boot Starter Web) |
| WEBFLUX|API REST (Spring Boot Starter WebFlux) |



Expand All @@ -78,14 +80,14 @@ gradle validateStructure
gradle vs
```

7 The ```generatePipeline | gpl``` task will generate CI pipeline inside the folder "./deployment/", this task have one required parameter ```value```.
7 The ```generatePipeline | gpl``` task will generate CI pipeline inside the folder "./deployment/", this task have one required parameter ```type```.
```sh
gradle generatePipeline --value=referenceNumberPipeline
gradle gpl --value referenceNumberPipeline
gradle generatePipeline --type=[pipelineType]
gradle gpl --type=[pipelineType]
````
| Reference pipeline value | Name |
| ------------------ | ------------ |
| 1|Azure DevOps |
| AZURE|Azure Pipeline |


How I can help?
Expand Down
142 changes: 71 additions & 71 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,114 +8,114 @@

buildscript {

repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
}
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.gradle.publish:plugin-publish-plugin:0.9.7"
}
}



plugins {
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins
id 'java-gradle-plugin'
id 'jacoco'
id 'idea'
id 'com.gradle.plugin-publish' version '0.11.0'
id "org.sonarqube" version "2.7"
// Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins
id 'java-gradle-plugin'
id 'jacoco'
id 'idea'
id 'com.gradle.plugin-publish' version '0.11.0'
id "org.sonarqube" version "2.7"
id 'maven-publish'
}

group 'co.com.bancolombia.cleanArchitecture'

version System.getProperty( 'version' )

version System.getProperty('version')


repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
jcenter()
}

dependencies {
// Use JUnit test framework for unit tests
testImplementation 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:2.9.0"
compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
compile gradleApi()
compile 'com.github.spullara.mustache.java:compiler:0.9.6'
compile 'com.fasterxml.jackson.core:jackson-databind:2.11.0'
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.0'
compile 'commons-io:commons-io:2.7'
compile gradleApi()
// Use JUnit test framework for unit tests
testCompile "org.mockito:mockito-core:2.9.0"
testImplementation 'junit:junit:4.12'
testImplementation gradleTestKit()

compileOnly 'org.projectlombok:lombok:1.18.10'
annotationProcessor 'org.projectlombok:lombok:1.18.10'
}

gradlePlugin {
// Define the plugin
plugins {
cleanArchitecture {
id = 'co.com.bancolombia.cleanArchitecture'
displayName = 'Scaffold Clean Architecture Bancolombia'
description = 'Gradle plugin to create a clean application in Java that already works, It follows our best practices!'
implementationClass = 'co.com.bancolombia.PluginClean'
}
}
// Define the plugin
plugins {
cleanArchitecture {
id = 'co.com.bancolombia.cleanArchitecture'
displayName = 'Scaffold Clean Architecture Bancolombia'
description = 'Gradle plugin to create a clean application in Java that already works, It follows our best practices!'
implementationClass = 'co.com.bancolombia.PluginClean'
}
}
}

// Add a source set for the functional test suite
sourceSets {
functionalTest {
}
functionalTest {
}
}

gradlePlugin.testSourceSets(sourceSets.functionalTest)
configurations.functionalTestImplementation.extendsFrom(configurations.testImplementation)

// Add a task to run the functional tests
task functionalTest(type: Test) {
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.functionalTest.runtimeClasspath
}

check {
// Run the functional tests as part of `check`
dependsOn(tasks.functionalTest)
// Run the functional tests as part of `check`
dependsOn(tasks.functionalTest)
}

pluginBundle {
website = 'https://github.com/bancolombia/scaffold-clean-architecture'
vcsUrl = 'https://github.com/bancolombia/scaffold-clean-architecture'
tags = ['gradle', 'plugin', 'scaffold', 'cleanArchitecture', 'Bancolombia', 'OpenSource']
website = 'https://github.com/bancolombia/scaffold-clean-architecture'
vcsUrl = 'https://github.com/bancolombia/scaffold-clean-architecture'
tags = ['gradle', 'plugin', 'scaffold', 'cleanArchitecture', 'Bancolombia', 'OpenSource']
}

jacocoTestReport{
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/report.xml")
html.enabled true
csv.enabled false
}
jacocoTestReport {
reports {
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco/report.xml")
html.enabled true
csv.enabled false
}
}

sonarqube {
properties {
property "sonar.organization", "grupo-bancolombia"
property "sonar.projectKey", "bancolombia_scaffold-clean-architecture"
property "sonar.host.url", "https://sonarcloud.io/"

property "sonar.sources", "."
property "sonar.java.binaries", "build/classes"
property "sonar.junit.reportPaths", "build/test-results/test"
property "sonar.java-coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/report.xml"
//property "sonar.jacoco.reportPaths", "build/reports/jacoco/report.xml"
property "sonar.test", "src/test/java"
property "sonar.exclusions", ".github/**,src/functionalTest/**,src/test/**/*Test.java,**/**models**,src/test/**/*Provider.java,**/**exceptions**"

//property "sonar.pullrequest.key", "40"
//property "sonar.pullrequest.base", "master"
//property "sonar.pullrequest.branch", "feature/my-new-feature"

property "sonar.sourceEncoding", "UTF-8"
}
properties {
property "sonar.organization", "grupo-bancolombia"
property "sonar.projectKey", "bancolombia_scaffold-clean-architecture"
property "sonar.host.url", "https://sonarcloud.io/"

property "sonar.sources", "."
property "sonar.java.binaries", "build/classes"
property "sonar.junit.reportPaths", "build/test-results/test"
property "sonar.java-coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/report.xml"
property "sonar.test", "src/test/java"
property "sonar.exclusions", ".github/**,src/functionalTest/**,src/test/**/*Test.java,**/**models**,src/test/**/*Provider.java,**/**exceptions**"
property "sonar.sourceEncoding", "UTF-8"
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
package=co.com.bancolombia
systemProp.version=1.5.5
systemProp.version=1.6.0
Loading

0 comments on commit bee277d

Please sign in to comment.