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

Unused deps check #171

Merged
merged 10 commits into from Jul 15, 2019

Conversation

@weiminyu
Copy link
Collaborator

commented Jul 12, 2019

Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

This change is Reviewable

weiminyu added some commits Jul 12, 2019

Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

@googlebot googlebot added the cla: yes label Jul 12, 2019

weiminyu added some commits Jul 12, 2019

Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

@weiminyu weiminyu requested review from hstonec, jianglai and gbrodman Jul 12, 2019

@hstonec
Copy link
Collaborator

left a comment

Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @gbrodman, @hstonec, @jianglai, and @weiminyu)


build.gradle, line 265 at r1 (raw file):

      configurations.all {
        it.dependencies.findAll { it.group != null }.each {
          depsInUse.add("${it.group}:${it.name}".toString())

remove .toString() ?


build.gradle, line 281 at r1 (raw file):

    }
    logger.error(
        "The following are not direct dependencies:\n${unusedDeps.toListString()}")

Maybe just say these dependencies are defined in the file but not actually used ?


buildSrc/build.gradle, line 93 at r1 (raw file):

}

task exportDenpendencies {

When do we need to use this task?

weiminyu added some commits Jul 12, 2019

Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
Check for unused dependencies
Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
@weiminyu
Copy link
Collaborator Author

left a comment

Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @gbrodman, @hstonec, and @jianglai)


build.gradle, line 265 at r1 (raw file):

Previously, hstonec (Shicong Huang) wrote…

remove .toString() ?

Commented on why it is necessary.


build.gradle, line 281 at r1 (raw file):

Previously, hstonec (Shicong Huang) wrote…

Maybe just say these dependencies are defined in the file but not actually used ?

Done.


buildSrc/build.gradle, line 93 at r1 (raw file):

Previously, hstonec (Shicong Huang) wrote…

When do we need to use this task?

Invoked from root, ../build.gradle:258

}
tasks.build.dependsOn(tasks.checkDependenciesDotGradle)

def createGetBuildSrcDirectDepsTask(outputFileName) {

This comment has been minimized.

Copy link
@gbrodman

gbrodman Jul 15, 2019

Collaborator

Should we prioritize moving buildSrc to a separate project?

@@ -251,3 +251,49 @@ subprojects {
}
}
}

task checkDependenciesDotGradle {

This comment has been minimized.

Copy link
@gbrodman

gbrodman Jul 15, 2019

Collaborator

Thoughts on moving this to the dependencies.gradle file?

@weiminyu
Copy link
Collaborator Author

left a comment

Reviewable status: 0 of 3 files reviewed, 5 unresolved discussions (waiting on @gbrodman, @hstonec, and @jianglai)


build.gradle, line 255 at r2 (raw file):

Previously, gbrodman wrote…

Thoughts on moving this to the dependencies.gradle file?

Can't do it until buildSrc is removed.


build.gradle, line 290 at r2 (raw file):

Previously, gbrodman wrote…

Should we prioritize moving buildSrc to a separate project?

I think buildSrc will go away after Lai's work, but this is simple enough and needn't wait.

@hstonec
Copy link
Collaborator

left a comment

Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @gbrodman, @hstonec, and @jianglai)

@weiminyu weiminyu merged commit 62eab98 into google:master Jul 15, 2019

3 of 4 checks passed

code-review/reviewable 3 files, 3 discussions left (gbrodman, hstonec, jianglai)
Details
cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
kokoro Kokoro build finished
Details

@weiminyu weiminyu deleted the weiminyu:unused-deps-check branch Jul 15, 2019

CydeWeys added a commit to CydeWeys/nomulus that referenced this pull request Jul 19, 2019

Unused deps check (google#171)
* Save for later

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.

* Check for unused dependencies

Add a task to check for unused dependencies in
dependencies.gradle. This file should only contain
dependencies explicitly added to a configuration
in root project or some subprojects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.