Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

How to set build.gradle file to execute checkLicenses task every time after sync #37

Closed
ghost opened this issue Jan 18, 2017 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 18, 2017

In our project we want to check licenses automatically every time after sync.
I can do that by setting my own gradle task in my Android Studio, but we want the whole team could do the same thing without other setting.

Thank you for making this convenient library!

@ghost
Copy link
Author

ghost commented Jan 19, 2017

@reiko8D
You mean you'd like to run checkLicense every gradle sync on AS with configuring build.gradle, don't you?

You can it with preBuild.dependsOn(checkLicense), I think. http://stackoverflow.com/questions/27816699/android-studio-gradle-task-to-execute-after-sync

But we recommend you run the task on CI since the task takes additional time.

@ghost
Copy link
Author

ghost commented Jan 20, 2017

@Kazu-matsu

Thank you for your answer, I tried preBuild.dependsOn(checkLicense), but get build error

Error:(25, 0) Could not get unknown property 'checkLicense' for project ':app' of type org.gradle.api.Project.

I also asked similar question how to set build.gradle file at stackoverflow.

We will run the check task before release until we find a way to do it automatically.
Anyway, arigatou gozaimasu.

@ghost
Copy link
Author

ghost commented Jan 20, 2017

@reiko8D
Oops, I think its my mistake. checkLicense should be checkLicenses.
checkLicense part should set correct task name you can obtain from gradle tasks.

@ghost
Copy link
Author

ghost commented Jan 20, 2017

I think stackoverflow is better than asking about it here since this issue is related to Gradle and Android Studio.

So, I close this issue.
Thanks!

@ghost ghost closed this as completed Jan 20, 2017
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants