From 40b31374bad5082da91c4c054c34217282d61318 Mon Sep 17 00:00:00 2001 From: aminecmi Date: Sat, 1 Oct 2022 21:17:04 +0200 Subject: [PATCH] Let's see if the build works. --- .drone.yml | 8 ++++---- .idea/dataSources.xml | 12 ++++++++++++ build.gradle.kts | 22 +++++++++++++++++++++- settings.gradle.kts | 3 +++ 4 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 .idea/dataSources.xml diff --git a/.drone.yml b/.drone.yml index 83bf350..14c52d9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,7 +31,7 @@ steps: - name: build image: gradle:jdk8 commands: - - ./gradlew assemble + - ./gradlew build - name: scpFiles image: appleboy/drone-scp settings: @@ -54,10 +54,10 @@ steps: - sudo service cv-api stop - cd /home/ubuntu/cv-api - sudo chown ubuntu:ubuntu ./* - - sudo mv -f ./cvApi-1.0-SNAPSHOT.jar /usr/local/bin/ #todo change file to variable + - sudo mv -f ./cvApi-1.0-SNAPSHOT-all.jar /usr/local/bin/ #todo change file to variable - cd /usr/local/bin/ - - sudo mv cv-api.jar cv-api.jar.back - - sudo ln -s cvApi-1.0-SNAPSHOT.jar cv-api.jar #todo change file to variable + - sudo mv -f cv-api.jar cv-api.jar.back + - sudo ln -s cvApi-1.0-SNAPSHOT-all.jar cv-api.jar #todo change file to variable - sudo service cv-api start trigger: diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..efdcd8b --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,12 @@ + + + + + sqlite.xerial + true + org.sqlite.JDBC + jdbc:sqlite:$PROJECT_DIR$/cvapi.db + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index f5a3b14..6fe0122 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,9 +1,10 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id("com.squareup.sqldelight") id("org.sonarqube") + id("com.github.johnrengelman.shadow") kotlin("jvm") version "1.7.10" } @@ -31,9 +32,28 @@ tasks.withType { kotlinOptions.jvmTarget = "1.8" } +tasks.withType { + manifest { + attributes["Main-Class"] = "ServerKt" + } +} + sqldelight { database("CVApiDB") { packageName = "fr.louveauAmine.cvApi.dao" sourceFolders = listOf("sqldelight") } +} + +tasks.withType { + mergeServiceFiles() + manifest { + attributes(mapOf("Main-Class" to "ServerKt")) + } +} + +tasks { + build { + dependsOn(shadowJar) + } } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 4c7a6f1..e12bf91 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,6 +15,9 @@ pluginManagement { if (requested.id.id == "org.sonarqube") { useModule("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513") } + if (requested.id.id == "com.github.johnrengelman.shadow") { + useModule("gradle.plugin.com.github.johnrengelman:shadow:7.1.2") + } } } }