-
-
Notifications
You must be signed in to change notification settings - Fork 72
feat: allow for specifying ATs for upstream sources #377
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
Open
Toffikk
wants to merge
39
commits into
PaperMC:main
Choose a base branch
from
CraftCanvasMC:feat/ats-for-upstream-sources
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
3665104
feat: allow for specifying ATs for upstream sources
Toffikk 55d76c0
chore: remove unnecessary this@PatchingTasks specifier
Toffikk 3ddbc21
chore: cleanup tagging logic
Toffikk 4f1edf1
fix: provide compile classpath for JST
Toffikk 617e64b
chore: indent
Toffikk aca60da
fix: provide the classpaths of subprojects
Toffikk 6fd4a2a
fix: append the mache minecraft jar to JST's classpath
Toffikk 575a6a0
format
Toffikk 09cce04
fix(normal AT logic/paperweight issue): append compile classpath for …
Toffikk d6b74bf
Revert "fix(normal AT logic/paperweight issue): append compile classp…
Toffikk d7015e4
chore: cleanup impl
Toffikk 81c147d
fix: resolve gradle errors while running upstream setup
Toffikk a20d4ac
fix: workaround the latest review
Toffikk 9b14741
chore: format
Toffikk 209e911
Update Gradle wrapper
jpenilla be36f8d
fix(deps): update junit-framework monorepo to v6.0.3
renovate[bot] 213a301
chore(deps): update mikepenz/action-junit-report action to v6
renovate[bot] 8236b2b
fix(deps): update asm to v9.9.1
renovate[bot] d964e87
Prepare for 26.1 (#382)
jpenilla c58fb68
fix(deps): update dependency com.gradleup.shadow:com.gradleup.shadow.…
renovate[bot] 0af45d0
fix(deps): update dependency io.mockk:mockk to v1.14.9
renovate[bot] a2800e4
add back updatingMinecraft prop check for patch roulette tasks
jpenilla a243362
Initial userdev update for dev bundle v8
jpenilla f3beb76
Initial userdev update for dev bundle v8
jpenilla f64b04d
release: Version 2.0.0-beta.20
jpenilla 626c75f
2.0.0-SNAPSHOT
jpenilla 2357a1a
Add missing V7 check in SetupHandler.kt
jpenilla 13ea400
release: Version 2.0.0-beta.21
jpenilla 28cbae3
2.0.0-SNAPSHOT
jpenilla 650c8e3
Set JVM target attribute on reobf variant
jpenilla ec2dcfb
Introduce a dependency bridge plugin
Toffikk f2b5b84
Merge remote-tracking branch 'papermc/main' into feat/ats-for-upstrea…
Toffikk d8881c6
Provide a more comprehensive classpath for MC AT application to decre…
Toffikk 2a976f2
fix: dont trigger compileJava for the API subproject
Toffikk a0a6d1b
fix: don't fail on clean run
Toffikk 283ee51
actually fix
Toffikk 752b4dc
revert unnecessary changes
Toffikk 3e9d77f
final tweaks
Toffikk d4fa08c
Dirty workaround for upstream ATs
Toffikk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...weight-core/src/main/kotlin/io/papermc/paperweight/core/tasks/SetupForkUpstreamSources.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /* | ||
| * paperweight is a Gradle plugin for the PaperMC project. | ||
| * | ||
| * Copyright (c) 2023 Kyle Wood (DenWav) | ||
| * Contributors | ||
| * | ||
| * This library is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU Lesser General Public | ||
| * License as published by the Free Software Foundation; | ||
| * version 2.1 only, no later versions. | ||
| * | ||
| * This library is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * Lesser General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Lesser General Public | ||
| * License along with this library; if not, write to the Free Software | ||
| * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 | ||
| * USA | ||
| */ | ||
|
|
||
| package io.papermc.paperweight.core.tasks | ||
|
|
||
| import io.papermc.paperweight.core.util.ApplySourceATs | ||
| import io.papermc.paperweight.tasks.* | ||
| import io.papermc.paperweight.util.* | ||
| import kotlin.io.path.* | ||
| import org.eclipse.jgit.api.Git | ||
| import org.gradle.api.file.DirectoryProperty | ||
| import org.gradle.api.file.RegularFileProperty | ||
| import org.gradle.api.provider.Property | ||
| import org.gradle.api.tasks.Input | ||
| import org.gradle.api.tasks.InputDirectory | ||
| import org.gradle.api.tasks.InputFile | ||
| import org.gradle.api.tasks.Nested | ||
| import org.gradle.api.tasks.Optional | ||
| import org.gradle.api.tasks.OutputDirectory | ||
| import org.gradle.api.tasks.TaskAction | ||
| import org.gradle.kotlin.dsl.* | ||
|
|
||
| abstract class SetupForkUpstreamSources : JavaLauncherTask() { | ||
|
|
||
| @get:InputDirectory | ||
| abstract val inputDir: DirectoryProperty | ||
|
|
||
| @get:OutputDirectory | ||
| abstract val outputDir: DirectoryProperty | ||
|
|
||
| @get:Nested | ||
| val ats: ApplySourceATs = objects.newInstance() | ||
|
|
||
| @get:InputFile | ||
| @get:Optional | ||
| abstract val atFile: RegularFileProperty | ||
|
|
||
| @get:Input | ||
| abstract val identifier: Property<String> | ||
|
|
||
| @TaskAction | ||
| fun run() { | ||
| val out = outputDir.path.cleanDir() | ||
| inputDir.path.copyRecursivelyTo(out) | ||
|
|
||
| val git = Git.open(outputDir.path.toFile()) | ||
|
|
||
| if (atFile.isPresent && atFile.path.readText().isNotBlank()) { | ||
| println("Applying access transformers...") | ||
| ats.run( | ||
| launcher.get(), | ||
| inputDir.path, | ||
| outputDir.path, | ||
| atFile.path, | ||
| temporaryDir.toPath(), | ||
| ) | ||
| commitAndTag(git, "ATs", "${identifier.get()} ATs") | ||
| } | ||
| commitAndTag(git, "base") | ||
|
|
||
| git.close() | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.