MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
514 stars 443 forks source link

[Question][3.+ for 1.13.2] Why does prepareRuns depend on classes and not build? #560

Closed ghost closed 5 years ago

ghost commented 5 years ago

I stumbled upon this while writing a custom resource processor. Here's output from runClient --dry-run: :compileKotlin SKIPPED :compileJava SKIPPED :processResources SKIPPED :classes SKIPPED :downloadMCMeta SKIPPED :downloadAssets SKIPPED :extractNatives SKIPPED :prepareRuns SKIPPED :prepareRunClient SKIPPED :runClient SKIPPED

Depending on this skips, among other custom tasks (shadowing maybe?), tests and checks that run before build. Any reason why it doesn't depend on build?

AbrarSyed commented 5 years ago

The build task doesn't actually do anything. Its only value is that it depends on the tasks that compile the code, package a jar, run tests, and maybe deploy. RunClient only really needs the code to be compiled and the resources to be processed. The rest of the skipped tasks are things to make sure MC is setup correctly, and since they were skipped, it seems that everything is in fact in order.

Shadowing and such inst done before runClient. If you wanna see whats really going on, try running gradle tasks --all

On 2/18/19 8:01 PM, SapozhnikovD wrote:

I stumbled upon this while writing a custom resource processor. Here's output from runClient --dry-run: |:compileKotlin SKIPPED :compileJava SKIPPED :processResources SKIPPED :classes SKIPPED :downloadMCMeta SKIPPED :downloadAssets SKIPPED :extractNatives SKIPPED :prepareRuns SKIPPED :prepareRunClient SKIPPED :runClient SKIPPED|

Depending on this skips, among other custom tasks (shadowing maybe?), tests and checks that run before build. Any reason why it doesn't depend on build?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MinecraftForge/ForgeGradle/issues/560, or mute the thread https://github.com/notifications/unsubscribe-auth/AAf9SQb1dwVIwEj-sT9P5hBc9qf2e6Ckks5vO1rpgaJpZM4bCBCq.

ghost commented 5 years ago

They were all skipped since I used --dry-run to see all tasks that are going to be executed. tasks --all doesn't show task graphs since 3.3.

I'm not exactly sure about skipping tests and still a bit worried it won't run some of the custom tasks in more complicated setups, but I suppose that can be solved with a simple prepareRuns.dependsOn build. Just wanted to know if there's a reason for that dependency.