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

fix: support provider api introduced in gradle 4.7 #122

Merged
merged 1 commit into from
Aug 7, 2018

Conversation

fractalwrench
Copy link
Contributor

Goal

Gradle 4.7 introduced a provider API for lazy evaluation of properties. The AGP subsequently changed the type of the manifestOutputDir property from File to Provider. This changeset supports that API change while maintaining backward compatibility.

Changeset

If manifestOutputDir is not a File, assume it is using the Provider API and coerce it to a file.

Tests

Tested manually on an app using AGP 3.1.0 and another app running AGP 3.3.0.

Additionally the mazerunner scenarios were run on AGP 3.0.1, and then updated to also run on AGP 3.3.0. It's worth noting that the default_lib feature does not pass in the 3.3.0 project - this is thought to be due to a separate issue.

Linked issues

#121

gradle 4.7 introduced a provider API for lazy evaluation of properties, AGP subsequently changed the
API from File to Provider<File> for manifestOutputDir
@fractalwrench fractalwrench requested a review from a team August 3, 2018 15:59
Copy link

@martin308 martin308 left a comment

Choose a reason for hiding this comment

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

Just one question around the import statement. If that works then this looks good to me.

@@ -4,6 +4,8 @@ import com.android.build.gradle.api.BaseVariant
import com.android.build.gradle.api.BaseVariantOutput
import groovy.xml.Namespace
import org.gradle.api.DefaultTask
import org.gradle.api.file.Directory
import org.gradle.api.provider.Provider

Choose a reason for hiding this comment

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

do we support gradle versions less than 4.7? If so would there be an issue with this import when used with gradle < 4.7?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We support lower than 4.7. The import doesn't seem to be an issue as the mazerunner scenarios pass on CI, which uses gradle <4.7.

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.

2 participants