Skip to content

Commit

Permalink
migrated gradle build files to kotlin dsl; switched from kapt to ksp
Browse files Browse the repository at this point in the history
  • Loading branch information
ezechuka committed Apr 13, 2022
1 parent 740f392 commit 1ba0a49
Show file tree
Hide file tree
Showing 28 changed files with 313 additions and 272 deletions.
3 changes: 1 addition & 2 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinScripting.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

63 changes: 0 additions & 63 deletions app/build.gradle

This file was deleted.

75 changes: 75 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
plugins {
id("com.android.application")
id("kotlin-android")
id("com.google.devtools.ksp")
}

android {
compileSdkVersion(31)
buildToolsVersion("30.0.3")

defaultConfig {
applicationId("com.javalon.roomie")
minSdkVersion(21)
targetSdkVersion(31)
versionCode(1)
versionName("1.0")

testInstrumentationRunner("androidx.test.runner.AndroidJUnitRunner")
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}

getByName("debug") {
sourceSets {
getByName("main") {
java.srcDir(File("build/generated/ksp/debug/kotlin"))
}
}
}
getByName("release") {
sourceSets {
getByName("main") {
java.srcDir(File("build/generated/ksp/release/kotlin"))
}
}

}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
}
}
}

dependencies {
val kotlinVersion: String by project
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("androidx.core:core-ktx:1.7.0")
implementation("androidx.appcompat:appcompat:1.4.1")
implementation("com.google.android.material:material:1.5.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.3")
implementation("com.google.code.gson:gson:2.9.0")
implementation("androidx.room:room-runtime:2.4.1")

implementation(project(":roomie-annotation"))
ksp(project(":roomie-processor"))

testImplementation("junit:junit:4.+")
androidTestImplementation("androidx.test.ext:junit:1.1.3")
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
}
5 changes: 4 additions & 1 deletion app/src/main/java/com/javalon/roomie/Person.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
package com.javalon.roomie

data class Person()
import com.javalon.AddConverter

//@AddConverter(name = "PeopleConverter")
//data class Person(val firstName: String, val lastName: List<String>)
31 changes: 0 additions & 31 deletions build.gradle

This file was deleted.

20 changes: 20 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
val kotlinVersion: String by project
val kspVersion: String by project
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:$kspVersion")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
kotlinVersion=1.5.30
kspVersion=1.5.30-1.0.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Feb 11 13:03:25 WAT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
20 changes: 0 additions & 20 deletions roomie-annotation/build.gradle

This file was deleted.

19 changes: 19 additions & 0 deletions roomie-annotation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
plugins {
id("kotlin")
id("maven-publish")
}

group = "com.github.ezechuka"
version = "1.0.0-beta02"

java {
withSourcesJar()
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.javalon.roomie_annotation
package com.javalon

/**
* Automatically generates a TypeConverter
* for the class with this annotation.
*/
@Retention(AnnotationRetention.SOURCE)
@Target(AnnotationTarget.CLASS)
annotation class AddConverter(val name: String = "")
annotation class AddConverter(val name: String = "", val asList: Boolean = false)
30 changes: 0 additions & 30 deletions roomie-processor/build.gradle

This file was deleted.

30 changes: 30 additions & 0 deletions roomie-processor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
plugins {
id("kotlin")
id("maven-publish")
}

group = "com.github.ezechuka"
version = "1.0.0-beta02"

java {
withSourcesJar()
}

val kspVersion: String by project

dependencies {
implementation("com.google.devtools.ksp:symbol-processing-api:$kspVersion")

implementation(project(":roomie-annotation"))

implementation("com.squareup:kotlinpoet:1.4.4")
implementation("com.google.code.gson:gson:2.9.0")
}

publishing {
publications {
create<MavenPublication>("mavenJava") {
from(components["java"])
}
}
}
5 changes: 0 additions & 5 deletions roomie-processor/src/main/AndroidManifest.xml

This file was deleted.

Loading

0 comments on commit 1ba0a49

Please sign in to comment.