Update toolchain and fix minor javadoc problems (#2563)

* Update toolchain and fix minor javadoc problems

Fixes #2518 and resolves gradle warnings

Signed-off-by: liach <liach@users.noreply.github.com>

* update java version in comment as well

* remove obsolete comment (didn't forsee mojang would go java 16)

Signed-off-by: liach <liach@users.noreply.github.com>

* beautify this as well

* at least javadoc won't stall for 10 minutes now

still after 5 minutes of building there is a daemon with 4G ram usage

Signed-off-by: liach <liach@users.noreply.github.com>

* Use more friendly format to set properties

Signed-off-by: liach <liach@users.noreply.github.com>

Co-authored-by: liach <liach@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
liach 2021-07-10 06:28:14 -05:00 committed by GitHub
parent 3e0278676c
commit d88f9e4804
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 42 deletions

View File

@ -12,18 +12,17 @@ buildscript {
classpath "net.fabricmc:stitch:${project.stitch_version}" classpath "net.fabricmc:stitch:${project.stitch_version}"
classpath "commons-io:commons-io:2.8.0" classpath "commons-io:commons-io:2.8.0"
classpath 'de.undercouch:gradle-download-task:4.1.1' classpath 'de.undercouch:gradle-download-task:4.1.1'
classpath 'net.fabricmc:tiny-remapper:0.3.2' classpath 'net.fabricmc:tiny-remapper:0.4.2'
classpath "net.fabricmc.unpick:unpick:${project.unpick_version}" classpath "net.fabricmc.unpick:unpick:${project.unpick_version}"
classpath "net.fabricmc.unpick:unpick-format-utils:${project.unpick_version}" classpath "net.fabricmc.unpick:unpick-format-utils:${project.unpick_version}"
} }
} }
plugins { plugins {
id 'java' // for constants, packages, javadoc
id 'de.undercouch.download' version '4.1.1' id 'de.undercouch.download' version '4.1.1'
id 'base'
id 'maven-publish' id 'maven-publish'
id 'java' // for jd gen id 'org.cadixdev.licenser' version '0.6.1'
id 'org.cadixdev.licenser' version '0.5.1'
id 'net.fabricmc.filament' version '0.3.0' id 'net.fabricmc.filament' version '0.3.0'
} }
@ -145,11 +144,11 @@ task downloadVersionsManifest {
group = setupGroup group = setupGroup
//inputs.property "mc_ver", minecraft_version //inputs.property "mc_ver", minecraft_version
inputs.property "currenttime", new Date() inputs.property "currenttime", new Date()
def manifestFile = new File(cacheFilesMinecraft, "version_manifest.json") def manifestFile = new File(cacheFilesMinecraft, "version_manifest_v2.json")
outputs.file(manifestFile) outputs.file(manifestFile)
doLast { doLast {
logger.lifecycle(":downloading minecraft versions manifest") logger.lifecycle(":downloading minecraft versions manifest")
FileUtils.copyURLToFile(new URL("https://launchermeta.mojang.com/mc/game/version_manifest.json"), manifestFile) FileUtils.copyURLToFile(new URL("https://launchermeta.mojang.com/mc/game/version_manifest_v2.json"), manifestFile)
} }
} }
@ -232,15 +231,20 @@ task downloadIntermediaryV2(type: Download) {
def url = "https://maven.fabricmc.net/net/fabricmc/intermediary/${minecraft_version}/intermediary-${minecraft_version}-v2.jar" def url = "https://maven.fabricmc.net/net/fabricmc/intermediary/${minecraft_version}/intermediary-${minecraft_version}-v2.jar"
src com.google.common.net.UrlEscapers.urlFragmentEscaper().escape(url) src com.google.common.net.UrlEscapers.urlFragmentEscaper().escape(url)
dest new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.jar") dest new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.jar")
}
task extractIntermediaryV2(dependsOn: downloadIntermediaryV2, type: Copy) {
def output = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.tiny") def output = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.tiny")
from({ zipTree(downloadIntermediaryV2.dest) }) { outputs.file output
include 'mappings/mappings.tiny'
rename 'mappings.tiny', "../${output.name}" doLast {
copy {
from({ zipTree(downloadIntermediaryV2.dest) }) {
from 'mappings/mappings.tiny'
rename 'mappings.tiny', "../${output.name}"
}
into output.parentFile
}
} }
into output.parentFile
} }
task mergeJars(dependsOn: downloadMcJars) { task mergeJars(dependsOn: downloadMcJars) {
@ -322,7 +326,7 @@ task invertIntermediary(dependsOn: downloadIntermediary, type: FileOutput) {
} }
} }
task invertIntermediaryv2(dependsOn: extractIntermediaryV2, type: FileOutput) { task invertIntermediaryv2(dependsOn: downloadIntermediaryV2, type: FileOutput) {
group = buildMappingGroup group = buildMappingGroup
def v2Input = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.tiny") def v2Input = new File(cacheFilesMinecraft, "${minecraft_version}-intermediary-v2.tiny")
@ -655,7 +659,7 @@ task unpickIntermediaryJar(type: JavaExec, dependsOn: [mapIntermediaryJar, "cons
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
group "unpick" group "unpick"
main "daomephsta.unpick.cli.Main" mainClass = "daomephsta.unpick.cli.Main"
systemProperty "java.util.logging.config.file", file('unpick-logging.properties') systemProperty "java.util.logging.config.file", file('unpick-logging.properties')
classpath configurations.unpick classpath configurations.unpick
@ -670,14 +674,12 @@ task unpickIntermediaryJar(type: JavaExec, dependsOn: [mapIntermediaryJar, "cons
// Setup the build for the unpicked constants // Setup the build for the unpicked constants
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_16
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
if (JavaVersion.current().isJava9Compatible()) { it.options.release = 16
it.options.release = 8
}
} }
sourceSets { sourceSets {
@ -687,7 +689,6 @@ sourceSets {
license { license {
header file("HEADER") header file("HEADER")
sourceSets = [sourceSets.constants, sourceSets.packageDocs]
include '**/*.java' include '**/*.java'
} }
@ -701,13 +702,7 @@ task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.constants.allSource from sourceSets.constants.allSource
} }
compilePackageDocsJava {
it.options.encoding = "UTF-8"
it.options.release = 16
}
// Only build jars for package infos if we need to actually expose stuff like annotation in the future. // Only build jars for package infos if we need to actually expose stuff like annotation in the future.
// Also need to downgrade java in that case!
build.dependsOn constantsJar build.dependsOn constantsJar
@ -805,7 +800,7 @@ task genFakeSource(type: JavaExec, dependsOn: ["mergeV2", "mapNamedJar"]) {
group = "javadoc generation" group = "javadoc generation"
outputs.upToDateWhen { false } outputs.upToDateWhen { false }
main "net.fabricmc.mappingpoet.Main" mainClass = "net.fabricmc.mappingpoet.Main"
classpath configurations.mappingPoet classpath configurations.mappingPoet
// use merged v2 so we have all namespaces in jd // use merged v2 so we have all namespaces in jd
args mergeV2.output.getAbsolutePath(), namedJar.getAbsolutePath(), fakeSourceDir.getAbsolutePath(), libraries.getAbsolutePath() args mergeV2.output.getAbsolutePath(), namedJar.getAbsolutePath(), fakeSourceDir.getAbsolutePath(), libraries.getAbsolutePath()
@ -816,15 +811,13 @@ task genFakeSource(type: JavaExec, dependsOn: ["mergeV2", "mapNamedJar"]) {
} }
task decompileCFR(type: JavaExec, dependsOn: [mapNamedJar]) { task decompileCFR(type: JavaExec, dependsOn: [mapNamedJar]) {
doFirst { mainClass = "org.benf.cfr.reader.Main"
classpath = configurations.decompileClasspath
}
main = "org.benf.cfr.reader.Main"
args namedJar.getAbsolutePath(), "--outputdir", file("namedSrc").absolutePath args namedJar.getAbsolutePath(), "--outputdir", file("namedSrc").absolutePath
doFirst { doFirst {
file("namedSrc").deleteDir() file("namedSrc").deleteDir()
classpath = configurations.decompileClasspath
} }
} }
@ -844,6 +837,7 @@ javadoc {
def mappingPoetJar = project.provider { zipTree configurations.mappingPoetJar.singleFile } def mappingPoetJar = project.provider { zipTree configurations.mappingPoetJar.singleFile }
failOnError = false failOnError = false
maxMemory = '2G'
// verbose = true // enable to debug // verbose = true // enable to debug
options { options {
@ -879,9 +873,8 @@ javadoc {
'https://commons.apache.org/proper/commons-compress/javadocs/api-1.8.1/', 'https://commons.apache.org/proper/commons-compress/javadocs/api-1.8.1/',
"https://maven.fabricmc.net/docs/fabric-loader-${project.fabric_loader_version}/", "https://maven.fabricmc.net/docs/fabric-loader-${project.fabric_loader_version}/",
"https://docs.oracle.com/en/java/javase/16/docs/api/" "https://docs.oracle.com/en/java/javase/16/docs/api/"
// Need to add loader jd publication for env annotations!
) )
// https://docs.oracle.com/en/java/javase/15/docs/specs/man/javadoc.html#additional-options-provided-by-the-standard-doclet // https://docs.oracle.com/en/java/javase/16/docs/specs/man/javadoc.html#additional-options-provided-by-the-standard-doclet
addBooleanOption 'Xdoclint:html', true addBooleanOption 'Xdoclint:html', true
addBooleanOption 'Xdoclint:syntax', true addBooleanOption 'Xdoclint:syntax', true
addBooleanOption 'Xdoclint:reference', true addBooleanOption 'Xdoclint:reference', true
@ -890,8 +883,8 @@ javadoc {
source fileTree(fakeSourceDir) + sourceSets.constants.allJava + sourceSets.packageDocs.allJava source fileTree(fakeSourceDir) + sourceSets.constants.allJava + sourceSets.packageDocs.allJava
classpath = configurations.javadocClasspath.plus downloadMcLibs.outputs.files.asFileTree classpath = configurations.javadocClasspath.plus downloadMcLibs.outputs.files.asFileTree
finalizedBy { doLast {
task copyCopyOnClickScript(type: Copy) { project.copy {
from mappingPoetJar from mappingPoetJar
include "copy_on_click.js" include "copy_on_click.js"
into javadoc.outputDirectory into javadoc.outputDirectory
@ -902,7 +895,7 @@ javadoc {
// lazy setting // lazy setting
options { options {
tagletPath configurations.mappingPoet.files.toList() tagletPath configurations.mappingPoet.files.toList()
header mappingPoetJar.get().filter { it.name == 'javadoc_header.txt' }.singleFile.readLines()[0] // cannot include line breaks header mappingPoetJar.get().filter { it.name == 'javadoc_header.txt' }.singleFile.text.trim() // cannot include line breaks
addFileOption "-add-stylesheet", mappingPoetJar.get().filter { it.name == 'forms.css' }.singleFile addFileOption "-add-stylesheet", mappingPoetJar.get().filter { it.name == 'forms.css' }.singleFile
} }
} }

View File

@ -1,12 +1,12 @@
# Done to increase the memory available to gradle. # Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx4G org.gradle.jvmargs=-Xmx1G
enigma_version=1.3.4 enigma_version=1.3.4
stitch_version=0.6.1 stitch_version=0.6.1
unpick_version=2.2.0 unpick_version=2.2.0
cfr_version=0.0.3 cfr_version=0.0.6
# Javadoc generation/linking # Javadoc generation/linking
fabric_loader_version=0.11.3 fabric_loader_version=0.11.6
jetbrains_annotations_version=21.0.1 jetbrains_annotations_version=21.0.1
mappingpoet_version=0.2.8 mappingpoet_version=0.2.8

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -3,7 +3,7 @@ CLASS net/minecraft/class_4148 net/minecraft/entity/ai/brain/sensor/Sensor
COMMENT replaces that of individual tasks, so that it is more efficient than the goal COMMENT replaces that of individual tasks, so that it is more efficient than the goal
COMMENT system. COMMENT system.
COMMENT COMMENT
COMMENT @see Brain#sensors COMMENT @see net.minecraft.entity.ai.brain.Brain#sensors
FIELD field_18463 lastSenseTime J FIELD field_18463 lastSenseTime J
FIELD field_18464 senseInterval I FIELD field_18464 senseInterval I
FIELD field_19294 RANDOM Ljava/util/Random; FIELD field_19294 RANDOM Ljava/util/Random;

View File

@ -53,7 +53,7 @@ CLASS net/minecraft/class_2158 net/minecraft/server/function/CommandFunction
CLASS class_2162 FunctionElement CLASS class_2162 FunctionElement
COMMENT A synthetic element to be stored in a {@link CommandFunctionManager.Entry}. COMMENT A synthetic element to be stored in a {@link CommandFunctionManager.Entry}.
COMMENT This is not present as parts of command functions, but created by {@link COMMENT This is not present as parts of command functions, but created by {@link
COMMENT CommandFunctionManager.Execution#recursiveRun}. COMMENT net.minecraft.server.function.CommandFunctionManager.Execution#recursiveRun}.
FIELD field_9812 function Lnet/minecraft/class_2158$class_2159; FIELD field_9812 function Lnet/minecraft/class_2158$class_2159;
METHOD <init> (Lnet/minecraft/class_2158;)V METHOD <init> (Lnet/minecraft/class_2158;)V
ARG 1 function ARG 1 function