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

Gradle 4.8-rc-1 compat fix - use def when finding the buildType #110

Merged
merged 3 commits into from
May 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 3.2.7 (TBD)

### Bug fixes

* Add compatibility with Gradle 4.8-rc1 - use def rather than TreeSet when finding the buildType
[Jamie Lynch](https://github.com/fractalwrench) [#110](https://github.com/bugsnag/bugsnag-android-gradle-plugin/pull/110)

## 3.2.6 (2018-04-24)

* Update Android Plugin for Gradle version to 3.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class BugsnagPlugin implements Plugin<Project> {
private static boolean isJackEnabled(Project project, BaseVariant variant) {

// First check the selected build type to see if there are jack settings
TreeSet buildTypes = project.android.buildTypes.store
def buildTypes = project.android.buildTypes.store

Choose a reason for hiding this comment

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

haha, Groovy is helpful sometimes right

BuildType b = findNode(buildTypes, variant.baseName)

if (b?.hasProperty('jackOptions')
Expand Down Expand Up @@ -287,7 +287,7 @@ class BugsnagPlugin implements Plugin<Project> {
String toolchain = null

// First check the selected build type to see if there are cmake arguments
TreeSet buildTypes = project.android.buildTypes.store
def buildTypes = project.android.buildTypes.store
BuildType b = findNode(buildTypes, variant.baseName)

if (b != null
Expand Down Expand Up @@ -340,7 +340,7 @@ class BugsnagPlugin implements Plugin<Project> {
* @param name The name of the buildtype to search for
* @return The buildtype, or null if not found
*/
private static BuildType findNode(TreeSet<BuildType> set, String name) {
private static BuildType findNode(def set, String name) {
Iterator<BuildType> iterator = set.iterator()

while (iterator.hasNext()) {
Expand Down