Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.gradle.internal.os.OperatingSystem
- plugins {
- id "java"
- id "application"
- id "org.openjfx.javafxplugin" version "0.0.8"
- id "org.javamodularity.moduleplugin" version "1.5.0"
- id "org.beryx.jlink" version "2.16.4"
- }
- group = "io.github.mzmine"
- version = "3.0"
- description = "MZmine"
- sourceCompatibility = "12"
- targetCompatibility = "12"
- defaultTasks "runtimeZip"
- // Check the OS
- project.ext.osSuffix = OperatingSystem.current().getName().replaceAll(" ", "_")
- if (OperatingSystem.current().isMacOsX())
- project.ext.osSuffix = "macOS"
- if (OperatingSystem.current().isLinux())
- project.ext.osSuffix = "Linux"
- if (OperatingSystem.current().isWindows())
- project.ext.osSuffix = "Windows"
- println "OS detected as " + project.ext.osSuffix
- repositories {
- mavenCentral()
- maven {
- url = "file://" + projectDir + "/src/main/lib"
- }
- maven { // For jmztab 3.0.9+ (https://github.com/PRIDE-Utilities/jmzTab)
- url = "https://dl.bintray.com/lifs/maven/"
- }
- maven { // For jmzml, etc.
- url = "https://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo/"
- }
- maven {
- url = "https://repo.maven.apache.org/maven2"
- }
- maven { // For SIRIUS ID modules
- url = "https://bio.informatik.uni-jena.de/repository/libs-oss/"
- }
- maven {
- url = "https://jitpack.io"
- }
- maven {
- url = "https://www.xypron.de/repository/"
- }
- maven { // For cpdetector
- url = "https://nexus.nuiton.org/nexus/content/groups/releases/"
- }
- }
- ext {
- msdkVersion = "0.0.27"
- cdkVersion = "2.3"
- jmztabVersion = "3.0.9"
- swaggerVersion = "1.5.22"
- okhttpVersion = "2.7.5"
- guavaVersion = "28.1-jre"
- slf4jVersion = "1.7.28"
- poiVersion = "4.1.0"
- batikVersion = "1.11"
- controlsfxVersion = "11.0.1"
- }
- dependencies {
- implementation "com.github.graphstream:gs-core:2.0-alpha"
- implementation "com.github.graphstream:gs-ui-javafx:2.0-alpha"
- implementation "org.jfree:jfreechart:1.5.0"
- implementation "org.jfree:jfreechart-fx:1.0.1"
- implementation "org.jfree:fxgraphics2d:1.8"
- implementation "org.jfree:jfreesvg:3.3"
- implementation "com.orsonpdf:orsonpdf:1.9"
- implementation "com.google.guava:guava:$guavaVersion"
- implementation "org.apache.commons:commons-math:2.2"
- implementation "edu.ucar:netcdf4:4.5.5"
- implementation "org.ostermiller:utils:1.07.00"
- implementation "com.google.code.findbugs:jsr305:3.0.2"
- implementation "nz.ac.waikato.cms.weka:weka-stable:3.8.3"
- implementation "net.sourceforge.jmol:jmol:14.29.27"
- implementation "org.slf4j:slf4j-api:$slf4jVersion"
- implementation "org.slf4j:slf4j-jdk14:$slf4jVersion"
- implementation "org.apache.poi:poi:$poiVersion"
- implementation "org.apache.poi:poi-ooxml:$poiVersion"
- implementation "org.openscience.cdk:cdk-core:$cdkVersion"
- implementation "org.openscience.cdk:cdk-io:$cdkVersion"
- implementation "org.openscience.cdk:cdk-standard:$cdkVersion"
- implementation "org.openscience.cdk:cdk-silent:$cdkVersion"
- implementation "org.openscience.cdk:cdk-formula:$cdkVersion"
- implementation "org.openscience.cdk:cdk-sdg:$cdkVersion"
- implementation "org.openscience.cdk:cdk-renderbasic:$cdkVersion"
- implementation "org.openscience.cdk:cdk-renderawt:$cdkVersion"
- implementation "org.openscience.cdk:cdk-data:$cdkVersion"
- implementation "org.openscience.cdk:cdk-interfaces:$cdkVersion"
- implementation "org.openscience.cdk:cdk-smiles:$cdkVersion"
- implementation "uk.ac.ebi.jmzml:jmzml:1.7.11"
- implementation "org.postgresql:postgresql:9.3-1102-jdbc41"
- implementation "mysql:mysql-connector-java:5.1.34"
- implementation "org.nuiton.thirdparty:REngine:1.8-5"
- implementation "org.nuiton.thirdparty:Rserve:1.8-5"
- implementation "com.github.jbytecode:RCaller:3.0"
- implementation "uk.ac.ebi.pride:jmztab-modular-model:$jmztabVersion"
- implementation "uk.ac.ebi.pride:jmztab-modular-util:$jmztabVersion"
- implementation "org.apache.xmlgraphics:fop:1.0"
- implementation "org.freehep:freehep-graphicsio-emf:2.4"
- implementation "org.xerial:sqlite-jdbc:3.8.11.2"
- implementation "it.unimi.dsi:fastutil:8.2.2"
- implementation "com.itextpdf:itextpdf:5.5.13.1"
- implementation "org.apache.xmlgraphics:xmlgraphics-commons:2.3"
- implementation "org.apache.xmlgraphics:batik-util:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-transcoder:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-codec:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-ext:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-awt-util:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-dom:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-svggen:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-svg-dom:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-anim:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-rasterizer:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-swing:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-gui-util:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-ttf2svg:$batikVersion"
- implementation "org.apache.xmlgraphics:batik-parser:$batikVersion"
- implementation "net.sf.epsgraphics:epsgraphics:1.2"
- implementation "com.miglayout:miglayout:3.7.4"
- implementation "javax.xml.bind:jaxb-api:2.3.1"
- implementation "com.sun.xml.bind:jaxb-core:2.3.0.1"
- implementation "com.sun.xml.bind:jaxb-impl:2.3.2"
- implementation "javax.activation:javax.activation-api:1.2.0"
- implementation "javax.mail:javax.mail-api:1.6.2"
- implementation "io.swagger:swagger-annotations:$swaggerVersion"
- implementation "com.squareup.okhttp:okhttp:$okhttpVersion"
- implementation "com.squareup.okhttp:logging-interceptor:$okhttpVersion"
- implementation "com.google.code.gson:gson:2.8.5"
- implementation "io.gsonfire:gson-fire:1.8.0"
- implementation "org.threeten:threetenbp:1.3.8"
- implementation "org.controlsfx:controlsfx:$controlsfxVersion"
- implementation "org.drjekyll:fontchooser:2.4"
- implementation "org.json:json:20190722"
- implementation "com.panemu:tiwulfx:3.0" // For DetachableTabPane
- implementation "com.github.oshi:oshi-core:4.5.2" // because the version that is pulled by SIRIUS crashes
- }
- /*
- * Remove the xml-apis dependencies to avoid a compilation error in Eclipse.
- * The org.w3c.dom package is present in the java.xml module as well as in these dependencies.
- * That is illegal (https://bugs.eclipse.org/bugs/show_bug.cgi?id=536928).
- */
- configurations.all {
- exclude group: "xml-apis", module: "xml-apis"
- exclude group: "xml-apis", module: "xml-apis-ext"
- exclude group: "xom", module: "xom"
- exclude group: "ch.qos.logback", module: "logback-core"
- exclude group: "ch.qos.logback", module: "logback-classic"
- exclude group: "gurobi", module: "gurobi-linux64"
- exclude group: "cplex", module: "cplex"
- }
- /*
- * Include JavaFX modules
- */
- javafx {
- version = "14"
- modules = ["javafx.controls",
- "javafx.swing",
- "javafx.fxml",
- "javafx.web",
- "javafx.graphics"
- ]
- }
- tasks.withType(JavaCompile) {
- options.encoding = "UTF-8"
- }
- /*
- * Set the basic Java runtime parameters (heap size etc.)
- */
- application {
- mainClassName = "io.github.mzmine.main.MZmineCore"
- applicationName = "MZmine"
- executableDir = ""
- applicationDefaultJvmArgs = ["-showversion",
- "-XX:MaxHeapFreeRatio=100",
- "-XX:InitialRAMPercentage=30",
- "-XX:MinRAMPercentage=80",
- "-XX:MaxRAMPercentage=80",
- "-Djava.library.path=lib",
- "-enableassertions",
- "-Dapple.awt.application.name=MZmine ${version}"
- ]
- }
- /*
- * Provide a default start script for this platform
- */
- startScripts {
- applicationName = "startMZmine-" + osSuffix
- classpath = files("lib/*")
- doLast {
- if (OperatingSystem.current().isWindows()) {
- delete unixScript
- // Temporary fix for https://github.com/gradle/gradle/issues/10387
- windowsScript.text = windowsScript.text.replace('set JAVA_HOME=\"%~dp0.."', 'set JAVA_HOME="%~dp0"')
- } else {
- delete windowsScript
- }
- }
- }
- /*
- * Build the JVM runtime using jlink
- */
- jlink {
- mergedModule{
- requires 'java.desktop'
- requires "java.logging"
- requires "java.rmi"
- requires "java.sql"
- requires "java.datatransfer"
- requires "java.management"
- requires "java.xml"
- requires "java.xml.crypto"
- requires "jdk.xml.dom"
- requires "java.naming"
- requires "java.transaction.xa"
- requires "java.scripting"
- requires "jdk.jsobject"
- requires "jdk.jfr"
- requires "java.security.sasl"
- requires "java.security.jgss"
- requires "jdk.unsupported"
- requires "jdk.unsupported.desktop"
- }
- launcher{
- name = 'mzmine'
- }
- options = ["--compress=2", "--vm=server", "--no-header-files", "--no-man-pages", "--output", "jre/jre"]
- }
- /*
- * Copy the resources and logging properties
- */
- tasks.jlink.doLast {
- // Remove the "release" file produced by jlink
- delete file(relativePath(imageDir) + "/release")
- copy {
- from("log")
- into("${buildDir}/${applicationName}-${version}-${osSuffix}" + "/log")
- }
- copy {
- from("manual.pdf")
- into("${buildDir}/${applicationName}-${version}-${osSuffix}")
- }
- copy {
- from("LICENSE.txt")
- into("${buildDir}/${applicationName}-${version}-${osSuffix}"+ "/legal/MZmine/")
- }
- copy {
- from("src/main/lib/vendor_lib")
- into("${buildDir}/${applicationName}-${version}-${osSuffix}" + "/lib/vendor_lib")
- }
- }
- /*
- * This is important in order to copy all .java, .fxml, and help files into the final MZmine jar.
- * The .java files are only for people who want to check the source codes.
- * But the .fxml and help files are required for the GUI.
- */
- jar {
- sourceSets.main.resources.srcDirs += ["src/main/java"]
- }
- /*
- * Add MZmine version number to mzmineversion.properties
- */
- processResources {
- filesMatching("mzmineversion.properties") {
- expand(project.properties)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement