From d2ea697e0cb1a3d2752263de66fb84135a1eab38 Mon Sep 17 00:00:00 2001 From: Qifan Yang <14819756+underwindfall@users.noreply.github.com> Date: Fri, 3 Apr 2020 22:25:24 +0200 Subject: [PATCH] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++ .github/pull_request_template.md | 8 ++++ .github/workflows/check.yml | 16 ++++++++ README.md | 3 ++ README_ZH.md | 4 ++ .../ExampleInstrumentedTest.kt | 24 ------------ dependencies.gradle | 8 ++++ powerpermission-coroutines/build.gradle | 10 ++--- powerpermission-livedata/build.gradle | 10 ++--- powerpermission-rxjava2/build.gradle | 10 ++--- powerpermission-rxjava3/build.gradle | 10 ++--- powerpermission/build.gradle | 10 ++--- .../core/PowerPermissionManager.kt | 8 +++- 14 files changed, 123 insertions(+), 56 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/check.yml delete mode 100644 app/src/androidTest/java/com/qifan/powerpermission/ExampleInstrumentedTest.kt diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..532ad38 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,8 @@ +### Guidelines + +1. You must run the `spotlessApply` task before commiting, either through Android Studio or with `./gradlew spotlessApply`. +2. A PR should be focused and contained. If you are changing multiple unrelated things, they should be in separate PRs. +3. A PR should fix a bug or solve a problem - something that only you would use is not necessarily something that should be published. +4. Give your PR a detailed title and description - look over your code one last time before actually creating the PR. Give it a self-review. + +**If you do not follow the guidelines, your PR will be rejected.** \ No newline at end of file diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..a04ccb6 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,16 @@ +name: Android Check CI +on: [push] + +jobs: + build: + + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v1 + - name: set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Build with Gradle + run: ./gradlew build check \ No newline at end of file diff --git a/README.md b/README.md index 493255a..c4be93b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # PowerPermission +[ ![jCenter](https://api.bintray.com/packages/undervoid/PowerPermission/powerpermission/images/download.svg) ](https://bintray.com/undervoid/maven/Powerpermission/powerpermission/_latestVersion) +[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0.html) +![Android Check CI](https://github.com/underwindfall/PowerPermission/workflows/Android%20Check%20CI/badge.svg) #### English Documentation | [中文文档](https://github.com/underwindfall/PowerPermission/blob/master/README_ZH.md) ## Table of Contents diff --git a/README_ZH.md b/README_ZH.md index 349bf48..c6192d2 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -1,4 +1,7 @@ # PowerPermission +[ ![jCenter](https://api.bintray.com/packages/undervoid/PowerPermission/powerpermission/images/download.svg) ](https://bintray.com/undervoid/maven/Powerpermission/powerpermission/_latestVersion) +[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0.html) +![Android Check CI](https://github.com/underwindfall/PowerPermission/workflows/Android%20Check%20CI/badge.svg) #### [English Documentation](https://github.com/underwindfall/PowerPermission) | 中文文档 ## 目录 @@ -22,6 +25,7 @@ - [自定义解释界面](#-------) - [Choose those permissions are rational](#choose-those-permissions-are-rational) * [License](#license) + ## 简介 `PowerPermission` 主要针对 `Android` 开发者在面对请求[RuntimePermission](https://developer.android.com/reference/java/lang/RuntimePermission)时的复杂流程的使用进行简化,来提高代码的便携效率。 > 在这个Repo已经有个示例的`application`或者你可以通过这个[链接](https://github.com/underwindfall/PowerPermission/releases)直接下载APK. diff --git a/app/src/androidTest/java/com/qifan/powerpermission/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/qifan/powerpermission/ExampleInstrumentedTest.kt deleted file mode 100644 index 6689dc7..0000000 --- a/app/src/androidTest/java/com/qifan/powerpermission/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.qifan.powerpermission - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.qifan.powerpermission", appContext.packageName) - } -} diff --git a/dependencies.gradle b/dependencies.gradle index ab85bdc..07b9173 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -47,4 +47,12 @@ ext { //mock mockKVersion = "1.9.3" mockK = "io.mockk:mockk:$mockKVersion" + + + publishVersionID = "1.0.0" + groupProjectID = "com.qifan.powerpermission" + userName = "undervoid" + libName = "PowerPermission" + descriptionLib = "PowerPermission makes handling runtime permissions extremely easy." + websiteLib = "https://github.com/underwindfall/PowerPermission" } \ No newline at end of file diff --git a/powerpermission-coroutines/build.gradle b/powerpermission-coroutines/build.gradle index 6a452dd..85819e5 100644 --- a/powerpermission-coroutines/build.gradle +++ b/powerpermission-coroutines/build.gradle @@ -41,15 +41,13 @@ dependencies { } publish { - def groupProjectID = "com.qifan.powerpermission" - def publishVersionID = "1.0.0" def artifactProjectID = "powerpermission-coroutines" - userOrg = "undervoid" - repoName = "PowerPermission" + userOrg = userName + repoName = libName groupId = groupProjectID artifactId = artifactProjectID publishVersion = publishVersionID - desc = "PowerPermission makes handling runtime permissions extremely easy." - website = "https://github.com/underwindfall/PowerPermission" + desc = descriptionLib + website = websiteLib } \ No newline at end of file diff --git a/powerpermission-livedata/build.gradle b/powerpermission-livedata/build.gradle index cba4c91..c2bcb0e 100644 --- a/powerpermission-livedata/build.gradle +++ b/powerpermission-livedata/build.gradle @@ -40,15 +40,13 @@ dependencies { } publish { - def groupProjectID = "com.qifan.powerpermission" - def publishVersionID = "1.0.0" def artifactProjectID = "powerpermission-livedata" - userOrg = "undervoid" - repoName = "PowerPermission" + userOrg = userName + repoName = libName groupId = groupProjectID artifactId = artifactProjectID publishVersion = publishVersionID - desc = "PowerPermission makes handling runtime permissions extremely easy." - website = "https://github.com/underwindfall/PowerPermission" + desc = descriptionLib + website = websiteLib } \ No newline at end of file diff --git a/powerpermission-rxjava2/build.gradle b/powerpermission-rxjava2/build.gradle index 4a5ae9e..872b842 100644 --- a/powerpermission-rxjava2/build.gradle +++ b/powerpermission-rxjava2/build.gradle @@ -39,15 +39,13 @@ dependencies { } publish { - def groupProjectID = "com.qifan.powerpermission" - def publishVersionID = "1.0.0" def artifactProjectID = "powerpermission-rxjava2" - userOrg = "undervoid" - repoName = "PowerPermission" + userOrg = userName + repoName = libName groupId = groupProjectID artifactId = artifactProjectID publishVersion = publishVersionID - desc = "PowerPermission makes handling runtime permissions extremely easy." - website = "https://github.com/underwindfall/PowerPermission" + desc = descriptionLib + website = websiteLib } \ No newline at end of file diff --git a/powerpermission-rxjava3/build.gradle b/powerpermission-rxjava3/build.gradle index c7837d0..034861c 100644 --- a/powerpermission-rxjava3/build.gradle +++ b/powerpermission-rxjava3/build.gradle @@ -40,15 +40,13 @@ dependencies { } publish { - def groupProjectID = "com.qifan.powerpermission" - def publishVersionID = "1.0.0" def artifactProjectID = "powerpermission-rxjava3" - userOrg = "undervoid" - repoName = "PowerPermission" + userOrg = userName + repoName = libName groupId = groupProjectID artifactId = artifactProjectID publishVersion = publishVersionID - desc = "PowerPermission makes handling runtime permissions extremely easy." - website = "https://github.com/underwindfall/PowerPermission" + desc = descriptionLib + website = websiteLib } \ No newline at end of file diff --git a/powerpermission/build.gradle b/powerpermission/build.gradle index 937dd58..72d27fc 100644 --- a/powerpermission/build.gradle +++ b/powerpermission/build.gradle @@ -63,15 +63,13 @@ dependencies { } publish { - def groupProjectID = "com.qifan.powerpermission" - def publishVersionID = "1.0.0" def artifactProjectID = "powerpermission" - userOrg = "undervoid" - repoName = "PowerPermission" + userOrg = userName + repoName = libName groupId = groupProjectID artifactId = artifactProjectID publishVersion = publishVersionID - desc = "PowerPermission makes handling runtime permissions extremely easy." - website = "https://github.com/underwindfall/PowerPermission" + desc = descriptionLib + website = websiteLib } \ No newline at end of file diff --git a/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt b/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt index 137c04e..f37828f 100644 --- a/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt +++ b/powerpermission/src/main/java/com/qifan/powerpermission/core/PowerPermissionManager.kt @@ -33,7 +33,9 @@ class PowerPermissionManager internal constructor() { "Created new PermissionFragment for %s", fragmentActivity::class.java.simpleName ) - fragmentActivity.transact { add(this@apply, TAG_ACTIVITY) } + fragmentActivity.transact { + add(this@apply, TAG_ACTIVITY) + } } } else { debug( @@ -52,7 +54,9 @@ class PowerPermissionManager internal constructor() { "Created new PermissionFragment for %s", fragment::class.java.simpleName ) - fragment.transact { add(this@apply, TAG_FRAGMENT) } + fragment.transact { + add(this@apply, TAG_FRAGMENT) + } } } else { debug(