From a9b384f28cb61f974e26d40e6f7ddc0bab0740c1 Mon Sep 17 00:00:00 2001 From: Charfaoui Younes Date: Wed, 23 Oct 2024 22:44:30 +0100 Subject: [PATCH] Updating Projects Main Dependencies. --- .gitignore | 3 + .idea/kotlinc.xml | 2 +- build.gradle.kts | 7 +- example/build.gradle.kts | 7 +- gradle/wrapper/gradle-wrapper.properties | 3 +- settings.gradle.kts | 13 ++- tarka-ui-icons/build.gradle.kts | 35 +++--- tarka-ui/build.gradle.kts | 43 +++---- .../components/TUIMobileOverlayMenuItem.kt | 3 +- tarkaicons/build.gradle.kts | 72 ++++++++++++ tarkaui/build.gradle.kts | 107 ++++++++++++++++++ 11 files changed, 247 insertions(+), 48 deletions(-) create mode 100644 tarkaicons/build.gradle.kts create mode 100644 tarkaui/build.gradle.kts diff --git a/.gitignore b/.gitignore index 0c1140ac..1384a7ac 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,6 @@ local.properties .idea/deploymentTargetDropDown.xml .idea/gradle.xml .idea/misc.xml + +# Kotlin 2.0 +.kotlin/ \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml index fe63bb67..c224ad56 100644 --- a/.idea/kotlinc.xml +++ b/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 9b9509c3..16297046 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,11 +5,12 @@ buildscript { } plugins { - id("com.android.application") version "7.4.2" apply false - id("com.android.library") version "7.4.2" apply false - id("org.jetbrains.kotlin.android") version "1.9.23" apply false + id("com.android.application") version "8.7.1" apply false + id("com.android.library") version "8.7.1" apply false + id("org.jetbrains.kotlin.android") version "2.0.21" apply false id("com.vanniktech.maven.publish") version "0.27.0" id("org.jetbrains.dokka") version "1.9.20" apply false + id("org.jetbrains.kotlin.plugin.compose") version "2.0.21" apply false } subprojects { diff --git a/example/build.gradle.kts b/example/build.gradle.kts index 19ece771..b7f7e5f4 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id ("com.android.application") id ("org.jetbrains.kotlin.android") + id("org.jetbrains.kotlin.plugin.compose") } android { @@ -34,12 +35,6 @@ android { kotlinOptions { jvmTarget = "17" } - buildFeatures { - compose = true - } - composeOptions { - kotlinCompilerExtensionVersion = "1.5.11" - } packagingOptions { resources { excludes.add("/META-INF/{AL2.0,LGPL2.1}") diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d15d2118..b4324de0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ #Thu Apr 06 13:09:30 IST 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +networkTimeout=10000 distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts index 998d408f..b7c66fe4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,7 @@ @file:Suppress("UnstableApiUsage") +import java.io.FileInputStream +import java.util.Properties pluginManagement { @@ -10,14 +12,21 @@ pluginManagement { } } dependencyResolutionManagement { + val localProperties = Properties() + val localPropertiesFile = File("local.properties") + if (localPropertiesFile.exists()) { + localProperties.load(FileInputStream(localPropertiesFile)) + } repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven(url = "https://maven.pkg.github.com/tarkalabs/tarka-ui-kit-android") { credentials { - username = System.getenv("GITHUB_USER") - password = System.getenv("GITHUB_TOKEN") + username = + System.getenv("GITHUB_USER") ?: localProperties.getProperty("GITHUB_USER") + password = + System.getenv("GITHUB_TOKEN") ?: localProperties.getProperty("GITHUB_TOKEN") } } } diff --git a/tarka-ui-icons/build.gradle.kts b/tarka-ui-icons/build.gradle.kts index 6c7ce00a..05580fba 100644 --- a/tarka-ui-icons/build.gradle.kts +++ b/tarka-ui-icons/build.gradle.kts @@ -1,10 +1,15 @@ @file:Suppress("UnstableApiUsage") +import java.io.FileInputStream +import java.util.Properties + + plugins { id("com.android.library") id("org.jetbrains.kotlin.android") id("maven-publish") id("org.jetbrains.dokka") + id("org.jetbrains.kotlin.plugin.compose") } android { @@ -31,13 +36,6 @@ android { kotlinOptions { jvmTarget = "17" } - - buildFeatures { - compose = true - } - composeOptions { - kotlinCompilerExtensionVersion = "1.5.11" - } } @@ -54,25 +52,32 @@ publishing { } repositories { + val localProperties = Properties() + val localPropertiesFile = File("local.properties") + if (localPropertiesFile.exists()) { + localProperties.load(FileInputStream(localPropertiesFile)) + } maven { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/tarkalabs/tarka-ui-kit-android") credentials { - username = System.getenv("GITHUB_USER") - password = System.getenv("GITHUB_TOKEN") + username = + System.getenv("GITHUB_USER") ?: localProperties.getProperty("GITHUB_USER") + password = + System.getenv("GITHUB_TOKEN") ?: localProperties.getProperty("GITHUB_TOKEN") } } } } dependencies { - val composeUiVersion = "1.4.1" - implementation("androidx.compose.runtime:runtime:$composeUiVersion") - implementation("androidx.compose.ui:ui:$composeUiVersion") + implementation("androidx.core:core-ktx:1.13.1") + implementation("androidx.appcompat:appcompat:1.7.0") + implementation(platform("androidx.compose:compose-bom:2024.10.00")) + implementation("androidx.compose.runtime:runtime") + implementation("androidx.compose.ui:ui") api("com.microsoft.design:fluent-system-icons:1.1.239@aar") - implementation("androidx.core:core-ktx:1.10.0") - implementation("androidx.appcompat:appcompat:1.6.1") testImplementation("junit:junit:4.13.2") - androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") } \ No newline at end of file diff --git a/tarka-ui/build.gradle.kts b/tarka-ui/build.gradle.kts index 65a59461..59285d82 100644 --- a/tarka-ui/build.gradle.kts +++ b/tarka-ui/build.gradle.kts @@ -1,8 +1,12 @@ @file:Suppress("UnstableApiUsage") +import java.util.Properties +import java.io.FileInputStream + plugins { id("com.android.library") id("org.jetbrains.kotlin.android") + id("org.jetbrains.kotlin.plugin.compose") id("shot") id("maven-publish") id ("org.jetbrains.dokka") @@ -34,12 +38,6 @@ android { kotlinOptions { jvmTarget = "17" } - buildFeatures { - compose = true - } - composeOptions { - kotlinCompilerExtensionVersion = "1.5.11" - } packagingOptions { resources { excludes.add("/META-INF/{AL2.0,LGPL2.1}") @@ -72,12 +70,19 @@ publishing { } repositories { + val localProperties = Properties() + val localPropertiesFile = File("local.properties") + if (localPropertiesFile.exists()) { + localProperties.load(FileInputStream(localPropertiesFile)) + } maven { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/tarkalabs/tarka-ui-kit-android") credentials { - username = System.getenv("GITHUB_USER") - password = System.getenv("GITHUB_TOKEN") + username = + System.getenv("GITHUB_USER") ?: localProperties.getProperty("GITHUB_USER") + password = + System.getenv("GITHUB_TOKEN") ?: localProperties.getProperty("GITHUB_TOKEN") } } mavenCentral() @@ -85,25 +90,25 @@ publishing { } dependencies { - val composeUiVersion = "1.4.1" - implementation("androidx.core:core-ktx:1.10.0") - implementation("androidx.compose.ui:ui:$composeUiVersion") - implementation("androidx.compose.ui:ui-tooling-preview:$composeUiVersion") - implementation("androidx.compose.material3:material3:1.2.0") - implementation("androidx.compose.foundation:foundation:$composeUiVersion") + implementation("androidx.core:core-ktx:1.13.1") + implementation(platform("androidx.compose:compose-bom:2024.10.00")) + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.compose.material3:material3:1.2.1") + implementation("androidx.compose.foundation:foundation") api("com.tarkalabs:tarkaui-icons:1.0.5") implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.7") testImplementation("junit:junit:4.13.2") - androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.ext:junit:1.2.1") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") androidTestImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0") api("com.microsoft.design:fluent-system-icons:1.1.239@aar") - androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.4.3") + androidTestImplementation("androidx.compose.ui:ui-test-junit4") androidTestImplementation("org.mockito:mockito-android:4.5.1") - debugImplementation("androidx.compose.ui:ui-test-manifest:1.4.3") - debugImplementation ("androidx.compose.ui:ui-tooling:1.4.3") - androidTestImplementation ("androidx.test:core:1.5.0") + debugImplementation("androidx.compose.ui:ui-test-manifest") + debugImplementation ("androidx.compose.ui:ui-tooling") + androidTestImplementation ("androidx.test:core:1.6.1") } diff --git a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayMenuItem.kt b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayMenuItem.kt index 30d4409e..008f67de 100644 --- a/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayMenuItem.kt +++ b/tarka-ui/src/main/java/com/tarkalabs/tarkaui/components/TUIMobileOverlayMenuItem.kt @@ -17,6 +17,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.ripple.rememberRipple import androidx.compose.material3.Icon import androidx.compose.material3.Text +import androidx.compose.material3.ripple import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Alignment @@ -152,7 +153,7 @@ sealed class MobileOverlayMenuItemStyle { .background(color = bgColor) .clickable( interactionSource = interactionSource, - indication = rememberRipple(color = rippleColor), + indication = ripple(color = rippleColor), onClick = onMobileOverlayMenuItemClick ) .testTag(tags.parentTag), diff --git a/tarkaicons/build.gradle.kts b/tarkaicons/build.gradle.kts new file mode 100644 index 00000000..8bbd6438 --- /dev/null +++ b/tarkaicons/build.gradle.kts @@ -0,0 +1,72 @@ +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + id("maven-publish") +} + +android { + namespace = "com.tarkalabs.tarkaicons" + compileSdk = 33 + + defaultConfig { + minSdk = 24 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + } + + 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" + } +} + + +publishing { + publications { + create("gpr") { + run { + groupId = "com.tarkalabs" + artifactId = "tarkaicons" + version = "1.0.0" + artifact("$buildDir/outputs/aar/tarkaicons-release.aar") + } + } + } + + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/REPOSITORY_URL_HERE") + credentials { + username = System.getenv("GITHUB_USER") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} + +dependencies { + val composeUiVersion = "1.4.1" + + implementation("androidx.compose.ui:ui:$composeUiVersion") + implementation("androidx.compose.ui:ui-tooling-preview:$composeUiVersion") + implementation("androidx.compose.material3:material3:1.1.0-rc01") + implementation("androidx.compose.foundation:foundation:$composeUiVersion") + api("com.microsoft.design:fluent-system-icons:1.1.201@aar") + implementation("androidx.core:core-ktx:1.10.0") + implementation("androidx.appcompat:appcompat:1.6.1") + implementation("com.google.android.material:material:1.9.0") + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") +} \ No newline at end of file diff --git a/tarkaui/build.gradle.kts b/tarkaui/build.gradle.kts new file mode 100644 index 00000000..d9acbd20 --- /dev/null +++ b/tarkaui/build.gradle.kts @@ -0,0 +1,107 @@ +@file:Suppress("UnstableApiUsage") + +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + id("shot") + id("maven-publish") +} + +android { + namespace = "com.tarkalabs.uicomponents" + compileSdk = 33 + + defaultConfig { + minSdk = 26 + targetSdk = 33 + + testInstrumentationRunner = "com.karumi.shot.ShotTestRunner" + testApplicationId = "com.tarkalabs.uicomponents" + consumerProguardFiles("consumer-rules.pro") + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.4.3" + } + packagingOptions { + resources { + excludes.add("/META-INF/{AL2.0,LGPL2.1}") + } + } + shot { + tolerance = 0.1 + applicationId = "com.tarkalabs.uicomponents" + } + testOptions { + emulatorSnapshots.maxSnapshotsForTestFailures = 10 + } + sourceSets { + getByName("androidTest").assets.srcDir("$projectDir/src/androidTest/java/com/tarkalabs/uicomponents/assets") + } +} + +fun getLibraryArtifactId() = "tarkaui" + +publishing { + publications { + create("gpr") { + run { + groupId = "com.tarkalabs" + artifactId = getLibraryArtifactId() + version = "1.0.0" + artifact("$buildDir/outputs/aar/${getLibraryArtifactId()}-release.aar") + } + } + } + + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/tarkalabs/tarka-ui-kit-android") + credentials { + username = System.getenv("GITHUB_USER") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} + +dependencies { + val composeUiVersion = "1.4.1" + implementation("androidx.core:core-ktx:1.10.0") + implementation("androidx.compose.ui:ui:$composeUiVersion") + implementation("androidx.compose.ui:ui-tooling-preview:$composeUiVersion") + implementation("androidx.compose.material3:material3:1.1.0-rc01") + implementation("androidx.compose.foundation:foundation:$composeUiVersion") + api(project(":tarkaicons")) + + testImplementation("junit:junit:4.13.2") + androidTestImplementation("androidx.test.ext:junit:1.1.5") + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") + androidTestImplementation("org.mockito.kotlin:mockito-kotlin:4.0.0") + androidTestImplementation("org.mockito:mockito-android:4.5.1") + + androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.4.3") + androidTestImplementation("org.mockito:mockito-android:4.5.1") + debugImplementation("androidx.compose.ui:ui-test-manifest:1.4.3") + debugImplementation ("androidx.compose.ui:ui-tooling:1.4.3") + androidTestImplementation ("androidx.test:core:1.5.0") + +} +