82 lines
1.9 KiB
Groovy
82 lines
1.9 KiB
Groovy
plugins {
|
|
id 'org.springframework.boot' version '2.6.3'
|
|
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
|
id 'java'
|
|
}
|
|
|
|
group = 'com.crypto'
|
|
version = '0.0.1-SNAPSHOT'
|
|
sourceCompatibility = '8'
|
|
|
|
configurations {
|
|
compileOnly {
|
|
extendsFrom annotationProcessor
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
|
compileOnly 'org.projectlombok:lombok'
|
|
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
|
runtimeOnly 'com.h2database:h2'
|
|
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
|
|
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
|
|
annotationProcessor 'org.projectlombok:lombok'
|
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
|
}
|
|
|
|
tasks.named('test') {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
// React
|
|
def webappDir = "$projectDir/frontend"
|
|
|
|
sourceSets {
|
|
main {
|
|
resources {
|
|
srcDirs = ["$webappDir/build", "$projectDir/src/main/resources"]
|
|
}
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
dependsOn "copyWebApp"
|
|
}
|
|
|
|
task copyWebApp(type: Copy) {
|
|
dependsOn "buildReact"
|
|
from "$webappDir/build"
|
|
into "$projectDir/src/main/resources/static"
|
|
}
|
|
|
|
task buildReact(type: Exec) {
|
|
dependsOn "installReact"
|
|
workingDir "$webappDir"
|
|
inputs.dir "$webappDir"
|
|
group = BasePlugin.BUILD_GROUP
|
|
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
|
|
commandLine "npm.cmd", "run-script", "build"
|
|
} else {
|
|
commandLine "npm", "run-script", "build"
|
|
}
|
|
}
|
|
|
|
task installReact(type: Exec) {
|
|
workingDir "$webappDir"
|
|
inputs.dir "$webappDir"
|
|
group = BasePlugin.BUILD_GROUP
|
|
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
|
|
commandLine "npm.cmd", "audit", "fix"
|
|
commandLine 'npm.cmd', 'install'
|
|
} else {
|
|
commandLine "npm", "audit", "fix"
|
|
commandLine 'npm', 'install'
|
|
}
|
|
}
|