Fix readme generator (multiplatform / jvm) (#188)
Links for jvm orx'es were broken. Fixed. Also orx'es are now shown in two lists: multiplatform and jvm.
This commit is contained in:
31
build.gradle
31
build.gradle
@@ -181,14 +181,6 @@ task buildMainReadme {
|
|||||||
for (line in header) {
|
for (line in header) {
|
||||||
newReadme.add(line)
|
newReadme.add(line)
|
||||||
}
|
}
|
||||||
newReadme.add("| name" +
|
|
||||||
" " +
|
|
||||||
" " +
|
|
||||||
" " +
|
|
||||||
" " +
|
|
||||||
" " +
|
|
||||||
" " + " | description |")
|
|
||||||
newReadme.add("| --- | --- |")
|
|
||||||
|
|
||||||
// Search for the description at the top of the readme.
|
// Search for the description at the top of the readme.
|
||||||
// Skip the hash character from the headline, then start
|
// Skip the hash character from the headline, then start
|
||||||
@@ -197,6 +189,9 @@ task buildMainReadme {
|
|||||||
def descriptionRx = ~/(?s)\#.*?\n(.+?)\n\r?\n/
|
def descriptionRx = ~/(?s)\#.*?\n(.+?)\n\r?\n/
|
||||||
// Note: the readme needs an empty line after the description
|
// Note: the readme needs an empty line after the description
|
||||||
|
|
||||||
|
def orxMultiplatform = []
|
||||||
|
def orxJVMOnly = []
|
||||||
|
|
||||||
// Build orx list
|
// Build orx list
|
||||||
for (sub in subProjects) {
|
for (sub in subProjects) {
|
||||||
def orxReadmeFile = sub.file("README.md")
|
def orxReadmeFile = sub.file("README.md")
|
||||||
@@ -206,8 +201,14 @@ task buildMainReadme {
|
|||||||
description ->
|
description ->
|
||||||
def trimmedDescription = description[1].trim() //.strip() supports unicode, java11 only
|
def trimmedDescription = description[1].trim() //.strip() supports unicode, java11 only
|
||||||
.replace("\n", " ").replace("\r", "")
|
.replace("\n", " ").replace("\r", "")
|
||||||
newReadme.add("| [`${sub.name}`](${sub.name}/) " +
|
def path = sub.path.substring(1).replace(":", "/")
|
||||||
"| $trimmedDescription |")
|
if (path.startsWith("orx-jvm")) {
|
||||||
|
orxJVMOnly.add("| [`${sub.name}`]($path/) " +
|
||||||
|
"| $trimmedDescription |")
|
||||||
|
} else {
|
||||||
|
orxMultiplatform.add("| [`${sub.name}`]($path/) " +
|
||||||
|
"| $trimmedDescription |")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -215,6 +216,16 @@ task buildMainReadme {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newReadme.add("\n## Multiplatform\n")
|
||||||
|
newReadme.add("| name" + " " * 36 + " | description |")
|
||||||
|
newReadme.add("| --- | --- |")
|
||||||
|
newReadme.addAll(orxMultiplatform)
|
||||||
|
|
||||||
|
newReadme.add("\n## JVM only\n")
|
||||||
|
newReadme.add("| name" + " " * 36 + " | description |")
|
||||||
|
newReadme.add("| --- | --- |")
|
||||||
|
newReadme.addAll(orxJVMOnly)
|
||||||
|
|
||||||
for (line in footer) {
|
for (line in footer) {
|
||||||
newReadme.add(line)
|
newReadme.add(line)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user