User Tools

Site Tools


tutorial:migratemappings

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:migratemappings [2019/11/16 22:36] fudgetutorial:migratemappings [2022/12/22 16:23] (current) – Add reference to tutorial:mappings in case people want to know more about how they work basil4088
Line 1: Line 1:
 ====== Updating Yarn mappings in a Java codebase ====== ====== Updating Yarn mappings in a Java codebase ======
-====== Loom 0.2.6 and above ====== 
-Currently, this process will only affect Java files.   
  
-Say you want to migrate from 1.14.4 to 19w46b  +Loom allows semi-automatic updating of the mappings used in a Java codebase. Due to frequent changes in Yarn, this can be a useful tool for keeping a codebase up-to-date with the newest changes.
  
-  - Go [[https://modmuss50.me/fabric.html?&version=19w46b|here]]select ''19w46b'', and copy the ''yarn_mappings'' value, for example ''19w46b+build.1'' DO NOT modify your gradle.properties or build.gradle yet.    +**Note:** This automated process currently does not handle Mixins or reflectioninstances of these will need to be manually updated.
-  - In the root of your gradle project, run ''gradlew migrateMappings ---mappings "19w46b+build.1"'' +
-  - Your migrated source will appear in ''remappedSrc''. Verify your code was not nuked and copy it over. +
-  - Update your gradle.properties file according to the instructions in [[https://modmuss50.me/fabric.html?&version=19w46b|this]] site. +
-  - You're done.+
  
-=== Additional customization ===  +===== Loom 0.2.6 and above =====
-  * Specify from where to take your Java files with ''----input path/to/source''Default: ''src/main/java''+
-  * Specify where to output the remapped source with ''----output path/to/output''. Default: 'remappedSrc'+
-  * Specify a custom place to retrieve the mappings from with ''----mappings some_group:some_artifact:some_version:some_qualifier''. Default: ''net.fabricmc:yarn:<version-you-inputted>:v2''+
  
-====== Loom 0.2.5 and below ======+Say you want to migrate from 1.16.5 yarn to 1.17.1 yarn. 
 + 
 +  - Go [[https://fabricmc.net/develop|here]], select the version to migrate to, and copy the Gradle command under "Mappings Migration", for example ''gradlew migrateMappings %%--%%mappings %%"%%1.17.1+build.40%%"%%'' DO NOT modify your gradle.properties or build.gradle yet.    
 +  - Run the command in the root of your Gradle project. 
 +  - Your migrated sources will appear in ''remappedSrc''. Verify that the migration produced valid migrated code. 
 +  - Copy the sources from ''remappedSrc'' to the original folder. Keep the original sources backed up just in case. 
 +  - Update your gradle.properties file according to the instructions in [[https://fabricmc.net/develop|the first site]]. 
 +  - Refresh the Gradle project in your IDE. 
 +  - Check and update any Mixin targets that may be outdated. 
 + 
 +If you want to go from Mojang's official mappings, AKA mojmap, to yarn, make sure your mappings in ''build.gradle'' is set to ''loom.officialMojangMappings()'' before running ''migrateMappings''. For more information, check out the dedicated [[tutorial:mappings|Mappings]] page. 
 + 
 +=== Additional customization ===  
 +  * Specify from where to take your Java files with ''%%--%%input path/to/source''. Default: ''src/main/java''
 +  * Specify where to output the remapped source with ''%%--%%output path/to/output''. Default: 'remappedSrc'. You can use ''src/main/java'' here to avoid having to copy the remapped classes, but make sure you have a backup. 
 +  * Specify a custom place to retrieve the mappings from with ''%%--%%mappings some_group:some_artifact:some_version:some_qualifier''. Default: ''net.fabricmc:yarn:<version-you-inputted>:v2''. Use ''net.minecraft:mappings:<minecraft-version>'' to migrate to official Mojang mappings.
  
-==== Requirements ====+=== Reporting issues === 
 +Loom uses [[https://github.com/CadixDev/Mercury|Mercury]] to remap Java source code, for problems with remapping please report issues to their [[https://github.com/CadixDev/Mercury/issues|issue tracker]], or discuss it through their communications channel (irc.esper.net #cadix).
  
-  * Fabric-Loom 0.2.2 or above +===== Loom 0.2.2-0.2.5 =====
-  * A Java codebase Kotlin and Scala will not, currently, do. +
-  * Some assembly required+
  
-==== Instructions ====+Some assembly required.
  
   - Figure out your target mappings version. For example, "net.fabricmc:yarn:1.14.1 Pre-Release 2+build.2".   - Figure out your target mappings version. For example, "net.fabricmc:yarn:1.14.1 Pre-Release 2+build.2".
Line 32: Line 37:
     * "inputDir" is the input directory, containing Java source code,     * "inputDir" is the input directory, containing Java source code,
     * "outputDir" is the output directory. It will be created if it is missing.     * "outputDir" is the output directory. It will be created if it is missing.
-  - Copy the remapped source code to the input directory, if everything's fine,+  - Copy the remapped source code to the input directory, if everything's fine.
   - Hope for the best.   - Hope for the best.
  
tutorial/migratemappings.1573943795.txt.gz · Last modified: 2019/11/16 22:36 by fudge