Skip to content

Commit

Permalink
Merge pull request #170 from akshaaatt/migrate
Browse files Browse the repository at this point in the history
Migrate to version catalogs
  • Loading branch information
akshaaatt authored Jul 16, 2024
2 parents 9bca3be + 3299df6 commit 92949b1
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 52 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ proguard/
# Android Studio captures folder
captures/

.kotlin

# Intellij
*.iml
.idea
Expand Down
30 changes: 13 additions & 17 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import java.util.Properties

plugins {
id("com.android.application")
id("kotlin-android")
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}

android {
compileSdk = 34
compileSdk = libs.versions.compileSdk.get().toInt()

namespace = "com.limurse.iapsample"
defaultConfig {
applicationId = "com.limurse.iapsample"
minSdk = 21
targetSdk = 34
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = 8
versionName = "1.0.7"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -29,16 +29,12 @@ android {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
"proguard-rules.pro"
)
proguardFiles("proguard-rules.pro")
resValue("string", "licenseKey", licenseKey)
}
debug {
isMinifyEnabled = false
proguardFiles(
"proguard-rules.pro"
)
proguardFiles("proguard-rules.pro")
resValue("string", "licenseKey", licenseKey)
}
}
Expand All @@ -60,9 +56,9 @@ android {
dependencies {
implementation(project(":iap"))

implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.gridlayout:gridlayout:1.0.0")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("com.intuit.sdp:sdp-android:1.1.1")
}
implementation(libs.appcompat)
implementation(libs.gridlayout)
implementation(libs.material)
implementation(libs.constraintlayout)
implementation(libs.sdp.android)
}
24 changes: 5 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
buildscript {
repositories {
google()
mavenCentral()
}

val kotlinVersion = "1.9.22"
dependencies {
classpath("com.android.tools.build:gradle:8.5.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}

allprojects {
repositories {
google()
mavenCentral()
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
}

tasks.register<Delete>("clean") {
delete(layout.buildDirectory)
}
}
31 changes: 31 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[versions]
kotlin = "2.0.0"
agp = "8.5.1"
compileSdk = "34"
targetSdk = "34"
minSdk = "21"
appcompat = "1.7.0"
gridlayout = "1.0.0"
material = "1.12.0"
constraintlayout = "2.1.4"
sdp-android = "1.1.1"
billing-ktx = "7.0.0"
lifecycle-extensions = "2.2.0"
lifecycle-runtime-ktx = "2.8.3"
junit = "4.13.2"

[libraries]
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
gridlayout = { module = "androidx.gridlayout:gridlayout", version.ref = "gridlayout" }
material = { module = "com.google.android.material:material", version.ref = "material" }
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
sdp-android = { module = "com.intuit.sdp:sdp-android", version.ref = "sdp-android" }
billing-ktx = { module = "com.android.billingclient:billing-ktx", version.ref = "billing-ktx" }
lifecycle-extensions = { module = "androidx.lifecycle:lifecycle-extensions", version.ref = "lifecycle-extensions" }
lifecycle-runtime-ktx = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
junit = { module = "junit:junit", version.ref = "junit" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
25 changes: 11 additions & 14 deletions iap/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
plugins {
id("com.android.library")
id("kotlin-android")
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
id("maven-publish")
}

android {
compileSdk = 34
compileSdk = libs.versions.compileSdk.get().toInt()

namespace = "com.limurse.iap"
defaultConfig {
minSdk = 21
minSdk = libs.versions.minSdk.get().toInt()
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
"proguard-rules.pro"
)
proguardFiles("proguard-rules.pro")
}
}

Expand All @@ -38,15 +36,14 @@ android {
}
}


dependencies {
implementation("com.android.billingclient:billing-ktx:7.0.0")
implementation(libs.billing.ktx)

implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.lifecycle:lifecycle-extensions:2.2.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.3")
implementation(libs.appcompat)
implementation(libs.lifecycle.extensions)
implementation(libs.lifecycle.runtime.ktx)

testImplementation("junit:junit:4.13.2")
testImplementation(libs.junit)
}

publishing {
Expand All @@ -61,4 +58,4 @@ publishing {
}
}
}
}
}
2 changes: 0 additions & 2 deletions settings.gradle

This file was deleted.

18 changes: 18 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}

include(":app")
include(":iap")

0 comments on commit 92949b1

Please sign in to comment.