Skip to content

Commit

Permalink
Update compose to 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PranavMaganti committed Sep 22, 2022
1 parent c003db1 commit b6b583c
Show file tree
Hide file tree
Showing 21 changed files with 163 additions and 221 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = Dependencies.AndroidX.Compose.compilerVersion
}
namespace = "com.vanpra.composematerialdialogdemos"
}

dependencies {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
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="com.vanpra.composematerialdialogdemos"
android:sharedUserId="com.vanpra.composematerialdialogs.uid">

<application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ fun BasicDialogDemo() {
) {
title(res = R.string.input_dialog_title)
input(
label = "Name", placeholder = "Jon Smith",
label = "Name",
placeholder = "Jon Smith",
keyboardActions = KeyboardActions(
onDone = { submit() }
),
Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("com.diffplug.spotless") version "6.0.4"
id("org.jetbrains.dokka") version "1.6.0"
id("com.diffplug.spotless") version "6.10.0"
id("org.jetbrains.dokka") version "1.7.10"
}

buildscript {
Expand All @@ -14,9 +14,9 @@ buildscript {

dependencies {
classpath(Dependencies.Kotlin.gradlePlugin)
classpath("com.android.tools.build:gradle:7.3.0-beta05")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.19.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.7.0")
classpath("com.android.tools.build:gradle:8.0.0-alpha01")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.22.0")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.7.10")
classpath(Dependencies.Shot.core)
}
}
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/CommonModulePlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@ class CommonModulePlugin: Plugin<Project> {
private fun Project.dependenciesConf() {
dependencies.apply {
implementation(Dependencies.AndroidX.coreKtx)
implementation(Dependencies.AndroidX.viewmodelKtx)

implementation(Dependencies.AndroidX.Compose.ui)
implementation(Dependencies.AndroidX.Compose.material)
implementation(Dependencies.AndroidX.Compose.foundationLayout)
implementation(Dependencies.AndroidX.Compose.animation)
implementation(Dependencies.AndroidX.Compose.viewmodel)

androidTestImplementation(Dependencies.AndroidX.Compose.activity)
androidTestImplementation(Dependencies.AndroidX.Compose.testing)
androidTestImplementation(Dependencies.AndroidX.Testing.core)
androidTestImplementation(Dependencies.AndroidX.Testing.rules)
androidTestImplementation(Dependencies.AndroidX.Testing.runner)

add("androidTestImplementation", project(":test-utils"))
}
}
Expand Down
25 changes: 13 additions & 12 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ object Dependencies {
}

object Ktlint {
const val version = "0.45.2"
const val version = "0.47.1"
}

object Accompanist {
private const val version = "0.24.13-rc"
private const val version = "0.25.1"
const val pager = "com.google.accompanist:accompanist-pager:$version"
}

object Kotlin {
private const val version = "1.7.0"
private const val version = "1.7.10"
const val gradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:$version"
}

Expand All @@ -34,18 +34,18 @@ object Dependencies {
}

object AndroidX {
const val coreKtx = "androidx.core:core-ktx:1.8.0"
const val coreKtx = "androidx.core:core-ktx:1.9.0"
const val viewmodelKtx = "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.0-alpha02"

object Testing {
const val version = "1.4.0"
const val core = "androidx.test:core:$version"
const val rules = "androidx.test:rules:$version"
const val runner = "androidx.test:runner:$version"
const val core = "androidx.test:core:1.5.0-alpha02"
const val rules = "androidx.test:rules:1.4.1-alpha07"
const val runner = "androidx.test:runner:1.5.0-alpha04"
}

object Compose {
const val version = "1.2.0-rc03"
const val compilerVersion = "1.2.0"
const val version = "1.2.1"
const val compilerVersion = "1.3.0"

const val ui = "androidx.compose.ui:ui:$version"
const val material = "androidx.compose.material:material:$version"
Expand All @@ -55,8 +55,9 @@ object Dependencies {
const val foundationLayout = "androidx.compose.foundation:foundation-layout:$version"

const val testing = "androidx.compose.ui:ui-test-junit4:$version"
const val activity = "androidx.activity:activity-compose:1.4.0"
const val navigation = "androidx.navigation:navigation-compose:2.5.0"
const val activity = "androidx.activity:activity-compose:1.6.0-rc02"
const val navigation = "androidx.navigation:navigation-compose:2.5.2"
const val viewmodel = "androidx.lifecycle:lifecycle-viewmodel-compose:2.6.0-alpha02"
}
}
}
110 changes: 58 additions & 52 deletions buildSrc/src/main/kotlin/update_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,76 @@
from selenium.webdriver.support import expected_conditions as ec

main_search_url = 'https://search.maven.org/solrsearch/select?q=g:"{}"+AND+a:"{}"&core=gav&rows=1&wt=json'
google_search_url = "https://maven.google.com/web/index.html"
google_base_url = "https://dl.google.com/android/maven2/"


chrome_options = Options()
# chrome_options.add_argument("--headless")
chrome_options.add_argument("--window-size=1920x1080")
driver = webdriver.Chrome(options=chrome_options)

# chrome_options = Options()
# # chrome_options.add_argument("--headless")
# chrome_options.add_argument("--window-size=1920x1080")
# driver = webdriver.Chrome("/opt/google/chrome-beta/google-chrome-beta", options=chrome_options)
#
dep_file = "Dependencies.kt"

with open(dep_file, "r") as readfile:
current_deps = readfile.read().splitlines()

version_patten = re.compile(r"version = \"(.*)\"")
dep_pattern = re.compile(r"const val ([^=]*) = \"(.*)\"")
current_version = ("", -1, "")

updated_deps: List[str] = []
current_version = ("", None, "")

for index, item in enumerate(tqdm(current_deps)):
version_match = version_patten.search(item)
dep_match = dep_pattern.search(item)

if version_match:
if current_version[1] != -1:
updated_deps[current_version[1]] = re.sub(version_patten, f'version = "{current_version[0]}"', current_version[2])
current_version = (version_match.group(1), index, item)
updated_deps.append(item)
elif dep_match:
(dep, version) = dep_match.group(2).rsplit(":", 1)
(group, artifact) = dep.split(":")
main_dep_url = main_search_url.format(group, artifact)
google_dep_url = f"{google_search_url}#{group}:{artifact}"

res = requests.get(main_dep_url).json()
latest_version = version

if res["response"]["docs"]:
latest_version = res["response"]["docs"][0]["v"]
else:
print(google_dep_url)
driver.get(google_dep_url)
elems = WebDriverWait(driver, 10).until(
ec.visibility_of_element_located(
(By.XPATH, "//div[@class='content-header ng-binding ng-scope']")
)
)

soup = beautifulsoup.BeautifulSoup(driver.page_source, "html.parser")
latest_version = soup.find("span", {"class": "ng-binding"}).text

if version == "$version":
current_version = (latest_version, current_version[1], current_version[2])
updated_deps.append(item)
else:
updated_deps.append(
f"const val {dep_match.group(1)} = \"{group}:{artifact}:{latest_version}\""
)
else:
updated_deps.append(item)


if current_version[1] != -1:
updated_deps[current_version[1]] = re.sub(version_patten, f'version = "{current_version[0]}"', current_version[2])

with open(dep_file, "w") as outfile:
outfile.write("\n".join(updated_deps))
#
# updated_deps: List[str] = []
#
# for index, item in enumerate(tqdm(current_deps)):
# version_match = version_patten.search(item)
# dep_match = dep_pattern.search(item)
#
# if version_match:
# if current_version[1] != -1:
# updated_deps[current_version[1]] = re.sub(version_patten, f'version = "{current_version[0]}"', current_version[2])
# current_version = (version_match.group(1), index, item)
# updated_deps.append(item)
# elif dep_match:
# (dep, version) = dep_match.group(2).rsplit(":", 1)
# (group, artifact) = dep.split(":")
# main_dep_url = main_search_url.format(group, artifact)
# google_dep_url = f"{google_search_url}#{group}:{artifact}"
#
# res = requests.get(main_dep_url).json()
# latest_version = version
#
# if res["response"]["docs"]:
# latest_version = res["response"]["docs"][0]["v"]
# else:
# print(google_dep_url)
# driver.get(google_dep_url)
# elems = WebDriverWait(driver, 10).until(
# ec.visibility_of_element_located(
# (By.XPATH, "//div[@class='content-header ng-binding ng-scope']")
# )
# )
#
# soup = beautifulsoup.BeautifulSoup(driver.page_source, "html.parser")
# latest_version = soup.find("span", {"class": "ng-binding"}).text
#
# if version == "$version":
# current_version = (latest_version, current_version[1], current_version[2])
# updated_deps.append(item)
# else:
# updated_deps.append(
# f"const val {dep_match.group(1)} = \"{group}:{artifact}:{latest_version}\""
# )
# else:
# updated_deps.append(item)
#
#
# if current_version[1] != -1:
# updated_deps[current_version[1]] = re.sub(version_patten, f'version = "{current_version[0]}"', current_version[2])
#
# with open(dep_file, "w") as outfile:
# outfile.write("\n".join(updated_deps))
6 changes: 2 additions & 4 deletions color/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = Dependencies.AndroidX.Compose.compilerVersion
}
namespace = "com.vanpra.composematerialdialogs.color"
testNamespace = "com.vanpra.composematerialdialogs.test"
}

dependencies {
Expand All @@ -53,8 +55,4 @@ dependencies {

shot {
tolerance = 1.0 // Tolerance needed for CI
}

mavenPublish {
sonatypeHost = com.vanniktech.maven.publish.SonatypeHost.S01
}
1 change: 0 additions & 1 deletion color/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vanpra.composematerialdialogs.test"
android:sharedUserId="com.vanpra.composematerialdialogs.uid">
<application>
<activity
Expand Down
2 changes: 1 addition & 1 deletion color/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.vanpra.composematerialdialogs.color">
<manifest>

</manifest>
5 changes: 1 addition & 4 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ android {
composeOptions {
kotlinCompilerExtensionVersion = Dependencies.AndroidX.Compose.compilerVersion
}
namespace = "com.vanpra.composematerialdialogs"
}

dependencies {
Expand All @@ -55,8 +56,4 @@ dependencies {

shot {
tolerance = 1.0 // Tolerance needed for CI
}

mavenPublish {
sonatypeHost = com.vanniktech.maven.publish.SonatypeHost.S01
}
1 change: 0 additions & 1 deletion core/src/androidTest/AndroidManifest.xml
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="com.vanpra.composematerialdialogs.test"
android:sharedUserId="com.vanpra.composematerialdialogs.uid">
<application>
<activity
Expand Down
3 changes: 1 addition & 2 deletions core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vanpra.composematerialdialogs">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
5 changes: 1 addition & 4 deletions datetime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ android {
"-Xopt-in=com.google.accompanist.pager.ExperimentalPagerApi"
)
}
namespace = "com.vanpra.composematerialdialogs.datetime"
}

dependencies {
Expand All @@ -63,8 +64,4 @@ dependencies {

shot {
tolerance = 1.0 // Tolerance needed for CI
}

mavenPublish {
sonatypeHost = com.vanniktech.maven.publish.SonatypeHost.S01
}
1 change: 0 additions & 1 deletion datetime/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vanpra.composematerialdialogs.datetime.test"
android:sharedUserId="com.vanpra.composematerialdialogs.uid">
<application>
<activity
Expand Down
2 changes: 1 addition & 1 deletion datetime/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.vanpra.composematerialdialogs.datetime">
<manifest>

</manifest>
Loading

0 comments on commit b6b583c

Please sign in to comment.