Add code generation to the GitHub workflow
This commit is contained in:
parent
cea8837521
commit
61878a39b6
2 changed files with 11 additions and 10 deletions
10
.github/workflows/build_and_test.yml
vendored
10
.github/workflows/build_and_test.yml
vendored
|
@ -14,17 +14,27 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK 1.8
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
java-version: 1.8
|
||||||
|
|
||||||
- name: Cache Gradle packages
|
- name: Cache Gradle packages
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/caches
|
path: ~/.gradle/caches
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
||||||
restore-keys: ${{ runner.os }}-gradle
|
restore-keys: ${{ runner.os }}-gradle
|
||||||
|
|
||||||
|
- name: Download Minecraft data
|
||||||
|
run: ./gradlew downloadMinecraftData
|
||||||
|
|
||||||
|
- name: Run code generation
|
||||||
|
run: ./gradlew generateAPIFiles
|
||||||
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
|
|
||||||
- name: Test with Gradle
|
- name: Test with Gradle
|
||||||
run: ./gradlew test
|
run: ./gradlew test
|
||||||
|
|
|
@ -5,7 +5,7 @@ import org.gradle.api.Project
|
||||||
|
|
||||||
class MinecraftDataSourcesPlugin : Plugin<Project> {
|
class MinecraftDataSourcesPlugin : Plugin<Project> {
|
||||||
override fun apply(project: Project) {
|
override fun apply(project: Project) {
|
||||||
val downloadTask = project.task("download") {
|
val downloadTask = project.task("downloadMinecraftData") {
|
||||||
it.group = TASK_GROUP
|
it.group = TASK_GROUP
|
||||||
|
|
||||||
it.doLast {
|
it.doLast {
|
||||||
|
@ -31,15 +31,6 @@ class MinecraftDataSourcesPlugin : Plugin<Project> {
|
||||||
).generate()
|
).generate()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
project.task("generateServerFiles") {
|
|
||||||
it.group = TASK_GROUP
|
|
||||||
it.dependsOn(downloadTask)
|
|
||||||
|
|
||||||
it.doLast {
|
|
||||||
println("generateAPIFiles")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Reference in a new issue