Skip to content
Snippets Groups Projects
build.gradle 1.94 KiB
Newer Older
Spotlight Deveaux's avatar
Spotlight Deveaux committed
apply plugin: 'java'
apply plugin: 'maven'

Spotlight Deveaux's avatar
Spotlight Deveaux committed
group = 'io.github.packserver.Cedar'
version = '1.0'
Spotlight Deveaux's avatar
Spotlight Deveaux committed

sourceCompatibility = 1.8
targetCompatibility = 1.8

sourceSets {
    main {
        java {
            srcDir 'src/'
        }
        resources {
Spotlight Deveaux's avatar
Spotlight Deveaux committed
            srcDir 'resources/'
Spotlight Deveaux's avatar
Spotlight Deveaux committed
        }
    }
}

repositories {
Spotlight Deveaux's avatar
Spotlight Deveaux committed
    jcenter()
Spotlight Deveaux's avatar
Spotlight Deveaux committed
    maven {
Spotlight Deveaux's avatar
Spotlight Deveaux committed
        name 'Spigot'
Spotlight Deveaux's avatar
Spotlight Deveaux committed
        url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
Spotlight Deveaux's avatar
Spotlight Deveaux committed
    }
    maven {
        name 'BungeeCord'
        url 'https://oss.sonatype.org/content/repositories/snapshots'
    }
Spotlight Deveaux's avatar
Spotlight Deveaux committed
    maven {
        name 'JitPack'
        url "https://jitpack.io"
    }
Spotlight Deveaux's avatar
Spotlight Deveaux committed
}

// Simple hack for provided dependencies
configurations {
    provided
    compile.extendsFrom provided
}

dependencies {
    // Spring
    compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.6.v20170531'
    compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.6.v20170531'
Spotlight Deveaux's avatar
Spotlight Deveaux committed
    // QR
    compile 'com.github.kenglxn.QRGen:javase:2.2.0'
    // Spigot
    provided group: 'org.spigotmc', name: 'spigot-api', version: '1.12.1-R0.1-SNAPSHOT'
    provided group: 'org.bukkit', name: 'bukkit', version: '1.12.1-R0.1-SNAPSHOT'
    compile group: 'commons-io', name: 'commons-io', version: '2.5'
Spotlight Deveaux's avatar
Spotlight Deveaux committed
    // Redis
    compile group: "redis.clients", name: "jedis", version: "2.9.0"
Spotlight Deveaux's avatar
Spotlight Deveaux committed
}

// Simple hack for provided dependencies
jar {
    dependsOn configurations.runtime
    from {
        (configurations.runtime - configurations.provided).collect {
            it.isDirectory() ? it : zipTree(it)
        }
    } {
        exclude "META-INF/*.SF"
        exclude "META-INF/*.DSA"
        exclude "META-INF/*.RSA"
    }
}

Spotlight Deveaux's avatar
Spotlight Deveaux committed
task deploy(type: Exec) {
    if (System.getenv().containsKey("IS_RELEASE"))
        commandLine "bash", "/Users/spotlight/bin/deploy-prod", libsDir.getCanonicalPath() + "/Cedar-1.0.jar"
Spotlight Deveaux's avatar
Spotlight Deveaux committed
    else
Spotlight Deveaux's avatar
Spotlight Deveaux committed
        commandLine "bash", "/Users/spotlight/bin/deploy-dev", libsDir.getCanonicalPath() + "/Cedar-1.0.jar"
Spotlight Deveaux's avatar
Spotlight Deveaux committed
}