Skip to content

Commit

Permalink
Name refactor, add test artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafał committed May 23, 2019
1 parent 5ee8d32 commit 5e9aa45
Show file tree
Hide file tree
Showing 19 changed files with 146 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.devstruktor.PermissionRequestState
import com.devstruktor.coroutine_permission.CoroutinePermissions
import com.devstruktor.coroutine_permission.staticPermission.SuspendPermissions
import com.devstruktor.coroutinePermission.CoroutinePermissions
import com.devstruktor.coroutinePermission.staticPermission.SuspendPermissions
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.coroutines.*
import kotlin.coroutines.CoroutineContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.devstruktor.coroutinepermissionexample

import android.app.Application
import android.widget.Toast
import com.devstruktor.coroutine_permission.CoroutinePermissions
import com.devstruktor.coroutinePermission.CoroutinePermissions
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ allprojects {
ext {

publishedGroupId = 'com.devstruktor.coroutinePermission'
artifact = 'coroutinePermission'

libraryName = 'CoroutinePermission'
libraryVersion = '2.2.0'

Expand Down
4 changes: 1 addition & 3 deletions coroutine_permission/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'kotlin-android'

group = publishedGroupId
version = libraryVersion

android {
compileSdkVersion 28
Expand Down Expand Up @@ -35,7 +33,7 @@ install {
project {
packaging 'aar'
groupId publishedGroupId
artifactId artifact
artifactId "coroutine-permission"

name libraryName
description libraryDescription
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devstruktor.coroutine_permission;
package com.devstruktor.coroutinePermission;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand Down
2 changes: 1 addition & 1 deletion coroutine_permission/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devstruktor.coroutine_permission">
package="com.devstruktor.coroutinePermission">

<application>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devstruktor.coroutine_permission
package com.devstruktor.coroutinePermission

import android.content.Context
import com.devstruktor.nabinbhandariPermissions.PermissionHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.devstruktor.coroutine_permission
package com.devstruktor.coroutinePermission

import androidx.fragment.app.FragmentActivity
import com.devstruktor.coroutine_permission.activityPermission.CoroutineActivityPermissions
import com.devstruktor.coroutine_permission.activityPermission.SuspendActivityPermissions
import com.devstruktor.coroutine_permission.staticPermission.CoroutineStaticPermissions
import com.devstruktor.coroutine_permission.staticPermission.SuspendPermissions
import com.devstruktor.coroutinePermission.activityPermission.CoroutineActivityPermissions
import com.devstruktor.coroutinePermission.activityPermission.SuspendActivityPermissions
import com.devstruktor.coroutinePermission.staticPermission.CoroutineStaticPermissions
import com.devstruktor.coroutinePermission.staticPermission.SuspendPermissions
import com.devstruktor.initalizer.PermissionsInitProvider
import com.devstruktor.nabinbhandariPermissions.Permissions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package com.devstruktor.coroutine_permission.activityPermission
package com.devstruktor.coroutinePermission.activityPermission

import android.Manifest
import android.content.Context
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import com.devstruktor.PermissionRequestState
import com.devstruktor.coroutine_permission.staticPermission.CoroutineStaticPermissions
import com.devstruktor.coroutinePermission.staticPermission.CoroutineStaticPermissions
import com.devstruktor.nabinbhandariPermissions.Permissions
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.devstruktor.coroutine_permission.activityPermission
package com.devstruktor.coroutinePermission.activityPermission

import com.devstruktor.PermissionRequestState
import com.devstruktor.coroutine_permission.staticPermission.SuspendPermissions
import com.devstruktor.coroutinePermission.staticPermission.SuspendPermissions

interface SuspendActivityPermissions: SuspendPermissions {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.devstruktor.coroutine_permission.staticPermission
package com.devstruktor.coroutinePermission.staticPermission

import android.Manifest
import android.content.Context
import com.devstruktor.coroutine_permission.CoroutinePermissionHandler
import com.devstruktor.coroutinePermission.CoroutinePermissionHandler
import com.devstruktor.nabinbhandariPermissions.Permissions
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.suspendCancellableCoroutine
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devstruktor.coroutine_permission.staticPermission
package com.devstruktor.coroutinePermission.staticPermission


interface SuspendPermissions {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.devstruktor.coroutine_permission;
package com.devstruktor.coroutinePermission;

import org.junit.Test;

Expand Down
1 change: 1 addition & 0 deletions coroutine_permission_test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
80 changes: 80 additions & 0 deletions coroutine_permission_test/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28



defaultConfig {
minSdkVersion 21
targetSdkVersion 28
versionCode 2
versionName "2.2.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

}

install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
groupId publishedGroupId
artifactId "coroutine-permission-test"

name libraryName
description libraryDescription
url siteUrl

licenses {
license {
name licenseName
url licenseUrl
}
}
developers {
developer {
id developerId
name developerName
email developerEmail
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl

}
}
}
}
}

dependencies {

implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

implementation group: 'org.jetbrains.kotlinx', name: 'kotlinx-coroutines-core', version: '1.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'

implementation "androidx.lifecycle:lifecycle-livedata:2.0.0"

implementation project(path:':coroutine_permission')


}
21 changes: 21 additions & 0 deletions coroutine_permission_test/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
6 changes: 6 additions & 0 deletions coroutine_permission_test/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devstruktor.coroutine_permission_test">



</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.devstruktor

import com.devstruktor.coroutinePermission.staticPermission.SuspendPermissions

class TestCoroutinePermission(private val returnSuccess: Boolean) : SuspendPermissions {
override suspend fun request(permission: String) = returnSuccess

override suspend fun requestLocation() = returnSuccess

override suspend fun requestCamera() = returnSuccess

override suspend fun requestExternalStorageRead() = returnSuccess

override suspend fun requestExternalStorageWrite() = returnSuccess

}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app', ':coroutine_permission'
include ':app', ':coroutine_permission',':coroutine_permission_test'

0 comments on commit 5e9aa45

Please sign in to comment.