Skip to content

Commit

Permalink
Merge pull request #62 from ReneeVandervelde/master
Browse files Browse the repository at this point in the history
Upgrade API Dependencies
  • Loading branch information
ReneeVandervelde authored Nov 29, 2020
2 parents 03464c5 + 79827ea commit dafbd1d
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 30 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Change Log
==========

1.2.0
-----

- Update ColorMath dependency to 2.0.0
- Update to Kotlin 1.4.20
- Update OkHttp to 4.9.0
- Update ThreeTenBP to 1.5.0

1.1.3
-----

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath(kotlin("gradle-plugin", version = "1.3.72"))
classpath(kotlin("gradle-plugin", version = "1.4.20"))
classpath(atomicFU("gradle-plugin"))
}
}
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/SharedDependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.gradle.kotlin.dsl.DependencyHandlerScope

fun DependencyHandlerScope.coroutines(
module: String = "core",
version: String = "1.3.8"
version: String = "1.4.2"
) = "org.jetbrains.kotlinx:kotlinx-coroutines-$module:$version"

fun DependencyHandlerScope.retrofit(
Expand All @@ -17,12 +17,12 @@ fun DependencyHandlerScope.moshi(

fun DependencyHandlerScope.okHttp(
module: String = "okhttp",
version: String = "4.8.0"
version: String = "4.9.0"
) = "com.squareup.okhttp3:$module:$version"

fun DependencyHandlerScope.threeTen(
module: String = "threetenbp",
version: String = "1.4.4",
version: String = "1.5.0",
includeTimezoneDb: Boolean = false
) = "org.threeten:$module:$version" + (":no-tzdb".takeIf { !includeTimezoneDb }.orEmpty())

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
Expand Down
21 changes: 3 additions & 18 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand All @@ -54,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init
if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
Expand All @@ -64,29 +64,14 @@ echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

: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 %CMD_LINE_ARGS%
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*

:end
@rem End local scope for the variables with windows NT shell
Expand Down
2 changes: 1 addition & 1 deletion hue-constructs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies {

implementation(moshi())
kapt(moshi("moshi-kotlin-codegen"))
compile("com.github.ajalt:colormath:1.2.0")
compile("com.github.ajalt.colormath:colormath:2.0.0")
compile(threeTen())

testImplementation(jUnit())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package inkapplications.shade.constructs

import com.github.ajalt.colormath.ConvertibleColor
import com.github.ajalt.colormath.Color
import com.squareup.moshi.JsonClass

/**
Expand All @@ -10,7 +10,7 @@ import com.squareup.moshi.JsonClass
*/
@JsonClass(generateAdapter = true)
data class Coordinates(val x: Float, val y: Float) {
constructor(color: ConvertibleColor): this(
constructor(color: Color): this(
x = color.xyy().first.toFloat(),
y = color.xyy().second.toFloat()
)
Expand All @@ -21,7 +21,7 @@ data class Coordinates(val x: Float, val y: Float) {
*
* In the case that this is black. The color will default to a D65 White reference.
*/
private fun ConvertibleColor.xyy(default: Pair<Double, Double> = 0.31271 to 0.32902): Pair<Double, Double> {
private fun Color.xyy(default: Pair<Double, Double> = 0.31271 to 0.32902): Pair<Double, Double> {
with(toXYZ()) {
val sum = x + y + z
if (sum == 0.0) return default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package inkapplications.shade.serialization

import com.github.ajalt.colormath.ConvertibleColor
import com.github.ajalt.colormath.Color
import com.squareup.moshi.FromJson
import com.squareup.moshi.ToJson
import inkapplications.shade.constructs.Coordinates

object ColorTransformer {
@ToJson
fun toCoordinates(color: ConvertibleColor) = Coordinates(color.toXYZ())
fun toCoordinates(color: Color) = Coordinates(color.toXYZ())

@FromJson
fun fromCoordinates(coordinates: Coordinates) = coordinates
Expand Down

0 comments on commit dafbd1d

Please sign in to comment.