mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-15 16:34:56 +01:00
misc: Remove the handbook from the main repository
sorry guys, i just wanted to do something cool...
This commit is contained in:
77
build.gradle
77
build.gradle
@@ -1,4 +1,3 @@
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
|
||||
/*
|
||||
@@ -311,7 +310,6 @@ javadoc {
|
||||
// Add this to avoid warning caused by lack of comments in proto generated java files
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
exclude '**/*.md'
|
||||
exclude 'src/handbook/**/*.*'
|
||||
exclude 'src/generated/**/*.*'
|
||||
}
|
||||
|
||||
@@ -332,81 +330,6 @@ public final class BuildConfig {
|
||||
}"""
|
||||
}
|
||||
|
||||
tasks.register('generateHandbook') {
|
||||
if (project.hasProperty('skipHandbook')) {
|
||||
println('Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
|
||||
// Resolve the NPM command.
|
||||
var npm = 'npm'
|
||||
if (Os.isFamily(Os.FAMILY_WINDOWS))
|
||||
npm = 'npm.cmd'
|
||||
|
||||
def npmVersion = {
|
||||
try {
|
||||
return "${npm} --version".execute()
|
||||
} catch (ignored) {
|
||||
ignored.printStackTrace()
|
||||
return 'NPM_NOT_FOUND'
|
||||
}
|
||||
}
|
||||
|
||||
// Check if Node is installed.
|
||||
if (npmVersion() == 'NPM_NOT_FOUND') {
|
||||
println('NPM is not installed. Skipping handbook generation.')
|
||||
} else {
|
||||
// Check if the handbook resources are present.
|
||||
if (!file('src/handbook/data/commands.json').exists()) {
|
||||
println('Command data was not found. Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
if (!file('src/handbook/data/avatars.csv').exists()) {
|
||||
println('Avatar data was not found. Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
if (!file('src/handbook/data/entities.csv').exists()) {
|
||||
println('Entity data was not found. Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
if (!file('src/handbook/data/items.csv').exists()) {
|
||||
println('Item data was not found. Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
if (!file('src/handbook/data/mainquests.csv').exists()) {
|
||||
println('Main quest data was not found. Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
if (!file('src/handbook/data/quests.csv').exists()) {
|
||||
println('Quest data was not found. Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
if (!file('src/handbook/data/scenes.csv').exists()) {
|
||||
println('Scene data was not found. Skipping handbook generation.')
|
||||
return
|
||||
}
|
||||
|
||||
// Install dependencies before building.
|
||||
exec {
|
||||
workingDir 'src/handbook'
|
||||
commandLine npm, 'install'
|
||||
}
|
||||
|
||||
// Build the handbook.
|
||||
exec {
|
||||
workingDir 'src/handbook'
|
||||
commandLine npm, 'run', 'build'
|
||||
}
|
||||
|
||||
// Copy the handbook from /dist to /src/main/resources.
|
||||
copy {
|
||||
from 'src/handbook/dist/index.html'
|
||||
into 'src/main/resources/html'
|
||||
rename 'index.html', 'handbook.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
dependsOn 'generateProto'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user