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

Prepare for 3.0.1 and tweak a migration guide. #382

Merged
merged 1 commit into from
Sep 17, 2017
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ChangeLog

- 3.0.1 2017/09/17
- Fix: NeedsPermission annotated method with parameter doesn't work in Kotlin [#376](https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/376)
- Fix: CallNeedsPermission check incorrectly flags calls to methods of different class [#377](https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/377)
- 3.0.0 2017/09/16
- Add fully [Kotlin support](https://github.com/hotchemi/PermissionsDispatcher/blob/master/doc/kotlin_support.md)!
- Allow for Deterministic, Reproducible Builds with sorted inputs [#342](https://github.com/permissions-dispatcher/PermissionsDispatcher/pull/342)
Expand Down
18 changes: 8 additions & 10 deletions doc/migration_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [Migrating to 3.x](#migrating-to-permissionsdispatcher-3x)
- [Migrating to 2.x](#migrating-to-permissionsdispatcher-2x)

## Migrating to PermissionsDispatcher 3.x
## Migrating to 3.x

### Method name changing

Expand All @@ -25,16 +25,16 @@ This change is especially beneficial in Kotlin, because the receiver of the gene

Issue: [#320](https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/320)

Actually it's been possible to use PermissionsDispatcher with Kotlin already, because of its interoperability with Java. But to give you a more concise, comfortable and idiomatic experience, we added full Kotlin support which is described in [here](kotlin_support.md).
Actually it's been possible to use PermissionsDispatcher with Kotlin already, because of its interoperability with Java. But to give you a more concise and idiomatic experience, we added full Kotlin support which is described in [here](kotlin_support.md).

If you're already using PermissionsDispatcher with Kotlin, be aware of the following 2 changes:

#### `***WithPermissionCheck`

```diff
button.setOnClickListener {
- MainActivityPermissionsDispatcher.showCameraWithCheck(this)
+ showCameraWithPermissionCheck()
- MainActivityPermissionsDispatcher.showCameraWithCheck(this)
+ showCameraWithPermissionCheck()
}
```

Expand All @@ -43,16 +43,14 @@ button.setOnClickListener {
```diff
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
- MainActivityPermissionsDispatcher.onRequestPermissionsResult(requestCode, grantResults)
+ onRequestPermissionsResult(requestCode, grantResults)
- MainActivityPermissionsDispatcher.onRequestPermissionsResult(requestCode, grantResults)
+ onRequestPermissionsResult(requestCode, grantResults)
}
```

And that's it!
Those methods are defined as extension functions so now you don't have to call `***MainActivityPermissionsDispatcher` class!



## Migrating to PermissionsDispatcher 2.x
## Migrating to 2.x

Since the internals of PermissionsDispatcher 2 have undergone a fundamental refactoring, most notably in the switch of languages to Kotlin for our annotation processor, the exposed APIs to users of the library have been tweaked as well. This guide will help you migrate to the latest version in just a few minutes!

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ USER = hotchemi
GROUP_ID = com.github.hotchemi
ARTIFACT_ID_LIBRARY = permissionsdispatcher
ARTIFACT_ID_PROCESSOR = permissionsdispatcher-processor
VERSION = 3.1.0-SNAPSHOT
VERSION = 3.0.1
DESCRIPTION = Annotation-based library for generating runtime permissions dispatcher.
WEBSITE = https://github.com/hotchemi/PermissionsDispatcher
LICENCES = ['Apache-2.0']

# Plugin versions
GRADLE_PLUGIN_VERSION=3.0.0-beta5
GRADLE_PLUGIN_VERSION=3.0.0-beta6
KOTLIN_VERSION=1.1.4-3
BINTRAY_PLUGIN_VERSION=0.5.0
CONFIG_PLUGIN_VERSION=2.2.2
Expand Down