Commit Graph

42 Commits

Author SHA1 Message Date
Luke Bemish
0dc2d67317 Add extension option to configure known INVOKEDYNAMIC BSMs (#945)
* Set up configuration for known indy bsms

* Make ignoredIndyBsms apply to service remapper

* Add groovy indy instruction to default known BSMs

* Address feedback

---------

Co-authored-by: modmuss <modmuss50@gmail.com>
2023-09-09 13:21:14 +01:00
modmuss50
da4b01427f Move access widener jar processor for new processor API. (#787) 2023-01-10 23:19:21 +00:00
modmuss50
39be6fa6e0 Merge remote-tracking branch 'origin/dev/1.0' into exp/1.1
# Conflicts:
#	src/main/java/net/fabricmc/loom/build/mixin/AnnotationProcessorInvoker.java
#	src/main/java/net/fabricmc/loom/task/AbstractRemapJarTask.java
2022-12-11 20:31:07 +00:00
modmuss50
be4e7a42a3 Fix getRuntimeRemapConfigurations() returning the wrong classpath. (#769) 2022-12-11 18:26:39 +00:00
Juuz
e48a7124f5 Add LoomGradleExtensionAPI.getRuns() for consistency with runs() (#748)
* Add LoomGradleExtensionAPI.getRuns() for consistency with runs()

* Improve jd
2022-11-01 19:31:03 +00:00
modmuss50
0036d81a3a Fixes to legacy jar processors. 2022-10-06 22:48:09 +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
727c396cd9 Add getMappingsFile and getDecompileTask APIs for use by the MC Dev plugin. (#697) 2022-08-07 09:50:22 +01:00
modmuss50
e561cca19a Split mod dependencies into client/common as required. 2022-08-04 08:56:37 +01:00
modmuss50
53f239fd8e Remove shareCaches option, has not been used for a few versions.
Was basically designed for FabricAPI only, now the same is applied where possible to all projects in a much better fashion.
2022-07-25 18:39:39 +01:00
modmuss50
c4c6de23e3 Rewrite download utils (#681)
- eTag support (It seems Mojang's CDN and our meta/maven do not support this right now)
- Age based caching.
- Sha1 based caching.
- HTTP(S) proxy settings should now be respected.
- The downloader has better awareness of offline mode and refresh deps, cleaning up the calling code a bit.
- Uses the new Java 11 HTTP client, provides async support for downloading multiple files
- Progress handling (TODO needs hooking up to gradle)
- Better compression support. Handled by [Methanol](https://mizosoft.github.io/methanol/) 
- Unit tested with a real web server.
2022-07-25 18:01:11 +01:00
modmuss50
48fafb9a64 Remove unused properties. 2022-07-03 15:09:45 +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
modmuss50
f632dee2df Mod provided javadoc (#627) 2022-04-19 23:30:28 +01:00
modmuss50
febc999092 Merge branch 'exp/0.12' into dev/0.12 2022-04-16 00:16:59 +01:00
modmuss50
66ef9659a2 Fail hard with an error message when calling the wrong officialMojangMappings method.
Before this would have been a weird silent failure and resulted in bad mappings.
2022-04-16 00:06:56 +01:00
modmuss50
0a8b792564 Add DSL to configure mod class path groups. (#608)
* Add basic mod settings.

* Cleanup and review feedback.

* Add idea output dir support.

* Eclipse and vscode + better tests.
2022-03-14 01:07:53 +00:00
modmuss50
fff4afe405 Initial support for split client/common sourcesets. (#606) 2022-03-04 15:01:45 +00:00
modmuss50
de31f1e083 Intermediate mapping handling improvements. (#593)
* Add API for intermediate mappings. Add hacky option to run with no intermediate mappings.

* Add setter, and some getters that I need :)

* Remove unused inject.

* Don't add asm-all to the libraries.

* Fix unit tests.
2022-02-09 13:49:15 +00:00
modmuss50
582b6826bd Support client only jar, add tests for ancient minecraft versions. (#589)
* Support client only jar, add tests for ancient minecraft versions.

* Misc fixes.
2022-01-31 16:30:12 +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
240a23f52d Improve decompiler options by moving them away from the task.
Done because the split jar changes required registering the decompiler task after evaluation.
As there may be more than one decompile task, the options are set per decompiler and not per task.
This should also make easier to add new decompilers without requiring a plugin.
2022-01-05 09:49:11 +00:00
shartte
ccfe12eb17 Interface Injection (#496)
* Added interface injection via fabric.mod.json.

* Added interface injection

* Added amending of class signature with injected interface.
2022-01-04 18:15:21 +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
6d65e120e7 Remove deprecated stuff 2021-12-04 19:00:47 +00:00
Cat Core
a91b75c05c Allow to set custom intermediary url again (#528)
* allow to set custom intermediary url again

* apply suggestions

* add some javadoc
2021-11-01 15:47:28 +00:00
shartte
d48c74161e Access Widener 2.0 with support for Transitive Access Wideners (#484)
* Added global access widener support.

* Adapt loom to changed API of latest AW PR.

* Fix expected access widener to fix the test. Since the access widener is now streamed directly into the writer, the expanded rules (i.e. accessible field makes the owning class also accessible) are no longer found in the remapped file.

* Add basic transitive accesswidener test

* Extracted applying transitive access wideners into their own jar processor since they also need to be applied if there is no AW in the mod itself.

* Misc assortment of fixes

* Set up the processor lazily to allow for adding the intermediary MC jar, which is needed to correctly remap intermediary AWs to named.

* Rework to setup the tiny remapper classpath with the mc jar
Add an extension prop to disable

* Add TransitiveDetectorVisitor

* Minor refactoring.

* Use release-version of access-widener.

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2021-09-14 22:40:47 +01:00
modmuss50
08e548b6c6 Expose layered mappings as an API (#490)
* Expose layered mappings as an API

* Add FileSpec

* Cleanup and support DependencyFileSpec
2021-09-13 17:58:52 +01:00
modmuss50
2c464cdef3 Add loom.modVersion to read the version from the fabric.mod.json file. (#489) 2021-09-10 16:06:37 +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
ea8ee4c21a Add option to disable deprecated POM generation and the warnings together with it (#487) 2021-09-05 17:55:42 +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
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
Juuxel
b558ee1a46 Fix loom.accessWidener being a read-only property in Kotlin (#447)
* Re-enable Kotlin test because the related bug has been fixed

* Fix loom.accessWidener being a read-only property in Kotlin

* Remove Kotlin test exclusions
2021-07-26 12:14:31 +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
777f30913b Add back customManifest api 2021-07-16 22:36:22 +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