-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat($maf-mis): migrate from Maven to Gradle
- Loading branch information
1 parent
caf7015
commit cc0438a
Showing
17 changed files
with
171 additions
and
429 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
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
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,5 +1,6 @@ | ||
description = "Muscle and Fitness Server :: MAF MIS - Biz" | ||
|
||
dependencies { | ||
implementation(project(":maf-mis-domain")) | ||
// MAF | ||
api(project(":maf-mis-domain")) | ||
} | ||
|
||
description = "Muscle and Fitness Server :: MAF MIS - Biz" |
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 |
---|---|---|
@@ -1,6 +1,75 @@ | ||
@file:Suppress("UnstableApiUsage") | ||
|
||
import com.palantir.gradle.gitversion.VersionDetails | ||
import groovy.lang.Closure | ||
import org.springframework.boot.gradle.tasks.bundling.BootJar | ||
import org.springframework.boot.gradle.tasks.run.BootRun | ||
import java.time.LocalDateTime | ||
|
||
description = "Muscle and Fitness Server :: MAF MIS - Bootstrap" | ||
|
||
plugins { | ||
id("com.google.cloud.tools.jib") | ||
} | ||
|
||
val versionDetails: Closure<VersionDetails> by extra | ||
val gitVersionDetails = versionDetails() | ||
|
||
dependencies { | ||
implementation(project(":maf-mis-web")) | ||
implementation(project(":maf-mis-message")) | ||
} | ||
|
||
description = "Muscle and Fitness Server :: MAF MIS - Bootstrap" | ||
tasks.withType<BootJar> { | ||
this.enabled = true | ||
// archiveFileName = [baseName]-[gitHash]-[version]-[classifier].[extension] | ||
this.archiveFileName.set("${archiveBaseName.get()}-${gitVersionDetails.gitHash}-${archiveVersion.get()}.${archiveExtension.get()}") | ||
logger.info("Building Spring Boot executable jar: ${this.archiveFileName.get()}") | ||
} | ||
|
||
tasks.withType<BootRun> { | ||
if (project.hasProperty("jvmArgs")) { | ||
val jvmArgsProperty = (project.properties["jvmArgs"] as String) | ||
logger.info("jvmArgsProperty for the app [${project.name}] (before split): `$jvmArgsProperty`") | ||
jvmArgs = jvmArgsProperty.split(Regex("\\s+")) | ||
logger.info("allJvmArgs for the app [${project.name}] (after split): $allJvmArgs") | ||
} | ||
} | ||
|
||
// https://www.baeldung.com/spring-boot-auto-property-expansion | ||
// https://github.com/gradle/kotlin-dsl-samples/blob/master/samples/copy/build.gradle.kts | ||
// https://www.tristanfarmer.dev/blog/gradle_property_expansion_spring_boot | ||
tasks.withType<ProcessResources> { | ||
// Only expand the file `application.yml` | ||
filesMatching("**/application.yml") { | ||
expand(project.properties) | ||
} | ||
} | ||
|
||
springBoot { | ||
buildInfo() | ||
} | ||
|
||
// https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin | ||
jib { | ||
pluginExtensions { | ||
pluginExtension { | ||
implementation = "com.google.cloud.tools.jib.gradle.extension.springboot.JibSpringBootExtension" | ||
properties = mapOf("useDeprecatedExcludeDevtoolsOption" to "true") | ||
} | ||
} | ||
val temurinTag: String by properties | ||
from.image = "eclipse-temurin:${temurinTag}" | ||
val dockerHubRepositoryPrefix: String by properties | ||
val projectArtifactId: String by properties | ||
val mafMisArtifactId: String by properties | ||
to.image = "$dockerHubRepositoryPrefix$projectArtifactId.$mafMisArtifactId" | ||
to.tags = setOf("${gitVersionDetails.gitHash}-${project.version}") | ||
container.appRoot = "/$mafMisArtifactId" | ||
val projectBuildSourceEncoding: String by properties | ||
container.jvmFlags = listOf("-Dfile.encoding=$projectBuildSourceEncoding") | ||
val mafMisPort: String by properties | ||
container.ports = listOf(mafMisPort) | ||
container.creationTime = LocalDateTime.now().toString() | ||
} | ||
|
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
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,5 +1,6 @@ | ||
description = "Muscle and Fitness Server :: MAF MIS - Domain" | ||
|
||
dependencies { | ||
implementation(project(":maf-mis-infra")) | ||
// MAF dependencies | ||
api(project(":maf-mis-infra")) | ||
} | ||
|
||
description = "Muscle and Fitness Server :: MAF MIS - Domain" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.