Skip to content

Commit

Permalink
update versions and tests (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostkontentitan committed Aug 4, 2021
1 parent 1776e9f commit abb712a
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 14 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {

ext.kotlin_version = "1.5.10"
ext.kotlin_version = "1.5.21"

repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.0-beta03"
classpath "com.android.tools.build:gradle:7.0.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.gradleup:auto-manifest-plugin:1.0.4'
Expand Down
8 changes: 4 additions & 4 deletions checks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ dependencies {

compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
compileOnly "com.android.tools.lint:lint-api:30.0.0-beta03"
compileOnly "com.android.tools.lint:lint-checks:30.0.0-beta03"
compileOnly "com.android.tools.lint:lint-api:30.0.0"
compileOnly "com.android.tools.lint:lint-checks:30.0.0"

testImplementation "com.android.tools.lint:lint:30.0.0-beta03"
testImplementation "com.android.tools.lint:lint-tests:30.0.0-beta03"
testImplementation "com.android.tools.lint:lint:30.0.0"
testImplementation "com.android.tools.lint:lint-tests:30.0.0"
testImplementation "junit:junit:4.13.2"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import org.junit.Test
internal class NetworkLayerClassImmutabilityDetectorTest {

private fun Any.retrofit(): TestFile.BinaryTestFile = bytes(
"libs/retrofit-2.7.2.jar",
"libs/retrofit-2.9.0.jar",
javaClass
.getResourceAsStream("/retrofit-2.7.2.jar")
.getResourceAsStream("/retrofit-2.9.0.jar")
.readBytes()
)

Expand Down Expand Up @@ -78,6 +78,7 @@ internal class NetworkLayerClassImmutabilityDetectorTest {
""".trimIndent()
)
)
.allowCompilationErrors()
.issues(ISSUE_NETWORK_LAYER_IMMUTABLE_CLASS_RULE)
.run()
.expectClean()
Expand Down Expand Up @@ -537,6 +538,7 @@ internal class NetworkLayerClassImmutabilityDetectorTest {
fun `java file with final`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand Down Expand Up @@ -575,6 +577,7 @@ internal class NetworkLayerClassImmutabilityDetectorTest {
fun `java file with Void`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand All @@ -598,6 +601,7 @@ internal class NetworkLayerClassImmutabilityDetectorTest {
fun `java file generic method with Void`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand Down Expand Up @@ -625,6 +629,7 @@ internal class NetworkLayerClassImmutabilityDetectorTest {
fun `java file without final`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,16 @@ private val ISSUES_TO_TEST = arrayOf(ISSUE_NETWORK_LAYER_CLASS_JSON_RULE, ISSUE_
internal class NetworkLayerClassJsonDetectorTest {

private fun retrofit(): TestFile.BinaryTestFile = bytes(
"libs/retrofit-2.7.2.jar",
"libs/retrofit-2.9.0.jar",
javaClass
.getResourceAsStream("/retrofit-2.7.2.jar")
.getResourceAsStream("/retrofit-2.9.0.jar")
.readBytes()
)

private fun moshi(): TestFile.BinaryTestFile = bytes(
"libs/moshi-1.12.0.jar",
javaClass
.getResourceAsStream("/moshi-1.12.0.jar")
.readBytes()
)

Expand Down Expand Up @@ -464,6 +471,8 @@ internal class NetworkLayerClassJsonDetectorTest {
fun `java file with Json`() {
lint()
.files(
retrofit(),
moshi(),
java(
"""
package foo;
Expand Down Expand Up @@ -501,6 +510,7 @@ internal class NetworkLayerClassJsonDetectorTest {
fun `java file with Void`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand All @@ -524,6 +534,7 @@ internal class NetworkLayerClassJsonDetectorTest {
fun `java file generic method with Void`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand Down Expand Up @@ -551,6 +562,8 @@ internal class NetworkLayerClassJsonDetectorTest {
fun `java file without Json`() {
lint()
.files(
retrofit(),
moshi(),
java(
"""
package foo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ import org.junit.Test
internal class NetworkLayerClassSerializedNameDetectorTest {

private fun retrofit(): TestFile.BinaryTestFile = bytes(
"libs/retrofit-2.7.2.jar",
"libs/retrofit-2.9.0.jar",
javaClass
.getResourceAsStream("/retrofit-2.7.2.jar")
.getResourceAsStream("/retrofit-2.9.0.jar")
.readBytes()
)

private fun gson(): TestFile.BinaryTestFile = bytes(
"libs/gson-2.8.6.jar",
"libs/gson-2.8.7.jar",
javaClass
.getResourceAsStream("/gson-2.8.6.jar")
.getResourceAsStream("/gson-2.8.7.jar")
.readBytes()
)

Expand Down Expand Up @@ -478,6 +478,8 @@ internal class NetworkLayerClassSerializedNameDetectorTest {
fun `java file with SerializedName`() {
lint()
.files(
gson(),
retrofit(),
java(
"""
package foo;
Expand Down Expand Up @@ -518,6 +520,7 @@ internal class NetworkLayerClassSerializedNameDetectorTest {
fun `java file with Void`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand All @@ -541,6 +544,7 @@ internal class NetworkLayerClassSerializedNameDetectorTest {
fun `java file generic method with Void`() {
lint()
.files(
retrofit(),
java(
"""
package foo;
Expand Down Expand Up @@ -568,6 +572,8 @@ internal class NetworkLayerClassSerializedNameDetectorTest {
fun `java file without SerializedName`() {
lint()
.files(
gson(),
retrofit(),
java(
"""
package foo;
Expand Down
Binary file not shown.
Binary file removed checks/src/test/resources/moshi-1.10.0.jar
Binary file not shown.
Binary file added checks/src/test/resources/moshi-1.12.0.jar
Binary file not shown.
Binary file removed checks/src/test/resources/retrofit-2.7.2.jar
Binary file not shown.
Binary file added checks/src/test/resources/retrofit-2.9.0.jar
Binary file not shown.

0 comments on commit abb712a

Please sign in to comment.