Skip to content

Commit

Permalink
Merge pull request #39 from morganlutz/morgan/update-kotlin-only
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
ericbrynsvold authored Aug 3, 2022
2 parents e6cb8a8 + 71e39fb commit 09da96c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 22 deletions.
14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
buildscript {
ext.versions = [
'incap' : '0.3',
'kotlin': '1.5.10'
'kotlin': '1.7.10'
]

ext.deps = [
android: [
'runtime': 'com.google.android:android:4.1.1.4',
'gradlePlugin': "com.android.tools.build:gradle:4.2.2",
],
'autoService':'com.google.auto.service:auto-service:1.0-rc6',
'autoService':'com.google.auto.service:auto-service:1.0.1',
'kotlin': [
'reflect': "org.jetbrains.kotlin:kotlin-reflect:${versions.kotlin}",
'stdlib': "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}"
Expand All @@ -18,16 +18,15 @@ buildscript {
'runtime': "net.ltgt.gradle.incap:incap:${versions.incap}",
'processor': "net.ltgt.gradle.incap:incap-processor:${versions.incap}",
],
'junit': 'junit:junit:4.12',
'junit': 'junit:junit:4.13.2',
'kotlinx': [
'metadataJvm':"org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.3.0"
'metadataJvm':"org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.5.0"
],
'kotlinpoet': 'com.squareup:kotlinpoet:1.9.0'
'kotlinpoet': 'com.squareup:kotlinpoet:1.12.0'
]

repositories {
mavenCentral()
jcenter()
}

dependencies {
Expand All @@ -37,7 +36,6 @@ buildscript {
allprojects {
repositories {
google()
maven { url "https://kotlin.bintray.com/kotlinx/" }
mavenCentral()
jcenter()
}
Expand All @@ -49,5 +47,5 @@ buildscript {


plugins {
id "com.github.ben-manes.versions" version "0.27.0"
id "com.github.ben-manes.versions" version "0.42.0"
}
2 changes: 1 addition & 1 deletion mr-clean-annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repositories {
}

dependencies {
compile deps.kotlin.stdlib
implementation deps.kotlin.stdlib
}

sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package com.trello.mrclean.plugin

import com.android.build.gradle.AppExtension
import com.android.build.gradle.AppPlugin
import com.android.build.gradle.FeatureExtension
import com.android.build.gradle.FeaturePlugin
import com.android.build.gradle.LibraryExtension
import com.android.build.gradle.LibraryPlugin
import com.android.build.gradle.api.BaseVariant
Expand All @@ -28,9 +26,6 @@ class MrCleanPlugin : Plugin<Project> {
override fun apply(project: Project) {
project.plugins.apply("kotlin-kapt")

project.allprojects.forEach {
it.repositories.maven { mavenRepo -> mavenRepo.setUrl("https://kotlin.bintray.com/kotlinx/") }
}
project.plugins.all {
when (it) {
is LibraryPlugin -> {
Expand Down Expand Up @@ -72,7 +67,7 @@ class MrCleanPlugin : Plugin<Project> {
variant.javaCompileOptions.annotationProcessorOptions.arguments["mrclean.packagename"] = packageName
variant.javaCompileOptions.annotationProcessorOptions.arguments["mrclean.debug"] = variant.buildType.isDebuggable.toString()

variant.outputs.all { output ->
variant.outputs.all { _ ->
if (once.compareAndSet(false, true)) {
val taskName = "generate${variant.name.capitalize()}RootSanitizeFunction"
val outputDir = project.buildDir.resolve("generated/source/mrclean/${variant.name}")
Expand All @@ -92,5 +87,5 @@ class MrCleanPlugin : Plugin<Project> {
}

private operator fun <T : Any> ExtensionContainer.get(type: KClass<T>): T {
return getByType(type.java)!!
return getByType(type.java)
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RootFunctionGenerator {
.build()
return FileSpec.builder(packageName, "RootSanitizeFunction")
.addFunction(rootFunction)
.addComment("This is the root function that generated functions will overload")
.addFileComment("This is the root function that generated functions will overload")
.build()
}
}
8 changes: 4 additions & 4 deletions mr-clean-processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ dependencies {
api deps.incap.runtime
compileOnly deps.incap.processor

compile deps.kotlin.stdlib
implementation deps.kotlin.stdlib

compile deps.kotlinx.metadataJvm
implementation deps.kotlinx.metadataJvm

compile deps.kotlinpoet
implementation deps.kotlinpoet

testCompile deps.junit
testImplementation deps.junit
}

sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class MrCleanProcessor : AbstractProcessor() {
val enclosingElementName = element.enclosingElement.simpleName.toString().capitalize()
FileSpec.builder(packageName!!, "SanitizationFor$enclosingElementName${element.simpleName}")
.apply {
if (isDebug) addComment("Debug") else addComment("Release")
if (isDebug) addFileComment("Debug") else addFileComment("Release")
}
.addFunction(funSpec)
.build()
Expand Down

0 comments on commit 09da96c

Please sign in to comment.