Skip to content
Snippets Groups Projects
build.gradle 1.92 KiB
Newer Older
plugins {
    id 'java'
    id 'io.quarkus'
    id("de.undercouch.download") version "5.4.0"
}

repositories {
    mavenCentral()
    mavenLocal()
}

dependencies {
    implementation 'io.quarkus:quarkus-container-image-docker'
    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
    implementation 'io.quarkiverse.mybatis:quarkus-mybatis:1.0.7'
    implementation 'io.quarkus:quarkus-grpc'
    implementation 'io.quarkus:quarkus-hibernate-orm'
    implementation 'io.quarkus:quarkus-flyway'
    implementation 'io.quarkiverse.mybatis:quarkus-mybatis-plus:1.0.7'
    implementation 'io.quarkus:quarkus-jdbc-postgresql'
    implementation 'io.quarkus:quarkus-arc'
    implementation 'io.quarkus:quarkus-resteasy-reactive'
    testImplementation 'io.quarkus:quarkus-junit5'
}

group 'cz.mendelu'
version '1.0.0-SNAPSHOT'

java {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

test {
    systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager"
}

compileJava {
    options.encoding = 'UTF-8'
    options.compilerArgs << '-parameters'
}

compileTestJava {
    options.encoding = 'UTF-8'
}

// read-only token
def protoRepositoryToken = 'XXXXXX'
def protoRepositoryTag = '1.0.5'
def protoRepositoryUrl = "https://gitlab.com/api/v4/projects/45963671/packages/generic/proto/" + protoRepositoryTag + "/proto.zip"
def protoZipFileDest = new File(buildDir, "myprotos/proto.zip")
def protoDir = "src/main/proto"

def allowedProtoFiles = ['hello.proto']

task deleteProtoDir(type: Delete) {
    delete protoDir
}

task pullProtoFiles(type: Download) {
    dependsOn deleteProtoDir

    src protoRepositoryUrl
    dest protoZipFileDest
    header 'PRIVATE-TOKEN', protoRepositoryToken

    doLast {
        copy {
            from zipTree(protoZipFileDest)
            into protoDir
            include allowedProtoFiles
        }
    }
}