Skip to content

Commit 358fcb2

Browse files
feat(build): add/apply autodoc plugin (#2028)
* feat(build): add/apply autodoc plugin * add autodoc.md
1 parent 4c891ce commit 358fcb2

File tree

3 files changed

+42
-9
lines changed

3 files changed

+42
-9
lines changed

build.gradle.kts

+30-7
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,32 @@ val edcScmUrl: String by project
5555
val groupId: String by project
5656
val defaultVersion: String by project
5757
val metaModelVersion: String by project
58+
val annotationProcessorVersion: String by project
59+
// where our SNAPSHOT versions are published to and resolved from
60+
val snapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
61+
// where our release versions are published to (staging)
62+
val releaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
5863

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

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

67+
val projectVersion: String = (project.findProperty("edcVersion") ?: defaultVersion) as String
68+
var deployUrl = releaseUrl
6469
if (projectVersion.contains("SNAPSHOT")) {
65-
deployUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
70+
deployUrl = snapshotUrl
6671
}
6772

6873
subprojects {
6974

7075
repositories {
7176
maven {
72-
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
77+
url = uri(snapshotUrl)
7378
}
7479
mavenCentral()
7580
maven {
7681
url = uri("https://maven.iais.fraunhofer.de/artifactory/eis-ids-public/")
7782
}
83+
mavenLocal()
7884
}
7985
tasks.register<DependencyReportTask>("allDependencies") {}
8086

@@ -117,20 +123,37 @@ subprojects {
117123
}
118124

119125
buildscript {
126+
repositories {
127+
maven {
128+
// can't use the snapshotUrl variable here, because buildscript has a different scope
129+
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
130+
}
131+
mavenLocal()
132+
}
120133
dependencies {
121134
val swagger: String by project
135+
val autodocPluginVersion: String by project
136+
122137
classpath("io.swagger.core.v3:swagger-gradle-plugin:${swagger}")
138+
classpath("org.eclipse.dataspaceconnector.autodoc:org.eclipse.dataspaceconnector.autodoc.gradle.plugin:${autodocPluginVersion}")
123139
}
124140
}
125141

126142
allprojects {
127143
repositories {
128-
mavenLocal()
144+
maven {
145+
url = uri(snapshotUrl)
146+
}
129147
}
130148
apply(plugin = "maven-publish")
131149
apply(plugin = "checkstyle")
132150
apply(plugin = "java")
151+
apply(plugin = "${groupId}.autodoc")
133152

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

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

@@ -371,7 +394,7 @@ nexusPublishing {
371394
repositories {
372395
sonatype {
373396
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
374-
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
397+
snapshotRepositoryUrl.set(uri(snapshotUrl))
375398
username.set(System.getenv("OSSRH_USER") ?: return@sonatype)
376399
password.set(System.getenv("OSSRH_PASSWORD") ?: return@sonatype)
377400
}

docs/developer/autodoc.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# The `autodoc` Gradle plugin
2+
3+
Please find the comprehensive documentation about the `autodoc` plugin in
4+
the [Github Repo](https://github.com/eclipse-dataspaceconnector/GradlePlugins/blob/main/docs/developer/autodoc.md) of
5+
the plugin.
6+
7+
In EDC, the plugin is intended to be used to generate metamodel manifests for every Gradle module, which then
8+
transformed into Markdown files, subsequently rendered for publication in static web content.

gradle.properties

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
groupId=org.eclipse.dataspaceconnector
22
defaultVersion=0.0.1-SNAPSHOT
33
javaVersion=11
4-
54
edcDeveloperId=mspiekermann
65
edcDeveloperName=Markus Spiekermann
76
edcDeveloperEmail=[email protected]
87
edcScmConnection=scm:git:[email protected]:eclipse-dataspaceconnector/DataSpaceConnector.git
98
edcWebsiteUrl=https://github.com/eclipse-dataspaceconnector/DataSpaceConnector.git
109
edcScmUrl=https://github.com/eclipse-dataspaceconnector/DataSpaceConnector.git
11-
10+
# for now, we're using the same version for the autodoc plugin, the processor and the runtime-metamodel lib, but that could
11+
# change in the future
1212
metaModelVersion=0.0.1-SNAPSHOT
13+
autodocPluginVersion=0.0.1-SNAPSHOT
14+
annotationProcessorVersion=0.0.1-SNAPSHOT
1315
apacheCommonsPool2Version=2.11.1
1416
assertj=3.22.0
1517
atomikosVersion=5.0.8

0 commit comments

Comments
 (0)