Files
jambotron/build.gradle
T

154 lines
4.7 KiB
Groovy

plugins {
id 'java'
id 'org.springframework.boot' version '3.5.0'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.flywaydb.flyway' version '10.4.1'
}
group = 'com.jambotronGroup'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(24)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.projectlombok:lombok:1.18.26'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'jakarta.persistence:jakarta.persistence-api:3.1.0'
implementation 'jakarta.validation:jakarta.validation-api:3.0.2'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5' // For JSON serialization/deserialization
implementation 'org.postgresql:postgresql:42.6.0'
implementation 'org.flywaydb:flyway-core'
implementation("org.flywaydb:flyway-database-postgresql:10.4.1")
implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter:1.0.0-M6'
//implementation 'org.springframework.ai:spring-ai-starter-model-zhipuai'
//implementation 'org.springframework.ai:spring-ai-zhipuai-spring-boot-starter'
//implementation platform("org.springframework.ai:spring-ai-bom:1.0.0-SNAPSHOT")
// Replace the following with the starter dependencies of specific modules you wish to use
//implementation 'org.springframework.ai:spring-ai-zhipuai'
//implementation 'org.springframework.boot:spring-boot-starter-webflux'
//implementation("org.springframework.ai:spring-ai-spring-boot-autoconfigure:1.0.0-M6")
// https://mvnrepository.com/artifact/org.springframework.ai/spring-ai-retry
//implementation("org.springframework.ai:spring-ai-retry:1.0.0")
//implementation group: 'org.springframework.ai', name: 'spring-ai-spring-boot-autoconfigure', version: '1.0.0-M6'
}
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom ("org.springframework.ai:spring-ai-retry:1.0.0")
}
}
// copyResouces( type:Copy
//tasks copyResouces( type:Copy){
//
// def buildDir = "${project.buildDir}"
//
// from "{$buildDir}/jambotron-ui/dist/jambotron-ui/browser" // Source directory
// into "{$buildDir}/build/resources" // Target directory
// include '**/*'
//}
apply plugin: 'java'
/*tasks.register('copyResources', Copy) {
from 'jambotron-ui/dist/jambotron-ui/browser'
into 'src/main/resources/public'
}*/
//processResources.dependsOn(copyResources)
//compileJava.dependsOn(copyResources)
//bootRun.dependsOn("flywayMigrate")
//flyway {
// user='admin'
// password= 'postgrespw'
// url = 'jdbc:postgresql://localhost:5432/jambotronDB'
// driver = 'org.postgresql.Driver'
// baselineOnMigrate = true
// locations = ['filesystem:src/main/resources/db.migration/']
//}
/*sourceSets {
main {
resources {
srcDir 'jambotron-ui/dist/jambotron-ui/browser'
}
}
}*/
tasks.register('buildAngular_dev', Exec) {
//dependsOn deleteStaticFolder
workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app')
executable 'npm.cmd' // Use 'npm' for Unix-like systems or 'npm.cmd' for Windows
// Your Angular build command
args = ['run', 'build_dev']//do not forget build_dev used port 8080 for connect to backend rest api
}
tasks.register('buildAngular', Exec) {
//dependsOn deleteStaticFolder
workingDir './jambotron-ui' // Path to your Angular project (e.g., './angular-app')
executable 'npm.cmd' // Use 'npm' for Unix-like systems or 'npm.cmd' for Windows
// Your Angular build command
args = ['run', 'build']//do not forget build_dev used port 8080 for connect to backend rest api
}
tasks.register('deleteStaticFolder', Delete) {
dependsOn buildAngular
def dirName = "src/main/resources/static"
file(dirName).list().each {
f ->
delete "${dirName}/${f}"
}
}
tasks.register('deleteStaticFolder_dev', Delete) {
dependsOn buildAngular_dev
def dirName = "src/main/resources/static"
file(dirName).list().each {
f ->
delete "${dirName}/${f}"
}
}
tasks.register('copyAngularBuild', Copy) {
dependsOn deleteStaticFolder
from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder
into "src/main/resources/static" // Path INSIDE the WAR
}
tasks.register('copyAngularBuild_dev', Copy) {
dependsOn deleteStaticFolder_dev
from 'jambotron-ui/dist/jambotron-ui' // Path to your Angular dist folder
into "src/main/resources/static" // Path INSIDE the WAR
}
tasks.named('test') {
useJUnitPlatform()
}