You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2024/12/20 14:51:19 UTC
(sling-aggregator) 01/01: Generate Module Parent Info list, Deprecated status from asf.yaml
This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch feature/module-parent-info
in repository https://gitbox.apache.org/repos/asf/sling-aggregator.git
commit ded1b09f228232b4d6d637f0722f65849515a815
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Fri Dec 20 15:51:02 2024 +0100
Generate Module Parent Info list, Deprecated status from asf.yaml
---
deprecated-projects.txt | 48 --------------------------------
generate-aggregator-table.groovy | 8 +++++-
generate-badges.groovy | 60 ++++++++++++++++++++++++++++------------
3 files changed, 49 insertions(+), 67 deletions(-)
diff --git a/deprecated-projects.txt b/deprecated-projects.txt
deleted file mode 100644
index a66862b..0000000
--- a/deprecated-projects.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-org-apache-sling-jcr-contentparser
-org-apache-sling-ide-api
-org-apache-sling-ide-api-test
-org-apache-sling-ide-artifacts
-org-apache-sling-ide-eclipse-core
-org-apache-sling-ide-eclipse-m2e-core
-org-apache-sling-ide-eclipse-m2e-test
-org-apache-sling-ide-eclipse-m2e-ui
-org-apache-sling-ide-eclipse-sightly-core
-org-apache-sling-ide-eclipse-sightly-ui
-org-apache-sling-ide-eclipse-test
-org-apache-sling-ide-eclipse-ui
-org-apache-sling-ide-feature
-org-apache-sling-ide-impl-resource
-org-apache-sling-ide-impl-resource-test
-org-apache-sling-ide-impl-vlt
-org-apache-sling-ide-impl-vlt-test
-org-apache-sling-ide-m2e-feature
-org-apache-sling-ide-p2update
-org-apache-sling-ide-sightly-feature
-org-apache-sling-ide-source-bundle
-org-apache-sling-ide-target-definition
-org-apache-sling-ide-vlt-wrapper
-org-apache-sling-mailarchive-james-wrapper
-org-apache-sling-mailarchive-server
-org-apache-sling-mailarchive-stats
-org-apache-sling-mailarchive-ui
-org-apache-sling-performance-base
-org-apache-sling-performance-jcr-resource-2-0-10
-org-apache-sling-performance-jcr-resource-2-1-0
-org-apache-sling-performance-jcr-resource-2-2-0
-org-apache-sling-performance-jcr-resource-2-2-10
-org-apache-sling-performance-tests
-org-apache-sling-sample-slingshot
-org-apache-sling-samples-custom-login-form
-org-apache-sling-samples-espblog
-org-apache-sling-samples-fling
-org-apache-sling-samples-htlblog
-org-apache-sling-samples-javashell
-org-apache-sling-samples-path-based-rtp
-org-apache-sling-samples-post-servlet-extensions
-org-apache-sling-samples-slingbucks
-org-apache-sling-samples-testing-bundle-with-it
-org-apache-sling-samples-testing-module-with-it
-org-apache-sling-scripting-sightly-models-provider
-org-apache-sling-testing-tools
-org-apache-sling-scripting-console
-test-servlet-archetype-project
diff --git a/generate-aggregator-table.groovy b/generate-aggregator-table.groovy
index c9f7303..8cf719b 100755
--- a/generate-aggregator-table.groovy
+++ b/generate-aggregator-table.groovy
@@ -61,6 +61,10 @@ println 'Overwriting module file...'
modulesFile = new File(docsDir, 'modules.md')
modulesFile.text = "[Apache Sling](https://sling.apache.org) > [Aggregator](https://github.com/apache/sling-aggregator/) > Modules\n# Modules\n\n| Module | Description | Module Status | Pull Requests |\n|--- |--- |--- |---|"
+println 'Overwriting module parent info file...'
+modulesParentInfoFile = new File(docsDir, 'modules-parent-info.md')
+modulesParentInfoFile.text = "[Apache Sling](https://sling.apache.org) > [Aggregator](https://github.com/apache/sling-aggregator/) > Modules with Parent Info\n# Modules\n\n| Module | Version | Parent | Java Version | Java CI | Flags|\n|--- |--- |--- |--- |--- |--- |"
+
println 'Loading manifest...'
manifest = new XmlParser().parseText(new File('./default.xml').text)
manifest.project.@path.each { path ->
@@ -83,7 +87,8 @@ void addRepo(File repoFolder) {
void writeProject(Map project) {
println 'Writing project...'
- String projectStr = "| [${project.name}](https://github.com/apache/sling-${project.folder}) <br/> <small>([${project.artifactId}](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.sling%22%20a%3A%22${project.artifactId}D%22))</small> | ${project.description} | ${project.badges} |  [](https://github.com/apache/sling-${project.folder}/pulls) |"
+ String projectStr = "| [${project.name}](https://github.com/apache/sling-${project.folder}) <br/> <small>([${project.artifactId}](https://central.sonatype.com/search?namespace=org.apache.sling&name=${project.artifactId}))</small> | ${project.description} | ${project.badges} |  [](https://github.com/apache/sling-${project.folder}/pulls) |"
+ String projectParentInfoStr = "| [${project.name}](https://github.com/apache/sling-${project.folder})|${project.projectVersion} | ${project.parentVersion} | ${project.javaVersion} | ${project.buildJdks} | ${project.contrib ? 'contrib' : ''} ${project.deprecated ? 'deprecated' : ''}"
if (project.group) {
println "Adding to group file ${project.group}"
@@ -118,4 +123,5 @@ void writeProject(Map project) {
statusFile << '\n' << projectStr
}
modulesFile << '\n' << projectStr
+ modulesParentInfoFile << '\n' << projectParentInfoStr
}
diff --git a/generate-badges.groovy b/generate-badges.groovy
index e4ba23f..6ba74d7 100644
--- a/generate-badges.groovy
+++ b/generate-badges.groovy
@@ -19,6 +19,8 @@
import groovy.xml.XmlParser
import groovy.util.Node
+import groovy.json.JsonSlurper
+import groovy.yaml.YamlSlurper
/* groovylint-disable JavaIoPackageAccess */
@@ -98,32 +100,54 @@ Map parseMavenPom(File projectFolder, File aggregatorDir) {
println "Fetching from ${projectFolder}..."
println 'Reading status lists...'
- String[] deprecated = new File(aggregatorDir, 'deprecated-projects.txt').text.split('\\n')
- assert deprecated
String[] contrib = new File(aggregatorDir, 'contrib-projects.txt').text.split('\\n')
assert contrib
- if (pomFile.exists()) {
- println 'Parsing pom.xml...'
- Node pom = new XmlParser().parseText(pomFile.text)
-
- Map project = [:]
- project['artifactId'] = pom.artifactId.text()
- project['name'] = pom.name.text()
- project['description'] = pom.description.text().replace('\n', ' ')
- project['group'] = getProjectGroup(repoName, aggregatorDir)
- project['folder'] = repoName
- if (contrib.contains(repoName)) {
- println 'Setting project status to contrib...'
- project['contrib'] = true
+ if (!pomFile.exists()) {
+ return null
+ }
+
+ println 'Parsing pom.xml...'
+ Node pom = new XmlParser().parseText(pomFile.text)
+
+ Map project = [:]
+ project['artifactId'] = pom.artifactId.text()
+ project['name'] = pom.name.text()
+ project['description'] = pom.description.text().replace('\n', ' ')
+ project['group'] = getProjectGroup(repoName, aggregatorDir)
+ project['folder'] = repoName
+ project['projectVersion'] = pom.version.text()
+ project['parentVersion'] = pom.parent.version.text()
+ project['javaVersion'] = pom.properties["sling.java.version"].text()
+ if (contrib.contains(repoName)) {
+ println 'Setting project status to contrib...'
+ project['contrib'] = true
+ }
+
+ // parse .sling-module.json
+ project['buildJdks'] = ''
+ File slingModuleFile = new File(projectFolder, '.sling-module.json')
+ if (slingModuleFile.exists()) {
+ def jsonParser = new JsonSlurper()
+ def slingModule = jsonParser.parse(slingModuleFile)
+ if (slingModule.jenkins.jdks) {
+ project['buildJdks'] = slingModule.jenkins.jdks
}
- if (deprecated.contains(repoName)) {
+ }
+
+ // parse .asf.yaml
+ File asfYamlFile = new File(projectFolder, '.asf.yaml')
+ if (asfYamlFile.exists()) {
+ def yamlParser = new YamlSlurper()
+ def asfYaml = yamlParser.parse(asfYamlFile)
+ def labels = asfYaml.github.labels
+ if (labels && labels.contains("deprecated")) {
println 'Setting project status to deprecated...'
project['deprecated'] = true
}
- return project
}
- return null
+
+ return project
}
boolean responseValid(String url) {