Skip to content

Commit

Permalink
Merge pull request #382 from permissions-dispatcher/prepare_3.0.1
Browse files Browse the repository at this point in the history
Prepare for 3.0.1 and tweak a migration guide.
  • Loading branch information
hotchemi committed Sep 17, 2017
2 parents f94f8f1 + 7605410 commit 107b98b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -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
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
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

0 comments on commit 107b98b

Please sign in to comment.