From b04e04689186771181d542f99923557cb55070cc Mon Sep 17 00:00:00 2001 From: stella-03 Date: Sat, 26 Apr 2025 15:34:40 +0800 Subject: [PATCH 1/2] Updated build.gradle with JaCoCo and project info --- .DS_Store | Bin 0 -> 6148 bytes build.gradle | 23 +++++++++++++++++++++++ src/.DS_Store | Bin 0 -> 6148 bytes 3 files changed, 23 insertions(+) create mode 100644 .DS_Store create mode 100644 src/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..22793a3d5a041cf1015fcb66bef146ee148ee44d GIT binary patch literal 6148 zcmeHKzfTlF7=7by@I*;27R170{sJPMg~dvahL*&Fg6Q26Fy7u0?yzMk?q7fgdlM5Y z3rY$?XzXnLCu~WG@0*$1n_=%XCWII=Uo!JH-;a6UzPp{-1)x^;vt^(KpvfVa%yXJz z5|>f42hQ`HsLUE&6zF4!cX(gRj*h56RN#M8K%U(NEFr@dKEi)~`}FMfwwKqtMZRm> zPJaD4J1^SpPOs=Nt9kzQ=*`8?i`Rdv$o{cncgOEYb9p4}f15kbFzEK+YRQlJz2%pm z#=TXwc`@l^T0G!Ad?CCK$Gq6VJ~{zA9yRJ2eh=A?N}n6+_?^to3i?4R{m8xK{1y9Q zCyi4-=J)XV$+544srA{X#Y0{>H!w%__qgY0=wU15{_^T(+~+@CtN4R8{2pfIgngVz z9}RrKOANve=C3CapL=6eal1O7wH^)mwB;M{zPkb6)9>F5pNaT8E=JC4nT9L3K#j4`I= Wf|xoiEz(1aF9Jq}I7J2SRDs_S_UxJf literal 0 HcmV?d00001 diff --git a/build.gradle b/build.gradle index b52d8e185..bf15feb7f 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,7 @@ plugins { id 'org.cyclonedx.bom' version '1.10.0' id 'io.spring.javaformat' version '0.0.43' id "io.spring.nohttp" version "0.0.11" + id 'jacoco' } apply plugin: 'java' @@ -25,6 +26,18 @@ repositories { mavenCentral() } + +jacoco { + toolVersion = "0.8.11" // The Latest version +} + +jacocoTestReport { + dependsOn test // Ensures tests run before generating reports + reports { + xml.required = true // Required for CI tools (e.g., SonarQube) + html.required = true // Human-readable HTML report + } +} ext.checkstyleVersion = "10.20.1" ext.springJavaformatCheckstyleVersion = "0.0.43" ext.webjarsLocatorLiteVersion = "1.0.1" @@ -88,3 +101,13 @@ checkFormatAotTest.enabled = false formatAot.enabled = false formatAotTest.enabled = false + +// Custom Build task +task printBuildInfo { + doLast { + println "Hi,we edit here!!" + println "Project: ${project.name}" + println "Version: ${version}" + println "Java Version: ${java.sourceCompatibility}" // Uses sourceCompatibility instead of toolchain + } +} \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..2f258b4dd44e300e377be6f83912ee8b4056fb2f GIT binary patch literal 6148 zcmeHKJ5B>Z47HOK;U@)&f(p$QQqV8aa)L+{RFEtXM3#*p6m)w9DjGNdr=ZI%kT?ew z&*Nb~+C-uOA!JLQH#@e+vu~nxOhi1mOZr4TBI-f~TWc7Wh}cCN(h4h^K=ylF(JjsC zo~Crx@V14&$bj74I*n<98yi#Q{-ziG;W$fYdg%7eD!(*~5*fcB8u*_b|yOV3)IoQE3yOx)e zEuS~os(C*ip3A(2z0AAJUdzkxlGnr-Fb0f)pJD(tTco?8XrnP;3>X6i1M+=vP{Al* zuIN7<7<>x=>|ogo=F&?@j0+eA%oSmQu!aIPltYWb8jf`r{Gx!lqJ|TP=7U3K4jl^n z?AYIVcj8FVMq|Jjs58*k$DY*x!`1zNJ;*dGB;gAK;OuQKon5a)0b literal 0 HcmV?d00001 From 06427a5bc982f4911086417e51a5ce41e202d480 Mon Sep 17 00:00:00 2001 From: Lanaetan Date: Sun, 27 Apr 2025 00:14:18 +0800 Subject: [PATCH 2/2] Add Vagrantfile --- Vagrantfile | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..330b32b94 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,48 @@ +Vagrant.configure("2") do |config| + # Use the ubuntu/bionic64 box + config.vm.box = "ubuntu/bionic64" + config.vm.boot_timeout = 600000 + + # Configuring VirtualBox provider settings + config.vm.provider "virtualbox" do |vb| + vb.name = "MyVB" + vb.cpus = 2 + vb.memory = "2048" + end + + # Configuring VirtualBox network settings + config.vm.network "forwarded_port", guest: 8080, host: 8086 +~ + # Configuring VirtualBox folder settings + config.vm.synced_folder ".", "/home/vagrant/petclinic" + + # Provisioning with a shell script to run the JAR file + config.vm.provision "shell", inline: <<-SHELL + apt update + apt install -y openjdk-17-jdk git unzip + + APP_DIR="/home/vagrant/petclinic" + REPO_URL="https://github.com/yiting68/spring-petclinic.git" + JAR_NAME="spring-petclinic-3.4.0.jar" + SERVICE_NAME="petclinic"~~ + + # Clone Spring PetClinic project if does not exist + if [ ! -d "$APP_DIR/.git" ]; then + git clone "$REPO_URL" "$APP_DIR" + # Pull latest changes if project already exists + else + cd "$APP_DIR" + git pull + fi + + # Navigate to the project directory + cd "$APP_DIR" + + # Build the JAR file + ./gradlew build + + # Run the JAR file + nohup java -jar build/libs/$JAR_NAME > $APP_DIR/app.log 2>&1 & + + SHELL +end \ No newline at end of file