Skip to content

Commit

Permalink
Set up modules with KMP plugin, convert to KTS
Browse files Browse the repository at this point in the history
  • Loading branch information
zsmb13 committed May 10, 2024
1 parent 9ae5145 commit 1647cf3
Show file tree
Hide file tree
Showing 65 changed files with 298 additions and 307 deletions.
41 changes: 0 additions & 41 deletions app/build.gradle

This file was deleted.

56 changes: 56 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
}

kotlin {
androidTarget {
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}
}

android {
namespace = "co.zsmb.requirektx"
compileSdk = 34

defaultConfig {
applicationId = "co.zsmb.requirektx"
minSdk = 21
targetSdk = 34
versionCode = 1
versionName = "1.0"
}


buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.24")
implementation("androidx.core:core-ktx:1.5.0")
implementation("androidx.appcompat:appcompat:1.3.0")
implementation("com.google.android.material:material:1.3.0")
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="co.zsmb.requirektx">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
60 changes: 30 additions & 30 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.9.24"
ext.requirektx_version = '1.2.0'

repositories {
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.android.tools.build:gradle:8.2.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply from: "${rootDir}/scripts/publish-root.gradle"
//// Top-level build file where you can add configuration options common to all sub-projects/modules.
//buildscript {
// ext.kotlin_version = "1.9.24"
// ext.requirektx_version = '1.2.0'
//
// repositories {
// google()
// mavenCentral()
// maven { url "https://plugins.gradle.org/m2/" }
// }
// dependencies {
// classpath "com.android.tools.build:gradle:8.2.2"
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// classpath "io.github.gradle-nexus:publish-plugin:1.1.0"
// }
//}
//
//allprojects {
// repositories {
// google()
// mavenCentral()
// }
//}
//
//task clean(type: Delete) {
// delete rootProject.buildDir
//}
//
//apply plugin: 'io.github.gradle-nexus.publish-plugin'
//apply from: "${rootDir}/scripts/publish-root.gradle"
5 changes: 5 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
}
11 changes: 11 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[versions]
agp = "8.2.2"
kotlin = "1.9.24"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
55 changes: 0 additions & 55 deletions requirektx-bundle/build.gradle

This file was deleted.

40 changes: 40 additions & 0 deletions requirektx-bundle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
}

kotlin {
androidTarget {
publishLibraryVariants("release")
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}

sourceSets {
commonMain.dependencies {}
commonTest.dependencies {
implementation(libs.kotlin.test)
}
val androidUnitTest by getting {
dependencies {
implementation("org.robolectric:robolectric:4.5.1")
implementation("junit:junit:4.13.2")
}
}
}

explicitApi()
// TODO progressive mode
}

android {
namespace = "co.zsmb.requirektx"
compileSdk = 34

defaultConfig {
minSdk = 21
}
}
56 changes: 0 additions & 56 deletions requirektx-intent/build.gradle

This file was deleted.

42 changes: 42 additions & 0 deletions requirektx-intent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
}

kotlin {
androidTarget {
publishLibraryVariants("release")
compilations.all {
kotlinOptions {
jvmTarget = "11"
}
}
}

sourceSets {
commonMain.dependencies {
api(project(":requirektx-bundle"))
}
commonTest.dependencies {
implementation(libs.kotlin.test)
}
val androidUnitTest by getting {
dependencies {
implementation("org.robolectric:robolectric:4.5.1")
implementation("junit:junit:4.13.2")
}
}
}

explicitApi()
// TODO progressive mode
}

android {
namespace = "co.zsmb.requirektx"
compileSdk = 34

defaultConfig {
minSdk = 21
}
}
Loading

0 comments on commit 1647cf3

Please sign in to comment.