Skip to content

Commit 30694c0

Browse files
committed
Include offline docs in distribution zip
1 parent 928e597 commit 30694c0

3 files changed

Lines changed: 32 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testi
7676
## How to Obtain Runnable Tai-e?
7777

7878
The recommended way is to download the distribution ZIP from [GitHub Releases](https://github.com/pascal-lab/Tai-e/releases).
79-
The ZIP contains Tai-e, all runtime dependencies, and startup scripts for Windows, Linux, and macOS.
79+
The ZIP contains Tai-e, all runtime dependencies, offline documentation, and startup scripts for Windows, Linux, and macOS.
8080

8181
Alternatively, you might build the latest Tai-e yourself from the source code. This can be simply accomplished via Gradle (be sure that Java 17 (or higher version) is available on your system):
8282

build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,30 @@ application {
5959
applicationName = projectArtifactId
6060
}
6161

62+
val apiDocs = tasks.named("javadoc")
63+
val docsProject = project(":docs")
64+
6265
distributions {
6366
main {
6467
distributionBaseName.set(projectArtifactId)
6568
contents {
6669
from(files("COPYING", "COPYING.LESSER",
6770
"README.md", "CHANGELOG.md", "CITATION.bib"))
71+
from(apiDocs) {
72+
into("docs/api")
73+
}
74+
}
75+
}
76+
}
77+
78+
docsProject.plugins.withId("org.asciidoctor.jvm.convert") {
79+
distributions {
80+
main {
81+
contents {
82+
from(docsProject.tasks.named("asciidoctor")) {
83+
into("docs/reference")
84+
}
85+
}
6886
}
6987
}
7088
}

release-tests/src/test/java/pascal/taie/release/DistributionTests.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ CliRunner createRunner(File workingDir) throws IOException {
4343
+ "distribution ZIP");
4444
Path distributionDir = workingDir.toPath().resolve("distribution");
4545
extractZip(Path.of(distributionZipPath), distributionDir);
46+
assertDistributionFile(distributionDir, "docs/reference/en/index.html");
47+
assertDistributionFile(distributionDir, "docs/api/index.html");
4648
Path executable = findExecutable(distributionDir);
4749
if (!isWindows()) {
4850
assertTrue(executable.toFile().setExecutable(true)
@@ -73,6 +75,17 @@ private static void extractZip(Path zipPath, Path outputDir) throws IOException
7375
}
7476
}
7577

78+
private static void assertDistributionFile(
79+
Path distributionDir, String relativePath) throws IOException {
80+
Path expectedPath = Path.of(relativePath);
81+
try (var files = Files.walk(distributionDir)) {
82+
assertTrue(files
83+
.filter(Files::isRegularFile)
84+
.anyMatch(path -> path.endsWith(expectedPath)),
85+
"Distribution ZIP should contain " + relativePath);
86+
}
87+
}
88+
7689
private static Path findExecutable(Path distributionDir) throws IOException {
7790
String executableName = isWindows() ? "tai-e.bat" : "tai-e";
7891
try (var files = Files.walk(distributionDir)) {

0 commit comments

Comments
 (0)