From 6c656ef81214f591e80da1c5a9d44cb57c90ab5f Mon Sep 17 00:00:00 2001 From: dilhasha Date: Thu, 28 Aug 2025 14:33:17 +0530 Subject: [PATCH] Update gradle tasks --- ballerina/build.gradle | 5 +++++ native/build.gradle | 32 ++++++++++++++------------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 6d139d5..d3696e8 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -55,6 +55,11 @@ clean { delete "${project.projectDir}/target" delete "${project.projectDir}/Ballerina.lock" delete "${project.projectDir}/ballerina-internal.log" + delete "${project.projectDir}/build" + doLast { + // Force cleanup with retry + ant.delete(dir: 'ballerina/build', failonerror: false, includeemptydirs: true) + } } task copyExternalJarsToLib(type: Copy) { diff --git a/native/build.gradle b/native/build.gradle index 2829e90..a78fb2f 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -15,16 +15,12 @@ */ plugins { - id 'java' - id 'checkstyle' + id 'java-library' } description = 'Ballerina - Moesif Extension - Native Module' dependencies { - checkstyle project(':build-config:checkstyle') - checkstyle "com.puppycrawl.tools:checkstyle:${checkstylePluginVersion}" - implementation "org.ballerinalang:ballerina-runtime:${ballerinaLangVersion}" implementation "io.opentelemetry:opentelemetry-context:${openTelemetryVersion}" implementation "io.opentelemetry:opentelemetry-sdk-trace:${openTelemetrySDKVersion}" @@ -36,26 +32,14 @@ dependencies { implementation "com.squareup.okhttp3:okhttp:4.12.0" implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.9.23' implementation "com.squareup.okio:okio:3.9.0" - implementation "io.opentelemetry:opentelemetry-exporter-otlp-common:${openTelemetryExporterVersion}" + testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2' testImplementation 'org.mockito:mockito-core:5.1.1' testImplementation 'org.mockito:mockito-junit-jupiter:5.1.1' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' } -checkstyle { - toolVersion '7.8.2' - configFile rootProject.file("build-config/checkstyle/build/checkstyle.xml") -} - -def excludePattern = '**/module-info.java' -tasks.withType(Checkstyle) { - exclude excludePattern -} - -checkstyleMain.dependsOn(":build-config:checkstyle:downloadCheckstyleRuleFiles") - compileJava { doFirst { options.compilerArgs = [ @@ -65,6 +49,18 @@ compileJava { } } +compileTestJava { + // Don't use module path for test compilation + options.compilerArgs = [] +} + +test { + useJUnitPlatform() + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + } +} + jar { manifest { attributes('Implementation-Title': project.name, 'Implementation-Version': project.version)