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

CopyAppDependenciesTask to copy just the changed dependencies #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TurekBot
Copy link
Contributor

Okay, this isn't quite ready yet, but I'm going to start the pull request so it can be seen what I've got so far.

I've been following the suggestions of @aalmiray from Issue #23.

its inputs and outputs. Here I've given the task properties and identified
them with the appropriate annotations, as described in the
documentation (https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:up_to_date_checks)
* Using the IncrementalTaskInputs, as described in the documentation, to
only do something about inputs that have changed.

* I don't think I'm passing in the inputs in right, but they need to be
passed in somewhere, right?

* I realized that I'd made the properties private and like that no one
can access them. Did I get them right this time?
File workingDirectory = project.extensions.fxlauncher.resolveWorkingDirectory()
if (!workingDirectory.exists()) workingDirectory.mkdirs()
project.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
void copyDependencies(IncrementalTaskInputs inputs) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The IncrementalTaskInputs, is a way, according to the documentation, to check if each input has changed, and only deal with the changed ones.

@@ -54,7 +54,11 @@ class FXLauncherPlugin implements Plugin<Project> {
type: CopyAppDependenciesTask,
group: 'FXLauncher',
description: 'Copies all application runtime dependencies into working directory',
dependsOn: project.tasks.jar
dependsOn: project.tasks.jar,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aalmiray, maybe you can leave one of those newfangled suggestions on how to do this the right way?

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.

1 participant