diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 170f790..ea7e0e9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,10 +1,26 @@
name: Build
-on: [pull_request, push]
+
+on:
+ push:
+ pull_request:
+
jobs:
build:
runs-on: ubuntu-latest
+
steps:
- - name: Checkout the code
- uses: actions/checkout@v2
- - name: Build the app
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Configure JDK
+ uses: actions/setup-java@v4
+ with:
+ distribution: zulu
+ java-version: '17'
+ cache: gradle
+
+ - name: Validate Gradle Wrapper
+ uses: gradle/actions/wrapper-validation@v4
+
+ - name: Build
run: ./gradlew build
diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml
new file mode 100644
index 0000000..be35fcf
--- /dev/null
+++ b/.github/workflows/publish-release.yml
@@ -0,0 +1,33 @@
+name: Publish Release
+
+on:
+ push:
+ tags:
+ - '*'
+
+env:
+ RELEASE_SIGNING_ENABLED: true
+
+jobs:
+ publish:
+ runs-on: ubuntu-latest
+ if: github.repository == 'Commit451/coil-imagegetter'
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install JDK
+ uses: actions/setup-java@v4
+ with:
+ distribution: zulu
+ java-version: '17'
+ cache: gradle
+
+ - name: Release to Maven Central
+ run: ./gradlew publishAndReleaseToMavenCentral -PVERSION_NAME="${GITHUB_REF_NAME}" --no-configuration-cache
+ env:
+ ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
+ ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
+ ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
+ ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
diff --git a/.jitpack.yml b/.jitpack.yml
deleted file mode 100644
index adb3fe1..0000000
--- a/.jitpack.yml
+++ /dev/null
@@ -1,2 +0,0 @@
-jdk:
- - openjdk11
diff --git a/README.md b/README.md
index adbc16d..776d697 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,14 @@
# coil-imagegetter
Loads images for Html rendering in Android using [Coil](https://coil-kt.github.io/coil/)
-[](https://jitpack.io/#Commit451/coil-imagegetter)
+[](https://github.com/Commit451/coil-imagegetter/actions/workflows/ci.yml) [](https://central.sonatype.com/artifact/com.commit451/coil-imagegetter)
## Dependency
-Add this in your root `build.gradle` file (**not** your module `build.gradle` file):
+Add the library to your project `build.gradle`:
-```gradle
-allprojects {
- repositories {
- ...
- maven { url "https://jitpack.io" }
- }
-}
-```
-
-Then, add the library to your project `build.gradle`
```gradle
dependencies {
- implementation("com.github.Commit451:CoilImageGetter:latest.version.here")
+ implementation("com.commit451:coil-imagegetter:latest.version.here")
}
```
diff --git a/app/build.gradle b/app/build.gradle
deleted file mode 100644
index 58d5bbe..0000000
--- a/app/build.gradle
+++ /dev/null
@@ -1,47 +0,0 @@
-apply plugin: "com.android.application"
-apply plugin: "kotlin-android"
-
-android {
- compileSdkVersion 32
-
- defaultConfig {
- applicationId "com.commit451.coilimagegetter.sample"
- minSdkVersion 21
- targetSdkVersion 32
- versionCode 1
- versionName "1.0"
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
-
- buildFeatures {
- viewBinding true
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-
- kotlinOptions {
- jvmTarget = "1.8"
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
- }
- }
-}
-ext {
- coroutinesVersion = "1.6.1"
-}
-dependencies {
- implementation("androidx.appcompat:appcompat:1.4.1")
- implementation("androidx.core:core-ktx:1.7.0")
- implementation("com.atlassian.commonmark:commonmark:0.14.0")
- implementation("ru.gildor.coroutines:kotlin-coroutines-okhttp:1.0")
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
- implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
- implementation(project(":coilimagegetter"))
-}
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
new file mode 100644
index 0000000..8aed3ce
--- /dev/null
+++ b/app/build.gradle.kts
@@ -0,0 +1,49 @@
+plugins {
+ id("com.android.application")
+}
+
+android {
+ namespace = "com.commit451.coilimagegetter.sample"
+ compileSdk = 35
+
+ defaultConfig {
+ applicationId = "com.commit451.coilimagegetter.sample"
+ minSdk = 21
+ targetSdk = 35
+ versionCode = 1
+ versionName = "1.0"
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildFeatures {
+ viewBinding = true
+ }
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro",
+ )
+ }
+ }
+}
+
+dependencies {
+ val coroutinesVersion = "1.10.2"
+
+ implementation("androidx.appcompat:appcompat:1.7.1")
+ implementation("androidx.core:core-ktx:1.16.0")
+ implementation("org.commonmark:commonmark:0.24.0")
+ implementation("com.squareup.okhttp3:okhttp:4.12.0")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
+ implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
+
+ implementation(project(":coilimagegetter"))
+}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 62aa453..e81fe5d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,7 +1,6 @@
+ xmlns:tools="http://schemas.android.com/tools">
@@ -25,4 +24,4 @@
-
\ No newline at end of file
+
diff --git a/app/src/main/java/com/commit451/coilimagegetter/sample/MainActivity.kt b/app/src/main/java/com/commit451/coilimagegetter/sample/MainActivity.kt
index 493e478..4110841 100644
--- a/app/src/main/java/com/commit451/coilimagegetter/sample/MainActivity.kt
+++ b/app/src/main/java/com/commit451/coilimagegetter/sample/MainActivity.kt
@@ -7,12 +7,16 @@ import android.text.Spanned
import androidx.appcompat.app.AppCompatActivity
import com.commit451.coilimagegetter.CoilImageGetter
import com.commit451.coilimagegetter.sample.databinding.ActivityMainBinding
-import kotlinx.coroutines.*
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.Job
+import kotlinx.coroutines.async
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
import okhttp3.OkHttpClient
import okhttp3.Request
import org.commonmark.parser.Parser
import org.commonmark.renderer.html.HtmlRenderer
-import ru.gildor.coroutines.okhttp.await
import kotlin.coroutines.CoroutineContext
class MainActivity : AppCompatActivity(), CoroutineScope {
@@ -54,8 +58,11 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
val request = Request.Builder()
.url("https://raw.githubusercontent.com/Jawnnypoo/open-meh/master/README.md")
.build()
- val result = client.newCall(request).await()
- val markdown = result.body?.string()
+ val markdown = withContext(Dispatchers.IO) {
+ client.newCall(request).execute().use { response ->
+ response.body?.string()
+ }
+ } ?: ""
val document = parser.parse(markdown)
return renderer.render(document)
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index 61bc295..0000000
--- a/build.gradle
+++ /dev/null
@@ -1,22 +0,0 @@
-buildscript {
- ext.kotlin_version = '1.6.21'
- repositories {
- google()
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:7.2.0'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-}
-
-allprojects {
- repositories {
- google()
- mavenCentral()
- }
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000..d709a4e
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,9 @@
+plugins {
+ id("com.android.application") version "9.1.0" apply false
+ id("com.android.library") version "9.1.0" apply false
+ id("com.vanniktech.maven.publish") version "0.30.0" apply false
+}
+
+tasks.register("clean") {
+ delete(rootProject.layout.buildDirectory)
+}
diff --git a/coilimagegetter/build.gradle b/coilimagegetter/build.gradle
deleted file mode 100644
index 7008720..0000000
--- a/coilimagegetter/build.gradle
+++ /dev/null
@@ -1,35 +0,0 @@
-apply plugin: "com.android.library"
-apply plugin: "kotlin-android"
-
-android {
- compileSdkVersion 32
-
- defaultConfig {
- minSdkVersion 21
- targetSdkVersion 32
- versionCode 1
- versionName "1.0"
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles "consumer-rules.pro"
- }
-
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- kotlinOptions {
- jvmTarget = "1.8"
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
- }
- }
-}
-
-dependencies {
- api("io.coil-kt:coil:2.0.0")
-}
diff --git a/coilimagegetter/build.gradle.kts b/coilimagegetter/build.gradle.kts
new file mode 100644
index 0000000..f3d589d
--- /dev/null
+++ b/coilimagegetter/build.gradle.kts
@@ -0,0 +1,52 @@
+import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
+import com.vanniktech.maven.publish.SonatypeHost
+
+plugins {
+ id("com.android.library")
+ id("com.vanniktech.maven.publish")
+}
+
+group = findProperty("GROUP") as String
+version = findProperty("VERSION_NAME") as String
+
+android {
+ namespace = "com.commit451.coilimagegetter"
+ compileSdk = 35
+
+ defaultConfig {
+ minSdk = 21
+ consumerProguardFiles("consumer-rules.pro")
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro",
+ )
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_17
+ targetCompatibility = JavaVersion.VERSION_17
+ }
+}
+
+dependencies {
+ val coilVersion = "3.4.0"
+
+ api("io.coil-kt.coil3:coil:$coilVersion")
+ api("io.coil-kt.coil3:coil-network-okhttp:$coilVersion")
+}
+
+mavenPublishing {
+ configure(AndroidSingleVariantLibrary("release", true, true))
+ coordinates("com.commit451", "coil-imagegetter", version.toString())
+ publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
+ if (System.getenv("RELEASE_SIGNING_ENABLED") == "true") {
+ signAllPublications()
+ }
+}
diff --git a/coilimagegetter/src/main/AndroidManifest.xml b/coilimagegetter/src/main/AndroidManifest.xml
index 859031e..cc947c5 100644
--- a/coilimagegetter/src/main/AndroidManifest.xml
+++ b/coilimagegetter/src/main/AndroidManifest.xml
@@ -1 +1 @@
-
+
diff --git a/coilimagegetter/src/main/java/com/commit451/coilimagegetter/CoilImageGetter.kt b/coilimagegetter/src/main/java/com/commit451/coilimagegetter/CoilImageGetter.kt
index 3f1107e..c3562ba 100644
--- a/coilimagegetter/src/main/java/com/commit451/coilimagegetter/CoilImageGetter.kt
+++ b/coilimagegetter/src/main/java/com/commit451/coilimagegetter/CoilImageGetter.kt
@@ -5,9 +5,10 @@ import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.text.Html
import android.widget.TextView
-import coil.Coil
-import coil.ImageLoader
-import coil.request.ImageRequest
+import coil3.ImageLoader
+import coil3.SingletonImageLoader
+import coil3.asDrawable
+import coil3.request.ImageRequest
/**
* An [Html.ImageGetter] implementation that uses Coil to load images.
@@ -19,7 +20,7 @@ import coil.request.ImageRequest
*/
open class CoilImageGetter(
private val textView: TextView,
- private val imageLoader: ImageLoader = Coil.imageLoader(textView.context),
+ private val imageLoader: ImageLoader = SingletonImageLoader.get(textView.context),
private val sourceModifier: ((source: String) -> String)? = null
) : Html.ImageGetter {
@@ -28,8 +29,8 @@ open class CoilImageGetter(
val drawablePlaceholder = DrawablePlaceHolder()
imageLoader.enqueue(ImageRequest.Builder(textView.context).data(finalSource).apply {
- target { drawable ->
- drawablePlaceholder.updateDrawable(drawable)
+ target { image ->
+ drawablePlaceholder.updateDrawable(image.asDrawable(textView.resources))
// invalidating the drawable doesn't seem to be enough...
textView.text = textView.text
}
diff --git a/gradle.properties b/gradle.properties
index 23339e0..1f78a0b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,21 +1,27 @@
-# Project-wide Gradle settings.
-# IDE (e.g. Android Studio) users:
-# Gradle settings configured through the IDE *will override*
-# any settings specified in this file.
-# For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-org.gradle.jvmargs=-Xmx1536m
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
-# AndroidX package structure to make it clearer which packages are bundled with the
-# Android operating system, and which are packaged with your app's APK
-# https://developer.android.com/topic/libraries/support-library/androidx-rn
+org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
-# Automatically convert third-party libraries to use AndroidX
-android.enableJetifier=true
-# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
+
+GROUP=com.commit451
+POM_ARTIFACT_ID=coil-imagegetter
+VERSION_NAME=1.0.1
+
+POM_NAME=coil-imagegetter
+POM_DESCRIPTION=Loads images for Html rendering in Android using Coil
+POM_INCEPTION_YEAR=2022
+POM_URL=https://github.com/Commit451/coil-imagegetter/
+
+POM_LICENSE_NAME=The Apache Software License, Version 2.0
+POM_LICENSE_URL=https://www.apache.org/licenses/LICENSE-2.0.txt
+POM_LICENSE_DIST=repo
+
+POM_SCM_URL=https://github.com/Commit451/coil-imagegetter/
+POM_SCM_CONNECTION=scm:git:git://github.com/Commit451/coil-imagegetter/.git
+POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/Commit451/coil-imagegetter/.git
+
+POM_DEVELOPER_ID=Commit451
+POM_DEVELOPER_NAME=Commit 451
+POM_DEVELOPER_URL=https://github.com/Commit451/
+
+SONATYPE_CONNECT_TIMEOUT_SECONDS=60
+SONATYPE_CLOSE_TIMEOUT_SECONDS=900
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 41d9927..61285a6 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 92f06b5..5f38436 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip
+networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 1b6c787..adff685 100755
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright © 2015-2021 the original authors.
+# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +82,11 @@ do
esac
done
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
+# This is normally unused
+# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -114,7 +114,6 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -133,22 +132,29 @@ location of your Java installation."
fi
else
JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
+ fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -165,7 +171,6 @@ fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
@@ -193,18 +198,27 @@ if "$cygwin" || "$msys" ; then
done
fi
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
+ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
diff --git a/gradlew.bat b/gradlew.bat
index ac1b06f..e509b2d 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -13,8 +13,10 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +27,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
+if %ERRORLEVEL% equ 0 goto execute
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -56,32 +59,33 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
diff --git a/settings.gradle b/settings.gradle
deleted file mode 100644
index bd16991..0000000
--- a/settings.gradle
+++ /dev/null
@@ -1 +0,0 @@
-include ':app', ':coilimagegetter'
diff --git a/settings.gradle.kts b/settings.gradle.kts
new file mode 100644
index 0000000..7e1ae6e
--- /dev/null
+++ b/settings.gradle.kts
@@ -0,0 +1,18 @@
+pluginManagement {
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ google()
+ mavenCentral()
+ }
+}
+
+rootProject.name = "coil-imagegetter"
+include(":app", ":coilimagegetter")