diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 49b081c..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,62 +0,0 @@ -apply plugin: "com.android.application" -apply plugin: "kotlin-android" - -android { - namespace = "com.jawnnypoo.physicslayout.sample" - compileSdk 34 - - defaultConfig { - applicationId "com.jawnnypoo.physicslayout.sample" - minSdk 21 - targetSdk 34 - versionCode 101 - versionName "1.0.1" - } - - buildFeatures { - viewBinding true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" - } - } - -} - -kotlin { - jvmToolchain 17 -} - -def coroutinesVersion = "1.7.1" -def retrofitVersion = "2.9.0" -dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion") - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion") - - implementation("androidx.activity:activity-ktx:1.8.2") - implementation("androidx.appcompat:appcompat:1.6.1") - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0") - - implementation("com.google.android.material:material:1.11.0") - - implementation("de.hdodenhof:circleimageview:3.1.0") - - implementation("io.coil-kt:coil:1.1.1") - - implementation("com.squareup.retrofit2:retrofit:$retrofitVersion") - implementation("com.squareup.retrofit2:converter-moshi:$retrofitVersion") - - implementation("com.squareup.moshi:moshi-kotlin:1.13.0") - - implementation("com.wefika:flowlayout:0.4.1") { - exclude group: "com.intellij", module: "annotations" - } - - - implementation("com.github.Commit451:Gimbal:3.0.0") - - implementation(project(":physicslayout")) -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..09e518e --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,69 @@ +plugins { + id("com.android.application") + id("kotlin-android") +} + +android { + namespace = "com.jawnnypoo.physicslayout.sample" + compileSdk = 34 + + defaultConfig { + applicationId = "com.jawnnypoo.physicslayout.sample" + minSdk = 21 + targetSdk = 34 + versionCode = 101 + versionName = "1.0.1" + } + + buildFeatures { + viewBinding = true + } + + buildTypes { + getByName("release") { + isMinifyEnabled = true + isShrinkResources = true + proguardFiles("proguard-rules.pro", getDefaultProguardFile("proguard-android.txt")) + } + getByName("debug") { + isMinifyEnabled = false + isShrinkResources = false + proguardFiles("proguard-rules.pro", getDefaultProguardFile("proguard-android.txt")) + } + } + +} + +kotlin { + jvmToolchain(17) +} + +dependencies { + implementation(libs.coroutines.core) + implementation(libs.coroutines.android) + + implementation(libs.androidx.activity) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.lifecycle.viewmodel) + + implementation(libs.google.material) + + implementation(libs.circle.image.view) + + implementation(libs.coil) + + implementation(libs.retrofit) + implementation(libs.retrofit.moshi) + + implementation(libs.moshi) + + //https://github.com/blazsolar/FlowLayout/issues/31 + implementation(libs.flowlayout) { + exclude(group = "com.intellij", module = "annotations") + } + + + implementation(libs.gimbal) + + implementation(project(":physicslayout")) +} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 0d08635..0bc9c22 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -2,7 +2,7 @@ # By default, the flags in this file are appended to flags specified # in Z:\Code\ADT\sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. +# directive in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index bf6fc08..df4b631 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,15 +1,14 @@ - + - - + + + android:theme="@style/AppTheme"> @@ -20,7 +19,7 @@ - + diff --git a/build.gradle b/build.gradle deleted file mode 100644 index fca175a..0000000 --- a/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -buildscript { - ext.kotlin_version = "1.9.10" - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.vanniktech:gradle-maven-publish-plugin:0.18.0" - } -} - -allprojects { - repositories { - google() - mavenCentral() - maven { url "https://jitpack.io" } - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..b0d291b --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,6 @@ +plugins { + alias(libs.plugins.com.android.application) apply false + alias(libs.plugins.com.android.library) apply false + alias(libs.plugins.org.jetbrains.kotlin.android) apply false + alias(libs.plugins.com.vanniktech.publish) apply false +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..b126d94 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,38 @@ +[versions] +org-jetbrains-kotlin-android = "1.9.10" +agp = "8.2.1" +coroutines = "1.7.1" +retrofit = "2.9.0" + +[libraries] +jbox2d = { group = "org.jbox2d", name = "jbox2d-library", version = "2.2.1.1" } +translation-drag-view-helper = { group = "com.commit451", name = "translationviewdraghelper", version = "2.0.3" } + +coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" } +coroutines-android = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" } + +androidx-activity = { group = "androidx.activity", name = "activity-ktx", version = "1.8.2" } +androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version = "1.6.1" } +androidx-lifecycle-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version = "2.7.0" } + +google-material = { group = "com.google.android.material", name = "material", version = "1.11.0" } + +circle-image-view = { group = "de.hdodenhof", name = "circleimageview", version = "3.1.0" } + +coil = { group = "io.coil-kt", name = "coil", version = "1.1.1" } + +retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" } +retrofit-moshi = { group = "com.squareup.retrofit2", name = "converter-moshi", version.ref = "retrofit" } + +moshi = { group = "com.squareup.moshi", name = "moshi-kotlin", version = "1.13.0" } + +flowlayout = { group = "com.wefika", name = "flowlayout", version = "0.4.1" } + +gimbal = { group = "com.github.Commit451", name = "Gimbal", version = "3.0.0" } + + +[plugins] +org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "org-jetbrains-kotlin-android" } +com-android-application = { id = "com.android.application", version.ref = "agp" } +com-android-library = { id = "com.android.library", version.ref = "agp" } +com-vanniktech-publish = { id = "com.vanniktech.maven.publish", version = "0.18.0" } \ No newline at end of file diff --git a/physicslayout/build.gradle b/physicslayout/build.gradle deleted file mode 100644 index b907703..0000000 --- a/physicslayout/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -apply plugin: "com.android.library" -apply plugin: "kotlin-android" -apply plugin: "com.vanniktech.maven.publish" -apply from: "../publish.gradle" - -android { - namespace = "com.jawnnypoo.physicslayout" - compileSdk 34 - - defaultConfig { - minSdk 15 - targetSdk 34 - } -} - -kotlin { - jvmToolchain 17 -} - -dependencies { - api("org.jbox2d:jbox2d-library:2.2.1.1") - api("com.commit451:translationviewdraghelper:2.0.3") -} diff --git a/physicslayout/build.gradle.kts b/physicslayout/build.gradle.kts new file mode 100644 index 0000000..4cce892 --- /dev/null +++ b/physicslayout/build.gradle.kts @@ -0,0 +1,32 @@ +import com.vanniktech.maven.publish.SonatypeHost + +plugins { + alias(libs.plugins.com.android.library) + alias(libs.plugins.org.jetbrains.kotlin.android) + alias(libs.plugins.com.vanniktech.publish) +} + +android { + namespace = "com.jawnnypoo.physicslayout" + compileSdk = 34 + + defaultConfig { + minSdk = 15 + } +} + +kotlin { + jvmToolchain(17) +} + +dependencies { + api(libs.jbox2d) + api(libs.translation.drag.view.helper) +} + +mavenPublish { + sonatypeHost = SonatypeHost.S01 + // We need this, because on Jitpack, we don't want the release to be signed, + // but on GitHub actions, we do, since it will be published to Maven Central + releaseSigningEnabled = System.getenv("RELEASE_SIGNING_ENABLED") == "true" +} diff --git a/physicslayout/proguard-rules.pro b/physicslayout/proguard-rules.pro index 5cd497e..358200d 100644 --- a/physicslayout/proguard-rules.pro +++ b/physicslayout/proguard-rules.pro @@ -2,7 +2,7 @@ # By default, the flags in this file are appended to flags specified # in Z:/Code/ADT/sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. +# directive in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/publish.gradle b/publish.gradle deleted file mode 100644 index de004b8..0000000 --- a/publish.gradle +++ /dev/null @@ -1,6 +0,0 @@ -mavenPublish { - sonatypeHost = "S01" - // We need this, because on Jitpack, we don't want the release to be signed, - // but on GitHub actions, we do, since it will be published to Maven Central - releaseSigningEnabled = System.getenv("RELEASE_SIGNING_ENABLED") == "true" -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index a739bc8..0000000 --- a/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app', ':physicslayout' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..fe0fa8b --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,17 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + maven(url = "https://jitpack.io") + } +} + +include(":app", ":physicslayout") \ No newline at end of file