Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(build): add/apply autodoc plugin #2028

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,32 @@ val edcScmUrl: String by project
val groupId: String by project
val defaultVersion: String by project
val metaModelVersion: String by project
val annotationProcessorVersion: String by project
// where our SNAPSHOT versions are published to and resolved from
val snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
// where our release versions are published to (staging)
val releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"

// required by the nexus publishing plugin
val projectVersion: String = (project.findProperty("edcVersion") ?: defaultVersion) as String

var deployUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
// required by the nexus publishing plugin

val projectVersion: String = (project.findProperty("edcVersion") ?: defaultVersion) as String
var deployUrl = releaseUrl
if (projectVersion.contains("SNAPSHOT")) {
deployUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
deployUrl = snapshotUrl
}

subprojects {

repositories {
maven {
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
url = uri(snapshotUrl)
}
mavenCentral()
maven {
url = uri("https://maven.iais.fraunhofer.de/artifactory/eis-ids-public/")
}
mavenLocal()
}
tasks.register<DependencyReportTask>("allDependencies") {}

Expand Down Expand Up @@ -117,20 +123,37 @@ subprojects {
}

buildscript {
repositories {
maven {
// can't use the snapshotUrl variable here, because buildscript has a different scope
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
mavenLocal()
}
dependencies {
val swagger: String by project
val autodocPluginVersion: String by project

classpath("io.swagger.core.v3:swagger-gradle-plugin:${swagger}")
classpath("org.eclipse.dataspaceconnector.autodoc:org.eclipse.dataspaceconnector.autodoc.gradle.plugin:${autodocPluginVersion}")
}
}

allprojects {
repositories {
mavenLocal()
maven {
url = uri(snapshotUrl)
}
}
apply(plugin = "maven-publish")
apply(plugin = "checkstyle")
apply(plugin = "java")
apply(plugin = "${groupId}.autodoc")

// configure which version of the annotation processor to use. defaults to the same version as the plugin
configure<org.eclipse.dataspaceconnector.plugins.autodoc.AutodocExtension> {
processorVersion.set(annotationProcessorVersion)
}

apply(plugin = "org.eclipse.dataspaceconnector.test-summary")

Expand Down Expand Up @@ -371,7 +394,7 @@ nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
snapshotRepositoryUrl.set(uri(snapshotUrl))
username.set(System.getenv("OSSRH_USER") ?: return@sonatype)
password.set(System.getenv("OSSRH_PASSWORD") ?: return@sonatype)
}
Expand Down
8 changes: 8 additions & 0 deletions docs/developer/autodoc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The `autodoc` Gradle plugin

Please find the comprehensive documentation about the `autodoc` plugin in
the [Github Repo](https://github.com/eclipse-dataspaceconnector/GradlePlugins/blob/main/docs/developer/autodoc.md) of
the plugin.

In EDC, the plugin is intended to be used to generate metamodel manifests for every Gradle module, which then
transformed into Markdown files, subsequently rendered for publication in static web content.
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
groupId=org.eclipse.dataspaceconnector
defaultVersion=0.0.1-SNAPSHOT
javaVersion=11

edcDeveloperId=mspiekermann
edcDeveloperName=Markus Spiekermann
[email protected]
edcScmConnection=scm:git:[email protected]:eclipse-dataspaceconnector/DataSpaceConnector.git
edcWebsiteUrl=https://github.com/eclipse-dataspaceconnector/DataSpaceConnector.git
edcScmUrl=https://github.com/eclipse-dataspaceconnector/DataSpaceConnector.git

# for now, we're using the same version for the autodoc plugin, the processor and the runtime-metamodel lib, but that could
# change in the future
metaModelVersion=0.0.1-SNAPSHOT
autodocPluginVersion=0.0.1-SNAPSHOT
annotationProcessorVersion=0.0.1-SNAPSHOT
apacheCommonsPool2Version=2.11.1
assertj=3.22.0
atomikosVersion=5.0.8
Expand Down