From 5eab04f4063e0965f6e983af9774a7b9d6330a18 Mon Sep 17 00:00:00 2001 From: Shishir Yadav Date: Wed, 29 Jan 2025 14:52:29 +0530 Subject: [PATCH] javadocjar --- build.gradle | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index c33e600..1648de3 100644 --- a/build.gradle +++ b/build.gradle @@ -24,6 +24,8 @@ repositories { java { sourceCompatibility = "17" targetCompatibility = "17" + withJavadocJar() // Enable Javadoc generation + withSourcesJar() // Enable Sources generation } // Pre-commit hook installation task @@ -108,10 +110,11 @@ tasks.openApiValidate.configure { dependsOn(validateSpec) } -// Task to generate sources JAR (this will create a sources.jar for the source code) -task sourcesJar(type: Jar) { - archiveClassifier.set('sources') - from sourceSets.main.allJava +// Configure Javadoc +javadoc { + options.addStringOption('Xdoclint:none', '-quiet') + options.addStringOption('encoding', 'UTF-8') + options.addStringOption('charSet', 'UTF-8') } // Signing keys and credentials (these can be defined in `local.properties` or via environment variables) @@ -145,9 +148,6 @@ publishing { version = project.version from components.java // Publish the compiled Java artifact - // Include the sources JAR - artifact sourcesJar - pom { name.set("Mavenpublish") description.set("Publishing Jar to remote Maven repository") @@ -200,7 +200,6 @@ publishing { } } - signing { useInMemoryPgpKeys( findProperty("SIGNING_KEY") ?: System.getenv("SIGNING_KEY"), @@ -209,8 +208,7 @@ signing { sign publishing.publications.mavenJava } - -// As of now, we have to keep following dependencies to generate builds with generated sources +// Dependencies dependencies { implementation 'com.squareup.okhttp3:okhttp:4.12.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' @@ -225,4 +223,4 @@ dependencies { testImplementation 'org.mockito:mockito-core:5.6.0' testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0' -} +} \ No newline at end of file