Add support for multiple language directories#5
Draft
aurakle wants to merge 2 commits intoFallen-Breath:masterfrom
Draft
Add support for multiple language directories#5aurakle wants to merge 2 commits intoFallen-Breath:masterfrom
aurakle wants to merge 2 commits intoFallen-Breath:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When working on Trickster, I ran into an interesting situation: I found myself wanting to convert YAML language files present both in the primary mod resources (
assets/trickster) and the secondary (assets/whatever_else).Due to yamlang lacking support for this, I've implemented an alternative way of defining input and output directories. If
inputDiris defined, this alternative option is ignored. These changes add two new properties:directories, which is basicallyinputDiras a list; anddirectoriesMapped, which isinputDir->outputDiras a list (the key is theinputDir, the value is theoutputDir). These two other properties get merged to allow definitions such as this:yamlang { targetSourceSets = [sourceSets.main] directoriesMapped = [ 'assets/example/yamlang': "assets/example/lang" ] directories = [ "assets/example/lang" ] }The above results in a mapping which can be represented as:
[ 'assets/example/yamlang': "assets/example/lang", 'assets/example/lang': "assets/example/lang" ](I also set the executable flag on
gradlew, and renamed the*_PREFIXstatic fields to*_SUFFIX, as they go after and not before the filename.)