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

Issue: #952 Make project.sync() a public API #1137

Merged
merged 1 commit into from Mar 28, 2017
Merged

Issue: #952 Make project.sync() a public API #1137

merged 1 commit into from Mar 28, 2017

Conversation

hotchemi
Copy link
Contributor

@hotchemi hotchemi commented Jan 10, 2017

Overview

Any of the checked boxes below indicate that I took action:

For all non-trivial changes that modify the behavior or public API:

  • Before submitting a pull request, I started a discussion on the Gradle developer list,
    the forum or can reference a JIRA issue.
  • I considered writing a design document. A design document can be
    brief but explains the use case or problem you are trying to solve,
    touches on the planned implementation approach as well as the test cases
    that verify the behavior. Optimally, design documents should be submitted
    as a separate pull request. Samples
    can be found in the Gradle GitHub repository. Please let us know if you need help with
    creating the design document. We are happy to help!
  • The pull request contains an appropriate level of unit and integration
    test coverage to verify the behavior. Before submitting the pull request
    I ran a build on your local machine via the command
    ./gradlew quickCheck <impacted-subproject>:check.
  • The pull request updates the Gradle documentation like user guide,
    DSL reference and Javadocs where applicable.

@eriwen eriwen added a:feature A new functionality from:contributor in:core DO NOT USE labels Jan 10, 2017
Copy link
Member

@big-guy big-guy left a comment

Choose a reason for hiding this comment

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

Thanks @hotchemi.

The changes look good to me, except for the documentation comments and some test coverage. I'd like to see some more test coverage in SyncTaskIntegrationTest like we have in CopyTaskIntegrationSpec.

Specifically, I'd like to see a "sync action" test that's like "copy action" where the build has a set of source files and the destination has some files already in it. The build script should define a task that uses project.sync. After the task runs, the destination should have all files from the source and none of the pre-existing files.

And then I'd like to see the same sort of test for "copy single files", "copy from file tree", "copy from file collection", and "copy from composite file collection", but using project.sync. The important difference with this is that we should have something in the destination before running the task and ensure that it's removed after running the task.

Thanks again for helping out.

* Synchronizes the contents of a destination directory with some source directories and files.
*
* <p>
* This task is like the {@link #copy(Action)} task, except the destination directory will only contain the files copied.
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a "task", so we should probably just say This method is like {@link #copy(Action)}, ...

@@ -1452,6 +1452,41 @@
CopySpec copySpec();

/**
* Synchronizes the contents of a destination directory with some source directories and files.
Copy link
Member

Choose a reason for hiding this comment

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

We should make this follow with copy(Action) says, e.g.:

Synchronizes the contents of a destination directory with some source directories and files. The given action is used to configure a {@link CopySpec}, which is then used to synchronize the files.

* <p>
* Examples:
* <pre autoTested=''>
* // Sync can be used like a Copy task
Copy link
Member

Choose a reason for hiding this comment

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

Like copy(Closure), we should have an example that uses project.sync instead of the Sync task.

@hotchemi
Copy link
Contributor Author

@big-guy Thank you for your polite review and sorry for my misunderstanding🙇 Addressed at a8cda8c.

@hotchemi
Copy link
Contributor Author

🙇

@big-guy
Copy link
Member

big-guy commented Jan 16, 2017

@hotchemi Thanks for your help. Could you follow up on adding some integration tests that I described here: #1137 (review) ?

@hotchemi
Copy link
Contributor Author

@big-guy Ah sorry I missed...let me work on.

@bmuschko
Copy link
Contributor

@hotchemi Are you still planning to add the requested tests?

@hotchemi
Copy link
Contributor Author

@bmuschko Ah sorry I forgot to do that...let me work on 🙇

- Add Project.java to the signature and doc.
- Add the method to the DSL.
- Add integration tests for new exposed api.
@hotchemi
Copy link
Contributor Author

@big-guy @bmuschko really sorry for leaving the PR long time...added several integration tests and squash commits to one 🙇

@bmuschko
Copy link
Contributor

@big-guy Tests were added. Can you have another look?

@big-guy big-guy merged commit 2a07a82 into gradle:master Mar 28, 2017
@big-guy
Copy link
Member

big-guy commented Mar 28, 2017

Thanks @hotchemi, this will be in the next release (after 3.5).

@hotchemi hotchemi deleted the hotchemi/issues/752 branch March 29, 2017 00:59
@hotchemi
Copy link
Contributor Author

@big-guy Thx 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:core DO NOT USE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make project.sync() a public API
4 participants