Browse Source

Add action and task for creating documentation.

pull/127/head
weisj 5 years ago
parent
commit
65d0bb4bb9
  1. 65
      .github/workflows/documentation.yml
  2. 10
      core/build.gradle.kts
  3. 5
      core/src/test/java/documentation/CreateUITable.java

65
.github/workflows/documentation.yml

@ -0,0 +1,65 @@
name: Documentation
on:
push:
paths:
- '**.properties'
pull_request:
paths:
- '**.properties'
jobs:
windows:
name: Windows (Java 11)
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build
run: ./gradlew :darklaf-core:makeDocumentation
- name: Upload windows documentation
uses: actions/upload-artifact@v1
with:
name: documentation_windows
path: build/documentation
macOS:
name: macOS (Java 11)
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build
run: ./gradlew makeDocumentation
- name: Upload macOS :darklaf-core:documentation
uses: actions/upload-artifact@v1
with:
name: documentation_windows
path: build/documentation
linux:
name: Linux (Java 8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Build
run: ./gradlew :darklaf-core:makeDocumentation
- name: Upload linux documentation
uses: actions/upload-artifact@v1
with:
name: documentation_windows
path: build/documentation

10
core/build.gradle.kts

@ -34,6 +34,16 @@ tasks.jar {
}
}
val makeDocumentation by tasks.registering(JavaExec::class) {
group = "Development"
description = "Builds and starts JMeter GUI"
dependsOn(tasks.testClasses)
workingDir = File(project.rootDir, "build")
main = "documentation.CreateUITable"
classpath(sourceSets.main.get().runtimeClasspath, sourceSets.test.get().runtimeClasspath)
}
tasks.shadowJar {
exclude("help/")
exclude("icons/")

5
core/src/test/java/documentation/CreateUITable.java

@ -54,7 +54,7 @@ public class CreateUITable {
private static final int SAMPLE_WIDTH = 150;
private static final int SAMPLE_HEIGHT = 25;
private static final String FOLDER = "defaults/";
private static final String FOLDER = "documentation/";
private static final String IDENT = " ";
private static String workingFolder;
@ -73,7 +73,8 @@ public class CreateUITable {
public static void createThemeDefaultsPage(final Theme theme) throws IOException {
workingFolder = FOLDER + theme.getName() + "/";
String htmlFile = workingFolder + "defaults_" + SystemInfo.OS_NAME.replaceAll(" ", "_") + ".html";
String os = SystemInfo.isMac ? "mac" : SystemInfo.isWindows ? "windows" : "linux";
String htmlFile = workingFolder + "defaults_" + os + ".html";
new File(workingFolder).mkdirs();
new File(htmlFile).createNewFile();

Loading…
Cancel
Save