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

extractIr task dependencies are configured correctly #1128

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

carterkozak
Copy link
Contributor

==COMMIT_MSG==
extractIr task dependencies are configured correctly
==COMMIT_MSG==

@changelog-app
Copy link

changelog-app bot commented Dec 6, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

extractIr task dependencies are configured correctly

Check the box to generate changelog(s)

  • Generate changelog entry

import org.gradle.api.tasks.OutputDirectory;
import org.gradle.api.tasks.Sync;

public abstract class ExtractConjureIrTask extends Sync {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely my preferred way of writing all Gradle tasks in plugins now, making an implementation of the standard task type with real input/output properties.

Provider<File> conjureIrFile = extractConjureIr.map(
irTask -> new File(irTask.getDestinationDir(), project.getName() + ".conjure.json"));
Provider<File> conjureIrFile = extractConjureIr
.flatMap(task -> task.getConjureIr().file(project.getName() + ".conjure.json"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this sets up the task dependency correctly (you can run with --dry-run)? This seems functionally the same to me as the previous code, except with some added custom types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

womp:

Querying the mapped value of map(flatmap(provider(task 'extractConjureIr', class com.palantir.gradle.conjure.ExtractConjureIrTask))) before task ':remote-api:extractConjureIr' has completed is not supported

@carterkozak
Copy link
Contributor Author

Whew, so I've updated this PR based on feedback, and I believe it does make the code easier to follow, and probably gives gradle more information to help us. However, I don't believe any change is necessary in this project as the root cause appears to be resolved by: palantir/sls-packaging#1417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants