Commit Graph

67 Commits

Author SHA1 Message Date
modmuss
4e593fc5ae Rework how unpick and linenumber maps are applied (#907)
This should hopefully vastly improve debugging, and more imporantly not work in a consistant manner, making debugging issues a lot easier.

This commit contains an intergration test that uses a real debugger to check that breakpoints are being fired as expected.
2023-06-16 21:55:04 +01:00
modmuss50
da9f601c2f Set configuration roles + cleanup setup classes. (#868) 2023-04-20 08:45:18 +01:00
modmuss50
c16303b9b2 Rewrite Minecraft Library handling. (#857)
This PR rewrites the Minecraft library processing with a more structured and testable set of "library processors". The old code is a mess of special cases and work arounds for various issues on various platforms.

Previously this was only really used on lesser used platforms/versions so wasnt a major issue if things broke, however current shipping Minecraft versions (1.19.4) use an LWJGL version that does not work well on Java versions new than 19. With this change LWJGL is upgraded when using Java 19 or later.

Upgraded libraries are also now only placed on the runtime classpath, this prevents you from using newer library features in your mod.
2023-04-17 00:07:52 +01:00
modmuss50
0c68994aa6 Fix #755 2023-01-16 18:38:16 +00:00
modmuss50
da4b01427f Move access widener jar processor for new processor API. (#787) 2023-01-10 23:19:21 +00:00
modmuss50
00a3b7ff4e Move Iface injection to new MinecraftJarProcessor API 2022-10-26 12:51:08 +01:00
modmuss50
47987b2aa3 Cleanup configuration related code by passing ConfigContext 2022-10-26 12:51:08 +01:00
modmuss50
06074ae73c Start on improved mappings service 2022-10-26 12:47:36 +01:00
modmuss50
cc43cfc1dc Major steps towards config caching support :) 2022-10-06 21:42:45 +01:00
modmuss50
24b727c84c More changes 2022-10-04 20:46:46 +01:00
modmuss50
ab4234330e First look at MinecraftJarProcessor API 2022-10-03 22:00:07 +01:00
modmuss50
e16811eb74 Fix build :) 2022-08-22 23:36:17 +01:00
modmuss50
24150283e6 Move configuration lock file out of the project dir. Hopefully fixes #703 2022-08-22 20:43:21 +01:00
modmuss50
5e4ea68b5f Try and fix crash when releasing project configuration lock. #703 2022-08-15 12:54:38 +01:00
modmuss50
e561cca19a Split mod dependencies into client/common as required. 2022-08-04 08:56:37 +01:00
modmuss50
3913c2e897 Add a lock file around building the loom cache. Regenerate if the lock file exists.
This helps to ensure that failed or canceled builds do not cause the cache to be left in an undetectable invalid state.
2022-07-30 19:21:56 +01:00
modmuss50
5f09152e9f Merge branch 'dev/0.12' into exp/0.13 2022-07-02 23:42:41 +01:00
modmuss50
97927f913a Replace getRemapArchives & getSetupRemappedVariants with a gradle property. (#678)
* Replace getRemapArchives & getSetupRemappedVariants with a gradle property as they are evaluated too early to be set.

* Use true for all projects.

* Cleanup, you can set properties for each subproject.

* Fix docs.
2022-07-01 18:13:56 +01:00
modmuss50
da2992e7d9 Configurable remap configs. (#674)
* First pass at configurable remap configs.

* No benefit to making it lazy: https://github.com/gradle/gradle/blob/v7.4.2/subprojects/plugins/src/main/java/org/gradle/api/plugins/BasePlugin.java#L104 ... fixes some stuff to make it work.
2022-06-25 21:38:43 +01:00
Jared
722a72f999 Add Jetbrains Annotations to test compile (#670) 2022-06-16 19:07:40 +01:00
modmuss50
b8687c87ce Support 1.19-pre1, natives are now all loaded via the classpath. 2022-05-18 18:27:11 +01:00
Juuxel
bab1aa8216 Expose underlying messages in RemapJarTask and Minecraft setup (#650)
Closes #649. Closes #638.
2022-05-17 21:35:38 +01:00
modmuss50
f632dee2df Mod provided javadoc (#627) 2022-04-19 23:30:28 +01:00
modmuss50
fff4afe405 Initial support for split client/common sourcesets. (#606) 2022-03-04 15:01:45 +00:00
Lovely_xianxian
46c6a2757a Add support for mixins written in groovy (#580) 2022-01-24 19:05:55 +00:00
modmuss50
9662a8b3de Support injecting interfaces from the mod source. Add a comment to target classes saying what mod is providing an injected interface. (#581) 2022-01-24 15:21:00 +00:00
modmuss50
b31ce4e525 Remove log4j from compile classpath starting with Minecraft 22w03a.
This is done to force modders to use SLF4J as Mojang have the ability to remove it at anytime. An option is provided to disable this.
2022-01-19 20:04:10 +00:00
modmuss50
e9d1f005d9 Add server only jar configuration option. (#574)
* Add server only option.

* Fix crash.

* Fix unpick jar task name.

* Revert test memory change

* Dont add client only libraries.

* Fixes

* Move option to the extension
2022-01-17 22:11:08 +00:00
modmuss50
d40241d75a Fix performance regressions in large multi-project builds. (#571)
* Perf improvements to multi-project builds.

* Fixes.

* More fixes.

* Layered mappings fixes

* Perf improvements. Undo broken fix.

* Fix remap classpath being empty.

* Another gradle bug? Either way this is fine and works.

* Fix broken test

* Final fixes?

* Fix and cleanup mixin ap mappings.
2022-01-14 19:50:45 +00:00
modmuss50
4158062ce5 Experimental support for split common and clientonly minecraft jars. (#561)
This lays the ground work for split client and server mod code. With this first phase when enabled loom will generate a clientonly and common minecraft jar. Fabric loader and API will both need changes to support this before it can be used to develop mods.

Phase two of this project will handle splitting mod code into a client and common source set along with spliting any dependencies. 

Mostly fixes #539 by sepreating decompile tasks
2022-01-04 21:19:03 +00:00
modmuss50
53b839b739 Decompiler API improvements:
* Fix decompiler tasks getting registered in afterEvaluate
* Allow decompilers to add file collections to the forked JVM classpath.
* General code cleanup.
2021-12-29 00:10:58 +00:00
modmuss50
ab21e0e550 Rewrire Jar and Source remapping tasks. (#504) 2021-12-20 16:29:11 +00:00
modmuss50
5a16440c1e Support ARM natives, rewrite native handling and misc cleanup. (#554)
* Rewrite natives handling, upgrade LWJGL on ARM machines.

* Remove old natives override hack, should now always be done via gradle.

* Use "idea" everywhere

* Add server specific libraries onto their own classpath. Includes misc code cleanup.

* Start on writing the excluded server libs.

* Gradle deprecation fixes, and misc cleanup

* Add support mod.

* Make native support mod none transitive.

* Update gradle.
2021-12-17 15:37:00 +00:00
Juuxel
9ddff5f31a Fix gradle module metadatas not including api deps in runtimeElements (#540) 2021-11-23 18:35:08 +00:00
modmuss50
35afda4398 Fix namedElements not extending from api (#533)
* Fix `namedElements` not extending from api
Fix artifact not waiting for remapAllJars with shared caches

* Use apiElements

* Add a better test for this.

* Also add remapped api mods to namedElements
2021-11-12 10:46:23 +00:00
modmuss50
ba4b9289e2 Ensure that the encoding is set to UTF-8 2021-11-10 14:23:32 +00:00
Juuxel
587db4abae Add localRuntime and modLocalRuntime configurations (#526)
Closes #481.

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2021-10-29 22:26:59 +01:00
modmuss50
e409f13b8c Add dev config with default jar task on it, to aid with depending on … (#525)
* Add dev config with default jar task on it, to aid with depending on sub projects.

* Rename to `namedElements`

* Update src/main/java/net/fabricmc/loom/configuration/CompileConfiguration.java

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
2021-10-29 13:29:29 +01:00
modmuss50
2b9907e0f0 Fix mappings not begin on test runtime classpath. 2021-10-16 22:20:27 +01:00
modmuss50
6666b95b54 Fix mod* configurations not being on the test compile/runtime configuration. Closes #488 2021-10-12 13:31:12 +01:00
modmuss50
8da2da8aed Update checkstyle to prevent using var expect for new instance creation. 2021-09-07 11:55:05 +01:00
Logic
3b0dc7f0f4 Use tiny-remapper to remap mixin annotation. (#441)
* use tiny-remapper 0.5.0

* add property of useLegacyMixinAp and rename mixin to mixinAp

* disable mixin ap if useLegacyMixinAp is false

* fix tests

* remove experimental for mixinAp

* enable mixin remapper

* revert changes on API

* rename MixinAp*** to Mixin***

* move useLegacyMixinAp inside MixinExtension

* cleaner code

* update test

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2021-09-07 11:28:51 +01:00
Juuxel
08f055489b Fix the java software component not working with Loom and fix #200 (#460)
* Add modCompileOnlyApi, modRuntimeOnly; deprecate modRuntime

* begin

* continue

* Make RemapSourcesJarTask use properties

* finish

* Remove cursed version hack 😉

* Finish for real

* Add missing header

* Clarify a comment

* Fix tests

* Use Gradle's own *Elements and remove -dev jars

* Fix maven test

* Put mappingsFinal onto runtimeClasspath instead of implementation

* Make non-mod dependencies work with the legacy pom magic too

* Be a bit more clever when removing dev artifacts
2021-09-05 16:08:16 +01:00
modmuss50
2b5d3d4a3a Revert: "Always fork the java compiler" Fixes #453
This reverts 0cfa88f73b as it causes OOM issues when building fabric api.
2021-07-28 18:19:56 +01:00
shedaniel
75234f4cbd Use Property in LoomGradleExtension & Move task groups to constants (#445)
* Use Property in LoomGradleExtension

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Fix customMinecraftManifest

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Add deprecation messages, let's wait for the tests to run to fix the tests that are using deprecated apis

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Apply license

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Update src/main/java/net/fabricmc/loom/util/DeprecationHelper.java

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

* Fix some tests, move mixinRefmapName -> mixin.defaultRefmapName

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Move back to the api

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Fix some tests

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Apply reviews

Signed-off-by: shedaniel <daniel@shedaniel.me>

* Update src/main/java/net/fabricmc/loom/api/LoomGradleExtensionAPI.java

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
Co-authored-by: modmuss50 <modmuss50@gmail.com>
2021-07-26 20:08:03 +01:00
LogicFan
81fa551382 Better Mixin AP configuration (#423)
* [SPON-15] Apply Mixin AP config for all projects.

* Revert "[SPON-15] Apply Mixin AP config for all projects."

This reverts commit 93576e83b1221949d551b6307938f7dd6dc8fbbe.

* use setter & getter

* fix broken test introduced in 54d6ef7896

* initial commit for mixin extension

* refactor getConfiguration

* apply mixin extension

* [SPON-15] allow across project AP config

* [SPON-15] revert some changes

* [SPON-15] refactor codes

* [SPON-15] fix bugs

* [SPON-15] bring back cross-project apconfig

* [SPON-15] bug fix: move add default sourceSet earlier

* [SPON-15] fix style

* [SPON-15] refactor MixinAPExtension

* add test

* update test

* [SPON-15] fix test

* Update MixinAnnotationProcessorExtension.java

* [SPON-15] fix test

* fix deprecated gradle API

* [SPON-15] refactor ApInvoker

* [SPON-15] refactor ApInvoker

* allow change refmap name in sourceSet bases

* add new condition on test

* [SPON-15] fix wrong suffix

* Revert "[SPON-15] fix wrong suffix"

This reverts commit 98910392d91c26cd0454cca8cfc03c4e3d417fd6.

* fix mixinjson suffix

* use stream instead of collection for mixin json name

* change name for function

* use correct auto-refmap

* fix file name

* add with action

* add test

* refactor some codes

* refactor code

* update test

* fix checkstyle

* better error message

* fix checkstyle

* remove corss project option

* allow mixin inside loom

* remove project0

I should remove all project0. If I forget one please tell me.

* move `mixin` inside `loom`

* fix spotless

* merge attempt

* fix checkstyle

* seperate api & impl

* add experimental annotation for API

* use API

* Fix indentation

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

* fix typo

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

* fix typo

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>

* better javadoc

Co-authored-by: Juuxel <6596629+Juuxel@users.noreply.github.com>
2021-07-18 14:13:47 +01:00
modmuss50
e439a1b354 Refactor LoomGradleExtension (#431)
* First pass at refactoring the extension

* Fix inital issues.

* Combine some interfaces

* Checkstyle

* Fix years

* Add isShareCaches to api
2021-07-14 00:03:21 +01:00
modmuss50
2259a4efc8 Add versions used to compile/build against to jar manifest (#428)
* Add versions used to compile/build against to jar manifest

* checkstyle

* Move to post remap

* Fix build

* Add mc version and mixin group

* Typo

* Make test run across versions better.
2021-07-13 23:10:07 +01:00
modmuss50
54fe0909ff Use spotless for header validation, years have been back-filled from git history 2021-07-10 21:50:53 +01:00
modmuss50
1f9f48052b Basic layered mappings with @ParchmentMC support (#413) 2021-06-14 18:39:03 +01:00