Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate build script to Kotlin DSL #134

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("kotlin-kapt")
}

android {
namespace = "com.bnyro.wallpaper"
compileSdk = 33

defaultConfig {
applicationId = "com.bnyro.wallpaper"
minSdk = 21
targetSdk = 33
versionCode = 21
versionName = "6.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}

javaCompileOptions {
annotationProcessorOptions {
arguments["room.schemaLocation"] += "$projectDir/schemas"
}
}

buildTypes {
release {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
debug {
isDebuggable = true
applicationIdSuffix = ".debug"
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.4.2"
}
packagingOptions {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
}

dependencies {
val compose_version: String by rootProject.extra
// Core
implementation("androidx.core:core-ktx:1.10.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1")
implementation("androidx.work:work-runtime-ktx:2.8.1")
implementation("androidx.documentfile:documentfile:1.0.1")

// UI
implementation("androidx.activity:activity-compose:1.7.2")
implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.compose.ui:ui-tooling-preview:$compose_version")
implementation("androidx.navigation:navigation-compose:2.5.3")

// Design libraries
implementation("androidx.compose.material3:material3:1.2.0-alpha02")
implementation("androidx.compose.material:material-icons-core:1.4.3")
implementation("androidx.compose.material:material-icons-extended:1.4.3")
implementation("androidx.palette:palette:1.0.0")


// Retrofit
implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("com.squareup.retrofit2:converter-jackson:2.9.0")

// Coil
implementation("io.coil-kt:coil-compose:2.4.0")

// Renderscript
implementation(project(":renderscript-toolkit"))

// Room
implementation("androidx.room:room-runtime:2.5.1")
kapt("androidx.room:room-compiler:2.5.1")

// Local image parsing
implementation("androidx.exifinterface:exifinterface:1.3.6")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
debugImplementation("androidx.compose.ui:ui-tooling:$compose_version")
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")

// Desugaring
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3")
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
10 changes: 0 additions & 10 deletions build.gradle

This file was deleted.

8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
buildscript {
val compose_version by extra("1.5.0-beta01")
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "7.5.0" apply false
id("com.android.library") version "7.5.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.10" apply false
}
49 changes: 0 additions & 49 deletions renderscript-toolkit/build.gradle

This file was deleted.

50 changes: 50 additions & 0 deletions renderscript-toolkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
plugins {
id("com.android.library")
id("kotlin-android")
}

android {
namespace = "com.google.android.renderscript"
compileSdk = 33
buildToolsVersion = "31.0.0"

defaultConfig {
minSdk = 16
targetSdk = 33
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
externalNativeBuild {
cmake {
cppFlags += "-std=c++17"
}
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
externalNativeBuild {
cmake {
path = file("src/main/cpp/CMakeLists.txt")
}
}
}

dependencies {

implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.20")
implementation("androidx.core:core-ktx:1.9.0")
}
2 changes: 1 addition & 1 deletion renderscript-toolkit/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
# proguardFiles setting in build.gradle.kts.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
Expand Down
5 changes: 2 additions & 3 deletions settings.gradle → settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ dependencyResolutionManagement {
}
}
rootProject.name = "Wall You"
include ':app'
include(":app")

include 'renderscript-toolkit'
project(':renderscript-toolkit').projectDir = new File(settingsDir, './renderscript-toolkit')
include(":renderscript-toolkit")