2018-04-22 14:32:44 +02:00
|
|
|
import org.gradle.api.internal.HasConvention
|
|
|
|
import org.gradle.internal.impldep.org.apache.http.client.methods.RequestBuilder.options
|
2018-06-20 16:20:08 +02:00
|
|
|
import org.jetbrains.kotlin.contracts.model.structure.UNKNOWN_COMPUTATION.type
|
2018-04-22 14:32:44 +02:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.Coroutines
|
|
|
|
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
|
|
|
|
import org.jetbrains.kotlin.gradle.plugin.android.AndroidGradleWrapper.getTestVariants
|
|
|
|
import org.jetbrains.kotlin.gradle.plugin.android.AndroidGradleWrapper.srcDir
|
2018-06-20 16:20:08 +02:00
|
|
|
import java.util.Collections
|
2018-04-27 22:06:53 +02:00
|
|
|
import java.time.Instant
|
2018-04-22 14:32:44 +02:00
|
|
|
|
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
maven
|
2018-06-20 16:20:08 +02:00
|
|
|
kotlin("jvm").version("1.2.41")
|
2018-04-22 14:32:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
apply {
|
|
|
|
plugin("java")
|
|
|
|
plugin("kotlin")
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin.experimental.coroutines = Coroutines.ENABLE
|
|
|
|
|
|
|
|
group = "com.dorkbox"
|
|
|
|
version = "3.13-SNAPSHOT"
|
2018-06-20 16:20:08 +02:00
|
|
|
description = "Cross-platform SystemTray support for Swing/AWT, GtkStatusIcon, and AppIndicator on Java 6+"
|
2018-04-22 14:32:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
//configure<JavaPluginConvention> {
|
|
|
|
// setSourceCompatibility(1.7)
|
|
|
|
// setTargetCompatibility(1.7)
|
|
|
|
//// if (project.hasProperty("env")) {
|
|
|
|
//// var env = project.property("env");
|
|
|
|
//// sourceSets.getByName("main")
|
|
|
|
//// .resources.srcDirs("src/main/profile/" + env)
|
|
|
|
//// }
|
|
|
|
//}
|
2018-04-22 14:32:44 +02:00
|
|
|
|
2018-04-28 11:19:08 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// This creates the configurations usable inside dependencies and allowing us custom libs when building the example jars
|
|
|
|
val swingExampleCompile = configurations.create("swingExampleCompile")
|
|
|
|
val javaFxExampleCompile = configurations.create("javaFxExampleCompile")
|
|
|
|
val swtExampleCompile = configurations.create("swtExampleCompile")
|
2018-04-28 11:19:08 +02:00
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
// make working with sourceSets easier
|
2018-04-22 14:32:44 +02:00
|
|
|
val sourceSets = java.sourceSets
|
|
|
|
fun sourceSets(block: SourceSetContainer.() -> Unit) = sourceSets.apply(block)
|
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
val SourceSetContainer.main: SourceSet get() = maybeCreate("main")
|
2018-04-22 14:32:44 +02:00
|
|
|
fun SourceSetContainer.main(block: SourceSet.() -> Unit) = main.apply(block)
|
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
val SourceSetContainer.test: SourceSet get() = maybeCreate("test")
|
|
|
|
fun SourceSetContainer.test(block: SourceSet.() -> Unit) = test.apply(block)
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// test/example jars
|
2018-04-27 22:06:53 +02:00
|
|
|
val SourceSetContainer.swingExample: SourceSet get() = maybeCreate("swingExample")
|
|
|
|
fun SourceSetContainer.swingExample(block: SourceSet.() -> Unit) = swingExample.apply(block)
|
|
|
|
val org.gradle.api.tasks.SourceSetContainer.javaFxExample: SourceSet get() = maybeCreate("javaFxExample")
|
|
|
|
fun SourceSetContainer.javaFxExample(block: SourceSet.() -> Unit) = javaFxExample.apply(block)
|
2018-04-28 11:19:08 +02:00
|
|
|
val org.gradle.api.tasks.SourceSetContainer.swtExample: SourceSet get() = maybeCreate("swtExample")
|
|
|
|
fun SourceSetContainer.swtExample(block: SourceSet.() -> Unit) = swtExample.apply(block)
|
2018-04-22 14:32:44 +02:00
|
|
|
|
|
|
|
var SourceDirectorySet.sourceDirs: Iterable<File>
|
|
|
|
get() = srcDirs
|
|
|
|
set(value) {
|
|
|
|
setSrcDirs(value)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fun javaFile(vararg fileNames: String): Iterable<String> {
|
2018-06-20 16:20:08 +02:00
|
|
|
val fileList = ArrayList<String>()
|
2018-04-22 14:32:44 +02:00
|
|
|
|
|
|
|
for (name in fileNames) {
|
|
|
|
val fixed = name.replace('.', '/') + ".java"
|
|
|
|
fileList.add(fixed)
|
|
|
|
}
|
|
|
|
|
|
|
|
return fileList
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
sourceDirs = files("src")
|
2018-06-20 16:20:08 +02:00
|
|
|
|
|
|
|
// only want to include java files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java")
|
2018-04-27 22:06:53 +02:00
|
|
|
|
|
|
|
resources {
|
|
|
|
sourceDirs = files("src")
|
2018-06-20 16:20:08 +02:00
|
|
|
include("dorkbox/systemTray/gnomeShell/extension.js",
|
|
|
|
"dorkbox/systemTray/util/error_32.png")
|
2018-04-27 22:06:53 +02:00
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-04-22 14:32:44 +02:00
|
|
|
test {
|
2018-06-20 16:20:08 +02:00
|
|
|
java {
|
|
|
|
sourceDirs = files("test")
|
|
|
|
|
|
|
|
// only want to include java files for the source. 'setSrcDirs' resets includes...
|
|
|
|
include("**/*.java")
|
|
|
|
|
|
|
|
// this is required because we reset the srcDirs to 'test' above, and 'main' must manually be added back
|
|
|
|
srcDir(sourceSets.main.allJava)
|
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
}
|
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
swingExample {
|
|
|
|
java {
|
|
|
|
sourceDirs = files("test")
|
|
|
|
include(javaFile("dorkbox.TestTray", "dorkbox.CustomSwingUI"))
|
|
|
|
|
|
|
|
srcDir(sourceSets.main.allJava)
|
2018-06-20 16:20:08 +02:00
|
|
|
}
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
resources {
|
|
|
|
sourceDirs = files("test")
|
|
|
|
include("dorkbox/*.png")
|
2018-04-27 22:06:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
javaFxExample {
|
|
|
|
java {
|
|
|
|
sourceDirs = files("test")
|
|
|
|
include(javaFile("dorkbox.TestTray", "dorkbox.TestTrayJavaFX", "dorkbox.CustomSwingUI"))
|
|
|
|
|
|
|
|
srcDir(sourceSets.main.allJava)
|
2018-06-20 16:20:08 +02:00
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
resources {
|
|
|
|
sourceDirs = files("test")
|
|
|
|
include("dorkbox/*.png")
|
2018-04-22 14:32:44 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-28 11:19:08 +02:00
|
|
|
|
|
|
|
swtExample {
|
|
|
|
java {
|
|
|
|
sourceDirs = files("test")
|
|
|
|
include(javaFile("dorkbox.TestTray", "dorkbox.TestTraySwt", "dorkbox.CustomSwingUI"))
|
|
|
|
|
|
|
|
srcDir(sourceSets.main.allJava)
|
2018-06-20 16:20:08 +02:00
|
|
|
}
|
2018-04-28 11:19:08 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
resources {
|
|
|
|
sourceDirs = files("test")
|
|
|
|
include("dorkbox/*.png")
|
2018-04-28 11:19:08 +02:00
|
|
|
}
|
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
2018-06-20 16:20:08 +02:00
|
|
|
mavenLocal() // this must be first!
|
|
|
|
|
|
|
|
mavenCentral()
|
|
|
|
|
|
|
|
// because the eclipse release of SWT is abandoned on maven, this MAVEN repo has newer version of SWT,
|
|
|
|
maven(url = "http://maven-eclipse.github.io/maven")
|
|
|
|
maven(url = "https://oss.sonatype.org/content/repositories/snapshots/")
|
2018-04-27 22:06:53 +02:00
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile(project("Utilities")) {
|
|
|
|
// don't include any of the project dependencies for anything
|
|
|
|
isTransitive = false
|
|
|
|
}
|
|
|
|
|
|
|
|
// our main dependencies are ALSO the same as the limited utilities (they are not automatically pulled in from other sourceSets)
|
|
|
|
// needed by the utilities (custom since we don't want to include everything). IntelliJ includes everything, but our builds do not
|
|
|
|
compile(group = "com.dorkbox", name = "ShellExecutor", version = "1.1+")
|
|
|
|
compile(group = "org.javassist", name = "javassist", version = "3.21.0-GA")
|
|
|
|
compile(group = "net.java.dev.jna", name = "jna", version = "4.3.0")
|
|
|
|
compile(group = "net.java.dev.jna", name = "jna-platform", version = "4.3.0")
|
|
|
|
compile(group = "org.slf4j", name = "slf4j-api", version = "1.7.25")
|
|
|
|
|
|
|
|
|
|
|
|
val log = runtime(group = "ch.qos.logback", name = "logback-classic", version = "1.1.6")
|
|
|
|
|
|
|
|
// because the eclipse release of SWT is abandoned on maven, this repo has a newer version of SWT,
|
|
|
|
// http://maven-eclipse.github.io/maven
|
|
|
|
// 4.4 is the oldest version that works with us. We use reflection to access SWT, so we can compile the project without needing SWT
|
|
|
|
val swtDep = testCompileOnly(group = "org.eclipse.swt", name = getSwtMavenName(), version = "4.4+")
|
|
|
|
|
|
|
|
// JavaFX isn't always added to the compile classpath....
|
|
|
|
testCompile(files(System.getProperty("java.home", ".") + "/lib/ext/jfxrt.jar"))
|
|
|
|
|
|
|
|
// dependencies for our test examples
|
|
|
|
swingExampleCompile(configurations.compile)
|
|
|
|
javaFxExampleCompile(configurations.compile)
|
|
|
|
swtExampleCompile(configurations.compile)
|
|
|
|
swtExampleCompile(swtDep)
|
|
|
|
|
|
|
|
swingExampleCompile(log)
|
|
|
|
javaFxExampleCompile(log)
|
|
|
|
swtExampleCompile(log)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
project("Utilities") {
|
2018-04-27 22:06:53 +02:00
|
|
|
tasks.withType<Test> {
|
|
|
|
// want to remove utilities project from unit tests. It's unnecessary to run unit tests for the entire Utilities project
|
|
|
|
exclude("**/*")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<JavaCompile> {
|
|
|
|
options.encoding = "UTF-8"
|
|
|
|
options.isIncremental = true
|
|
|
|
options.isFork = true
|
|
|
|
options.forkOptions.executable = "javac"
|
|
|
|
|
|
|
|
// setup compile options. we specifically want to suppress usage of "Unsafe"
|
|
|
|
options.compilerArgs = listOf("-XDignore.symbol.file", "-Xlint:deprecation")
|
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
///////////////////////////////
|
|
|
|
////// Task defaults
|
|
|
|
///////////////////////////////
|
2018-04-27 22:06:53 +02:00
|
|
|
tasks.withType<JavaCompile> {
|
|
|
|
options.encoding = "UTF-8"
|
2018-06-20 16:20:08 +02:00
|
|
|
|
|
|
|
// options.bootstrapClasspath = files("/jre/lib/rt.jar")
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_6.toString()
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_6.toString()
|
2018-04-27 22:06:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<Jar> {
|
2018-06-20 16:20:08 +02:00
|
|
|
setDuplicatesStrategy(DuplicatesStrategy.FAIL)
|
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
manifest {
|
|
|
|
attributes["Implementation-Version"] = version
|
|
|
|
attributes["Built-Date"] = Instant.now().toString()
|
|
|
|
}
|
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
///////////////////////////////
|
|
|
|
////// UTILITIES COMPILE (for inclusion into jars)
|
|
|
|
///////////////////////////////
|
|
|
|
task<JavaCompile>("compileUtils") {
|
|
|
|
// we don't want the default include of **/*.java
|
|
|
|
includes.clear()
|
|
|
|
|
|
|
|
source = fileTree("../Utilities/src")
|
|
|
|
include(javaFile (
|
|
|
|
"dorkbox.util.SwingUtil",
|
|
|
|
"dorkbox.util.OS",
|
|
|
|
"dorkbox.util.OSUtil",
|
|
|
|
"dorkbox.util.OSType",
|
|
|
|
"dorkbox.util.ImageResizeUtil",
|
|
|
|
"dorkbox.util.ImageUtil",
|
|
|
|
"dorkbox.util.CacheUtil",
|
|
|
|
"dorkbox.util.IO",
|
|
|
|
"dorkbox.util.JavaFX",
|
|
|
|
"dorkbox.util.Property",
|
|
|
|
"dorkbox.util.Keep",
|
|
|
|
"dorkbox.util.FontUtil",
|
|
|
|
"dorkbox.util.ScreenUtil",
|
|
|
|
"dorkbox.util.ClassLoaderUtil",
|
|
|
|
"dorkbox.util.Swt",
|
|
|
|
"dorkbox.util.NamedThreadFactory",
|
|
|
|
"dorkbox.util.ActionHandlerLong",
|
|
|
|
"dorkbox.util.FileUtil",
|
|
|
|
"dorkbox.util.MathUtil",
|
|
|
|
"dorkbox.util.LocationResolver",
|
|
|
|
"dorkbox.util.Desktop"))
|
|
|
|
|
|
|
|
// entire packages/directories
|
|
|
|
include("dorkbox/util/jna/**/*.java")
|
|
|
|
include("dorkbox/util/windows/**/*.java")
|
|
|
|
include("dorkbox/util/swing/**/*.java")
|
|
|
|
|
|
|
|
classpath = sourceSets.main.compileClasspath
|
|
|
|
destinationDir = file("$rootDir/build/classes_utilities")
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// Tasks to launch examples from gradle
|
|
|
|
///////////////////////////////
|
|
|
|
task<JavaExec>("swingExample") {
|
|
|
|
classpath = sourceSets.swingExample.runtimeClasspath
|
|
|
|
main = "dorkbox.TestTray"
|
|
|
|
standardInput = System.`in`
|
|
|
|
}
|
|
|
|
|
|
|
|
task<JavaExec>("javaFxExample") {
|
|
|
|
classpath = sourceSets.javaFxExample.runtimeClasspath
|
|
|
|
main = "dorkbox.TestTrayJavaFX"
|
|
|
|
standardInput = System.`in`
|
|
|
|
}
|
|
|
|
|
|
|
|
task<JavaExec>("swtExample") {
|
|
|
|
classpath = sourceSets.swtExample.runtimeClasspath
|
|
|
|
main = "dorkbox.TestTraySwt"
|
|
|
|
standardInput = System.`in`
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////
|
|
|
|
////// Jar Tasks
|
|
|
|
///////////////////////////////
|
|
|
|
val jar: Jar by tasks
|
|
|
|
jar.apply {
|
|
|
|
dependsOn("compileUtils")
|
|
|
|
|
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from((tasks["compileUtils"] as JavaCompile).destinationDir)
|
|
|
|
}
|
|
|
|
|
|
|
|
task<Jar>("jarSwingExample") {
|
|
|
|
dependsOn("jar")
|
|
|
|
|
|
|
|
baseName = "SystemTray-SwingExample"
|
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = "Create an all-in-one example for testing, using Swing"
|
2018-04-27 22:06:53 +02:00
|
|
|
|
|
|
|
from(sourceSets.swingExample.output.classesDirs)
|
|
|
|
from(sourceSets.swingExample.output.resourcesDir)
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// add all of the main project jars as a fat-jar for all examples, exclude the Utilities.jar contents
|
|
|
|
from(configurations.compile.filter { it.nameWithoutExtension != "Utilities"}
|
|
|
|
.map { if (it.isDirectory) it else zipTree(it) })
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from((tasks["compileUtils"] as JavaCompile).destinationDir)
|
2018-04-27 22:06:53 +02:00
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes["Main-Class"] = "dorkbox.TestTray"
|
|
|
|
}
|
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
task<Jar>("jarJavaFxExample") {
|
|
|
|
dependsOn("jar")
|
|
|
|
|
|
|
|
baseName = "SystemTray-JavaFxExample"
|
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = "Create an all-in-one example for testing, using JavaFX"
|
2018-04-27 22:06:53 +02:00
|
|
|
|
|
|
|
from(sourceSets.javaFxExample.output.classesDirs)
|
|
|
|
from(sourceSets.javaFxExample.output.resourcesDir)
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// add all of the main project jars as a fat-jar for all examples, exclude the Utilities.jar contents
|
|
|
|
from(configurations.compile.filter { it.nameWithoutExtension != "Utilities" }
|
|
|
|
.map { if (it.isDirectory) it else zipTree(it) })
|
|
|
|
|
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from((tasks["compileUtils"] as JavaCompile).destinationDir)
|
2018-04-27 22:06:53 +02:00
|
|
|
|
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes["Main-Class"] = "dorkbox.TestTrayJavaFX"
|
2018-06-20 16:20:08 +02:00
|
|
|
attributes["Class-Path"] = System.getProperty("java.home", ".") + "/lib/ext/jfxrt.jar"
|
2018-04-27 22:06:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
task<Jar>("jarSwtExample") {
|
|
|
|
dependsOn("jar")
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
baseName = "SystemTray-SwtExample"
|
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = "Create an all-in-one example for testing, using SWT"
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-04-28 11:19:08 +02:00
|
|
|
from(sourceSets.swtExample.output.classesDirs)
|
|
|
|
from(sourceSets.swtExample.output.resourcesDir)
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// add all of the main project jars as a fat-jar for all examples, exclude the Utilities.jar contents
|
|
|
|
from(configurations.compile.filter { it.nameWithoutExtension != "Utilities" }
|
|
|
|
.map { if (it.isDirectory) it else zipTree(it) })
|
2018-04-28 11:19:08 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// include applicable class files from subset of Utilities project
|
|
|
|
from((tasks["compileUtils"] as JavaCompile).destinationDir)
|
2018-04-28 11:19:08 +02:00
|
|
|
|
|
|
|
manifest {
|
|
|
|
attributes["Main-Class"] = "dorkbox.TestTraySwt"
|
|
|
|
}
|
|
|
|
}
|
2018-04-27 22:06:53 +02:00
|
|
|
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
task("jarAllExamples") {
|
|
|
|
dependsOn("jarSwingExample")
|
|
|
|
dependsOn("jarJavaFxExample")
|
|
|
|
dependsOn("jarSwtExample")
|
2018-04-27 22:06:53 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
group = BasePlugin.BUILD_GROUP
|
|
|
|
description = "Create all-in-one examples for testing, using Swing, JavaFX, and SWT"
|
2018-04-22 14:32:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
operator fun Regex.contains(text: CharSequence): Boolean = this.matches(text)
|
|
|
|
fun getSwtMavenName(): String {
|
|
|
|
var platform = System.getProperty("os.name")
|
|
|
|
when (platform.replace("\\s".toRegex(), "").toLowerCase()) {
|
|
|
|
in Regex(".*linux.*") -> platform = "linux"
|
|
|
|
in Regex(".*darwin.*") -> platform = "macosx"
|
|
|
|
in Regex(".*osx.*") -> platform = "macosx"
|
|
|
|
in Regex(".*win.*") -> platform = "win32"
|
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
var arch = System.getProperty("os.arch")
|
|
|
|
if (arch.matches(".*64.*".toRegex())) {
|
|
|
|
arch = "x86_64"
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
arch = "x86"
|
|
|
|
}
|
2018-04-22 14:32:44 +02:00
|
|
|
|
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
// because the eclipse release of SWT is abandoned on maven, this MAVEN repo has newer version of SWT,
|
|
|
|
// https://github.com/maven-eclipse/maven-eclipse.github.io for the website about it
|
|
|
|
// http://maven-eclipse.github.io/maven for the maven repo
|
2018-04-22 14:32:44 +02:00
|
|
|
|
2018-06-20 16:20:08 +02:00
|
|
|
return "org.eclipse.swt.gtk.${platform}.${arch}"
|
|
|
|
}
|