Skip to content

Commit 5464210

Browse files
committed
Simplify README and adopt mise
1 parent cd5099e commit 5464210

5 files changed

Lines changed: 23 additions & 73 deletions

File tree

Lines changed: 7 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import java.time.LocalDate;
1414
import java.time.OffsetDateTime;
1515
import java.time.ZoneOffset;
16-
import java.time.format.DateTimeFormatter;
1716
import java.util.ArrayList;
1817
import java.util.Arrays;
1918
import java.util.Comparator;
@@ -46,7 +45,6 @@ final class GenerateReadme {
4645
private static final Comparator<String> TEXT_ORDER =
4746
Comparator.comparing((String value) -> value.toLowerCase(Locale.ROOT))
4847
.thenComparing(Comparator.naturalOrder());
49-
private static final DateTimeFormatter DISPLAY_DATE = DateTimeFormatter.ofPattern("dd/MM/uuuu");
5048

5149
public static void main(String[] args) throws Exception {
5250
if (args.length == 0) {
@@ -74,10 +72,10 @@ public static void main(String[] args) throws Exception {
7472
private static void usage() {
7573
System.err.println("""
7674
Usage:
77-
java scripts/GenerateReadme.java check [source]
78-
java scripts/GenerateReadme.java check-added <base-source> [source]
79-
java scripts/GenerateReadme.java self-test
80-
java scripts/GenerateReadme.java generate [source] [output] [cache] [--refresh-all] [--branch name]
75+
java .github/scripts/GenerateReadme.java check [source]
76+
java .github/scripts/GenerateReadme.java check-added <base-source> [source]
77+
java .github/scripts/GenerateReadme.java self-test
78+
java .github/scripts/GenerateReadme.java generate [source] [output] [cache] [--refresh-all] [--branch name]
8179
""");
8280
}
8381

@@ -108,7 +106,7 @@ private static void generate(String[] args) throws Exception {
108106
var outputPath = Path.of(args.length > 2 ? args[2] : "README.md");
109107
var cachePath = Path.of(args.length > 3 ? args[3] : ".cache/github-stats.tsv");
110108
var refreshAll = false;
111-
var branch = System.getenv().getOrDefault("GITHUB_REF_NAME", "master");
109+
var branch = System.getenv().getOrDefault("GITHUB_REF_NAME", "main");
112110

113111
for (var i = 4; i < args.length; i++) {
114112
switch (args[i]) {
@@ -522,27 +520,18 @@ private static void writeCache(Path path, StatsCache cache) throws IOException {
522520

523521
private static String render(Catalog source, StatsCache cache, LocalDate today, String branch) {
524522
var out = new StringBuilder();
525-
out.append("<!-- Generated from README_SOURCE.md by scripts/GenerateReadme.java. ")
523+
out.append("<!-- Generated from README_SOURCE.md by .github/scripts/GenerateReadme.java. ")
526524
.append("Do not edit README.md directly. -->\n\n")
527525
.append(source.title()).append("\n\n")
528526
.append(source.tagline()).append("\n\n")
529527
.append("<sub>").append(projectCount(source)).append(" projects · ")
530528
.append(source.categories().size()).append(" categories · ")
531-
.append(resourceCount(source)).append(" resources · ")
532-
.append(DISPLAY_DATE.format(cache.refreshed())).append("</sub>\n\n")
529+
.append(resourceCount(source)).append(" resources</sub>\n\n")
533530
.append("<sub>Activity: 🟢 pushed within 3 months · 🟠 pushed 3–12 months ago · ")
534531
.append("🔴 no push for over 12 months</sub>\n\n")
535532
.append("<sub>License chips use GitHub SPDX metadata when available.</sub>\n\n")
536533
.append("<sub>Entries spanning several repositories combine their stars, use the most recent push for activity ")
537534
.append("and show a license only when all repositories agree.</sub>\n\n")
538-
.append("Browse a category below, or use your browser's find command to locate a project.\n\n")
539-
.append("<details>\n")
540-
.append("<summary><strong>Browse</strong></summary>\n\n")
541-
.append("**Projects:** ");
542-
appendNavigation(out, source.categories().stream().map(category -> category.name).sorted(TEXT_ORDER).toList());
543-
out.append("\n\n**Resources:** ");
544-
appendNavigation(out, source.resources().stream().map(resource -> resource.name).toList());
545-
out.append("\n\n</details>\n\n")
546535
.append("## Projects\n\n");
547536

548537
source.categories().stream()
@@ -567,16 +556,6 @@ private static String render(Catalog source, StatsCache cache, LocalDate today,
567556
return out.toString();
568557
}
569558

570-
private static void appendNavigation(StringBuilder out, List<String> names) {
571-
for (var i = 0; i < names.size(); i++) {
572-
if (i > 0) {
573-
out.append(" · ");
574-
}
575-
var name = names.get(i);
576-
out.append('[').append(name).append("](#").append(slug(name)).append(')');
577-
}
578-
}
579-
580559
private static void renderCategory(
581560
StringBuilder out,
582561
Category category,
@@ -701,9 +680,6 @@ private static void validateRendered(
701680
0, "Generated README contains the retired commercial badge");
702681
require(!rendered.matches("(?s).*<kbd>\\d{2}/\\d{2}/\\d{4}</kbd>.*"), 0,
703682
"Generated README contains a per-project date");
704-
require(countOccurrences(rendered, "](#") == source.categories().size() + source.resources().size(),
705-
0, "Generated README contains an incomplete navigation index");
706-
707683
for (var item : source.projects()) {
708684
require(rendered.contains("**[" + item.name() + "](" + item.url() + ")**"), item.lineNumber(),
709685
"Generated README is missing project: " + item.name());
@@ -850,14 +826,6 @@ private static String normalizeUrl(String url) {
850826
return url.toLowerCase(Locale.ROOT).replaceAll("/+$", "");
851827
}
852828

853-
private static int countOccurrences(String value, String needle) {
854-
var count = 0;
855-
for (var index = value.indexOf(needle); index >= 0; index = value.indexOf(needle, index + 1)) {
856-
count++;
857-
}
858-
return count;
859-
}
860-
861829
private static String knownLicense(String license) {
862830
return license == null || license.isBlank()
863831
|| license.equals("NOASSERTION") || license.equals("OTHER")
@@ -995,8 +963,6 @@ private static void selfTest() throws Exception {
995963
today,
996964
"test"
997965
);
998-
require(rendered.contains("[Test](#test)") && rendered.contains("[Links](#links)"),
999-
0, "Navigation rendering");
1000966
require(rendered.contains("Suggest a project or resource"), 0, "Contribution CTA");
1001967
require(rendered.contains("CC BY-SA 4.0") && rendered.contains("[MIT](LICENSE-CODE)"),
1002968
0, "License footer");

.github/workflows/update-readme.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ on:
1010
- "CONTRIBUTING.md"
1111
- ".github/pull_request_template.md"
1212
- ".github/workflows/update-readme.yml"
13-
- ".tool-versions"
14-
- "scripts/**"
13+
- "mise.toml"
14+
- ".github/scripts/**"
1515
push:
1616
branches:
1717
- main
1818
- test
1919
paths:
2020
- "README_SOURCE.md"
2121
- ".github/workflows/update-readme.yml"
22-
- ".tool-versions"
23-
- "scripts/**"
22+
- "mise.toml"
23+
- ".github/scripts/**"
2424
schedule:
2525
- cron: "0 0 * * 1"
2626
workflow_dispatch:
@@ -49,14 +49,11 @@ jobs:
4949
echo "::error file=README.md::README.md is generated. Edit README_SOURCE.md instead."
5050
exit 1
5151
fi
52-
- uses: actions/setup-java@v5
53-
with:
54-
distribution: temurin
55-
java-version-file: ".tool-versions"
52+
- uses: jdx/mise-action@v3
5653
- name: Validate source and generator
5754
run: |
58-
java scripts/GenerateReadme.java self-test
59-
java scripts/GenerateReadme.java check README_SOURCE.md
55+
java .github/scripts/GenerateReadme.java self-test
56+
java .github/scripts/GenerateReadme.java check README_SOURCE.md
6057
- name: Validate added GitHub repositories
6158
env:
6259
BASE_SHA: ${{ github.event.pull_request.base.sha }}
@@ -65,7 +62,7 @@ jobs:
6562
base_source="$RUNNER_TEMP/README_SOURCE.base.md"
6663
if git cat-file -e "${BASE_SHA}:README_SOURCE.md"; then
6764
git show "${BASE_SHA}:README_SOURCE.md" > "$base_source"
68-
java scripts/GenerateReadme.java check-added "$base_source" README_SOURCE.md
65+
java .github/scripts/GenerateReadme.java check-added "$base_source" README_SOURCE.md
6966
else
7067
echo "::notice::Base branch has no README_SOURCE.md; skipping added repository validation."
7168
fi
@@ -79,10 +76,7 @@ jobs:
7976
- uses: actions/checkout@v6
8077
with:
8178
fetch-depth: 0
82-
- uses: actions/setup-java@v5
83-
with:
84-
distribution: temurin
85-
java-version-file: ".tool-versions"
79+
- uses: jdx/mise-action@v3
8680
- name: Restore statistics cache
8781
uses: actions/cache@v5
8882
with:
@@ -92,8 +86,8 @@ jobs:
9286
readme-stats-v3-${{ github.ref_name }}-
9387
- name: Validate source and generator
9488
run: |
95-
java scripts/GenerateReadme.java self-test
96-
java scripts/GenerateReadme.java check README_SOURCE.md
89+
java .github/scripts/GenerateReadme.java self-test
90+
java .github/scripts/GenerateReadme.java check README_SOURCE.md
9791
- name: Generate README
9892
env:
9993
GITHUB_TOKEN: ${{ github.token }}
@@ -102,7 +96,7 @@ jobs:
10296
if [ "${{ github.event_name }}" = "schedule" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
10397
args+=(--refresh-all)
10498
fi
105-
java scripts/GenerateReadme.java generate README_SOURCE.md README.md .cache/github-stats.tsv "${args[@]}" --branch "$GITHUB_REF_NAME"
99+
java .github/scripts/GenerateReadme.java generate README_SOURCE.md README.md .cache/github-stats.tsv "${args[@]}" --branch "$GITHUB_REF_NAME"
106100
- name: Commit README
107101
run: |
108102
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"

.tool-versions

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,17 @@
1-
<!-- Generated from README_SOURCE.md by scripts/GenerateReadme.java. Do not edit README.md directly. -->
1+
<!-- Generated from README_SOURCE.md by .github/scripts/GenerateReadme.java. Do not edit README.md directly. -->
22

33
# Awesome Java [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)
44

55
A curated list of noteworthy Java frameworks, libraries, tools and resources.
66

7-
<sub>812 projects · 75 categories · 80 resources · 27/07/2026</sub>
7+
<sub>812 projects · 75 categories · 80 resources</sub>
88

99
<sub>Activity: 🟢 pushed within 3 months · 🟠 pushed 3–12 months ago · 🔴 no push for over 12 months</sub>
1010

1111
<sub>License chips use GitHub SPDX metadata when available.</sub>
1212

1313
<sub>Entries spanning several repositories combine their stars, use the most recent push for activity and show a license only when all repositories agree.</sub>
1414

15-
Browse a category below, or use your browser's find command to locate a project.
16-
17-
<details>
18-
<summary><strong>Browse</strong></summary>
19-
20-
**Projects:** [Architecture](#architecture) · [Artificial Intelligence](#artificial-intelligence) · [Bean Mapping](#bean-mapping) · [Build](#build) · [Bytecode Manipulation](#bytecode-manipulation) · [Caching](#caching) · [CLI](#cli) · [Cloud](#cloud) · [Code Analysis](#code-analysis) · [Code Coverage](#code-coverage) · [Code Formatting](#code-formatting) · [Code Generators](#code-generators) · [Compiler-compiler](#compiler-compiler) · [Computer Vision](#computer-vision) · [Configuration](#configuration) · [Constraint Satisfaction Problem Solver](#constraint-satisfaction-problem-solver) · [CSV](#csv) · [Data Structures](#data-structures) · [Database](#database) · [Date and Time](#date-and-time) · [Decentralization](#decentralization) · [Decompilation](#decompilation) · [Dependency Injection](#dependency-injection) · [Development](#development) · [Distributed Applications](#distributed-applications) · [Distributed Transactions](#distributed-transactions) · [Distribution](#distribution) · [Document Processing](#document-processing) · [Financial](#financial) · [Flat File](#flat-file) · [Formal Verification](#formal-verification) · [Functional Programming](#functional-programming) · [Game Development](#game-development) · [Geospatial](#geospatial) · [GUI](#gui) · [High Performance](#high-performance) · [HTTP Clients](#http-clients) · [Hypermedia Types](#hypermedia-types) · [IDE](#ide) · [Imagery](#imagery) · [Introspection](#introspection) · [Job Scheduling](#job-scheduling) · [JSON](#json) · [JVM and JDK](#jvm-and-jdk) · [Logging](#logging) · [Machine Learning](#machine-learning) · [Messaging](#messaging) · [Microservice](#microservice) · [Miscellaneous](#miscellaneous) · [Mobile Development](#mobile-development) · [Monitoring](#monitoring) · [Native](#native) · [Natural Language Processing](#natural-language-processing) · [Networking](#networking) · [ORM](#orm) · [PaaS](#paas) · [Pathfinding](#pathfinding) · [PDF](#pdf) · [Performance analysis](#performance-analysis) · [Platform](#platform) · [Processes](#processes) · [Reactive libraries](#reactive-libraries) · [REST Frameworks](#rest-frameworks) · [Science](#science) · [Search](#search) · [Security](#security) · [Serialization](#serialization) · [Server](#server) · [Template Engine](#template-engine) · [Testing](#testing) · [Utility](#utility) · [Version Managers](#version-managers) · [Web Crawling](#web-crawling) · [Web Frameworks](#web-frameworks) · [Workflow Orchestration Engines](#workflow-orchestration-engines)
21-
22-
**Resources:** [Related Awesome Lists](#related-awesome-lists) · [Communities](#communities) · [Frontends](#frontends) · [Influential Books](#influential-books) · [Podcasts and Screencasts](#podcasts-and-screencasts) · [People](#people) · [Websites](#websites)
23-
24-
</details>
25-
2615
## Projects
2716

2817
<details id="architecture">

mise.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tools]
2+
java = "temurin"

0 commit comments

Comments
 (0)