Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runs generated by genIntellijRuns make the IDE build twice #703

Open
FoxSamu opened this issue Aug 10, 2020 · 2 comments
Open

Runs generated by genIntellijRuns make the IDE build twice #703

FoxSamu opened this issue Aug 10, 2020 · 2 comments
Assignees
Labels
bug Relates to or reports a bug in the codebase

Comments

@FoxSamu
Copy link

FoxSamu commented Aug 10, 2020

Run configurations generated by genIntellijRuns build the mod twice before running, which is useless. Right now the generated configurations have this:
Annotation 2020-08-10 124737
As prepareRun[...] builds the mod for running from the IDE, the build task before it is unecessary and should not be generated at all. Right now I have to remove the unnecessary build task from each run configuration manually each time I regenerate the run configurations, which is annoying.

There is one caveat though:

The mod class path (which is specified in an environment variable instead of the JDK class path property) that is configured in a generated run configuration seems to be different depending on this setting:
Annotation 2020-08-10 130117
Found at 'Settings > Build, Execution and Deployment > Build Tools > Gradle', this setting specifies whether the IDE should build with Gradle or with the builtin compiler:

  • When this setting is set to 'Gradle', the class path in generated run configurations is set to the outputs of the Gradle compiler (somewhere in the build directory).
  • When this setting is set to 'IntelliJ IDEA', the class path in generated run configurations is set to the outputs of the IntelliJ compiler (somewhere in the out directory).

There can be several solutions now:

  1. The build task is removed from the generated run configurations. In this case, the generated run configurations should always specify the outputs of the Gradle compiler as classpath, since prepareRun[...] always uses the Gradle compiler.
  2. The prepareRun[...] does not compile the mod anymore (does not depend on classes). In this case, run[...] (the Gradle task) should depend on classes so that sources are still compiled before running from Gradle (instead of the run configuration). This is a recommended solution since modders may want to modify what compiler builds the mod (with the setting shown above).
  3. The prepareRun[...] task is removed from the run configurations. In this case, genIntellijRuns should do all preparing configurations such as downloading assets. I discourage this solution though as I don't know what additional configurations prepareRun[...] does that need to be done every time before running.
@FoxSamu FoxSamu changed the title Runs generated by genIntellijRuns make the IDE build twice Runs generated by genIntellijRuns make the IDE build twice Aug 10, 2020
@FoxSamu FoxSamu changed the title Runs generated by genIntellijRuns make the IDE build twice Runs generated by genIntellijRuns make the IDE build twice Aug 10, 2020
@FledgeXu
Copy link
Contributor

FledgeXu commented Aug 12, 2020

Daemon will be stopped at the end of the build stopping after processing

> Configure project :
New Dep: net.minecraftforge:forge:1.15.2-31.2.31_mapped_snapshot_20200514-1.15.1
Found task graph: org.gradle.execution.taskgraph.DefaultTaskExecutionGraph@25c6102e
Found 9 tasks.
task ':downloadMcpConfig'
task ':extractSrg'
  - provider(task downloadMcpConfig, class net.minecraftforge.gradle.common.task.DownloadMavenArtifact)
task ':createSrgToMcp'
  - provider(task extractSrg, class net.minecraftforge.gradle.common.task.ExtractMCPData)
task ':downloadMCMeta'
task ':downloadAssets'
  - task ':downloadMCMeta'
task ':extractNatives'
  - task ':downloadMCMeta'
task ':makeSrcDirs'
task ':prepareRuns'
  - task ':extractNatives'
  - task ':createSrgToMcp'
  - task ':downloadAssets'
  - task ':makeSrcDirs'
task ':genIntellijRuns'
  - [task ':prepareRuns']
> Task :downloadMcpConfig
> Task :extractSrg UP-TO-DATE
> Task :createSrgToMcp
> Task :downloadMCMeta
> Task :extractNatives
> Task :makeSrcDirs
> Task :prepareRuns
> Task :genIntellijRuns

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 5m 53s
8 actionable tasks: 7 executed, 1 up-to-date

genIntellijRuns seems already depends on the downloadAssets and so on. The prepareRuns is totally unnecessary.

The 3 may be a good choice.

prepareRuns seems just need to run once instead of every time before the game start.

@FoxSamu
Copy link
Author

FoxSamu commented Aug 12, 2020

Well that is not the problem... The problem is that the default building process (compileJava, processResources, etc.) runs again after the IDE completes the same building process... As compiling can take a while on big projects it is very annoying to have it compile twice...

@SizableShrimp SizableShrimp added the bug Relates to or reports a bug in the codebase label Jun 14, 2022
@SizableShrimp SizableShrimp self-assigned this Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Relates to or reports a bug in the codebase
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants