apply plugin: 'java'
apply plugin: 'eclipse'

buildscript {
  ext {
    osgi_platform = 'gtk.linux.x86_64'
    swt_version = '+'
  }
}

sourceCompatibility = 1.7
compileJava.options.encoding = 'ISO-8859-1'

eclipse {
    classpath {
        downloadSources = true
    }
}

repositories {
    mavenCentral()
}

configurations.all {
    resolutionStrategy {
        dependencySubstitution {
            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.apache.xmlrpc:xmlrpc-client:+'
    compile 'org.bouncycastle:bcprov-jdk18on:+'
    compile 'org.bouncycastle:bcpkix-jdk18on:+'
    compile 'org.bouncycastle:bcutil-jdk18on:+'
    compile 'com.h2database:h2:+'
    compile 'commons-cli:commons-cli:+'
    compile 'commons-lang:commons-lang:2.+'
    compile 'commons-collections:commons-collections:3.+' // Version 3 brauchen wir noch wegen Velocity.
    compile 'commons-logging:commons-logging:1.+'
    compile 'com.mckoi:mckoisqldb:+'
    compile 'mysql:mysql-connector-java:5.+'
    compile 'be.cyberelf.nanoxml:nanoxml:+'
    compile 'org.apache.velocity:velocity:+'
    compile 'oro:oro:+'

    // Java EE. Ab Java 11 nicht mehr in Java enthalten
    compile 'javax.xml.ws:jaxws-api:2.3.1'
    compile 'org.glassfish.jaxb:jaxb-runtime:2.4.0-b180830.0438'
    compile 'org.glassfish.main.javaee-api:javax.jws:3.1.2.2'
    
    // SWT
    compile 'org.eclipse.platform:org.eclipse.swt.gtk.linux.x86_64:+'
    compile 'org.eclipse.platform:org.eclipse.swt.gtk.linux.aarch64:+'
    compile 'org.eclipse.platform:org.eclipse.swt.gtk.linux.x86:+'

    compile 'org.eclipse.platform:org.eclipse.swt.win32.win32.x86_64:+'
    compile 'org.eclipse.platform:org.eclipse.swt.win32.win32.x86:+'

    compile 'org.eclipse.platform:org.eclipse.swt.cocoa.macosx.x86_64:+'
    compile 'org.eclipse.platform:org.eclipse.swt.cocoa.macosx.aarch64:+'
    
    compile 'org.eclipse.platform:org.eclipse.jface:+'

}

task download(type: Copy) {
    into "lib/download"
    from configurations.runtime
}
