Skip to content

Instantly share code, notes, and snippets.

@jhyry-gcpud
Forked from slahn/build.gradle
Created November 3, 2020 08:32
Show Gist options
  • Save jhyry-gcpud/3b07d9dd01bc49ec4f7bd445e27e42c0 to your computer and use it in GitHub Desktop.
Save jhyry-gcpud/3b07d9dd01bc49ec4f7bd445e27e42c0 to your computer and use it in GitHub Desktop.
SWT and JFace with Gradle and Kotlin
group 'example'
version '1.0-SNAPSHOT'
buildscript {
ext {
kotlin_version = '1.1.2-2'
osgi_platform = 'win32.win32.x86_64'
swt_version = '3.105.3'
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
configurations.all {
resolutionStrategy {
dependencySubstitution {
// The maven property ${osgi.platform} is not handled by Gradle
// so we replace the dependency, using the osgi platform from the project settings
substitute module('org.eclipse.platform:org.eclipse.swt.${osgi.platform}') with module("org.eclipse.platform:org.eclipse.swt.$osgi_platform:$swt_version")
}
}
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
compile "org.eclipse.platform:org.eclipse.jface:3.12.2"
compile "org.eclipse.platform:org.eclipse.swt:$swt_version"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment