Skip to content

Commit

Permalink
javadocjar
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-shishiryadav committed Jan 29, 2025
1 parent 7c5698b commit 5eab04f
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ repositories {
java {
sourceCompatibility = "17"
targetCompatibility = "17"
withJavadocJar() // Enable Javadoc generation
withSourcesJar() // Enable Sources generation
}

// Pre-commit hook installation task
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -200,7 +200,6 @@ publishing {
}
}


signing {
useInMemoryPgpKeys(
findProperty("SIGNING_KEY") ?: System.getenv("SIGNING_KEY"),
Expand All @@ -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'
Expand All @@ -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'
}
}

0 comments on commit 5eab04f

Please sign in to comment.