Commit Graph

832 Commits

Author SHA1 Message Date
modmuss
e49a051ea0 Fix included none mod libraries not being reproducible. (#923)
Closes #921
2023-07-04 17:13:48 +01:00
modmuss
6413a9312c Create RunConfigSettings with Gradle's object factory (#917)
* Create RunConfigSettings with Gradle's object factory

* Update src/main/java/net/fabricmc/loom/configuration/ide/RunConfigSettings.java

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

* Update FabricAPI test

* Fix version

* Actually fix test

* Just make the minimal changes for now

---------

Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2023-07-03 17:45:13 +01:00
modmuss
8ddf572a7c Client annotation processor configuration extendsFrom "annotationProcessor" (#918) 2023-07-02 21:39:06 +01:00
Juuz
28b8caf8f1 Make resolvable copies of configurations not consumable (#920)
This prevents info-level log warnings from mod remapping
from flooding the console.
2023-07-02 21:38:55 +01:00
modmuss50
8abe00a2b1 Fix gen sources without unpick 2023-06-27 20:54:34 +01:00
qwertyuioplkjhgfd
867793d8c3 Fix constructor mappings with layered mappings (#881)
* add AddConstructorMappingVisitor

* add constructor test

* Update src/main/java/net/fabricmc/loom/configuration/providers/mappings/utils/AddConstructorMappingVisitor.java

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

* apply requested changes

---------

Co-authored-by: qwertyuioplkjhgfd <qwertyuioplkjhgfd@users.noreply.github.com>
Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com>
2023-06-27 14:16:40 +01:00
modmuss
f06bc6f735 Don't use arg files when running in a none ascii path (#916) 2023-06-27 14:06:48 +01:00
modmuss50
ffe4d52a12 Improve GenerateSourcesTask error message.
Closes https://github.com/FabricMC/fabric-loom/issues/914
2023-06-27 09:27:59 +01:00
modmuss
8b3b9b4aed Use intermediate provider name in cache key (#912) 2023-06-23 17:17:58 +01:00
modmuss
a2b541818c Apply AW as a TR AnalyzeVisitor (#892)
* Apply AW as a TR AnalyzeVisitor

* Update TR
2023-06-23 15:29:24 +01:00
modmuss50
2e31f8accb Use project specific cache dir in IncludedJarFactory.
Fixes https://github.com/FabricMC/fabric-loom/issues/911
2023-06-23 15:20:29 +01:00
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
modmuss
fe823ddb30 Add an internal API to allow 3rd party loom extensions to add library processors. (#906)
Stability of this API will not be guaranteed.
2023-06-15 20:14:52 +01:00
modmuss
590686fe1a Fix + test minecraft metadata downloading (#905) 2023-06-13 21:24:46 +01:00
TheKodeToad
ed5e4ac8dd Add Eclipse to ANSI supported IDEs - fixes #726 (#803) 2023-06-13 18:54:23 +01:00
modmuss
68c7eb21ba Enable reproducible builds by default (#899)
* Enable reproducible builds by default

* Review feedback
2023-06-13 18:31:25 +01:00
RedNesto
c557647e06 Fix invalid run config containing module names with spaces (#889) 2023-06-13 11:32:35 +01:00
Juuz
c62e96b0ae Fix non-main source set remap configurations publishing by default (#891)
Fixes #890.

Note that there is *no simple way* to enable publishing for remap
configurations created this way anymore as the publishing mode is read
during the `createRemapConfigurations` call.

This also changes the behaviour of `modClientX` configurations to no longer
publish. If that is wanted, I can add a `createRemapConfigurations()`
overload with some kind of configurability.
2023-06-13 11:25:43 +01:00
zml
3c487447fb Fix interface injection of inner class interfaces (#900)
Fixes #798
2023-06-13 11:20:46 +01:00
Luke Bemish
55c59ef97e Change zip entry ordering to place manifest first (#887)
* Change zip entry ordering to place manifest first

* Add handling for signature related files

* Update jar file hash

* Hopefully update correct file hashes this time

* Change jar hashes

* Add correct source hashes
2023-06-13 11:17:20 +01:00
modmuss
6e72125c0f Dont allow gradle to run game/genSources tasks in parallel (#901)
* Dont allow gradle to run game/genSources tasks in parallel

* Fix build
2023-06-13 11:16:56 +01:00
modmuss
af1f2497b5 Fix Kotlin 1.9.0 beta (#902)
* Fix Kotlin 1.9.0 beta

* Fix build
2023-06-13 11:16:14 +01:00
modmuss50
35e827566e Move jar merger to loom. (#882)
* Move jar merger to loom.

* Fix copyright years
2023-05-05 13:26:06 +01:00
modmuss50
92eed264ab Downloader improvements (#880)
* Fixes Integration tests locally often fail with download errors #878
* Hopefully fixes Loom is very slow to download files, often hanging for 10+ minutes #877
* "Forcing downloading" error should show much less often.
* Progress loggers get closed when download fails.
* Download assets uses a maxmium of 10 threads.
* Update tests to run against 8.3 nightlys.
* Fix windows arm tests as Mojang back-ported this change to all 1.19 versions.
2023-05-02 09:21:51 +01:00
modmuss50
dcbdbf0e30 Fix @Environment(EnvType.CLIENT) not being added to the named minecraft client only jar. 2023-04-23 14:15:45 +01:00
modmuss50
2e6a1a9128 Fix config roles. (#872) 2023-04-23 10:02:56 +01:00
Juuz
162b504d64 RunConfigSettings: Add support for fully custom main class (#871) 2023-04-23 09:22:41 +01:00
modmuss50
743ba4de66 Support 23w16a & Windows ARM64, and fix regression when adding ARM support on older versions. (#870)
* Support 23w16a & Windows ARM64, and fix regression when adding ARM support on older versions.

* Fix build
2023-04-20 22:42:44 +01:00
modmuss50
da9f601c2f Set configuration roles + cleanup setup classes. (#868) 2023-04-20 08:45:18 +01:00
modmuss50
b35753476c Fix applying mods to server libraries. 2023-04-18 14:27:54 +01:00
modmuss50
89d09600c5 Rewrite Kotlin metadata remapping to support the latest kotlin metadata library. (#866) 2023-04-17 23:46:45 +01:00
modmuss50
0d2152444f Allow decompilers to set a smaller min heap size. 2023-04-17 15:43:07 +01:00
modmuss50
1015ef09ff Update to Gradle 8.1 (#864)
* Update to Gradle 8.1

* Fix build, run RunConfigTest against all gradle versions.

* Fix build
2023-04-17 13:49:49 +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
95a260d923 Test against Gradle 8.1 and 8.2 nightly. (#846) 2023-04-16 17:19:21 +01:00
modmuss50
4ff9f726e1 Work around Gradle 8.1 bug causing Files.readString(Path) to call path.toFile(). 2023-04-12 19:56:01 +01:00
modmuss50
75a98a5038 Only force re-downloads when manually refreshing deps (#851) 2023-04-02 15:40:09 +01:00
marcus8448
b506a6280a fix: remapping of jars without a fabric.mod.json (#840)
* fix: remapping of jars without a fabric.mod.json
(jars that have `Fabric-Loom-Remap: true`)

* fix: checkstyle
2023-03-10 19:30:18 +00:00
Caoimhe
83b968df64 Warn when using clientOnlyMinecraftJar() on Minecraft versions newer than 1.3 (#824)
Single JARs break things like source generation on newer versions and
pretty much have no difference there, so we should log a warning,
similar to what we do for merged JARs not being supported on 1.2.5 or
older.
2023-02-18 21:04:17 +00:00
modmuss50
ab114b5d7a Fallback to HTTP 1.1 on the last retry when downloading. (#829) 2023-02-18 21:04:17 +00:00
Juuz
b19184751b Add toString to ModSettings and RemapConfigurationSettings (#831)
This helps a bit with debugging code that uses them as you don't
have to open the object to see which mod/remap configuration we're
investigating.
2023-02-18 21:04:17 +00:00
modmuss50
97f594da8e Recursively copy configurations.
Co-authored-by: Juuz <6596629+juuxel@users.noreply.github.com>
2023-01-28 13:46:33 +00:00
modmuss50
0fa4e1e05e Fix #815 - Regression causing TAWs from runtime only deps to be applied. 2023-01-25 09:30:36 +00:00
modmuss50
2bcee320d4 Fix download sources hook not working for client only jars. 2023-01-24 23:17:57 +00:00
modmuss50
f61afd865e Fix client environment annotations not being applied to the client only jar when using split sources. 2023-01-24 23:13:19 +00:00
modmuss50
5094a8af86 Update MCE (#818) 2023-01-24 10:54:37 +00:00
modmuss50
a1e671b719 Fix and test jar processor caching. 2023-01-23 22:06:05 +00:00
modmuss50
b22c66f0be Update dependencies 2023-01-22 13:34:28 +00:00
Juuz
06e9fb16e5 Rewrite the internals of mod configuration remapping to fix bugs (#807)
* Add test for #801

* Add test for #572

* Rewrite mod configuration remapping internals to fix bugs

Fixes #801. Fixes #572.

- Instead of individual mod configs getting remapped, Loom now remaps
  "collector configs": `mod[Compile/Runtime]Classpath[source set name]`
  (eg `modRuntimeClasspathMain` -> `modRuntimeClasspathMainRemapped`)
  - This lets us use Gradle's `org.gradle.usage` attributes to select
    whether it's a compile-time or runtime dependency
  - Note: Remap configurations sourcing from `api` are partially left
    intact due to their special logic in the `namedElements` configuration.
- Setting the proper usages fixes #801.
- No dependency files are added to the real target configurations
  (like `api` and `implementation`) anymore.
  - This fixes #572, since `runtimeClasspath` and `compileClasspath` don't
    leak transitive dependencies unlike `implementation` etc.

* Fix checkstyle

* Fix split env dependency consumers

* Only use collector configs for remapped deps and let the inputs stay intact

This way the code has less duplication.

* Improve log messages

* Update year

* Add some comments

* Fix compilation

* Use LinkedHashMap for reliable iteration order through remapped configs

* Use ImmutableMap.of instead of Map.of for reliable ordering

* ModConfigurationRemapper: Move namedElements handling out of forEach

* Add regression test for a crash where loader is resolved after other mods

* Fix the aforementioned bug

* Rename InstallerDataTest -> DependencyOrderTest

* Add TODO about refresh dependencies

The code currently processes the same deps multiple times when
--refresh-dependencies/-Dloom.refresh=true/a cache invalidation
is applied.

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2023-01-21 23:03:42 +00:00
modmuss50
7f06b64693 Fix issue caused in previous commit. 2023-01-16 21:53:44 +00:00