Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • ForgeGradle
  • Use ${} in mods.toml
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 0
DoctorC

Use ${} in mods.toml

By DoctorC, January 19 in ForgeGradle

  • Reply to this topic
  • Start new topic

Recommended Posts

DoctorC    0

DoctorC

DoctorC    0

  • Tree Puncher
  • DoctorC
  • Members
  • 0
  • 22 posts
Posted January 19

I read something somewhere that suggested using processResources to replace things in mods.toml.

Having little experience with ForgeGradle, I'm not sure what the problem is.

This is my current processResources (build.gradle):

 

// Process Resources on build
processResources {
    inputs.property 'mod_version', version
    inputs.property 'mod_id', archivesBaseName

    from (sourceSets.main.resources.srcDirs) {
        include 'META-INF/mods.toml'

        expand 'mod_version': version
        expand 'mod_id': archivesBaseName
        expand 'mod_name': "${mod_name}"
        expand 'mod_description': "${mod_description}"

        expand 'loader_version': "${loader_version}"
    }

    from (sourceSets.main.resources.srcDirs) {
        exclude 'META-INF/mods.toml'
    }
}

 

I've defined ${mod_name}, ${mod_description}, etc. etc. already, using gradle.properties.

 

I am getting this error on running processResources. I've also tried runClient but the same thing happens:

Execution failed for task ':processResources'.
> Could not copy file 'Mod Folder\src\main\resources\META-INF\mods.toml' to 'Mod Folder\build\resources\main\META-INF\mods.toml'.

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':processResources'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
	at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
	at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
	at org.gradle.execution.taskgraph.LocalTaskInfoExecutor.execute(LocalTaskInfoExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:277)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareWorkItemExecutor.execute(DefaultTaskExecutionGraph.java:262)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:135)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.execute(DefaultTaskPlanExecutor.java:200)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.executeWithWork(DefaultTaskPlanExecutor.java:191)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$ExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.api.GradleException: Could not copy file 'Mod Folder\src\main\resources\META-INF\mods.toml' to 'Mod Folder\build\resources\main\META-INF\mods.toml'.
	at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:79)
	at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.copyTo(DefaultFileCopyDetails.java:109)
	at org.gradle.api.internal.file.copy.FileCopyAction$FileCopyDetailsInternalAction.processFile(FileCopyAction.java:44)
	at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator$1$1.processFile(NormalizingCopyActionDecorator.java:66)
	at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator$1$1.processFile(DuplicateHandlingCopyActionDecorator.java:60)
	at org.gradle.api.internal.file.copy.CopyFileVisitorImpl.processFile(CopyFileVisitorImpl.java:62)
	at org.gradle.api.internal.file.copy.CopyFileVisitorImpl.visitFile(CopyFileVisitorImpl.java:46)
	at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFile(Jdk7DirectoryWalker.java:86)
	at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker$1.visitFile(Jdk7DirectoryWalker.java:59)
	at org.gradle.api.internal.file.collections.jdk7.Jdk7DirectoryWalker.walkDir(Jdk7DirectoryWalker.java:59)
	at org.gradle.api.internal.file.collections.DirectoryFileTree.walkDir(DirectoryFileTree.java:154)
	at org.gradle.api.internal.file.collections.DirectoryFileTree.visitFrom(DirectoryFileTree.java:132)
	at org.gradle.api.internal.file.collections.DirectoryFileTree.visit(DirectoryFileTree.java:117)
	at org.gradle.api.internal.file.collections.FileTreeAdapter.visit(FileTreeAdapter.java:117)
	at org.gradle.api.internal.file.CompositeFileTree.visit(CompositeFileTree.java:93)
	at org.gradle.api.internal.file.copy.CopySpecActionImpl.execute(CopySpecActionImpl.java:39)
	at org.gradle.api.internal.file.copy.CopySpecActionImpl.execute(CopySpecActionImpl.java:24)
	at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:707)
	at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:709)
	at org.gradle.api.internal.file.copy.DefaultCopySpec$DefaultCopySpecResolver.walk(DefaultCopySpec.java:709)
	at org.gradle.api.internal.file.copy.DefaultCopySpec.walk(DefaultCopySpec.java:513)
	at org.gradle.api.internal.file.copy.DelegatingCopySpecInternal.walk(DelegatingCopySpecInternal.java:282)
	at org.gradle.api.internal.file.copy.CopySpecBackedCopyActionProcessingStream.process(CopySpecBackedCopyActionProcessingStream.java:38)
	at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator$1.process(DuplicateHandlingCopyActionDecorator.java:44)
	at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator$1.process(NormalizingCopyActionDecorator.java:57)
	at org.gradle.api.internal.file.copy.FileCopyAction.execute(FileCopyAction.java:35)
	at org.gradle.api.internal.file.copy.NormalizingCopyActionDecorator.execute(NormalizingCopyActionDecorator.java:53)
	at org.gradle.api.internal.file.copy.DuplicateHandlingCopyActionDecorator.execute(DuplicateHandlingCopyActionDecorator.java:42)
	at org.gradle.api.internal.file.copy.CopyActionExecuter.execute(CopyActionExecuter.java:40)
	at org.gradle.api.tasks.AbstractCopyTask.copy(AbstractCopyTask.java:179)
	at org.gradle.language.jvm.tasks.ProcessResources.copy(ProcessResources.java:35)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
	at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:801)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:768)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
	at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
	... 31 more
Caused by: groovy.lang.MissingPropertyException: No such property: loader_version for class: SimpleTemplateScript6
	at SimpleTemplateScript6.run(SimpleTemplateScript6.groovy:1)
	at org.gradle.api.internal.file.copy.FilterChain$3.transform(FilterChain.java:121)
	at org.gradle.api.internal.file.copy.FilterChain$3.transform(FilterChain.java:110)
	at org.gradle.api.internal.ChainingTransformer.transform(ChainingTransformer.java:37)
	at org.gradle.api.internal.file.copy.FilterChain.transform(FilterChain.java:56)
	at org.gradle.api.internal.file.copy.FilterChain.transform(FilterChain.java:64)
	at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.open(DefaultFileCopyDetails.java:93)
	at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:56)
	at org.gradle.api.internal.file.copy.DefaultFileCopyDetails.copyTo(DefaultFileCopyDetails.java:101)
	at org.gradle.api.internal.file.AbstractFileTreeElement.copyFile(AbstractFileTreeElement.java:93)
	at org.gradle.api.internal.file.AbstractFileTreeElement.copyTo(AbstractFileTreeElement.java:74)
	... 75 more

 

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7688

diesieben07

diesieben07    7688

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7688
  • 56257 posts
Posted January 19

My question is: Why? Just put them in the mods.toml directly.

  • Quote

Share this post


Link to post
Share on other sites

DoctorC    0

DoctorC

DoctorC    0

  • Tree Puncher
  • DoctorC
  • Members
  • 0
  • 22 posts
Posted January 19
2 minutes ago, diesieben07 said:

My question is: Why? Just put them in the mods.toml directly.

Because it's easier to define everything in gradle.properties, and not have to think about the other files.

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7688

diesieben07

diesieben07    7688

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7688
  • 56257 posts
Posted January 19

Uh, not really.

This will make it completely not work in the development environment, too.

  • Quote

Share this post


Link to post
Share on other sites

DoctorC    0

DoctorC

DoctorC    0

  • Tree Puncher
  • DoctorC
  • Members
  • 0
  • 22 posts
Posted January 19 (edited)
9 minutes ago, diesieben07 said:

Uh, not really.

This will make it completely not work in the development environment, too.

 

Why not?

Edited January 19 by DoctorC
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7688

diesieben07

diesieben07    7688

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7688
  • 56257 posts
Posted January 19

Because in the development environment the full gradle build is not used.

  • Quote

Share this post


Link to post
Share on other sites

DoctorC    0

DoctorC

DoctorC    0

  • Tree Puncher
  • DoctorC
  • Members
  • 0
  • 22 posts
Posted January 19
1 minute ago, diesieben07 said:

Because in the development environment the full gradle build is not used.

Ah, so replacing anything inside the mods.toml would not be useful at all?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7688

diesieben07

diesieben07    7688

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7688
  • 56257 posts
Posted January 19

Correct.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Centmap
      Forge Mods Folder

      By Centmap · Posted 1 minute ago

      so i created a "1.16.5" folder in the folder "mod" as usual but it doesn't use the mods. Can anyone help me ?
    • Skyriis
      [SOLVED][1.16.5] Adding a Button to KeyBindings

      By Skyriis · Posted 41 minutes ago

      That worked.   Here is my solution @SubscribeEvent public static void onOpenGui(final GuiScreenEvent.InitGuiEvent.Post event) { if (!(event.getGui() instanceof ControlsScreen)) return; final ControlsScreen controlsScreen = (ControlsScreen) event.getGui(); final KeyBindingList replacement = new KeyBindingListReplacement(controlsScreen, event.getGui().getMinecraft()); final KeyBindingList old = ObfuscationReflectionHelper.getPrivateValue(ControlsScreen.class, controlsScreen, "field_146494_r"); controlsScreen.getEventListeners().remove(old); ObfuscationReflectionHelper.setPrivateValue(ControlsScreen.class, controlsScreen, replacement, "field_146494_r"); try { Method addChildMethod = ObfuscationReflectionHelper.findMethod(Screen.class, "func_230481_d_", IGuiEventListener.class); addChildMethod.setAccessible(true); addChildMethod.invoke(controlsScreen, replacement); addChildMethod.setAccessible(false); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } }  
    • DrCowiber
      Failed To Start Minecraft Server

      By DrCowiber · Posted 1 hour ago

      im using this run.sh file, which contains: java -Xmx6G -Xms6G -jar minecraft_server.1.16.5.jar --nogui Edit: When I first posted about this I was using the serverRun.jar, which the first log file I posted is what the output was
    • Tez
      [1.15.2] Couln't not resolve dependency: net.minecraftforge:forge:1.15.2-31.2.0:userdev

      By Tez · Posted 1 hour ago

      I'm new to mod coding so i've watch tutorial in youtube in setup workspace step i got this error , i've try many solutions to fix but it still not working try update gradle to 6.8.3 but still not working try update java and still not working too here's my stacktrace: Stacktrace
    • diesieben07
      Failed To Start Minecraft Server

      By diesieben07 · Posted 1 hour ago

      Please show how exactly you are starting the server.
  • Topics

    • Centmap
      0
      Forge Mods Folder

      By Centmap
      Started 1 minute ago

    • Skyriis
      8
      [SOLVED][1.16.5] Adding a Button to KeyBindings

      By Skyriis
      Started 22 hours ago

    • DrCowiber
      8
      Failed To Start Minecraft Server

      By DrCowiber
      Started 20 hours ago

    • Tez
      0
      [1.15.2] Couln't not resolve dependency: net.minecraftforge:forge:1.15.2-31.2.0:userdev

      By Tez
      Started 1 hour ago

    • Mysterious minecrafter
      1
      game keeps crashing while initializings

      By Mysterious minecrafter
      Started 3 hours ago

  • Who's Online (See full list)

    • GermanBucket
    • Centmap
    • smitokyo
    • xBenjihdx
    • sleepier
    • Tavi007
    • Zeher_Monkey
    • K1llM3Pl5
    • Uncreative
    • Skyriis
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • ForgeGradle
  • Use ${} in mods.toml
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community