-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tech] Utilisation de gradle #2618
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9236d9c
Replace maven with gradle
louptheron 5d016e7
Use gradle user
louptheron f0729cc
another try to fix docker build
louptheron 54b041b
Remove offline
louptheron 4983208
Try to fix sed
louptheron 3d0d511
Fix version typo
louptheron dcbb8d0
Add ktlint with gradle
louptheron 6fab74d
Update Makefile infra folder
louptheron cd525e5
Update .gitignore
louptheron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
sig/layersdata/** filter=lfs diff=lfs merge=lfs -text | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# Linux start script should use lf | ||
/gradlew text eol=lf | ||
|
||
# These are Windows script files and should use crlf | ||
*.bat text eol=crlf | ||
|
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 |
---|---|---|
@@ -0,0 +1,128 @@ | ||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
id("org.springframework.boot") version "3.1.3" | ||
id("org.jetbrains.kotlin.plugin.spring") version "1.9.10" | ||
kotlin("jvm") version "1.9.10" | ||
id("org.jetbrains.kotlin.plugin.allopen") version "1.9.10" | ||
kotlin("plugin.noarg") version "1.9.10" | ||
kotlin("plugin.jpa") version "1.9.10" | ||
id("org.jlleitschuh.gradle.ktlint") version "11.6.1" | ||
kotlin("plugin.serialization") version "1.9.10" | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
kotlin { | ||
jvmToolchain(17) | ||
} | ||
|
||
noArg { | ||
invokeInitializers = true | ||
} | ||
|
||
configurations.all { | ||
exclude(group = "org.springframework.boot", module = "spring-boot-starter-logging") | ||
} | ||
|
||
tasks.named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask::class.java) { | ||
compilerOptions { | ||
freeCompilerArgs.add("-Xjsr305=strict") | ||
// jvmTarget.set(JvmTarget.JVM_17) | ||
// javaParameters.set(true) | ||
} | ||
} | ||
|
||
dependencies { | ||
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1") | ||
api("io.ktor:ktor-client-core-jvm:2.3.3") | ||
api("io.ktor:ktor-client-java-jvm:2.3.3") | ||
api("io.ktor:ktor-client-mock-jvm:2.3.3") | ||
api("io.ktor:ktor-client-content-negotiation-jvm:2.3.3") | ||
api("io.ktor:ktor-serialization-kotlinx-json-jvm:2.3.3") | ||
api("org.springframework.boot:spring-boot-starter-web:3.1.3") | ||
api("org.springframework.security:spring-security-oauth2-resource-server:6.1.5") | ||
api("org.springframework.security:spring-security-oauth2-jose:6.1.4") | ||
api("org.hibernate.validator:hibernate-validator:8.0.1.Final") | ||
api("jakarta.validation:jakarta.validation-api:3.0.2") | ||
api("org.springframework.boot:spring-boot-starter-actuator:3.1.3") | ||
api("org.springframework.boot:spring-boot-starter-json:3.1.3") | ||
api("org.springframework.boot:spring-boot-starter-security:3.1.3") | ||
api("org.springframework.boot:spring-boot-starter-data-jpa:3.1.3") | ||
api("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.3") | ||
api("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") | ||
api("org.flywaydb:flyway-core:9.22.3") | ||
api("org.springdoc:springdoc-openapi-ui:1.7.0") | ||
api("org.jetbrains.kotlin:kotlin-reflect:1.9.10") | ||
api("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10") | ||
api("org.springframework.boot:spring-boot-configuration-processor:3.1.3") | ||
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") | ||
api("com.neovisionaries:nv-i18n:1.29") | ||
api("org.springframework.boot:spring-boot-starter-cache:3.1.3") | ||
api("com.github.ben-manes.caffeine:caffeine:3.1.8") | ||
api("org.springframework.security:spring-security-test:6.1.5") | ||
api("org.testcontainers:testcontainers:1.19.1") | ||
api("io.hypersistence:hypersistence-utils-hibernate-62:3.5.3") | ||
api("org.assertj:assertj-core:3.24.2") | ||
api("org.testcontainers:postgresql:1.19.1") | ||
api("org.springframework.boot:spring-boot-starter-log4j2:3.1.3") | ||
api("org.locationtech.jts:jts-core:1.19.0") | ||
api("org.hibernate:hibernate-spatial:6.1.7.Final") | ||
api("io.sentry:sentry:6.31.0") | ||
api("io.sentry:sentry-log4j2:6.31.0") | ||
runtimeOnly("org.springframework.boot:spring-boot-devtools:3.1.3") | ||
runtimeOnly("org.postgresql:postgresql:42.6.0") | ||
testImplementation("jakarta.servlet:jakarta.servlet-api:6.0.0") | ||
testImplementation("com.squareup.okhttp3:mockwebserver:4.11.0") | ||
testImplementation("org.springframework.boot:spring-boot-starter-test:3.1.3") | ||
testImplementation("org.springframework.restdocs:spring-restdocs-mockmvc:3.0.0") | ||
testImplementation("org.testcontainers:junit-jupiter:1.19.1") | ||
} | ||
|
||
group = "fr.gouv.cnsp" | ||
version = "VERSION_TO_CHANGE" | ||
description = "MonitorFish" | ||
java.sourceCompatibility = JavaVersion.VERSION_17 | ||
|
||
publishing { | ||
publications.create<MavenPublication>("maven") { | ||
from(components["java"]) | ||
} | ||
} | ||
|
||
springBoot { | ||
mainClass.set("fr.gouv.cnsp.monitorfish.MonitorFishApplicationKt") | ||
|
||
buildInfo { | ||
properties { | ||
additional = mapOf( | ||
"commit.hash" to "COMMIT_TO_CHANGE" | ||
) | ||
} | ||
} | ||
} | ||
|
||
tasks.withType<JavaCompile>() { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
tasks.withType<Javadoc>() { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> { | ||
verbose.set(true) | ||
android.set(false) | ||
outputToConsole.set(true) | ||
ignoreFailures.set(true) | ||
} | ||
|
||
tasks.named<Test>("test") { | ||
useJUnitPlatform() | ||
|
||
testLogging { | ||
events("passed") | ||
} | ||
} |
Binary file not shown.
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,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je n'avais même pas remarqué qu'on utilisait LFS. J'en profite du coup pour te demander ce que sont
layersdata
et pourquoi on les retire?Et si on utilise plus LFS, ça vaut peut être le coup de cleaner l'historique LFS de Git mais à vérifier si c'est utile ou non (ça ne l'est pas si le clone/pull ne prend pas l'historique LFS).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On n'utilise plus LFS !
Normalement le but c'est justement de ne pas polluer l'historique .git avec cet outil