Updated to use Gradle Utils for gradle/project update management
updated .gitignore
This commit is contained in:
parent
8ef6994d14
commit
0b8c9080c6
|
@ -81,10 +81,6 @@ gradle-app.setting
|
||||||
# Mobile Tools for Java (J2ME)
|
# Mobile Tools for Java (J2ME)
|
||||||
.mtj.tmp/
|
.mtj.tmp/
|
||||||
|
|
||||||
# Package Files #
|
|
||||||
*.jar
|
|
||||||
*.war
|
|
||||||
*.ear
|
|
||||||
|
|
||||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
|
|
|
@ -15,9 +15,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Build_gradle.Extras.bcVersion
|
import Build_gradle.Extras.bcVersion
|
||||||
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
|
|
||||||
import net.sf.json.JSONObject
|
|
||||||
import java.net.URL
|
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.collections.component1
|
import kotlin.collections.component1
|
||||||
|
@ -48,11 +45,9 @@ plugins {
|
||||||
|
|
||||||
id("com.dorkbox.Licensing") version "1.4"
|
id("com.dorkbox.Licensing") version "1.4"
|
||||||
id("com.dorkbox.VersionUpdate") version "1.4.1"
|
id("com.dorkbox.VersionUpdate") version "1.4.1"
|
||||||
|
id("com.dorkbox.GradleUtils") version "1.0"
|
||||||
|
|
||||||
// setup checking for the latest version of a plugin or dependency
|
kotlin("jvm") version "1.3.31"
|
||||||
id("com.github.ben-manes.versions") version "0.21.0"
|
|
||||||
|
|
||||||
kotlin("jvm") version "1.3.21"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
object Extras {
|
object Extras {
|
||||||
|
@ -413,70 +408,3 @@ publishing {
|
||||||
dependsOn("publishToNexus", "closeAndReleaseRepository")
|
dependsOn("publishToNexus", "closeAndReleaseRepository")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////
|
|
||||||
///// Prevent anything other than a release from showing version updates
|
|
||||||
//// https://github.com/ben-manes/gradle-versions-plugin/blob/master/README.md
|
|
||||||
///////////////////////////////
|
|
||||||
tasks.withType<DependencyUpdatesTask> {
|
|
||||||
group = "gradle"
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
outputs.cacheIf { false }
|
|
||||||
|
|
||||||
resolutionStrategy {
|
|
||||||
componentSelection {
|
|
||||||
all {
|
|
||||||
val rejected = listOf("alpha", "beta", "rc", "cr", "m", "preview")
|
|
||||||
.map { qualifier -> Regex("(?i).*[.-]$qualifier[.\\d-]*") }
|
|
||||||
.any { it.matches(candidate.version) }
|
|
||||||
if (rejected) {
|
|
||||||
reject("Release candidate")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// optional parameters
|
|
||||||
checkForGradleUpdate = true
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////
|
|
||||||
////// Gradle Wrapper Configuration.
|
|
||||||
///// Run this task (GRADLE -> autoUpdateGradleWrapper), then refresh the gradle project
|
|
||||||
///////////////////////////////
|
|
||||||
task<Task>("autoUpdateGradleWrapper") {
|
|
||||||
group = "gradle"
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
outputs.cacheIf { false }
|
|
||||||
|
|
||||||
// always make sure this task when specified. ALWAYS skip for other tasks, Never skip for us.
|
|
||||||
// This is a little bit of a PITA, because of how gradle configures, then runs tasks...
|
|
||||||
if (gradle.startParameter.taskNames.contains("autoUpdateGradleWrapper")) {
|
|
||||||
finalizedBy(task<Task>("autoUpdateGradleWrapperDownloader") {
|
|
||||||
group = "gradle"
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
outputs.cacheIf { false }
|
|
||||||
|
|
||||||
val releaseText = URL("https://services.gradle.org/versions/current").readText()
|
|
||||||
val foundGradleVersion = JSONObject.fromObject(releaseText)["version"] as String?
|
|
||||||
|
|
||||||
if (foundGradleVersion.isNullOrEmpty()) {
|
|
||||||
println("\tUnable to detect Newest Gradle Version. Output json: $releaseText")
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
println("\tDetected Newest Gradle Version: '$foundGradleVersion'")
|
|
||||||
|
|
||||||
finalizedBy(task<Wrapper>("wrapperUpdate") {
|
|
||||||
group = "gradle"
|
|
||||||
outputs.upToDateWhen { false }
|
|
||||||
outputs.cacheIf { false }
|
|
||||||
|
|
||||||
gradleVersion = foundGradleVersion
|
|
||||||
distributionUrl = distributionUrl.replace("bin", "all")
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
Loading…
Reference in New Issue