Skip to content

Commit

Permalink
Merge pull request #457 from vimeo/update-dependencies
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
anthonycr authored Jan 26, 2021
2 parents 2512e41 + c3bd9ee commit 2057980
Show file tree
Hide file tree
Showing 29 changed files with 826 additions and 96 deletions.
3 changes: 0 additions & 3 deletions api-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ repositories {
dependencies {
compileOnly project(':models')

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

// Retrofit
api "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion"
Expand Down
5 changes: 5 additions & 0 deletions api-core/detekt_baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues></CurrentIssues>
</SmellBaseline>
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ internal class ErrorHandlingCallAdapterFactory(private val vimeoLogger: VimeoLog
return null
}

if (returnType !is ParameterizedType) {
throw IllegalStateException("VimeoCall must have generic type (e.g., VimeoCall<ResponseBody>)")
check(returnType is ParameterizedType) {
"VimeoCall must have generic type (e.g., VimeoCall<ResponseBody>)"
}
val responseType = getParameterUpperBound(0, returnType)
val callbackExecutor = retrofit.callbackExecutor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ import com.vimeo.networking2.VimeoRequest
*/
interface VimeoCall<T> {

/**
* The URL to which this call will be made.
*/
val url: String

/**
* Register a [VimeoCallback] for the API request.
*
Expand All @@ -50,11 +55,6 @@ interface VimeoCall<T> {
*/
fun cancel()

/**
* The URL to which this call will be made.
*/
val url: String

/**
* Clone the API call.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.vimeo.networking2.internal.LocalVimeoCallAdapter
* @param developerMessage The optional message to provide if the parameter is invalid. A default message will be added
* by [validateParameters] when the [parameterValue] is invalid if none is provided here.
*/
@Suppress("DataClassShouldBeImmutable")
data class ApiParameter(
val parameterName: String,
val parameterValue: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import java.lang.reflect.Type
*/
class StringValueJsonAdapterFactory : JsonAdapter.Factory {
override fun create(type: Type, annotations: MutableSet<out Annotation>, moshi: Moshi): JsonAdapter<*>? =
when {
type is Class<*> && StringValue::class.java.isAssignableFrom(type) -> StringValueJsonAdapter()
else -> null
if (type is Class<*> && StringValue::class.java.isAssignableFrom(type)) {
StringValueJsonAdapter()
} else {
null
}
}
4 changes: 0 additions & 4 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ repositories {
dependencies {
api project(':api-core')
compileOnly project(':models')

// Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

}

compileKotlin {
Expand Down
5 changes: 5 additions & 0 deletions auth/detekt_baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues></CurrentIssues>
</SmellBaseline>
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ import com.vimeo.networking2.VimeoRequest
*/
class MutableAuthenticatorDelegate(var actual: Authenticator? = null) : Authenticator {
private val authenticator: Authenticator
get() = actual ?: throw IllegalStateException(
"Must call Authenticator.initialize() before calling Authenticator.instance()"
)
get() = actual ?: error("Must call Authenticator.initialize() before calling Authenticator.instance()")

override val currentAccount: VimeoAccount?
get() = authenticator.currentAccount
Expand Down
23 changes: 14 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
buildscript {
ext.kotlin_version = '1.3.72'
ext.kotlin_version = '1.4.21'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

plugins {
id "io.gitlab.arturbosch.detekt" version "1.0.0-RC14"
id "io.gitlab.arturbosch.detekt" version "1.14.2"
id "com.github.ben-manes.versions" version "0.36.0"
}

ext {
kotlin_version = '1.3.72'
retrofitVersion = '2.9.0'
okioVersion = '2.7.0'
moshiVersion = '1.9.3'
okioVersion = '2.10.0'
moshiVersion = '1.11.0'
stagVersion = '2.6.0'
junitVersion = '4.13'
junitVersion = '4.13.1'
buildToolsVersion = '29.0.3'
}

subprojects {
if (path.contains("integrations") || path.contains("models-")) {
if (path.contains("integrations") || path.contains("models-") || path.contains("example")) {
return
}

Expand All @@ -47,6 +48,10 @@ allprojects {
tasks.withType(JavaCompile) { options.fork = true }
}

tasks.named('wrapper') {
distributionType = Wrapper.DistributionType.ALL
}

task clean(type: Delete) {
delete rootProject.buildDir
}
11 changes: 6 additions & 5 deletions detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,16 @@ complexity:
TooManyFunctions:
active: false
LongParameterList:
threshold: 6
functionThreshold: 6
constructorThreshold: 8
ignoreDefaultParameters: true
NestedBlockDepth:
threshold: 5

empty-blocks:
EmptyFunctionBlock:
ignoreOverridden: true

exceptions:
TooGenericExceptionCaught:
exceptionNames:
Expand Down Expand Up @@ -60,12 +65,8 @@ style:
active: false
ExpressionBodySyntax:
active: false
MatchingDeclarationName:
active: false
ReturnCount:
active: false
FunctionMaxLength:
active: false
WildcardImport:
active: false
UnnecessaryParentheses:
Expand Down
4 changes: 2 additions & 2 deletions detekt_configuration.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
detekt {
toolVersion = "1.0.0-RC14"
toolVersion = "1.14.2"
input = files("$projectDir/src/main/java")
config = files("$rootDir/detekt.yml")
filters = ".*test.*,.*/resources/.*,.*/tmp/.*"
baseline = file("$projectDir/detekt_baseline.xml")
failFast = true
parallel = true
}
17 changes: 7 additions & 10 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion buildToolsVersion

defaultConfig {
applicationId "com.vimeo.moshiexampleandroid"
applicationId "com.vimeo.example"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
}

buildTypes {
release {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand All @@ -26,13 +26,10 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':auth')
implementation project(':request')
implementation project(':models')

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.appcompat:appcompat:1.1.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

implementation "androidx.appcompat:appcompat:1.2.0"
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
}
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Fri Jan 22 12:27:31 EST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-all.zip
5 changes: 5 additions & 0 deletions model-generator/detekt_baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues></CurrentIssues>
</SmellBaseline>
8 changes: 3 additions & 5 deletions model-generator/integrations/models-input/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ apply plugin: 'kotlin-kapt'


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.squareup.moshi:moshi-kotlin:1.9.3"
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.3"
implementation "com.squareup.moshi:moshi-kotlin:$moshiVersion"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
targetCompatibility = "1.8"
14 changes: 6 additions & 8 deletions model-generator/integrations/models-output/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ generated {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "com.squareup.moshi:moshi-kotlin:1.9.3"
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.3"
implementation "com.squareup.moshi:moshi-kotlin:$moshiVersion"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"

testImplementation "junit:junit:4.13"
testImplementation "junit:junit:4.13.1"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
testImplementation "org.assertj:assertj-core:3.16.1"
testImplementation "org.assertj:assertj-core:3.18.1"
testImplementation "io.github.classgraph:classgraph:4.8.87"
testImplementation "uk.co.jemos.podam:podam:7.2.3.RELEASE"
testImplementation "uk.co.jemos.podam:podam:7.2.5.RELEASE"
}

sourceCompatibility = "1.8"
targetCompatibility = "1.8"
targetCompatibility = "1.8"
17 changes: 8 additions & 9 deletions model-generator/plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
id 'io.gitlab.arturbosch.detekt' version '1.0.0-RC14'
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
id 'io.gitlab.arturbosch.detekt' version '1.14.2'
id 'java-gradle-plugin'
}

Expand All @@ -10,14 +10,13 @@ repositories {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.3.72'
implementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.72'
implementation 'org.jetbrains.kotlin:kotlin-android-extensions:1.3.72'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.72'
implementation 'org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.4.21'
implementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.21'
implementation 'org.jetbrains.kotlin:kotlin-android-extensions:1.4.21'
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.4.21'

implementation 'com.squareup:kotlinpoet:1.6.0'
implementation 'com.squareup.moshi:moshi-kotlin:1.9.3'
implementation "com.squareup.moshi:moshi-kotlin:1.11.0"
}

sourceCompatibility = '1.8'
Expand All @@ -30,4 +29,4 @@ gradlePlugin {
implementationClass = 'com.vimeo.modelgenerator.GenerateModelsPlugin'
}
}
}
}
5 changes: 5 additions & 0 deletions model-generator/plugin/detekt_baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" ?>
<SmellBaseline>
<ManuallySuppressedIssues></ManuallySuppressedIssues>
<CurrentIssues></CurrentIssues>
</SmellBaseline>
18 changes: 9 additions & 9 deletions models-parcelable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ generated {
}

android {
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion buildToolsVersion

defaultConfig {
minSdkVersion 23
targetSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -49,14 +51,12 @@ android {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "com.squareup.moshi:moshi-kotlin:1.9.3"
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.9.3"
implementation "com.squareup.moshi:moshi-kotlin:$moshiVersion"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"

testImplementation "junit:junit:4.13"
testImplementation "org.assertj:assertj-core:3.16.1"
testImplementation "junit:junit:4.13.1"
testImplementation "org.assertj:assertj-core:3.18.1"
testImplementation "io.github.classgraph:classgraph:4.8.87"
testImplementation "uk.co.jemos.podam:podam:7.2.3.RELEASE"
testImplementation "uk.co.jemos.podam:podam:7.2.5.RELEASE"
testImplementation 'org.robolectric:robolectric:4.3.1'
}
13 changes: 6 additions & 7 deletions models-serializable/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ generated {
}

dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.72'
implementation 'com.squareup.moshi:moshi-kotlin:1.9.3'
kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.9.3'
implementation "com.squareup.moshi:moshi-kotlin:$moshiVersion"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion"

testImplementation 'junit:junit:4.13'
testImplementation 'org.assertj:assertj-core:3.16.1'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.assertj:assertj-core:3.18.1'
testImplementation 'io.github.classgraph:classgraph:4.8.87'
testImplementation 'uk.co.jemos.podam:podam:7.2.3.RELEASE'
testImplementation 'uk.co.jemos.podam:podam:7.2.5.RELEASE'
}

sourceCompatibility = '1.8'
targetCompatibility = '1.8'
targetCompatibility = '1.8'
Loading

0 comments on commit 2057980

Please sign in to comment.