From e9ae8216b2daaa20d49fea69dfeca47f87e72914 Mon Sep 17 00:00:00 2001 From: Robinson Date: Thu, 26 Jan 2023 01:04:02 +0100 Subject: [PATCH] updated version dep + other build deps --- LICENSE | 30 +++++++++++++++++-- build.gradle.kts | 28 +++++------------ src/dorkbox/gradle/deps/GetVersionInfoTask.kt | 20 ++++++------- 3 files changed, 44 insertions(+), 34 deletions(-) diff --git a/LICENSE b/LICENSE index 4698600..e3e2fab 100644 --- a/LICENSE +++ b/LICENSE @@ -23,7 +23,7 @@ - OS - Information about the system, Java runtime, OS, Window Manager, and Desktop Environment. [The Apache Software License, Version 2.0] https://git.dorkbox.com/dorkbox/OS - Copyright 2022 + Copyright 2023 Dorkbox LLC Extra license information @@ -50,13 +50,37 @@ Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply See: https://github.com/JetBrains/kotlin/blob/master/license/README.md - - Version - Java Semantic Versioning with exceptions. Minor/Patch number optional and build-after-final-dot (minor/patch) permitted. + - Version - Java Semantic Versioning with exceptions. [MIT License] https://git.dorkbox.com/dorkbox/Version - Copyright 2020 + Copyright 2023 Dorkbox LLC G. Richard Bellamy Kenduck Larry Bordowitz Martin Rüegg Zafar Khaja + + Extra license information + - Kotlin - + [The Apache Software License, Version 2.0] + https://github.com/JetBrains/kotlin + Copyright 2020 + JetBrains s.r.o. and Kotlin Programming Language contributors + Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply + See: https://github.com/JetBrains/kotlin/blob/master/license/README.md + + - Updates - Software Update Management + [The Apache Software License, Version 2.0] + https://git.dorkbox.com/dorkbox/Updates + Copyright 2021 + Dorkbox LLC + + Extra license information + - Kotlin - + [The Apache Software License, Version 2.0] + https://github.com/JetBrains/kotlin + Copyright 2020 + JetBrains s.r.o. and Kotlin Programming Language contributors + Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply + See: https://github.com/JetBrains/kotlin/blob/master/license/README.md diff --git a/build.gradle.kts b/build.gradle.kts index cd11d94..0840b02 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,9 +23,9 @@ plugins { id("com.gradle.plugin-publish") version "1.1.0" - id("com.dorkbox.Licensing") version "2.17" - id("com.dorkbox.VersionUpdate") version "2.5" - id("com.dorkbox.GradleUtils") version "3.4" + id("com.dorkbox.Licensing") version "2.20" + id("com.dorkbox.VersionUpdate") version "2.6" + id("com.dorkbox.GradleUtils") version "3.10" kotlin("jvm") version "1.7.20" } @@ -34,7 +34,7 @@ object Extras { // set for the project const val description = "Gradle Plugin to manage various Gradle tasks, such as updating gradle and dependencies" const val group = "com.dorkbox" - const val version = "3.9" + const val version = "3.10" // set as project.ext const val name = "Gradle Utils" @@ -49,8 +49,7 @@ object Extras { ///// assign 'Extras' /////////////////////////////// GradleUtils.load("$projectDir/../../gradle.properties", Extras) -GradleUtils.fixIntellijPaths() -GradleUtils.defaultResolutionStrategy() +GradleUtils.defaults() GradleUtils.compileConfiguration(JavaVersion.VERSION_1_8) @@ -62,20 +61,7 @@ licensing { } } -sourceSets { - main { - java { - setSrcDirs(listOf("src")) - - // want to include kotlin files for the source. 'setSrcDirs' resets includes... - include("**/*.kt") - } - } -} - repositories { - mavenLocal() - mavenCentral() gradlePluginPortal() } @@ -86,13 +72,13 @@ dependencies { compileOnly("org.jetbrains.kotlin:kotlin-gradle-plugin") // for easier OS identification - implementation("com.dorkbox:OS:1.1") + implementation("com.dorkbox:OS:1.6") // for parsing JSON implementation("org.json:json:20220924") // for parsing version information from maven - implementation("com.dorkbox:Version:2.4") + implementation("com.dorkbox:Version:3.0") } tasks.jar.get().apply { diff --git a/src/dorkbox/gradle/deps/GetVersionInfoTask.kt b/src/dorkbox/gradle/deps/GetVersionInfoTask.kt index 86196cb..0c8d8c3 100644 --- a/src/dorkbox/gradle/deps/GetVersionInfoTask.kt +++ b/src/dorkbox/gradle/deps/GetVersionInfoTask.kt @@ -16,16 +16,15 @@ package dorkbox.gradle.deps -import com.dorkbox.version.Version import dorkbox.gradle.StaticMethodsAndTools +import dorkbox.version.Version import org.gradle.api.DefaultTask import org.gradle.api.Project import org.gradle.api.tasks.TaskAction import java.io.InputStreamReader import java.net.URL -import java.util.concurrent.Executors -import java.util.concurrent.Future -import java.util.concurrent.locks.ReentrantReadWriteLock +import java.util.concurrent.* +import java.util.concurrent.locks.* import kotlin.concurrent.write open class @@ -34,13 +33,14 @@ GetVersionInfoTask : DefaultTask() { var dirtyVersions = false fun updateReleaseVersion(version: String) { - if (release == null) { + val curRelease = release + if (curRelease == null) { release = version } else { // there can be errors when parsing version info, since not all version strings follow semantic versioning try { - val currentVersion = Version.from(release) - val releaseVer = Version.from(version) + val currentVersion = Version(curRelease) + val releaseVer = Version(version) if (releaseVer.greaterThan(currentVersion)) { release = version @@ -67,11 +67,11 @@ GetVersionInfoTask : DefaultTask() { try { // this creates a LOT of version objects. Probably better to store these in a list, however we want all backing data // structures to be strings. - val curVersion = Version.from(currentVersion) + val curVersion = Version(currentVersion) return versions.sortedWith { o1, o2 -> - Version.from(o1).compareTo(Version.from(o2)) + Version(o1).compareTo(Version(o2)) }.filter { - Version.from(it).greaterThan(curVersion) + Version(it).greaterThan(curVersion) }.toList() } catch (e: Exception) { // WHOOPS! There was an invalid version number! Instead of just crashing, try a different way...