diff options
| author | Robert Sosnitzka <robert.sosnitzka@gmail.com> | 2016-07-22 00:44:17 +0200 |
|---|---|---|
| committer | Robert Sosnitzka <robert.sosnitzka@gmail.com> | 2016-07-22 00:44:17 +0200 |
| commit | 374f1f1d24f37c660989ddbc4316b0440df12bc3 (patch) | |
| tree | 5775e5be7b2637d91dd93b684e95565992875727 /build.gradle | |
| parent | 6a932e6e56ecf19a5f843f83039bffc2f3647ba0 (diff) | |
Added nuggets + json files. F
Removed unnecessary lignite ores.
Fixed oreDict
Diffstat (limited to 'build.gradle')
| -rw-r--r-- | build.gradle | 83 |
1 files changed, 82 insertions, 1 deletions
diff --git a/build.gradle b/build.gradle index 7246278..ee3e18c 100644 --- a/build.gradle +++ b/build.gradle @@ -133,4 +133,85 @@ curseforge { displayName = "taiga-${project.buildInfo.revision}" } } -}
\ No newline at end of file +} +/* FOR AUTO JSON +ext.args = [:] + +ext.requireArgument = {String property, String displayValue -> + def value = args[property] + if (value == null) { + throw new InvalidUserDataException("$property must be set with \'$property=$displayValue\'") + } + return value +} + +tasks.addRule("Pattern: <property>=<value>: Passes arguments to the scripts") { String taskName -> + def match = taskName =~ /(.*?)=(.*?$)/ + if (match) { + def property = match[0][1] + def value = match[0][2] + ext.args[property] = value; + task(taskName) << { + println "Passes value \'$value\' to args[\'$property\']" + } + } +} + +import org.apache.tools.ant.filters.FixCrLfFilter + +class CopyJsonTemplate extends DefaultTask { + @Input + def template + + @Input + def arguments + + @Input + def jsonRename + + @TaskAction + def build() { + def args = arguments() + project.copy { + from("templates/${template}") { + expand(args) + filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf')) + } + into 'src/main/resources' + rename { String filename -> + def match = filename =~ /(.*)\.json/ + if (match) { + def prevFilename = match[0][1] + def newFilename = jsonRename.call(prevFilename) + return "${newFilename}.json" + } + else { + return filename + } + } + } + } +} + + +task generateBlockModel(type: CopyJsonTemplate) { + template 'block' + arguments { + def blockName = requireArgument('blockName', 'block_name') + return ['modid':archivesBaseName, 'block_name':blockName] + } + jsonRename { + return args['blockName'] + } +} + +task generateItemModel(type: CopyJsonTemplate) { + template 'item' + arguments { + def itemName = requireArgument('itemName', 'item_name') + return ['modid':archivesBaseName, 'item_name':itemName] + } + jsonRename { + return args['itemName'] + } +}*/
\ No newline at end of file |
