Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Softspoon #231

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
0f2bab7
paperweight v2
MiniDigger Oct 27, 2024
673ce7b
tests
MiniDigger Oct 27, 2024
8620635
Fixes
jpenilla Dec 6, 2024
392668c
run spotless
jpenilla Dec 6, 2024
edacf05
Fix slf4j issue
jpenilla Dec 6, 2024
9d336e1
Remove redundant repository injection
jpenilla Dec 6, 2024
2a33517
add paper repo to functional test project
jpenilla Dec 6, 2024
9a0c0f2
align some file locations with conventions
jpenilla Dec 6, 2024
b4750b2
Start bringing back reobf mappings gen & packaging
jpenilla Dec 7, 2024
64589ec
Use spigot recompiles if present
jpenilla Dec 7, 2024
80d00b0
cleanup relocations
MiniDigger Dec 7, 2024
27246cd
spotless
MiniDigger Dec 7, 2024
e890332
dont break nbt files
MiniDigger Dec 7, 2024
ad77945
fix compile
MiniDigger Dec 7, 2024
331988f
make sure comment is actually accurate
MiniDigger Dec 7, 2024
23970f9
Fix decompile not using java toolchain
jpenilla Dec 7, 2024
e03710c
Don't shade restamp
jpenilla Dec 7, 2024
a38e7aa
Revert "Don't shade restamp"
jpenilla Dec 7, 2024
362bdd6
Resolve restamp at runtime and run it using isolated workers
jpenilla Dec 8, 2024
eead554
Start ripping out legacy code
jpenilla Dec 8, 2024
61eab47
Remove more legacy code
jpenilla Dec 8, 2024
f361b18
Use java toolchain to run codebook
jpenilla Dec 8, 2024
88bd533
More cleanup, update source generator helper
jpenilla Dec 8, 2024
28d3d9d
Update functional test
jpenilla Dec 8, 2024
e194702
Update gradle, use attributes to declare java/gradle compatibility, o…
jpenilla Dec 8, 2024
b23d0bd
Initial work on updating userdev
jpenilla Dec 8, 2024
9be31dd
Move userdev setup execution to task execution time
jpenilla Dec 9, 2024
6ceb7e8
Fix rebuildPatches and work on config caching compat
jpenilla Dec 9, 2024
e556389
Override snappy temp dir
jpenilla Dec 9, 2024
cc0127a
don't copy nbt files to resources
MiniDigger Dec 9, 2024
7014ccc
Revert "don't copy nbt files to resources"
MiniDigger Dec 9, 2024
8ff2d5c
use the right ignorePrefix to ignore the nbt files
MiniDigger Dec 9, 2024
89c113a
Update testing mache
jpenilla Dec 9, 2024
243ab68
Populate mache config at execution time when config cache is reused
jpenilla Dec 11, 2024
a7f1809
allow having a not existing feature patches folder
MiniDigger Dec 13, 2024
f5702e0
Adjust CollectATsFromPatches optional inputs
jpenilla Dec 13, 2024
9848675
Make patches optional for ApplyFilePatches
jpenilla Dec 13, 2024
dce2d7e
Disable patcher build for now
jpenilla Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ ij_kotlin_field_annotation_wrap = split_into_lines
ij_kotlin_finally_on_new_line = false
ij_kotlin_if_rparen_on_new_line = true
ij_kotlin_import_nested_classes = false

[*.patch]
trim_trailing_whitespace=false
4 changes: 2 additions & 2 deletions .github/workflows/deploy-snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Deploy Snapshot
on:
push:
branches: [ 'main' ]
branches: [ 'main', 'softspoon-v2' ]
paths-ignore:
- 'license/*'
- 'readme.md'
Expand Down Expand Up @@ -29,7 +29,7 @@ jobs:
echo version=$project_version >> $GITHUB_OUTPUT
- name: Deploy snapshot version
if: endsWith(steps.get_version.outputs.version, '-SNAPSHOT')
run: ./gradlew -Dorg.gradle.parallel=true publish --no-daemon --stacktrace
run: ./gradlew -Dorg.gradle.parallel=true publish --no-daemon --stacktrace -Dorg.gradle.internal.http.socketTimeout=90000 -Dorg.gradle.internal.http.connectionTimeout=90000
env:
ORG_GRADLE_PROJECT_paperUsername: ${{ secrets.DEPLOY_USER }}
ORG_GRADLE_PROJECT_paperPassword: ${{ secrets.DEPLOY_PASS }}
12 changes: 11 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew build --no-daemon --stacktrace
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
./gradlew build --no-daemon --stacktrace
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
detailed_summary: true
annotate_notice: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ ehthumbs_vista.db

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.ja

# todo remove again
/test/
/testfork/
49 changes: 39 additions & 10 deletions buildSrc/src/main/kotlin/config-kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import net.kyori.indra.licenser.spotless.IndraSpotlessLicenserExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
idea
Expand All @@ -11,20 +14,16 @@ java {
}

tasks.withType(JavaCompile::class).configureEach {
options.release = 11
options.release = 17
}

kotlin {
jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
}
target {
compilations.configureEach {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs = listOf("-Xjvm-default=all", "-Xjdk-release=11")
}
}
compilerOptions {
jvmTarget = JvmTarget.JVM_17
freeCompilerArgs = listOf("-Xjvm-default=all", "-Xjdk-release=17", "-opt-in=kotlin.io.path.ExperimentalPathApi")
}
}

Expand All @@ -38,6 +37,28 @@ repositories {
mavenContent {
includeGroup("codechicken")
includeGroup("net.fabricmc")
includeGroupAndSubgroups("io.papermc")
}
}
maven("https://maven.parchmentmc.org") {
name = "ParchmentMC"
mavenContent {
releasesOnly()
includeGroupAndSubgroups("org.parchmentmc")
}
}
maven("https://maven.neoforged.net/releases") {
name = "NeoForged"
mavenContent {
releasesOnly()
includeGroupAndSubgroups("net.neoforged")
}
}
maven("https://maven.fabricmc.net") {
name = "FabricMC"
mavenContent {
releasesOnly()
includeGroupAndSubgroups("net.fabricmc")
}
}
mavenCentral()
Expand All @@ -46,7 +67,6 @@ repositories {

dependencies {
compileOnly(gradleApi())
compileOnly(kotlin("stdlib-jdk8"))
}

testing {
Expand All @@ -55,6 +75,16 @@ testing {
useKotlinTest(embeddedKotlinVersion)
dependencies {
implementation("org.junit.jupiter:junit-jupiter-engine:5.10.1")
implementation("org.junit.platform:junit-platform-launcher:1.10.1")
}

targets.configureEach {
testTask {
testLogging {
events(TestLogEvent.FAILED)
exceptionFormat = TestExceptionFormat.FULL
}
}
}
}
}
Expand All @@ -65,7 +95,6 @@ configurations.all {
return@all
}
dependencies.remove(project.dependencies.gradleApi())
dependencies.removeIf { it.group == "org.jetbrains.kotlin" }
}

tasks.jar {
Expand Down
43 changes: 29 additions & 14 deletions buildSrc/src/main/kotlin/config-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ configurations.implementation {
extendsFrom(shade)
}

configurations.shadowRuntimeElements {
compatibilityAttributes(objects)
}

fun ShadowJar.configureStandard() {
configurations = listOf(shade)

dependencies {
exclude(dependency("org.jetbrains.kotlin:.*:.*"))
exclude(dependency("org.slf4j:.*:.*"))
}

exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "OSGI-INF/**", "*.profile", "module-info.class", "ant_tasks/**")
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "OSGI-INF/**", "*.profile", "module-info.class", "ant_tasks/**", "OSGI-OPT/**", "META-INF/*.pro")

mergeServiceFiles()
}
Expand Down Expand Up @@ -66,26 +71,36 @@ val shadowJar by tasks.existing(ShadowJar::class) {

val prefix = "paper.libs"
listOf(
"codechicken.diffpatch",
/* -> */ "codechicken.repack",
"com.github.salomonbrys.kotson",
"com.google.errorprone.annotations",
"com.google.gson",
"dev.denwav.hypo",
/* -> */ "org.jgrapht",
/* -> */ "org.jheaps",
/* -> */ "com.google.errorprone.annotations",
/* -> */ "org.objectweb.asm",
"io.sigpipe.jbsdiff",
"me.jamiemansfield",
/* -> */ "org.tukaani.xz",
"net.fabricmc",
"org.apache.commons",
"org.apache.felix",
"org.apache.http",
/* -> */ "org.apache.commons",
"org.cadixdev",
"org.eclipse",
"org.jgrapht",
"org.jheaps",
"org.objectweb.asm",
"org.osgi",
"org.tukaani.xz",
"org.slf4j",
"codechicken.diffpatch",
"codechicken.repack"
/* -> */ "me.jamiemansfield",
"org.parchmentmc.feather",
/* -> */ "com.google.common",
/* ----> */ "com.google.j2objc",
/* ----> */ "com.google.thirdparty",
/* ----> */ "org.checkerframework",
/* ----> */ "javax.annotation",
"org.eclipse.jgit",
/* -> */ "com.googlecode.javaewah",
/* -> */ "com.googlecode.javaewah32",
"kotlinx.coroutines",
//"org.slf4j",
// used by multiple
"org.intellij.lang",
"org.jetbrains.annotations"
).forEach { pack ->
relocate(pack, "$prefix.$pack")
}
Expand Down
12 changes: 12 additions & 0 deletions buildSrc/src/main/kotlin/utils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import org.gradle.api.artifacts.Configuration
import org.gradle.api.attributes.java.TargetJvmVersion
import org.gradle.api.attributes.plugin.GradlePluginApiVersion
import org.gradle.api.model.ObjectFactory
import org.gradle.kotlin.dsl.*

fun Configuration.compatibilityAttributes(objects: ObjectFactory) {
attributes {
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 17)
attribute(GradlePluginApiVersion.GRADLE_PLUGIN_API_VERSION_ATTRIBUTE, objects.named("8.11.1"))
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = io.papermc.paperweight
version = 1.7.8-SNAPSHOT
version = 2.0.0-SNAPSHOT

org.gradle.caching = true
org.gradle.parallel = true
26 changes: 20 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,60 @@
[versions]
asm = "9.7"
asm = "9.7.1"
lorenz = "0.5.8"
hypo = "1.2.4"
serialize = "1.5.1"
feather = "1.1.0"
restamp = "1.1.0"

[libraries]
asm-core = { module = "org.ow2.asm:asm", version.ref = "asm" }
asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" }

httpclient = "org.apache.httpcomponents:httpclient:4.5.14"
kotson = "com.github.salomonbrys.kotson:kotson:2.5.0"
coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2"
jgit = "org.eclipse.jgit:org.eclipse.jgit:6.6.0.202305301015-r"
gson = "com.google.code.gson:gson:2.10.1"

cadix-lorenz-core = { module = "org.cadixdev:lorenz", version.ref = "lorenz" }
cadix-lorenz-asm = { module = "org.cadixdev:lorenz-asm", version.ref = "lorenz" }
cadix-lorenz-proguard = { module = "org.cadixdev:lorenz-io-proguard", version.ref = "lorenz" }
cadix-atlas = "org.cadixdev:atlas:0.2.1"
cadix-at = "org.cadixdev:at:0.1.0-rc1"
cadix-mercury = "org.cadixdev:mercury:0.1.2-paperweight-SNAPSHOT"

hypo-model = { module = "dev.denwav.hypo:hypo-model", version.ref = "hypo" }
hypo-core = { module = "dev.denwav.hypo:hypo-core", version.ref = "hypo" }
hypo-hydrate = { module = "dev.denwav.hypo:hypo-hydrate", version.ref = "hypo" }
hypo-asm-core = { module = "dev.denwav.hypo:hypo-asm", version.ref = "hypo" }
hypo-asm-hydrate = { module = "dev.denwav.hypo:hypo-asm-hydrate", version.ref = "hypo" }
hypo-mappings = { module = "dev.denwav.hypo:hypo-mappings", version.ref = "hypo" }
slf4j-jdk14 = "org.slf4j:slf4j-jdk14:1.7.32"

lorenzTiny = "net.fabricmc:lorenz-tiny:3.0.0"
jbsdiff = "io.sigpipe:jbsdiff:1.0"

diffpatch = "codechicken:DiffPatch:1.5.0.29"
feather-core = { module = "org.parchmentmc:feather", version.ref = "feather" }
feather-gson = { module = "org.parchmentmc.feather:io-gson", version.ref = "feather" }

diffpatch = "codechicken:DiffPatch:1.5.0.30"

serialize-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialize" }
serialize-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialize" }

restamp = {module = "io.papermc.restamp:restamp", version.ref = "restamp" }

# test
mockk = "io.mockk:mockk:1.13.8"

# Gradle
gradle-licenser = "net.kyori:indra-licenser-spotless:3.1.3"
gradle-spotless = "com.diffplug.spotless:spotless-plugin-gradle:6.23.1"
gradle-shadow = "com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:8.1.1"
gradle-kotlin-dsl = "org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:4.3.0"
gradle-kotlin-dsl = "org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:5.1.1"
gradle-plugin-kotlin = { module = "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin" }
gradle-plugin-publish = "com.gradle.publish:plugin-publish-plugin:1.2.1"

[bundles]
asm = ["asm-core", "asm-tree"]
cadix = ["cadix-lorenz-core", "cadix-lorenz-asm", "cadix-lorenz-proguard", "cadix-atlas", "cadix-at", "cadix-mercury"]
cadix = ["cadix-lorenz-core", "cadix-lorenz-asm", "cadix-lorenz-proguard", "cadix-atlas", "cadix-at"]
hypo = ["hypo-model", "hypo-core", "hypo-hydrate", "hypo-asm-core", "hypo-asm-hydrate", "hypo-mappings"]
kotson = ["kotson", "gson"]
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Loading
Loading