Commit Graph

643 Commits (5a16440c1efec12870953e369f0f481d37c16b23)

Author SHA1 Message Date
shedaniel be17a02e90
Use better gradle conventions, and fix #311 (#503)
* Use better gradle conventions, and fix #311

* Fix checkstyle

* Revert some changes

* Use convention

* Remove set classpath
2021-09-22 21:59:51 +01:00
modmuss50 06e60e5c29
Enable legacy mixin ap by default (#501) 2021-09-20 17:44:08 +01:00
modmuss50 1752659291 Dont add loom to compileOnly config.
I dont think this has been required since MCE is a thing.
2021-09-20 13:05:45 +01:00
modmuss50 256e61ce3c
Rebuild record components from field names, improves decompile (#497) 2021-09-19 08:53:13 +01:00
shartte 98d8f37672
Fixes merging of mappings for cases like: class_1234 is mapped, but class_1234$1 is not. (#498) 2021-09-18 21:15:32 +01:00
modmuss50 ae9a9e120d Update lorenz-tiny 2021-09-17 15:44:41 +01:00
modmuss50 2ec1dd032f Update tiny remapper, register the new LV pattern as invalid with TR. 2021-09-16 20:35:10 +01:00
modmuss50 2a040d03d7 Fix line number remapping not copying all class files. Fixes a runtime crash. 2021-09-16 16:23:33 +01:00
modmuss50 9d9be1b842
Migrate fully to mapping-io + Add comments about transitive access widners to generated sources (#495)
* Add comments about transitive access widners to generated sources

* Migrate fully to mapping io

* Use release version of lorenz-tiny

* Review comment
2021-09-16 15:28:06 +01: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
Juuxel 4f2ead9f16
Remove unused Constants.SOFTWARE_COMPONENT_NAME (#493)
This was a leftover from removed code, oops
2021-09-12 11:39:12 +01:00
shedaniel df7f56306b
Fix ParchmentMappingLayerTest test (#491)
* Fix ParchmentMappingLayerTest test

* Update mapping-io

* Remove comment
2021-09-11 14:39:19 +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
modmuss50 2bc7522a26 Fix reproducible build test, a none legacy test for this should be added at a later date. 2021-09-08 15:59:31 +01:00
modmuss50 1818ff03ab Update dependencies 2021-09-07 12:31:16 +01:00
modmuss50 aaf8653bee Disable ANSI when gradle's --console plain arg is used Fixes #486 2021-09-07 12:24:57 +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
modmuss50 52873435b7 Fix fabric api build test 2021-09-07 11:20:54 +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
modmuss50 1a060df4bf Revert fabric api patch to fix deprecations, I believe loom is wrong. 2021-09-05 17:06:26 +01:00
modmuss50 216b48337b Fix crash when "sourcesElements" is not present 2021-09-05 17:06:05 +01:00
modmuss50 ffaf893716 Patch fabric api to fix loom deprecations 2021-09-05 16:38:11 +01:00
modmuss50 2bdeb869ab Update MCE and test deps 2021-09-05 16:22:51 +01:00
shedaniel 0633b170fa
Make parchment layer test also test the parameter after being reordered (#483)
* Make parchment mappings layer test also test the parameter after being reordered.

* Switch to using hashCode
2021-09-05 16:08:43 +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 b1b395cedf Revert "Make SourceRemapper threaded (#446)"
This reverts commit ef2816b0d0.
2021-09-02 12:50:56 +01:00
shedaniel 6165576521
Make --refresh-dependencies work by creating the directory after clearing it (#482) 2021-08-31 14:54:17 +01:00
modmuss50 3ded0964c4
Refactor and improve tests (#466)
* Install and run a production server in tests

* Small improvements

* Add FabricAPI build test
Create new GradleProjectTestTrait replacing the old trait
Improve groovy code formatting.

* Refactor tests

* Fix MultiProjectTest + fix logging for fabric api test

* Cleanup and fixes

* Update fabric api + run in parallel for speed

* Set server memory + fix error
2021-08-31 11:48:58 +01:00
shedaniel 2277b93f8d
Fix compile for b320c4199a (#480)
* Fix compile for b320c4199a

* Fix checkstyle
2021-08-26 11:22:55 +01:00
hanbings b320c4199a
Allow developer set the site where to download game resource.(0.9 branch) (#442)
* Add mirrors util and mirror configuration

* Fix NPE in MirrorConfiguration;
Add constants in Constants;
Rename Mirrors.java to MirrorUtil.java

* Bump gradle nightly version

* Apply mirror to download assets.
Need fix settings in LoomRepositoryPlugin.java

* Fix MojangMappingsSpec having the same hash version for each mc version.

I dont think this would be a real cause for concern as the jar would have had the mc version in it anyway.

* Revert "Fix MojangMappingsSpec having the same hash version for each mc version."

This reverts commit 61fa4d9f

* Remove MirrorConfiguration and move to MirrorUtil

* StyleCheck.

* Fix "IllegalStateException: The root project is not yet available for build."

* Remove some of the extra content.

Co-authored-by: BreakIce <suibing112233@outlook.com>
Co-authored-by: modmuss50 <modmuss50@gmail.com>
2021-08-22 15:19:58 +01:00
Logic 9a470a49d8
update mapping-io, fix #473 (#474) 2021-08-22 15:03:09 +01:00
shedaniel 97a629eef9
File Structure Changes (#462)
* File Structure changes

* Fix checkstyle

* Fix processed jars

* Fix unpick tests

* Resolve reviews

* Fix merge conflicts
2021-08-13 21:02:45 +01:00
Juuxel a0c2d877af
Add modCompileOnlyApi, modRuntimeOnly; deprecate modRuntime (#458) 2021-07-31 23:46:42 +01:00
Juuxel f9a06cbd41
Make RemapSourcesJarTask use properties (#459) 2021-07-31 23:45:43 +01:00
Logic 2f4cf35abf
Remove the Cache class in the LoomRepositoryPlugin, use LoomFiles instead. (#464)
* refactor LoomFiles to support Settings

* remove Cache class, use LoomFiles class

* fix checkstyle
2021-07-31 23:43:46 +01:00
modmuss50 e5b972cf98 Remove the ShowCodeDetailsInExceptionMessages jvm arg, I didn't realise it was default to enabled now. 2021-07-31 23:41:31 +01:00
modmuss50 95751e213c Start experimental 0.10 branch - Won't be published right now. 2021-07-31 23:36:02 +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
Logic e124d48387
fix #448 (#451)
* fix #448

* minor fix
2021-07-28 08:50:14 +01:00
modmuss50 32837d71eb Fix NPE when in a mod loader dev env 2021-07-27 20:56:24 +01:00
Juuxel b955affb1a
Expose 'loom' extension as the API, deprecate 'minecraft' extension (#449) 2021-07-26 20:20:23 +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
modmuss50 ef2816b0d0
Make SourceRemapper threaded (#446)
Should be a little bit faster, but nothing magicial.
2021-07-25 22:54:22 +01:00
modmuss50 4601cc1db2 Update mercury. Test with Gradle 7.3 nightlys. Bump other deps. 2021-07-24 19:35:53 +01:00
Juuxel 08a797c53b
Use jar processor ids to fix #432 (#444)
* Use jar processor ids to fix #432

* Use full hash string of jar processor ids
2021-07-23 21:51:34 +01:00
modmuss50 606046e719 Ensure files are closed and outputs cleaned up when remapping. 2021-07-23 21:22:59 +01:00
modmuss50 e6793b5ed7 Revert "Fix MojangMappingsSpec having the same hash version for each mc version."
This reverts commit 61fa4d9f
2021-07-21 23:30:40 +01:00
modmuss50 61fa4d9fb6 Fix MojangMappingsSpec having the same hash version for each mc version.
I dont think this would be a real cause for concern as the jar would have had the mc version in it anyway.
2021-07-21 22:29:23 +01:00
modmuss50 d32acb3370 Bump gradle nightly version 2021-07-20 08:47:15 +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 a73696a83f Fix fabricApi.module does not respecting offline mode. Closes #412 2021-07-16 23:25:23 +01:00
modmuss50 69caaccb07 Fallback to fabric's experimental version manifest for versions that are not in the launchermeta. 2021-07-16 23:22:03 +01:00
modmuss50 d271dfadd0 Add CustomManifestTest 2021-07-16 22:59:37 +01:00
modmuss50 34b771f744 Actually handle gzip encoded connections when downloading. 2021-07-16 22:48:50 +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
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 e3b2f8610e Update parchment url 2021-07-13 12:43:47 +01:00
Juuxel f26e9e2c7b
Fix AW field remapping (#434)
* Fix AW field remapping

* Fix by updating TR instead

* Fix checkstyle so that tests run
2021-07-13 08:52:42 +01:00
modmuss50 ad5ac78e06 Improve some bad stack traces.
Idk why this happens.
2021-07-13 00:05:33 +01:00
Juuxel f13dc4eea7
Test AW field remapping (#433) 2021-07-12 23:39:32 +01:00
modmuss50 f3b336413c Fix header file from merge.
I should have really waited for the PRs to be merged first thinking about it..
2021-07-10 21:58:15 +01:00
Juuxel e9657d63c4
Fix local file mod dependencies (#430)
* ModProcessor: Add more descriptive error TR output error message

* Fix flatDir/files/fileTree mod dependencies

* Add clarifying comment

* Use hash as a placeholder version

* ProjectTestTrait: Copy instead of reading and writing text

This allows having jars and other binary data in tests.

* Add integration test for local file dependencies

* Use File.bytes instead of Files.copy

* Use truncated SHA256 instead of murmur3
2021-07-10 21:52:38 +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 b24e067215 Fix yet another gradle deprecation, expand tests to cover it 2021-07-05 23:04:08 +01:00
modmuss50 8ce991dadc Fix build... 2021-07-04 01:00:18 +01:00
modmuss50 3a51777b4b Use a detached configuration to add jetbrains annotations to the source remapper classpath. 2021-07-04 00:58:09 +01:00
modmuss50 5bccf43761 Update ReproducibleBuildTest hashes, the tiny remapper update caused this. 2021-06-30 22:54:42 +01:00
modmuss50 bed2031f3b Update ASM and nightly gradle 2021-06-30 22:33:17 +01:00
LogicFan 7fba77d43a
fix broken test introduced in 54d6ef7896 (#424) 2021-06-28 16:33:18 +01:00
shedaniel 54d6ef7896
Fix typo "officalMojangMappings" (#420)
Signed-off-by: shedaniel <daniel@shedaniel.me>
2021-06-20 13:24:10 +01:00
modmuss50 1f9f48052b
Basic layered mappings with @ParchmentMC support (#413) 2021-06-14 18:39:03 +01:00
haykam821 60482833b2
Use tabs for indentation in the Fernflower decompiler (#383)
Co-authored-by: modmuss50 <modmuss50@gmail.com>
2021-06-13 14:34:46 +01:00
modmuss50 9278f6c4b9
Fix new gradle 8.0 deprecation added in 7.2 (#416)
* Fix new gradle 8.0 deprecation added in 7.2

* Handle bootstrap tests a bit better

* Fix 0.9 wrapper tests
2021-06-13 13:28:47 +01:00
modmuss50 0cfa88f73b Always fork the java compiler 2021-06-13 11:23:46 +01:00
modmuss50 4763760984 Revert "Update mercury (#408)"
This reverts commit 50d6fd298d.
2021-06-02 23:05:51 +01:00
modmuss50 50d6fd298d
Update mercury (#408) 2021-06-02 09:06:26 +01:00
modmuss50 188bbe57d6 Fix MergedNestedJarProvider not calling the child's prepare 2021-06-01 18:13:59 +01:00
modmuss50 210938d749 Fix local ivy layout not respecting classifiers. Fixes #407 2021-05-28 11:31:19 +01:00
modmuss50 3318a15cc5 Suppress "Inconsistent inner class entries" error when decompiling 2021-05-27 22:08:56 +01:00
modmuss50 8238db1778
Improve error messages when using outdated Java or Gradle. 2021-05-26 11:41:52 +01:00
Mitchell Skaggs 1f80e00e88
Add classifier to "fake" mods' id if they have a classifier specified (#394)
* Remove unused codepath (`RemapJarTask` is an `AbstractArchiveTask`)

* Remove incorrect comment

Comment originally added in 02e9616622

* Add classifier to `DependencyInfo`

* Add classifier to generated mod ID

* Clean up code structure from review

Co-authored-by: haykam821 <haykam821@users.noreply.github.com>

* Inline `file` local variable

Co-authored-by: haykam821 <haykam821@users.noreply.github.com>

Co-authored-by: haykam821 <haykam821@users.noreply.github.com>
2021-05-22 23:29:02 +01:00
LogicFan e955ebb8c5
add support for new dependencyResolutionManagement (#400)
* move repo declartions

- Move repository declartions in MavenConfiguration.java to LoomRepositoryPlugin.java

* move repo declartions

- Move repository declartions in MinecraftMappedProvider.java to LoomRepositoryPlugin.java

* move repo declartions

- Move repository declarations in MinecraftProcessedProvider.java to LoomRepositoryPlugin.java

* do not add repositories if dependencyResolutionManagement is used

* Simplify the change on LoomGradlePlugin

- this is the suggestion from liach

* change name to follow fabric naming convension

- change getProjectUUID to getProjectUuid
- change PROJECT_MAPPED_CLASSIFIER to projectMappedClassifier

* remove MavenConfiguration.java

- the file currently do nothing.

* clean-up for all `instanceof` clause

* add DependencyResolutionManagementTest

* code cleanup

* Update src/test/resources/projects/dependencyResolutionManagement/projmap/src/main/resources/modid.accesswidener

* change project uuid to project full name

Co-authored-by: modmuss50 <modmuss50@gmail.com>
2021-05-22 23:28:42 +01:00
modmuss50 de665ab498 Add SignedProjectTest #404 2021-05-20 23:47:48 +01:00
modmuss50 93b2aebaf8 Update MCE to 0.4.4 2021-05-18 21:00:08 +01:00
modmuss50 90ff811ecd Make the run config api stable 2021-05-15 19:58:08 +01:00
modmuss50 9fb167d506
General cleanup by making use of java 16 features (#397)
* General cleanup by making use of java 16 features

* use jackson-databind in place of gson when reading to a record

* Fixes

* cleanup

* dep updates

* Replace commons IOUtils usage with native java

* Update fernflower
2021-05-13 22:06:34 +01:00
modmuss50 2f38c747a1 Catch all when merging jars 2021-05-12 20:31:05 +01:00
modmuss50 258578f142 Update MCE to 0.4.3 2021-05-12 20:08:55 +01:00
modmuss50 432e88f354 Add a simple java 16 project test 2021-05-12 19:03:59 +01:00
modmuss50 9303dc39c3 Cleanup merged jar on failure 2021-05-12 19:03:42 +01:00
modmuss50 63bf3aaaa4 Enable `ShowCodeDetailsInExceptionMessages` (Better null pointers) for all run configs 2021-05-12 16:01:00 +01:00
modmuss50 fc3a5ef052 Java 16 2021-05-12 14:03:45 +01:00
modmuss50 927180e36b Make all loom added configurations lazy 2021-05-04 20:06:24 +01:00
modmuss50 7ce072c47a Fix gradle 8 deprecation warning 2021-05-04 19:19:02 +01:00
modmuss50 a5bc38a940 Make remapped configurations lazy 2021-05-04 19:07:21 +01:00
modmuss50 cd17485280 Update to release 7.0 gradle 2021-05-04 18:37:23 +01:00