Skip to content
Snippets Groups Projects
build.gradle 3.75 KiB
Newer Older
import org.apache.tools.ant.filters.*

plugins {
    id 'java'
    id 'groovy'
    id 'org.springframework.boot' version '2.2.5.RELEASE'
    id "io.spring.dependency-management" version "1.0.9.RELEASE"
}

configurations {
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}
group = 'cz.dnaAnalyser'
version = '0.0.1-SNAPSHOT'

/*
def dockerRepository = 'dna-analyser'
def dockerName = "$dockerImageNamespace/$dockerRepository:$dockerImageTag"
group = 'cz.mendelu.bioinformatics'
version = gitVersion

sourceCompatibility = '1.8'
*/
/*
compileJava {
    options.compilerArgs.addAll(['--release', '8']) // FIX issue #383
}
*/
/*
bootJar {
    mainClassName = 'cz.mendelu.dnaAnalyser.Application'
    manifest {
        attributes(
                'Implementation-Title': project.name,
                'Implementation-Version': gitVersion,
        )
    }
}

task dockerBuild {
    group 'build'
    description 'Build docker image from Dockerfile'
    dependsOn bootJar
    doLast {
        def jarFile = "build/libs/backend-${version}.jar"
        exec {
            workingDir "$buildDir/.."
            commandLine "docker build --rm --build-arg JAR_FILE=$jarFile -t $dockerName .".split(" ")
        }
        print "Successfully built image '$dockerName'"
    }
}
*/
processResources {
    include '**'
    filter ReplaceTokens, tokens: [
            'gitVersion'  : version,
            'assemblyDate': Long.toString(System.currentTimeMillis())
    ]
}

sourceCompatibility = '1.8'

bootJar {
    mainClassName = 'cz.mendelu.dnaAnalyser.Application'
}

dependencies {
    // Compile and developer support
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    runtimeOnly 'net.bull.javamelody:javamelody-spring-boot-starter:1.+'
    //runtimeOnly 'net.bull.javamelody:javamelody-spring-boot-starter:1.79.0'

    // Spring boot framework
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-security'

    // Database
    runtimeOnly 'com.h2database:h2:1.4.196' // Newest version are not supported.
    runtimeOnly 'org.postgresql:postgresql'
    implementation 'org.flywaydb:flyway-core'
    implementation 'org.mybatis:mybatis:3.4.6'


    // JWT Token
    implementation 'io.jsonwebtoken:jjwt:0.9.+'

    implementation "com.google.guava:guava:16+"

    // Swagger documentation
    implementation 'io.springfox:springfox-boot-starter:3.+'

    // Apache commons libraries
    implementation 'org.apache.commons:commons-lang3:3.+'
    implementation 'org.apache.commons:commons-email:1.+'
    implementation 'commons-io:commons-io:2.+'

    // Export to CSV
    implementation'com.opencsv:opencsv:4.0'

    // Unit testing
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
    testImplementation 'org.codehaus.groovy:groovy-test:2.4.+'
    testImplementation 'org.spockframework:spock-core:1.1-groovy-2.4'
    testImplementation 'org.spockframework:spock-spring:1.1-groovy-2.4'
    testImplementation'cglib:cglib-nodep:3.+'

}

//dependencies {

//
//    // Test compile

//    testCompile 'org.springframework.boot:spring-boot-starter-test'
//    testCompile 'org.spockframework:spock-core:1.1-groovy-2.4'
//    testCompile 'org.spockframework:spock-spring:1.1-groovy-2.4'
//    testRuntime 'cglib:cglib-nodep:3.+'
//
//    // JavaMelody
//
//}