mirror of https://github.com/weisJ/darklaf.git
Browse Source
Upgrade gradle version to 7.0. Make use of typesafe project and library accessors. These replace the current bom project. Handle different xCode version on macOS.pull/245/head
weisj
4 years ago
committed by
Jannis Weis
26 changed files with 225 additions and 212 deletions
@ -0,0 +1,20 @@ |
|||||||
|
import org.gradle.util.VersionNumber |
||||||
|
import java.util.concurrent.TimeUnit |
||||||
|
|
||||||
|
fun String.runCommand(): String? { |
||||||
|
return runCatching { |
||||||
|
val process = ProcessBuilder(*split(" ").toTypedArray()).start() |
||||||
|
val output = process.inputStream.reader(Charsets.UTF_8).use { |
||||||
|
it.readText() |
||||||
|
} |
||||||
|
process.waitFor(10, TimeUnit.SECONDS) |
||||||
|
output.trim() |
||||||
|
}.getOrNull() |
||||||
|
} |
||||||
|
|
||||||
|
fun getXCodeVersion(): VersionNumber? { |
||||||
|
val version = "/usr/bin/xcodebuild -version".runCommand() ?: return null |
||||||
|
val extracted = Regex("""Xcode\s+([0-9\\.]*).*""") |
||||||
|
.find(version)?.groupValues?.getOrNull(1) ?: return null |
||||||
|
return VersionNumber.parse(extracted) |
||||||
|
} |
@ -1,47 +0,0 @@ |
|||||||
plugins { |
|
||||||
`java-platform` |
|
||||||
} |
|
||||||
|
|
||||||
val String.v: String get() = rootProject.extra["$this.version"] as String |
|
||||||
|
|
||||||
// Note: Gradle allows to declare dependency on "bom" as "api", |
|
||||||
// and it makes the constraints to be transitively visible |
|
||||||
// However Maven can't express that, so the approach is to use Gradle resolution |
|
||||||
// and generate pom files with resolved versions |
|
||||||
// See https://github.com/gradle/gradle/issues/9866 |
|
||||||
|
|
||||||
fun DependencyConstraintHandlerScope.apiv( |
|
||||||
notation: String, |
|
||||||
versionProp: String = notation.substringAfterLast(':') |
|
||||||
) = |
|
||||||
"api"("$notation:${versionProp.v}") |
|
||||||
|
|
||||||
fun DependencyConstraintHandlerScope.runtimev( |
|
||||||
notation: String, |
|
||||||
versionProp: String = notation.substringAfterLast(':') |
|
||||||
) = |
|
||||||
"runtimeOnly"("$notation:${versionProp.v}") |
|
||||||
|
|
||||||
dependencies { |
|
||||||
// Parenthesis are needed here: https://github.com/gradle/gradle/issues/9248 |
|
||||||
(constraints) { |
|
||||||
// api means "the dependency is for both compilation and runtime" |
|
||||||
// runtime means "the dependency is only for runtime, not for compilation" |
|
||||||
// In other words, marking dependency as "runtime" would avoid accidental |
|
||||||
// dependency on it during compilation |
|
||||||
apiv("net.java.dev.jna:jna") |
|
||||||
apiv("org.swinglabs:jxlayer") |
|
||||||
apiv("org.swinglabs:swingx") |
|
||||||
apiv("com.formdev:svgSalamander") |
|
||||||
apiv("com.fifesoft:rsyntaxtextarea") |
|
||||||
apiv("com.miglayout:miglayout-core", "miglayout") |
|
||||||
apiv("com.miglayout:miglayout-swing", "miglayout") |
|
||||||
apiv("org.junit.jupiter:junit-jupiter-api", "junit") |
|
||||||
apiv("org.junit.jupiter:junit-jupiter-engine", "junit") |
|
||||||
apiv("com.google.auto.service:auto-service-annotations", "auto-service") |
|
||||||
apiv("com.google.auto.service:auto-service", "auto-service") |
|
||||||
apiv("com.github.lgooddatepicker:LGoodDatePicker") |
|
||||||
apiv("com.github.weisj:swing-dsl-laf-support", "swing-dsl") |
|
||||||
apiv("org.jetbrains:annotations") |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,42 @@ |
|||||||
|
[versions] |
||||||
|
jna = "5.5.0" |
||||||
|
jxlayer = "3.0.4" |
||||||
|
swingx = "1.6.1" |
||||||
|
miglayout = "5.2" |
||||||
|
svgSalamander = "1.1.2.4" |
||||||
|
rsyntaxtextarea = "3.1.1" |
||||||
|
junit = "5.6.2" |
||||||
|
autoservice = "1.0-rc7" |
||||||
|
miglayout = "5.2" |
||||||
|
lGoodDatePicker = "11.0.2" |
||||||
|
swingDsl = "latest.integration" |
||||||
|
nullabilityAnnotations = "16.0.2" |
||||||
|
macOSFramework = "latest.integration" |
||||||
|
|
||||||
|
[libraries] |
||||||
|
jna = { module = "net.java.dev.jna:jna", version.ref = "jna" } |
||||||
|
jxlayer = { module = "org.swinglabs:jxlayer", version.ref = "jxlayer" } |
||||||
|
swingx = { module = "org.swinglabs:swingx", version.ref = "swingx" } |
||||||
|
svgSalamander = { module = "com.formdev:svgSalamander", version.ref = "svgSalamander" } |
||||||
|
swingDsl = { module = "com.github.weisj:swing-dsl-laf-support", version.ref = "swingDsl" } |
||||||
|
autoservice-annotations = { module = "com.google.auto.service:auto-service-annotations", version.ref = "autoservice" } |
||||||
|
autoservice-processor = { module = "com.google.auto.service:auto-service", version.ref = "autoservice" } |
||||||
|
nullabilityAnnotations = { module = "org.jetbrains:annotations", version.ref = "nullabilityAnnotations" } |
||||||
|
|
||||||
|
# MacOS frameworks |
||||||
|
macosLegacy-javaVM-base = { module = "dev.nokee.framework:JavaVM", version.ref = "macOSFramework" } |
||||||
|
macosLegacy-javaVM-capability-javaNativeFoundation = { module = "JavaVM:JavaNativeFoundation", version.ref = "macOSFramework" } |
||||||
|
macos-javaNativeFoundation = { module = "dev.nokee.framework:JavaNativeFoundation", version.ref = "macOSFramework" } |
||||||
|
macos-appKit = { module = "dev.nokee.framework:AppKit", version.ref = "macOSFramework" } |
||||||
|
macos-cocoa = { module = "dev.nokee.framework:Cocoa", version.ref = "macOSFramework" } |
||||||
|
|
||||||
|
# Test libraries |
||||||
|
test-junit-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" } |
||||||
|
test-junit-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" } |
||||||
|
test-miglayout-core = { module = "com.miglayout:miglayout-core", version.ref = "miglayout" } |
||||||
|
test-miglayout-swing = { module = "com.miglayout:miglayout-swing", version.ref = "miglayout" } |
||||||
|
test-lGoodDatePicker = { module = "com.github.lgooddatepicker:LGoodDatePicker", version.ref = "lGoodDatePicker" } |
||||||
|
test-rsyntaxtextarea = { module = "com.fifesoft:rsyntaxtextarea", version.ref = "rsyntaxtextarea" } |
||||||
|
|
||||||
|
[bundles] |
||||||
|
test-miglayout = ["test-miglayout-core", "test-miglayout-swing"] |
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-6.5-bin.zip |
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip |
||||||
zipStoreBase=GRADLE_USER_HOME |
zipStoreBase=GRADLE_USER_HOME |
||||||
zipStorePath=wrapper/dists |
zipStorePath=wrapper/dists |
||||||
|
Loading…
Reference in new issue