Skip to content

Commit

Permalink
Update lint to alpha9.
Browse files Browse the repository at this point in the history
Replace compile to implementation, testCompiler to testImplementation.
Apply formatter.
  • Loading branch information
hotchemi committed Sep 15, 2017
1 parent f50be7f commit 06f4720
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 61 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MOCKITO_VERSION=1.10.19
POWERMOCK_VERSION=1.6.4
COMPILE_TESTING_VERSION=0.6
GOOGLE_ANDROID_VERSION=4.1.1.4
LINT_VERSION=26.0.0-alpha8
LINT_VERSION=26.0.0-alpha9
ROBOLECTRIC_VERSION=3.3.2

# Android configuration
Expand Down
12 changes: 6 additions & 6 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ configurations {
}

dependencies {
compile "com.android.support:support-compat:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:support-v13:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:support-compat:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:support-v13:$SUPPORT_LIBRARY_VERSION"

testCompile "junit:junit:$JUNIT_VERSION"
testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
testCompile "org.powermock:powermock-api-mockito:$POWERMOCK_VERSION"
testCompile "org.powermock:powermock-module-junit4:$POWERMOCK_VERSION"
testImplementation "junit:junit:$JUNIT_VERSION"
testImplementation "org.mockito:mockito-core:$MOCKITO_VERSION"
testImplementation "org.powermock:powermock-api-mockito:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-module-junit4:$POWERMOCK_VERSION"

lintChecks project(path: ':lint', configuration: 'lintChecks')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ abstract class KotlinBaseProcessorUnit : KtProcessorUnit {
override fun createFile(rpe: RuntimePermissionsElement, requestCodeProvider: RequestCodeProvider): KotlinFile {
return KotlinFile.builder(rpe.packageName, rpe.generatedClassName)
.addFileComment(FILE_COMMENT)
.addFileAnnotation(createFileAnnotation(rpe))
.addProperties(createProperties(rpe.needsElements, requestCodeProvider))
.addFunctions(createWithPermissionCheckFuns(rpe))
.addFunctions(createPermissionHandlingFuns(rpe))
Expand All @@ -66,11 +65,6 @@ abstract class KotlinBaseProcessorUnit : KtProcessorUnit {

/* Begin private */

private fun createFileAnnotation(rpe: RuntimePermissionsElement): AnnotationSpec =
AnnotationSpec.builder(JvmName::class)
.addMember("name", "\"${rpe.generatedClassName}\"")
.build()

private fun createProperties(needsElements: List<ExecutableElement>, requestCodeProvider: RequestCodeProvider): List<PropertySpec> {
val properties: ArrayList<PropertySpec> = arrayListOf()
// The Set of annotated elements needs to be ordered
Expand Down
6 changes: 3 additions & 3 deletions sample-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ android {
}

dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile (project(':library')) {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
implementation (project(':library')) {
exclude module: "support-v13"
}
kapt project(':processor')
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
}

dependencies {
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile (project(':library')) {
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
implementation (project(':library')) {
exclude module: "support-v13"
}
annotationProcessor project(':processor')
Expand Down
24 changes: 12 additions & 12 deletions test-v13/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])

compile(project(':library'))
implementation(project(':library'))
kapt project(':processor')

compile "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:support-v13:$SUPPORT_LIBRARY_VERSION"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:support-v13:$SUPPORT_LIBRARY_VERSION"

testCompile "junit:junit:$JUNIT_VERSION"
testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
testCompile "org.powermock:powermock-api-mockito:$POWERMOCK_VERSION"
testCompile "org.powermock:powermock-module-junit4:$POWERMOCK_VERSION"
testCompile "org.powermock:powermock-module-junit4-rule:$POWERMOCK_VERSION"
testCompile "org.powermock:powermock-classloading-xstream:$POWERMOCK_VERSION"
testCompile "org.robolectric:robolectric:$ROBOLECTRIC_VERSION"
testImplementation "junit:junit:$JUNIT_VERSION"
testImplementation "org.mockito:mockito-core:$MOCKITO_VERSION"
testImplementation "org.powermock:powermock-api-mockito:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-module-junit4:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-module-junit4-rule:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-classloading-xstream:$POWERMOCK_VERSION"
testImplementation "org.robolectric:robolectric:$ROBOLECTRIC_VERSION"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import org.robolectric.RobolectricTestRunner
import permissions.dispatcher.PermissionRequest
import permissions.dispatcher.test.*


@Suppress("IllegalIdentifier")
@RunWith(RobolectricTestRunner::class)
@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "android.*")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package permissions.dispatcher.test_v13


import android.content.pm.PackageManager
import android.os.Process
import android.support.v13.app.FragmentCompat
Expand All @@ -22,7 +21,6 @@ import org.robolectric.RobolectricTestRunner
import permissions.dispatcher.PermissionRequest
import permissions.dispatcher.test.*


@Suppress("IllegalIdentifier")
@RunWith(RobolectricTestRunner::class)
@PowerMockIgnore("org.mockito.*", "org.robolectric.*", "android.*")
Expand Down
22 changes: 11 additions & 11 deletions test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.jar'])

compile(project(':library')) {
implementation(project(':library')) {
exclude module: "support-v13"
}
kapt project(':processor')

compile "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"
implementation "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"

testCompile "junit:junit:$JUNIT_VERSION"
testCompile "org.mockito:mockito-core:$MOCKITO_VERSION"
testCompile "org.powermock:powermock-api-mockito:$POWERMOCK_VERSION"
testCompile "org.powermock:powermock-module-junit4:$POWERMOCK_VERSION"
testCompile "org.powermock:powermock-module-junit4-rule:$POWERMOCK_VERSION"
testCompile "org.powermock:powermock-classloading-xstream:$POWERMOCK_VERSION"
testCompile "org.robolectric:robolectric:$ROBOLECTRIC_VERSION"
testImplementation "junit:junit:$JUNIT_VERSION"
testImplementation "org.mockito:mockito-core:$MOCKITO_VERSION"
testImplementation "org.powermock:powermock-api-mockito:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-module-junit4:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-module-junit4-rule:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-classloading-xstream:$POWERMOCK_VERSION"
testImplementation "org.robolectric:robolectric:$ROBOLECTRIC_VERSION"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
import android.support.v7.app.AppCompatActivity;

import permissions.dispatcher.NeedsPermission;
import permissions.dispatcher.OnNeverAskAgain;
import permissions.dispatcher.OnPermissionDenied;
import permissions.dispatcher.OnShowRationale;
import permissions.dispatcher.PermissionRequest;
import permissions.dispatcher.RuntimePermissions;

@RuntimePermissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import android.Manifest;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import permissions.dispatcher.NeedsPermission;
import permissions.dispatcher.OnNeverAskAgain;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import permissions.dispatcher.NeedsPermission;
import permissions.dispatcher.OnNeverAskAgain;
import permissions.dispatcher.OnPermissionDenied;
import permissions.dispatcher.RuntimePermissions;

@RuntimePermissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import org.powermock.api.mockito.PowerMockito
import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner


@Suppress("IllegalIdentifier")
@RunWith(PowerMockRunner::class)
@PrepareForTest(ActivityCompat::class, PermissionChecker::class, AppOpsManagerCompat::class, Process::class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package permissions.dispatcher.test


import android.content.pm.PackageManager
import android.os.Process
import android.support.v4.app.ActivityCompat
Expand All @@ -17,7 +16,6 @@ import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import permissions.dispatcher.PermissionRequest


@Suppress("IllegalIdentifier")
@RunWith(PowerMockRunner::class)
@PrepareForTest(ActivityCompat::class, PermissionChecker::class, AppOpsManagerCompat::class, Process::class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package permissions.dispatcher.test


import android.content.pm.PackageManager
import android.os.Process
import android.support.v4.app.ActivityCompat
Expand All @@ -17,7 +16,6 @@ import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import permissions.dispatcher.PermissionRequest


@Suppress("IllegalIdentifier")
@RunWith(PowerMockRunner::class)
@PrepareForTest(ActivityCompat::class, PermissionChecker::class, AppOpsManagerCompat::class, Process::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.powermock.api.mockito.PowerMockito
import java.lang.reflect.Field
import java.lang.reflect.Modifier


fun mockShouldShowRequestPermissionRationaleActivity(result: Boolean) {
PowerMockito.`when`(ActivityCompat.shouldShowRequestPermissionRationale(any(Activity::class.java), anyString())).thenReturn(result)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package permissions.dispatcher.test


import android.content.pm.PackageManager
import android.os.Process
import android.support.v4.app.AppOpsManagerCompat
Expand All @@ -17,7 +16,6 @@ import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import permissions.dispatcher.PermissionRequest


@Suppress("IllegalIdentifier")
@RunWith(PowerMockRunner::class)
@PrepareForTest(PermissionChecker::class, SupportFragmentWithAllAnnotationsKt::class, AppOpsManagerCompat::class, Process::class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package permissions.dispatcher.test


import android.content.pm.PackageManager
import android.os.Process
import android.support.v4.app.AppOpsManagerCompat
Expand All @@ -17,7 +16,6 @@ import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import permissions.dispatcher.PermissionRequest


@Suppress("IllegalIdentifier")
@RunWith(PowerMockRunner::class)
@PrepareForTest(PermissionChecker::class, SupportFragmentWithAllAnnotationsKt::class, AppOpsManagerCompat::class, Process::class)
Expand Down

0 comments on commit 06f4720

Please sign in to comment.